Code

Added Categorie selection
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 Nov 2005 10:19:10 +0000 (10:19 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 Nov 2005 10:19:10 +0000 (10:19 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1933 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index d71c874312a5c4328da87d3b062f409dce65d51a..fae76ed95c387741815d6596d6d6296862340ef4 100644 (file)
@@ -17,6 +17,7 @@ class application extends plugin
   var $gosaApplicationCategory= "";
   var $gotoLogonScript ="";
   var $iconData;
+  var $Categories;
 
   /* Headpage attributes */
   var $last_sorting= "invalid";
@@ -31,6 +32,21 @@ class application extends plugin
   {
        plugin::plugin ($config, $dn);
 
+       $tmp = new xmlParse();
+       
+       if(!isset($this->config->data['MAIN']['KDE_APPLICATIONS_MENU']))        {
+               print_red(_("There is no value specified for 'KDE_APPLICATIONS_MENU' in your gosa.conf."));
+               $this->Categories= array();
+       }else{
+               $path = $this->config->data['MAIN']['KDE_APPLICATIONS_MENU'];
+               if(file_exists($path)){
+                       $tmp->parseMenu($path);
+                       $this->Categories = $tmp->GetData();
+               }else{
+                       print_red(sprintf(_("The specified file '%s' for 'KDE_APPLICATIONS_MENU' n your gosa.conf is not accessable."),$path));
+               }
+       }
+
        /* Load icon */
        $ldap= $config->get_ldap_link();
        if ($dn != 'new'){
@@ -95,6 +111,9 @@ class application extends plugin
        /* Call parent execute */
        plugin::execute();
 
+       $smarty= get_smarty();
+       $smarty->assign("categories",array_flip($this->Categories));
+
        /* Do we represent a valid group? */
        if (!$this->is_account && $this->parent == NULL){
                 $display= "<img alt=\"\" src=\"images/stop.png\" align=\"middle\">&nbsp;<b>".
index 92f8cbaa50fcc600d26b9f58134aaa748d4c78d8..410075f9f0b6317d81f2a0375f06be336e457d5b 100644 (file)
@@ -46,7 +46,9 @@
     <tr>
      <td><LABEL for="gosaApplicationCategory">{t}Category{/t}</LABEL></td>
      <td>
-      <input id="gosaApplicationCategory" name="gosaApplicationCategory" size=35 maxlength=60 {$gosaApplicationCategoryACL} value="{$gosaApplicationCategory}">
+       <select size="1" id="base" name="gosaApplicationCategory" title="">
+        {html_options options=$categories selected=$gosaApplicationCategory}
+       </select>
      </td>
     </tr>
     <tr><td colspan=2><div style="height:15px;"></div></td></tr>