Code

Updated lists'n images
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 2 Mar 2010 08:35:31 +0000 (08:35 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 2 Mar 2010 08:35:31 +0000 (08:35 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15827 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/html/themes/modern/style.css
gosa-core/include/class_listing.inc
gosa-core/include/functions.inc
gosa-core/plugins/admin/users/user-list.tpl
gosa-core/plugins/admin/users/user-list.xml

index 4304e81f47c429709e6ad6943c4d8f51a7696afc..333fbb5e344dd732d5a3129a64945ef05f920fac 100644 (file)
@@ -90,6 +90,7 @@ input[type=submit].img{
   border:0;
   padding:0;
   margin:0;
+  margin-top:-2px;
   display:inline-block;
   display:-moz-inline-block;
   background-color:transparent;
@@ -765,7 +766,7 @@ div.listContainer {
 }
 
 .listScrollContent td div.img {
-  padding-right:1px;
+  margin-right:1px;
 }
 
 .listScrollContent td input[type=submit].img {
index 7b2cab1807c9923965c06e46a7888a3ddfddac02..ef7e038c30b9a64fa145bdd5306112e639047671 100644 (file)
@@ -238,7 +238,7 @@ class listing {
             isset($config['sortType'])) {
           $this->sortAttribute= $config['sortAttribute'];
           $this->sortType= $config['sortType'];
-          $sorter= "&nbsp;<img border='0' title='".($this->sortDirection[$index]?_("Up"):_("Down"))."' src='images/lists/sort-".($this->sortDirection[$index]?"up":"down").".png' align='top'>";
+          $sorter= "&nbsp;".image("images/lists/sort-".($this->sortDirection[$index]?"up":"down").".png", null, null, $this->sortDirection[$index]?_("Up"):_("Down"), "text-top");
         }
         $sortable= (isset($config['sortAttribute']));
 
@@ -1102,8 +1102,7 @@ class listing {
     // Load shortcut
     $actions= &$this->xmlData['actionmenu']['action'];
     $result= "<input type='hidden' name='act' id='actionmenu' value=''><div style='display:none'><input type='submit' name='exec_act' id='exec_act' value=''></div>".
-             "<ul class='level1' id='root'><li><a href='#'>"._("Actions")."&nbsp;<img ".
-             "border=0 class='center' src='images/lists/sort-down.png'></a>";
+             "<ul class='level1' id='root'><li><a href='#'>"._("Actions")."&nbsp;".image("images/lists/sort-down.png")."</a>";
 
     // Build ul/li list
     $result.= $this->recurseActions($actions);
@@ -1139,7 +1138,7 @@ class listing {
       // Fill image if set
       $img= "";
       if (isset($action['image'])){
-        $img= "<img border='0' class='center' src='".$action['image']."'>&nbsp;";
+        $img= image($action['image'])."&nbsp;";
       }
 
       if ($action['type'] == "separator"){
@@ -1151,7 +1150,7 @@ class listing {
       if ($action['type'] == "sub" && isset($action['action'])) {
         $level++;
         if (isset($action['label'])){
-          $result.= "<li$separator><a href='#'>$img"._($action['label'])."&nbsp;<img border='0' src='images/forward-arrow.png'></a>";
+          $result.= "<li$separator><a href='#'>$img"._($action['label'])."&nbsp;".image('images/forward-arrow.png')."</a>";
         }
 
         // Ensure we've an array of actions, this enables sub menus with only one action.
@@ -1373,13 +1372,13 @@ class listing {
 
       // Copy entry
       if($copy){
-        $result.= "<li$separator><a href='#' onClick='document.getElementById(\"actionmenu\").value= \"copy\";document.getElementById(\"exec_act\").click();'><img src='images/lists/copy.png' alt='' border='0' class='center'>&nbsp;"._("Copy")."</a></li>";
+        $result.= "<li$separator><a href='#' onClick='document.getElementById(\"actionmenu\").value= \"copy\";document.getElementById(\"exec_act\").click();'>".image('images/lists/copy.png')."&nbsp;"._("Copy")."</a></li>";
         $separator= "";
       }
 
       // Cut entry
       if($cut){
-        $result.= "<li$separator><a href='#' onClick='document.getElementById(\"actionmenu\").value= \"cut\";document.getElementById(\"exec_act\").click();'><img src='images/lists/cut.png' alt='' border='0' class='center'>&nbsp;"._("Cut")."</a></li>";
+        $result.= "<li$separator><a href='#' onClick='document.getElementById(\"actionmenu\").value= \"cut\";document.getElementById(\"exec_act\").click();'>".image("images/lists/cut.png")."&nbsp;"._("Cut")."</a></li>";
         $separator= "";
       }
     }
@@ -1387,9 +1386,9 @@ class listing {
     // Draw entries that allow pasting entries
     if($paste){
       if($this->copyPasteHandler->entries_queued()){
-        $result.= "<li$separator><a href='#' onClick='document.getElementById(\"actionmenu\").value= \"paste\";document.getElementById(\"exec_act\").click();'><img src='images/lists/paste.png' alt='' border='0' class='center'>&nbsp;"._("Paste")."</a></li>";
+        $result.= "<li$separator><a href='#' onClick='document.getElementById(\"actionmenu\").value= \"paste\";document.getElementById(\"exec_act\").click();'>".image("images/lists/paste.png")."&nbsp;"._("Paste")."</a></li>";
       }else{
-        $result.= "<li$separator><a href='#'><img src='images/lists/paste-grey.png' alt='' border='0' class='center'>&nbsp;"._("Paste")."</a></li>";
+        $result.= "<li$separator><a href='#'>".image('images/lists/paste-grey.png')."&nbsp;"._("Paste")."</a></li>";
       }
     }
     
@@ -1453,9 +1452,9 @@ class listing {
 
       // Draw icons according to the restore flag
       if($restore){
-        $result.= "<li$separator><a href='#' onClick='document.getElementById(\"actionmenu\").value= \"restore\";document.getElementById(\"exec_act\").click();'><img src='images/lists/restore.png' alt='' border='0' class='center'>&nbsp;"._("Restore snapshots")."</a></li>";
+        $result.= "<li$separator><a href='#' onClick='document.getElementById(\"actionmenu\").value= \"restore\";document.getElementById(\"exec_act\").click();'>".image('images/lists/restore.png')."&nbsp;"._("Restore snapshots")."</a></li>";
       }else{
-        $result.= "<li$separator><a href='#'><img src='images/lists/restore_grey.png' alt='' border='0' class='center'>&nbsp;"._("Restore snapshots")."</a></li>";
+        $result.= "<li$separator><a href='#'>".image('images/lists/restore_grey.png')."&nbsp;"._("Restore snapshots")."</a></li>";
       }
     }
 
@@ -1469,11 +1468,11 @@ class listing {
     $result = "";
 
     // Draw entries
-    $result.= "<li$separator><a href='#'><img border='0' class='center' src='images/lists/export.png'>&nbsp;"._("Export list")."&nbsp;<img border='0' src='images/forward-arrow.png'></a><ul class='level3'>";
+    $result.= "<li$separator><a href='#'>".image('images/lists/export.png')."&nbsp;"._("Export list")."&nbsp;".image("images/forward-arrow.png")."</a><ul class='level3'>";
 
     // Export CVS as build in exporter
     foreach ($this->exporter as $action => $exporter) {
-      $result.= "<li><a href='#' onClick='document.getElementById(\"actionmenu\").value= \"$action\";document.getElementById(\"exec_act\").click();'><img border='0' class='center' src='".$exporter['image']."'>&nbsp;".$exporter['label']."</a></li>";
+      $result.= "<li><a href='#' onClick='document.getElementById(\"actionmenu\").value= \"$action\";document.getElementById(\"exec_act\").click();'>".image($exporter['image'])."&nbsp;".$exporter['label']."</a></li>";
     }
 
     // Finalize list
index 24d9328ae29d984925b03cadf984c30a79a2a8b6..21813350df90975a6d736eae9f2b96a658cba1d3 100644 (file)
@@ -3519,7 +3519,7 @@ function mark($needle, $haystack, $ignorecase= true)
 
 
 /* Return an image description using the path */
-function image($path, $label= null, $action= "", $title= "")
+function image($path, $label= null, $action= "", $title= "", $align= "middle")
 {
   global $config;
   global $BASE_DIR;
@@ -3553,14 +3553,21 @@ function image($path, $label= null, $action= "", $title= "")
     }
   }
 
+  // Non middle layout?
+  if ($align == "middle") {
+    $align= "";
+  } else {
+    $align= ";vertical-align:$align";
+  }
+
   // Clickable image or not?
   if ($title != "") {
     $title= "title='$title'";
   }
   if ($action == "") {
-    return "<div class='img' $title style='".$styles[$path]."'>$lbl</div>";
+    return "<div class='img' $title style='".$styles[$path]."$align'>$lbl</div>";
   } else {
-    return "<input type='submit' class='img' id='$action' value='' name='$action' $title style='".$styles[$path]."'>";
+    return "<input type='submit' class='img' id='$action' value='' name='$action' $title style='".$styles[$path]."$align'>";
   }
 }
 
index e3a6438e5737e5bb3479916f5f5bbcb32ee3828f..009710dff58984269b958aaa110080ce652bae1a 100644 (file)
@@ -7,7 +7,7 @@
    <div class="mainlist-nav">
     <table>
      <tr>
-      <td>{$ROOT}&nbsp;</td><td>{$BACK}&nbsp;</td><td>{$HOME}&nbsp;</td><td>{$RELOAD}&nbsp;</td><td>{$SEPARATOR}&nbsp;</td><td>{t}Base{/t} {$BASE}&nbsp;</td><td>{$SEPARATOR}&nbsp;</td><td><img src='images/rocket.png' alt='' class='center'></td><td> {$ACTIONS}</td>
+      <td>{$ROOT}&nbsp;</td><td>{$BACK}&nbsp;</td><td>{$HOME}&nbsp;</td><td>{$RELOAD}&nbsp;</td><td>{$SEPARATOR}&nbsp;</td><td>{t}Base{/t} {$BASE}&nbsp;</td><td>{$SEPARATOR}&nbsp;</td><td> {$ACTIONS}</td>
      </tr>
     </table>
    </div>
index a7a12ba85b5b912775f3a15105bdfed993ef8140..6cc1dcbd83deb1e448179952eb7ec6ee07d5d47d 100644 (file)
@@ -91,7 +91,7 @@
      <action>
       <name>new</name>
       <type>entry</type>
-      <image>plugins/users/images/list_new_user.png</image>
+      <image>plugins/users/images/select_user.png</image>
       <label>User</label>
      </action>