Code

Completed lvm partition changes
[gosa.git] / gosa-plugins / fai / admin / fai / class_faiProfileEntry.inc
index fe7decf65103a16fdd9a679a1f862099de0343d9..652b36052540a3590076686481e3a7fa2372c9d1 100644 (file)
@@ -29,7 +29,7 @@ class faiProfileEntry extends plugin
                         "FAIhook"           => "faiHook",
                         "FAIvariable"       => "faiVariable",
                         "FAIpartitionTable" => "faiPartitionTable",
-                        "FAIpackageList"    => "faiPackageList");
+                        "FAIpackageList"    => "faiPackage");
 
     /* Read out all objects from fai tree */
     $ldap= $this->config->get_ldap_link();
@@ -75,7 +75,7 @@ class faiProfileEntry extends plugin
 
     /* If no search filter is set, create one */
     if (!session::is_set("SUBfaifilter")){
-      $SUBfaifilter= array("base" => get_ou('faiou').session::get('CurrentMainBase'), "Sregex" => "*");
+      $SUBfaifilter= array("base" => get_ou('faiBaseRDN').session::get('CurrentMainBase'), "Sregex" => "*");
       $SUBfaifilter['SShowTemplates'] = true;
       $SUBfaifilter['SShowScripts']   = true;
       $SUBfaifilter['SShowHooks']     = true;
@@ -88,8 +88,8 @@ class faiProfileEntry extends plugin
 
   function execute()
   {
-       /* Call parent execute */
-       plugin::execute();
+    /* Call parent execute */
+    plugin::execute();
 
     /* Fill templating stuff */
     $smarty     = get_smarty();
@@ -97,6 +97,11 @@ class faiProfileEntry extends plugin
 
     $SUBfaifilter  = session::get('SUBfaifilter');
 
+    /* Get alphabet selection */
+    if(isset($_GET['search'])){
+      $SUBfaifilter['Sregex'] = strtolower($_GET['search'])."*";
+    }
+
     /* If someone used the apply button, update searchfilter */
     if(isset($_POST['Sregex'])){
       foreach($SUBfaifilter as $key => $val){
@@ -130,12 +135,12 @@ class faiProfileEntry extends plugin
     }
 
     /* Create different picture for each object type */
-    $objTypes['FAIhook']            = "<img src='images/fai_hook.png' title='"._("Hook bundle")."' alt=''>&nbsp;";
-    $objTypes['FAItemplate']        = "<img src='images/fai_template.png' title='"._("Template bundle")."' alt=''>&nbsp;";
-    $objTypes['FAIscript']          = "<img src='images/fai_script.png' title='"._("Script bundle")."' alt=''>&nbsp;";
-    $objTypes['FAIvariable']        = "<img src='images/fai_variable.png' title='"._("Variable bundle")."' alt=''>&nbsp;";
-    $objTypes['FAIpackageList']     = "<img src='images/fai_packages.png' title='"._("Package bundle")."' alt=''>&nbsp;";
-    $objTypes['FAIpartitionTable']  = "<img src='images/fai_partitionTable.png' title='"._("Partition table")."' alt=''>&nbsp;";
+    $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;";
 
     /* Magic quotes GPC, escapes every ' " \, to solve some security risks
      * If we post the escaped strings they will be escaped again
@@ -184,7 +189,7 @@ class faiProfileEntry extends plugin
       $fi = str_replace("*",".*",$SUBfaifilter['Sregex']);  
  
       $abort = true;
-      if(!preg_match("/".$fi."/",$usedClass)){
+      if(!preg_match("/^".$fi."/i",$usedClass)){
         $abort = false;
         continue;
       }
@@ -233,7 +238,7 @@ class faiProfileEntry extends plugin
     $smarty->assign("launchimage"   , get_template_path('images/lists/action.png'));
     $smarty->assign("alphabet"      , generate_alphabet());
     $smarty->assign("apply"         , apply_filter(TRUE));
-    $smarty->assign("search_image"  , get_template_path('images/search.png'));
+    $smarty->assign("search_image"  , get_template_path('images/lists/search.png'));
 
     $display.= $smarty->fetch(get_template_path('faiProfileEntry.tpl', TRUE));
     return($display);