summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 367e244)
raw | patch | inline | side by side (parent: 367e244)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 17 Jan 2006 09:57:47 +0000 (09:57 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 17 Jan 2006 09:57:47 +0000 (09:57 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2502 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/fai/class_faiProfile.inc | patch | blob | history |
index 5cb6600f99930499eb6e251d02bd4d4b5133b79e..bf80503dfc9ae8f8de48a02dc6863a9d51484ad9 100644 (file)
plugin::plugin ($config, $dn);
$ldap=$this->config->get_ldap_link();
+ /* Parse ldap attribute to get all assigned classes */
$tmp = split(" ",$this->FAIclass);
$tmp2 = array();
foreach($tmp as $class){
$tmp2[trim($class)] = trim($class);
}
}
-
+
+ /* Sort assigned classes */
if(is_array($tmp2)){
foreach($tmp2 as $class){
$this->FAIclasses[$class]=$class;
}
}
- $categories = array("FAIscript","FAItemplate","FAIhook","FAIvariable","FAIpartitionTAble","FAIpackage");
+ $categories = array("FAIscript","FAItemplate","FAIhook","FAIvariable","FAIpartitionTable","FAIpackage");
/* Build filter */
$filter= "";
$filter.= "(objectClass=$cat)";
}
- $sort = array();
+ /* Get ldap connection */
$base = $_SESSION['faifilter']['base'];
$ldap->cd($base);
+ $sort = array();
+
+ /* search all FAI classes */
$ldap->search("(|$filter)",array("*"));
while($attrs = $ldap->fetch()){
+
+ /* Sort by categorie */
foreach($categories as $cat){
if(in_array($cat,$attrs['objectClass'])){
+
+ /* Append entry */
$this->FAIAllclasses[$attrs['cn'][0]][$cat]=$attrs;
+
+ /* Create sort array, because the array above is a multidimensional array, and can't be sorted by php sorting functions*/
$sort[strtolower($attrs['cn'][0])] = $attrs['cn'][0];
}
}
}
+
+ /* Sort the sort array */
ksort($sort);
+
+ /* Reorder the FAIclasses array */
foreach($sort as $name){
$tmp[$name] =$this->FAIAllclasses[$name];
}
+
+ /* Assign sorted classes */
$this->FAIAllclasses = array();
$this->FAIAllclasses = $tmp;
}
- /* Combine new array */
+ /* Combine new array, used for up down buttons */
function combineArrays($ar0,$ar1,$ar2)
{
$ret = array();
return($ret);
}
+ /* returns position in array */
function getpos($atr,$attrs)
{
$i = 0;
return(-1);
}
- /* TRansports the geiven Arraykey one position up*/
+ /* Transports the given Arraykey one position up*/
function ArrayUp($atr,$attrs)
{
$ret = $attrs;
}
- /* TRansports the geiven Arraykey one position up*/
+ /* Transports the given Arraykey one position down*/
function ArrayDown($atr,$attrs)
{
$ret = $attrs;
return($ret);
}
+ /* class one position up */
function catUp($id)
{
/* Get all cats depinding on current dir */
$this->FAIclasses =$this->ArrayUp($id,$cats);
}
+ /* Class one position down */
function catDown($id)
{
/* Get all cats depinding on current dir */
$s_action = "add";
}
+ /* Check if a list element should be pushed one position up */
if((preg_match("/sortup_/",$name))&&(!$sort_once)){
$sort_once = true;
$val = preg_replace("/sortup_/","",$name);
$this->catUp($val);
}
+ /* Check if a list element should be pushed one position down */
if((preg_match("/sortdown_/",$name))&&(!$sort_once)){
$sort_once = true;
$val = preg_replace("/sortdown_/","",$name);
$divlist =new divSelectBox("Profile");
$divlist->SetSummary(_("This list displays all assigned class names for this profile."));
+ /* item images */
$objTypes['FAIhook'] = "<img src='images/fai_hook.png' title='"._("Hook bundle")."' alt=''>";
$objTypes['FAItemplate'] = "<img src='images/fai_template.png' title='"._("Template bundle")."' alt=''>";
$objTypes['FAIscript'] = "<img src='images/fai_script.png' title='"._("Script bundle")."' alt=''>";
$objTypes['FAIpackages'] = "<img src='images/fai_packages.png' title='"._("Packages bundle")."' alt=''>";
$objTypes['FAIpartitionTable'] = "<img src='images/fai_partitionTable.png' title='"._("Partition table")."' alt=''>";
+ /* Delete button */
$actions = "<input type='image' src='images/edittrash.png' title='"._("Remove class from profile")."' name='DEL_%KEY%'>";
-
+
+ /* Up down buttons */
$linkupdown = " <input type='image' name='sortup_%s' alt='up' title='"._("Up")."' src='images/sort_up.png' align='top' >";
$linkupdown.= "<input type='image' name='sortdown_%s' alt='down' title='"._("Down")."' src='images/sort_down.png' >";
+ /* Append fai classes to divlist */
foreach($this->FAIclasses as $usedClass){
$str = " ";
-
if(isset($this->FAIAllclasses[$usedClass])){
foreach($this->FAIAllclasses[$usedClass] as $class => $obj){
$str.= $objTypes[$class];
}
}
-
-
$field1 = array("string"=> $usedClass,"attach"=>"");
$field2 = array("string"=> $str,"attach"=>"");