Code

Added menu to departments
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Nov 2007 13:46:43 +0000 (13:46 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Nov 2007 13:46:43 +0000 (13:46 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7718 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/departments/class_departmentManagement.inc
plugins/admin/departments/class_divListDepartment.inc

index c4a1176fea0d09f688abc7a3e4b99cc12cf91182..2055e6cfac9a02eef0d38f23d1331011314a12e9 100644 (file)
@@ -98,6 +98,16 @@ class departmentManagement extends plugin
       }
     }
 
+    /* Create options */
+    if(isset($_POST['menu_action']) && $_POST['menu_action'] == "dep_new"){
+      $s_action = "new";
+    }
+
+    /* handle remove from layers menu */
+    if(isset($_POST['menu_action']) && preg_match("/^remvove_multiple/",$_POST['menu_action'])){
+      $s_action = "del_multiple";
+    }
+
 
     /***************
       Create a new department
index 675c5b0a8ddb334fc257602a92a56bb1cb30b061..43171c777c31f9132c55fff2d941eee2475dd58d 100755 (executable)
@@ -121,25 +121,28 @@ class divListDepartment extends MultiSelectWindow
     /* Add default header */
     $listhead = MultiSelectWindow::get_default_header();
 
-    if(preg_match("/c/",$acl)){
-      $listhead .=  " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;".
-        " <input class='center' type='image' src='images/list_new_department.png' ".
-        "   align='middle' alt='"._("Create new department")."' name='dep_new'>&nbsp; ";
-    }
-  
-
     $listhead .= " <img class='center' src='images/list_seperator.png' align='middle' ".
       " alt='' height='16' width='1'>&nbsp;".
       " "._("Base")."&nbsp;<select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
       " <input class='center' type='image' src='images/list_submit.png' align='middle' ".
       "   title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'>&nbsp;";
 
-    /* Multiple options */
-    $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/edittrash.png'
-        title='"._("Remove selected departments")."' alt='"._("Remove departments")."' name='remove_multiple_departments'>&nbsp;";
+    /* Create Layers menu */
+    $s  = ".|"._("Actions")."|\n";
+    $s .= "..|<img src='images/list_new.png' alt='' border='0' class='center'>".
+      "&nbsp;"._("Create")."|\n";
+
+    /* Append create options */
+    if(preg_match("/c/",$acl)) {
+      $s.= "...|<input class='center' type='image' src='images/list_new_department' alt=''>".
+        "&nbsp;"._("Department")."|dep_new|\n";
+    }
+    $s.= "..|---|\n";
+    $s.= "..|<img src='images/edittrash.png' alt='' border='0' class='center'>".
+      "&nbsp;"._("Remove")."|"."remvove_multiple|\n";
 
-    $listhead .="</div>";;
 
+    $this->SetDropDownHeaderMenu($s);
     $this->SetListHeader($listhead);
   }