Code

Updated class selection for fai profiles
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 30 Mar 2010 15:01:21 +0000 (15:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 30 Mar 2010 15:01:21 +0000 (15:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17407 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/classSelect/class_classSelect.inc
gosa-plugins/fai/admin/fai/classSelect/class_filterFAIClass.inc
gosa-plugins/fai/admin/fai/classSelect/selectClass-filter.xml
gosa-plugins/fai/admin/fai/classSelect/selectClass-list.tpl

index 3db10bc473d1b1f81115aa521547f24581b739a1..518193c76ec2e847d31ebffee4d6fad631eebcad 100644 (file)
@@ -52,19 +52,19 @@ class classSelect extends management
   static function filterProperties($row, $classes)
   {
     /* Create different picture for each object type */
-    $objTypes['FAIhook']            = "<img src='plugins/fai/images/fai_hook.png' title='"._("Hook bundle")."' alt=''>&nbsp;";
-    $objTypes['FAItemplate']        = "<img src='plugins/fai/images/fai_template.png' title='"._("Template bundle")."' alt=''>&nbsp;";
-    $objTypes['FAIscript']          = "<img src='plugins/fai/images/fai_script.png' title='"._("Script bundle")."' alt=''>&nbsp;";
-    $objTypes['FAIvariable']        = "<img src='plugins/fai/images/fai_variable.png' title='"._("Variable bundle")."' alt=''>&nbsp;";
-    $objTypes['FAIpackageList']     = "<img src='plugins/fai/images/fai_packages.png' title='"._("Package bundle")."' alt=''>&nbsp;";
-    $objTypes['FAIpartitionTable']  = "<img src='plugins/fai/images/fai_partitionTable.png' title='"._("Partition table")."' alt=''>&nbsp;";
+    $objTypes['FAIhook']            = image('plugins/fai/images/fai_hook.png');
+    $objTypes['FAItemplate']        = image('plugins/fai/images/fai_template.png');
+    $objTypes['FAIscript']          = image('plugins/fai/images/fai_script.png');
+    $objTypes['FAIvariable']        = image('plugins/fai/images/fai_variable.png');
+    $objTypes['FAIpackageList']     = image('plugins/fai/images/fai_packages.png');
+    $objTypes['FAIpartitionTable']  = image('plugins/fai/images/fai_partitionTable.png');
 
     $str = "";
     foreach($objTypes as $class => $img){
       if(in_array($class, $classes)){
         $str .= $img;
       }else{
-        $str .= "<img src='images/empty.png'>&nbsp;";
+        $str .= image('images/empty.png');
       }
     }
     return($str);
index 66c88a47ce050e560ccde07e847f014802b66332..2659b3f6f2fbf1a63574aa009cc947be8973a18c 100644 (file)
@@ -33,7 +33,14 @@ class filterFAIClass {
       $attrs = $ldap->fetch();
 
       /* Only use objects which have cn set */
-      if(isset($attrs['cn'][0]) && preg_match("/".preg_quote($filter,'/')."/i", $attrs['cn'][0])){
+      $name = preg_replace("/[\*\.]/","",$filter);
+      if(empty($name)){
+        $regex = '.*';
+      }else{
+        $regex = preg_quote($name,'/');
+      }
+    
+      if(isset($attrs['cn'][0]) && preg_match("/".$regex."/i", $attrs['cn'][0])){
         foreach($categories as $cat => $acl){
           if(in_array($cat,$attrs['objectClass'])){
             $acl =  $ui->get_permissions($attrs['dn'],"fai/".$acl);
index 27d4ef7db0368205b7a65398484854808b988d6e..eba1954b4cf571cf1ac96aea3f70851bfc6fc30d 100644 (file)
@@ -21,7 +21,7 @@
     <label>Default filter</label>
     <query>
       <backend>FAIClass</backend>
-      <filter>(cn=$)</filter>
+      <filter>$</filter>
     </query>
     <autocomplete>
       <attribute>cn</attribute>
index a7576d1b320a9badeab4ff766233e6b5ee164257..db1c678e7df9d9924d10e24136e66f0311016985 100644 (file)
@@ -9,24 +9,9 @@
    
    <table summary="{$HEADLINE}">
     <tr>
-     <td>
-      {$ROOT}
-     </td>
-     <td>
-      {$BACK}
-     </td>
-     <td>
-      {$HOME}
-     </td>
      <td>
       {$RELOAD}
      </td>
-     <td class="left-border">{t}Base{/t}
-      {$BASE}
-     </td>
-     <td class="left-border">
-      {$ACTIONS}
-     </td>
      <td class="left-border">
       {$FILTER}
      </td>
@@ -44,4 +29,4 @@
  <button type=submit name="classSelect_cancel">
  {msgPool type=cancelButton}</button>
 </div>
-<input type="hidden" name="ignore">
\ No newline at end of file
+<input type="hidden" name="ignore">