Code

Fixed application script to get even variables that have been added in one
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sun, 16 Oct 2005 11:31:41 +0000 (11:31 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sun, 16 Oct 2005 11:31:41 +0000 (11:31 +0000)
editing session.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1572 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/applications/class_applicationGeneric.inc
plugins/admin/applications/generic.tpl

index 34ab301b7394030bafc1a9162983469c9db5c90a..7dd82fdc8b18a7e3969d656d6ce66564bb63105e 100644 (file)
@@ -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".
index fac82d0964c2e16311f701ba424175c4dc730ab9..f5dc7a3c356d5d12bd3eba3fb845701fa61d7f76 100644 (file)
 
 <p class="plugbottom" style="height:4px; margin-bottom:0px;">&nbsp;</p>
 
+<h2><img src="images/lamp.png" alt="{t}Options{/t}" align="center">&nbsp;{t}Options{/t}</h2>
 <table summary="" style="width:100%;">
   <tr>
-    <td>
+    <td style="width:50%;border-right:1px solid #B0B0B0">
       <input type=checkbox name="exec_for_groupmembers" value="1" {$gosaApplicationFlagsACL} {$exec_for_groupmembers}>{t}Only executable for members{/t}
       <br>
       <input type=checkbox name="overwrite_config" value="1" {$gosaApplicationFlagsACL} {$overwrite_config}>{t}Replace user configuration on startup{/t}
 <table width="99%">
        <tr>
                <td>
-                       <h2><img src="images/script.png" alt="{t}Script{/t}">{t}Script{/t}</h2>
+                       <h2><img src="images/fai_script.png" alt="{t}Script{/t}" align="center">&nbsp;{t}Script{/t}</h2>
                        <textarea name="gotoLogonScript" style='width:99%;height:220px;'>{$gotoLogonScript}</textarea>
                        <input type="file" name="ScriptFile" value="{t}Import{/t}">
                        <input type="submit" name="upLoad" value="{t}Upload{/t}">
-                       <input type="submit" name="ScriptTemplate" value="{t}Template{/t}">
+                       <input type="submit" name="ScriptTemplate" value="{t}Create template{/t}">
                </td>
        </tr>
 </table>