Code

Removed image parameter
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 Mar 2010 10:03:42 +0000 (10:03 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 Mar 2010 10:03:42 +0000 (10:03 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15887 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_baseSelector.inc
gosa-core/include/class_listing.inc
gosa-core/include/functions.inc
gosa-core/plugins/admin/users/class_userManagement.inc

index 3179e49f80d44df23997caaf2decfe1dab6911b0..2833ce5e36a00fd6df54c821e55528b139cb9da1 100644 (file)
@@ -203,7 +203,7 @@ class baseSelector {
 
     // Draw submitter if required
     if ($this->submitButton) {
-      $this->tree.= image('images/lists/submit.png', null, "submit_base_".$this->pid, _("Submit"));
+      $this->tree.= image('images/lists/submit.png', "submit_base_".$this->pid, _("Submit"));
     }
     $this->tree.= "<input type='submit' style='display:none' name='submit_tree_base_".$this->pid."' id='submit_tree_base_".$this->pid."'>";
     $this->tree.= "<input type='hidden' name='bs_rebase_".$this->pid."' id='bs_rebase_".$this->pid."'>";
index ef7e038c30b9a64fa145bdd5306112e639047671..53d50519d5507bfc91c0059c862e5243582844f3 100644 (file)
@@ -238,7 +238,7 @@ class listing {
             isset($config['sortType'])) {
           $this->sortAttribute= $config['sortAttribute'];
           $this->sortType= $config['sortType'];
-          $sorter= "&nbsp;".image("images/lists/sort-".($this->sortDirection[$index]?"up":"down").".png", null, null, $this->sortDirection[$index]?_("Up"):_("Down"), "text-top");
+          $sorter= "&nbsp;".image("images/lists/sort-".($this->sortDirection[$index]?"up":"down").".png", null, $this->sortDirection[$index]?_("Up"):_("Down"), "text-top");
         }
         $sortable= (isset($config['sortAttribute']));
 
@@ -416,7 +416,7 @@ class listing {
       foreach ($this->objectTypes as $objectType) {
         if (isset($this->objectTypeCount[$objectType['label']])) {
           $label= _($objectType['label']);
-          $result.= image($objectType['image'], null, null, $label)."&nbsp;".$this->objectTypeCount[$objectType['label']]."&nbsp;&nbsp;";
+          $result.= image($objectType['image'], null, $label)."&nbsp;".$this->objectTypeCount[$objectType['label']]."&nbsp;&nbsp;";
         }
       }
 
@@ -818,7 +818,7 @@ class listing {
     $objectType= $this->getObjectType($this->objectTypes, $classes);
     if ($objectType) {
       $this->objectDnMapping[$dn]= $objectType["objectClass"];
-      $result= image($objectType["image"], null, null, LDAP::fix($dn));
+      $result= image($objectType["image"], null, LDAP::fix($dn));
       if (!isset($this->objectTypeCount[$objectType['label']])) {
         $this->objectTypeCount[$objectType['label']]= 0;
       }
@@ -891,7 +891,7 @@ class listing {
       if ($action['type'] == "entry") {
         $label= $this->processElementFilter($action['label'], $this->entries[$row], $row);
         $image= $this->processElementFilter($action['image'], $this->entries[$row], $row);
-        $result.= image($image, null, "listing_".$action['name']."_$row", $label);
+        $result.= image($image, "listing_".$action['name']."_$row", $label);
       }
 
       // Handle special types
@@ -985,29 +985,29 @@ class listing {
 
     /* Draw root button */
     if($enableRoot){
-      $result["ROOT"]= image('images/lists/root.png', null, 'ROOT', _("Root"));
+      $result["ROOT"]= image('images/lists/root.png', 'ROOT', _("Root"));
     }else{
-      $result["ROOT"]= image('images/lists/root-grey.png', null, null, _("Root"));
+      $result["ROOT"]= image('images/lists/root-grey.png', null, _("Root"));
     }
 
     /* Draw back button */
     if($enableBack){
-      $result["BACK"]= image('images/lists/back.png', null, 'BACK', _("Go up one department"));
+      $result["BACK"]= image('images/lists/back.png', 'BACK', _("Go up one department"));
     }else{
-      $result["BACK"]= image('images/lists/back-grey.png', null, null, _("Go up one department"));
+      $result["BACK"]= image('images/lists/back-grey.png', null, _("Go up one department"));
     }
 
     /* Draw home button */
    /* Draw home button */
     if($enableHome){
-      $result["HOME"]= image('images/lists/home.png', null, 'HOME', _("Go to users department"));
+      $result["HOME"]= image('images/lists/home.png', 'HOME', _("Go to users department"));
     }else{
-      $result["HOME"]= image('images/lists/home-grey.png', null, null, _("Go to users department"));
+      $result["HOME"]= image('images/lists/home-grey.png', null, _("Go to users department"));
     }
 
 
     /* Draw reload button, this button is enabled everytime */
-    $result["RELOAD"]= image('images/lists/reload.png', null, 'REFRESH', _("Reload list"));
+    $result["RELOAD"]= image('images/lists/reload.png', 'REFRESH', _("Reload list"));
 
     return ($result);
   }
@@ -1411,7 +1411,7 @@ class listing {
     // Render cut entries
     if($cut){
       if($ui->is_cutable($dn, $category, $class)){
-        $result.= image('images/lists/cut.png', null, "listing_cut_$row", _("Cut this entry"));
+        $result.= image('images/lists/cut.png', "listing_cut_$row", _("Cut this entry"));
       }else{
         $result.= image('images/empty.png');
       }
@@ -1420,7 +1420,7 @@ class listing {
     // Render copy entries
     if($copy){
       if($ui->is_copyable($dn, $category, $class)){
-        $result.= image('images/lists/copy.png', null, "listing_copy_$row", _("Copy this entry"));
+        $result.= image('images/lists/copy.png', "listing_copy_$row", _("Copy this entry"));
       }else{
         $result.= image('images/empty.png');
       }
@@ -1502,7 +1502,7 @@ class listing {
 
         // Do we have snapshots for this dn?
         if($this->snapshotHandler->hasSnapshots($dn)){
-          $result.= image('images/lists/restore.png', null, "listing_restore_$row", _("Restore snapshot"));
+          $result.= image('images/lists/restore.png', "listing_restore_$row", _("Restore snapshot"));
         } else {
           $result.= image('images/lists/restore_grey.png');
         }
@@ -1510,7 +1510,7 @@ class listing {
 
       // Draw snapshot button
       if($ui->allow_snapshot_create($dn, $category)){
-          $result.= image('images/snapshot.png', null, "listing_snapshot_$row", _("Create a new snapshot from this object"));
+          $result.= image('images/snapshot.png', "listing_snapshot_$row", _("Create a new snapshot from this object"));
       }else{
           $result.= image('images/empty.png');
       }
index 21813350df90975a6d736eae9f2b96a658cba1d3..447e9a1aa75f1fa089127b8b46fd0bb27f037b26 100644 (file)
@@ -3519,10 +3519,11 @@ function mark($needle, $haystack, $ignorecase= true)
 
 
 /* Return an image description using the path */
-function image($path, $label= null, $action= "", $title= "", $align= "middle")
+function image($path, $action= "", $title= "", $align= "middle")
 {
   global $config;
   global $BASE_DIR;
+  $label= null;
 
   // Bail out, if there's no style file
   if(!session::global_is_set("img-styles")){
@@ -3544,6 +3545,12 @@ function image($path, $label= null, $action= "", $title= "", $align= "middle")
   }
   $styles= session::global_get('img-styles');
 
+  /* Extract labels from path */
+  if (preg_match("/(-[a-z0-9]+)\.png$/", $path, $matches)) {
+    print_a($matches);
+    exit;
+  }
+
   $lbl= "";
   if ($label) {
     if (isset($styles["images/label-".$label.".png"])) {
index 03a72b4eeab1c69ec69565cbf55cf2a80036d9f8..be15e04cdb2e1ea03ce37c7bcd84d950a7f875ee 100644 (file)
@@ -786,7 +786,7 @@ class userManagement extends management
     // Walk thru map
     foreach ($map as $oc => $properties) {
       if (in_array_ics($oc, $classes)) {
-        $result.= image($properties['image'], null, "listing_edit_".$properties['plugin']."_$row", $properties['title']);
+        $result.= image($properties['image'], "listing_edit_".$properties['plugin']."_$row", $properties['title']);
       } else {
         $result.= image('images/empty.png');
       }