From c4c75973b3593abef7f3d4613cde3a8000fef0ae Mon Sep 17 00:00:00 2001 From: cajus Date: Sun, 16 Oct 2005 11:31:41 +0000 Subject: [PATCH] Fixed application script to get even variables that have been added in one editing session. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1572 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../applications/class_applicationGeneric.inc | 45 +++++++------------ plugins/admin/applications/generic.tpl | 7 +-- 2 files changed, 21 insertions(+), 31 deletions(-) diff --git a/plugins/admin/applications/class_applicationGeneric.inc b/plugins/admin/applications/class_applicationGeneric.inc index 34ab301b7..7dd82fdc8 100644 --- a/plugins/admin/applications/class_applicationGeneric.inc +++ b/plugins/admin/applications/class_applicationGeneric.inc @@ -57,46 +57,35 @@ class application extends plugin } } + function generateTempalte(){ - $str = "# This code is part of GOsa (https://gosa.gonicus.de)\n". - "#\n". + $str= "# This code is part of GOsa (https://gosa.gonicus.de)\n". + "#\n". "# This program is free software; you can redistribute it and/or modify\n". "# it under the terms of the GNU General Public License as published by\n". "# the Free Software Foundation; either version 2 of the License, or\n". "# (at your option) any later version.\n". - "#\n". - "# This program is distributed in the hope that it will be useful,\n". - "# but WITHOUT ANY WARRANTY; without even the implied warranty of\n". - "# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n". - "# GNU General Public License for more details.\n". - "#\n". - "# You should have received a copy of the GNU General Public License\n". - "# along with this program; if not, write to the Free Software\n". - "# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n". "#\n"; - $vars = ($this->attrs['gosaApplicationParameter']); - unset($vars['count']); + $names = $this->parent->by_object['applicationParameters']->option_name; + $values = $this->parent->by_object['applicationParameters']->option_value; + if (count($names)){ + $str .="# This plugin handles these environment variables:\n"; + } else { + $str .="# This plugin handles no environment variables.\n"; + } - $str .="# This plugin handles these environment variables:\n"; + foreach($names as $index => $name){ - foreach($vars as $var){ - if(preg_match("/\:/",$var)){ - $stra = split(":",$var); - $Name = $stra[0]; - $Value = $stra[1]; - }else{ - $Name = $var; - $Value = ""; - } - for($i = strlen($Name);$i < 25 ; $i++){ - $Name.=" "; + // Fix length + if (strlen($name) < 35){ + $name= sprintf("%.35s", $name); } - if(!empty($Value)){ - $str.= "# ".$Name."\t\t(e.g. ".$Value.")\n"; + if(isset($values[$index])){ + $str.= "# ".$name."\t\t(e.g. ".$values[$index].")\n"; }else{ - $str.= "# ".$Name."\n"; + $str.= "# ".$name."\n"; } } $str .= "#\n". diff --git a/plugins/admin/applications/generic.tpl b/plugins/admin/applications/generic.tpl index fac82d096..f5dc7a3c3 100644 --- a/plugins/admin/applications/generic.tpl +++ b/plugins/admin/applications/generic.tpl @@ -55,9 +55,10 @@

 

+

{t}Options{/t} {t}Options{/t}

-
+ {t}Only executable for members{/t}
{t}Replace user configuration on startup{/t} @@ -77,11 +78,11 @@
-

{t}Script{/t}{t}Script{/t}

+

{t}Script{/t} {t}Script{/t}

- +
-- 2.30.2