From: hickert Date: Thu, 8 Sep 2005 12:31:03 +0000 (+0000) Subject: Some changes, added better filter management for ProfileEntry X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fed09c905c88f9e3068a8e37e802a78f26ab408a;p=gosa.git Some changes, added better filter management for ProfileEntry git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1330 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/FAI/class_faiProfileEntry.inc b/plugins/admin/FAI/class_faiProfileEntry.inc index d60e267ad..bf8d2033f 100644 --- a/plugins/admin/FAI/class_faiProfileEntry.inc +++ b/plugins/admin/FAI/class_faiProfileEntry.inc @@ -68,7 +68,7 @@ class faiProfileEntry extends plugin $SUBfaifilter = $_SESSION['SUBfaifilter']; /* If someone used the apply button, update searchfilter */ - if(isset($_POST['apply'])){ + if(isset($_POST['Sregex'])){ foreach($SUBfaifilter as $key => $val){ if(!isset($_POST[$key])){ $SUBfaifilter[$key] = false; @@ -76,8 +76,12 @@ class faiProfileEntry extends plugin $SUBfaifilter[$key] =$_POST[$key]; } } + $SUBfaifilter['Sregex']= $_POST['Sregex']; + if(!strstr($SUBfaifilter['Sregex'],"*")){ + $SUBfaifilter['Sregex'] = $SUBfaifilter['Sregex']."*"; + } } - + /* Save current searchfilter in session*/ $_SESSION['SUBfaifilter']= $SUBfaifilter; @@ -134,24 +138,29 @@ class faiProfileEntry extends plugin /* Check every single class name to match the current search filter */ foreach($this->FAIAllclasses as $usedClass => $classes){ - $abort = false; + $fi = str_replace("*",".*",$SUBfaifilter['Sregex']); + + $abort = false; + if(!preg_match("/".$fi."/",$usedClass)){ + $abort = true; + } if(($SUBfaifilter['SShowScripts'])&&(!in_array('FAIscript',$classes['objects']))){ - $abort = "true"; + $abort = true; } if(($SUBfaifilter['SShowTemplates'])&&(!in_array('FAItemplate',$classes['objects']))){ - $abort = "true"; + $abort = true; } if(($SUBfaifilter['SShowHooks'])&&(!in_array('FAIhook',$classes['objects']))){ - $abort = "true"; + $abort = true; } if(($SUBfaifilter['SShowVariables'])&&(!in_array('FAIvariable',$classes['objects']))){ - $abort = "true"; + $abort = true; } if(($SUBfaifilter['SShowPartitions'])&&(!in_array('FAIpartitionTable',$classes['objects']))){ - $abort = "true"; + $abort = true; } if(($SUBfaifilter['SShowPackages'])&&(!in_array('FAIpackages',$classes['objects']))){ - $abort = "true"; + $abort = true; } if(!$abort){ diff --git a/plugins/admin/FAI/faiProfileEntry.tpl b/plugins/admin/FAI/faiProfileEntry.tpl index b04a7ee33..36b2ba0f2 100644 --- a/plugins/admin/FAI/faiProfileEntry.tpl +++ b/plugins/admin/FAI/faiProfileEntry.tpl @@ -33,12 +33,18 @@ {$alphabet} - - - - - - + + + + + +
{t}Show only classes with templates{/t}
{t}Show only classes with scripts{/t}
{t}Show only classes with hooks{/t}
{t}Show only classes with variables{/t}
{t}Show only classes with packages{/t}
{t}Show only classes with partitions{/t}
{t}Show only classes with templates{/t}
{t}Show only classes with scripts{/t}
{t}Show only classes with hooks{/t}
{t}Show only classes with variables{/t}
{t}Show only classes with packages{/t}
{t}Show only classes with partitions{/t}