diff --git a/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc b/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc
index 130efb441edfbabde0def4c71ed3bfa96b3a821d..9e6d68651fab9be3bf2e1020c5ffe696252f2b5b 100644 (file)
/* Base object configuration */
$this->objs = array(
- "FAIscript" => array( "Image" =>"images/fai_script.png", "Name"=>_("Scripts") ,"Tree" =>get_ou('faiscriptou')) ,
- "FAIhook" => array( "Image" =>"images/fai_hook.png" , "Name"=>_("Hooks") ,"Tree" =>get_ou('faihookou')),
- "FAIvariable" => array( "Image" =>"images/fai_variable.png", "Name"=>_("Variables") ,"Tree" =>get_ou('faivariableou')) ,
- "FAItemplate" => array( "Image" =>"images/fai_template.png", "Name"=>_("Templates") ,"Tree" =>get_ou('faitemplateou')) ,
- "FAIpartitionTable" => array( "Image" =>"images/fai_partitionTable.png","Name"=>_("Partition table") ,"Tree" =>get_ou('faipartitionou')) ,
- "FAIpackageList" => array( "Image" =>"images/fai_packages.png", "Name"=>_("Package list") ,"Tree" =>get_ou('faipackageou')) ,
- "FAIprofile" => array( "Image" =>"images/fai_profile.png", "Name"=>_("Profiles") ,"Tree" =>get_ou('faiprofileou')));
+ "FAIscript" => array( "Image" =>"plugins/fai/images/fai_script.png", "Name"=>_("Scripts") ,"Tree" =>get_ou('faiScriptRDN')) ,
+ "FAIhook" => array( "Image" =>"plugins/fai/images/fai_hook.png" , "Name"=>_("Hooks") ,"Tree" =>get_ou('faiHookRDN')),
+ "FAIvariable" => array( "Image" =>"plugins/fai/images/fai_variable.png", "Name"=>_("Variables") ,"Tree" =>get_ou('faiVariableRDN')) ,
+ "FAItemplate" => array( "Image" =>"plugins/fai/images/fai_template.png", "Name"=>_("Templates") ,"Tree" =>get_ou('faiTemplateRDN')) ,
+ "FAIpartitionTable" => array( "Image" =>"plugins/fai/images/fai_partitionTable.png","Name"=>_("Partition table") ,"Tree" =>get_ou('faiPartitionRDN')) ,
+ "FAIpackageList" => array( "Image" =>"plugins/fai/images/fai_packages.png", "Name"=>_("Package list") ,"Tree" =>get_ou('faiPackageRDN')) ,
+ "FAIprofile" => array( "Image" =>"plugins/fai/images/fai_profile.png", "Name"=>_("Profiles") ,"Tree" =>get_ou('faiProfileRDN')));
}
/* Get classes & release name
There are 2 different tabs which use the summary tab
faiProfile / Workstations */
-
+
/* Check if given parent object is fai profile tabs */
if(isset($this->parent->by_name['faiProfile'])){
/* Get Classes and release */
$this->Classes = $this->parent->by_object['faiProfile']->FAIclasses;
- $this->base = $this->parent->by_object['faiProfile']->base;
- $str = preg_replace("/^.*".normalizePreg(get_ou('faiprofileou'))."/","",$this->dn);
+ $this->base = $this->parent->by_object['faiProfile']->parent->parent->fai_release;
+ $str = preg_replace("/^.*".preg_quote(get_ou('faiProfileRDN'), '/')."/i","",$this->dn);
+ $tmp = $this->parent->by_object['faiProfile']->parent->parent->getBranches();
+ $this->Release = $tmp[$this->base];
/* Check if parent tab is work tab */
}elseif(isset($this->parent->by_name['workstartup'])){
- $this->Classes = $this->parent->by_object['workstartup']->FAIclass;
- $this->Release = $this->parent->by_object['workstartup']->FAIrelease;
+
+ if($this->parent->by_object['workstartup']->FAIdebianMirror == "inherited"){
+ $this->Classes = $this->parent->by_object['workstartup']->InheritedFAIclass;
+ $this->Release = $this->parent->by_object['workstartup']->InheritedFAIrelease;
+ }else{
+ $this->Classes = $this->parent->by_object['workstartup']->FAIclass;
+ $this->Release = $this->parent->by_object['workstartup']->FAIrelease;
+ }
/* Check if this is a workstation or an object group */
if(isset($this->parent->by_object['workgeneric'])){
}
}
+ // All FAI stuff is located on the ldap base, isn't it?
+ $this->base = $this->config->current['BASE'];
+
$tmp = array_flip($this->getBranches());
$this->Classes[] = "LAST";
$this->Releases = $tmp;
$this->usedClasses = array();
+
/* Check the configuration */
if(count($this->Classes) && (!empty($this->Release))){
foreach($this->Classes as $class){
$value = preg_replace("/_.*$/","",$value);
unset($this->Result[$value]['Open']);
}
- if(preg_match("/^reloadList/",$name)){
- $this->InitCalled = false;
- }
+ }
+ if(isset($_POST['reloadList'])){
+ $this->InitCalled = false;
}
}
/* This function calls all nescessary functions to generate the fai class summary tree */
function execute()
{
+ plugin::execute();
/* Skip this if fai is deactivated */
$tmp = $this->config->search("faiManagement", "CLASS",array('menu','tabs'));
if(empty($tmp)){
- $str = "<h2>"._("You can't use this plugin until FAI is activated.")."</h2>";
+ $str = "<h3>"._("You can't use this plugin until FAI is activated.")."</h3>";
return $str;
}
function createSummary($data)
{
/* Don't generate any output, if there is no result */
- $str ="<table cellspacing=0 cellpadding=2 style='width:100%;background:#F5F5F5;'> ";
if(!count($this->Result)){
- $str.="<tr><td>";
- $str.= (_("This object has no FAI classes assigned."));
- $str.= "</tr></td></table>";
- return($str);
+ return("<h3>"._("This object has no FAI classes assigned.")."</h3>");
}
+ $str ="<table style='width:100%;' summary='"._("FAI summary")."'> ";
/* walk through all classes */
foreach($data as $key => $entry){
- $image = "<img src='".$this->objs[$key]['Image']."' class='center' alt='".$this->objs[$key]['Name']."' border=0>";
+ $image = image($this->objs[$key]['Image']);
if(!isset($entry['Open'])){
$str .= "<tr>
- <td colspan=2>
- <a href='?plug=".$_GET['plug']."&expand&id=".$key."'>
- <img border=0 class='center' src='images/lists/expand.png' alt='"._("Open")."'> ";
- $str .= $image." ";
- $str .= " <b>".$this->objs[$key]['Name']."</b></a></td></tr>";
+ <td colspan=2>".
+ image('images/lists/expand.png').$image." ".
+ "<a href='?plug=".$_GET['plug']."&expand&id=".$key."'>".
+ "<b>".$this->objs[$key]['Name']."</b></a></td></tr>";
}else{
- $str .= "<tr><td colspan=2>
- <a href='?plug=".$_GET['plug']."&compress&id=".$key."'>
- <img border=0 class='center' src='images/lists/sort-down.png' alt='"._("Close")."'> ";
- $str .= $image." ";
- $str .= "<b>".$this->objs[$key]['Name']."</b></a></td></tr>";
-
+ $str .= "<tr><td colspan=2>".
+ image('images/lists/sort-down.png').$image." ".
+ "<a href='?plug=".$_GET['plug']."&compress&id=".$key."'>".
+ "<b>".$this->objs[$key]['Name']."</b></a></td></tr>";
+
/* Display FAItemplate FAIhook FAIscript entries */
if(in_array($key,array("FAItemplate","FAIhook","FAIscript"))){
function resolveObject($class)
{
$ldap = $this->config->get_ldap_link();
- $dn = $this->Releases [$this->Release];
+ if(isset($this->Releases[$this->Release])){
+ $dn = $this->Releases[$this->Release];
+ }else{
+ return(FALSE);
+ }
+
$resolvedClasses = FAI::get_all_objects_for_given_base($dn,"(&(objectClass=FAIclass)(cn=".$class."))");
/* Try to fetch all types of fai objects with the given cn */
/* Create a new Profile entry */
function prepare_FAIprofile($data)
{
- $classes = split("\ ",$data['FAIclass'][0]);
+ $classes = explode(" ",$data['FAIclass'][0]);
foreach($classes as $class){
$class = trim($class);
$this->resolveObject($class);