diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc
index 99ccc4ba640c8de212a84c235fa77b9fbf678539..f902a92e0608c4a8a6f759164175b8cf81f13f1b 100644 (file)
$this->update_fai_cache();
}
}
+
+
+ // Prepare lists
+ $this->ldapList = new sortableListing(array(),array(), TRUE);
+ $this->ldapList->setDeleteable(true);
+ $this->ldapList->setEditable(false);
+ $this->ldapList->setWidth("100%");
+ $this->ldapList->setHeight("100px");
+ $this->ldapList->setHeader(array(_("LDAP server")));
+ $this->ldapList->setDefaultSortColumn(0);
}
/* Do we represent a valid terminal? */
if (!$this->is_account && $this->parent === NULL){
- $display= "<img alt=\"\" src=\"images/small-error.png\" align=middle> <b>".
- msgPool::noValidExtension(_("workstation"))."</b>";
+ $display= image("images/small-error.png")."<b>".msgPool::noValidExtension(_("workstation"))."</b>";
return ($display);
}
}
if(($sort_type)&&(!$sort)){
- $value = base64_decode(preg_replace("/_.*$/i","",preg_replace("/".$sort_type."/i","",$name)));
+ $value = postDecode(preg_replace("/_.*$/i","",preg_replace("/".$sort_type."/i","",$name)));
$sort = true;
$last = -1;
}
if(preg_match("/fai_remove/i",$name)){
- $value = base64_decode(preg_replace("/_.*$/i","",preg_replace("/fai_remove_/i","",$name)));
+ $value = postDecode(preg_replace("/fai_remove_/i","",$name));
unset($this->FAIclass[$value]);
}
}
$smarty->assign("gotoShareKeys",array_flip($this->printOutAssignedShares()));
$smarty->assign("gotoBootKernels",$this->gotoBootKernels);
- /* Create divSelectBox for ldap server selection
- */
- $SelectBoxLdapServer = new divSelectBox("LdapServer");
- $SelectBoxLdapServer->SetHeight(130);
+ $this->ldapList->setAcl($this->getacl('gotoLdapServer'));
/* Add new ldap server to the list */
if($this->acl_is_writeable("gotoLdapServer") &&
}
/* Move ldap servers up and down */
- if(!$this->gotoLdap_inherit && $this->acl_is_writeable("gotoLdapServer")){
- foreach($_POST as $name => $value){
- if(preg_match("/sort_ldap_up_/",$name)){
- $id = preg_replace("/^sort_ldap_up_([0-9]*)_(x|y)$/","\\1",$name);
- $from = $id;
- $to = $id -1;
- $tmp = $this->array_switch_item($this->gotoLdapServers,$from,$to);
- if($tmp){
- $this->gotoLdapServers = $tmp;
- }
- break;
- }
- if(preg_match("/sort_ldap_down_/",$name)){
- $id = preg_replace("/^sort_ldap_down_([0-9]*)_(x|y)$/","\\1",$name);
- $from = $id;
- $to = $id +1;
- $tmp = $this->array_switch_item($this->gotoLdapServers,$from,$to);
- if($tmp){
- $this->gotoLdapServers = $tmp;
- }
- break;
- }
- if(preg_match("/gotoLdapRemove_/",$name)){
- $id = preg_replace("/^gotoLdapRemove_([0-9]*)_(x|y)$/","\\1",$name);
- $value = $this->gotoLdapServers[$id];
- $this->gotoLdapServers = array_remove_entries(array($value),$this->gotoLdapServers);
- break;
- }
- }
+ $this->ldapList->save_object();
+ $action = $this->ldapList->getAction();
+ if($action['action'] == 'reorder'){
+ $this->gotoLdapServers = array_values($this->ldapList->getMaintainedData());
+ }
+ if($action['action'] == 'delete'){
+ $id = $this->ldapList->getKey($action['targets'][0]);
+ $value = $this->gotoLdapServers[$id];
+ $this->gotoLdapServers = array_remove_entries(array($value),$this->gotoLdapServers);
}
-
- /* Add Entries */
- if($this->acl_is_readable("gotoLdapServer")){
- foreach($this->gotoLdapServers as $key => $server){
+ /* Add Entries */
+ $data = $lData = array();
+ foreach($this->gotoLdapServers as $key => $server){
+ $data[$key]=$server;
/* Announce missing entries */
if(!in_array($server,$this->gotoLdapServerList)){
- $server = $server." <font style='color:red'>(missing)</font>";
+ $server = $server." <font style='color:red'>(missing)</font>";
}
/* Convert old style entry */
if (!preg_match('%:ldaps?://%', $server)){
- $server= "ldap://".preg_replace('/^([^:]+):/', '\1/', $server);
-
- /* Beautify new style entries */
- } else {
- $server= preg_replace("/^[^:]+:/", "", $server);
- }
-
- $SelectBoxLdapServer->AddEntry(
- array(array("string" => $server),
- array("string" =>
- "<input class='center' type='image' src='images/lists/sort-up.png' name='sort_ldap_up_".$key."'> ".
- "<input class='center' type='image' src='images/lists/sort-down.png' name='sort_ldap_down_".$key."'> ".
- "<input class='center' type='image' src='images/lists/trash.png' name='gotoLdapRemove_".$key."'>",
- "attach" => "style='text-align:right;width:40px;border-right:0px;'")));
- }
- }
+ $server= "ldap://".preg_replace('/^([^:]+):/', '\1/', $server);
+ } else {
+ $server= preg_replace("/^[^:]+:/", "", $server);
+ $lData[$key] = array('data'=>array($server));
+ }
+ }
+ $this->ldapList->setListData($data,$lData);
+ $this->ldapList->update();
+ $smarty->assign("usePrototype", "true");
if($this->gotoLdap_inherit){
$smarty->assign("gotoLdapServerACL_inherit", preg_replace("/w/","",$this->getacl("gotoLdapServer")));;
$list[$key] = $entry;
}
}
- $smarty->assign("gotoLdapServers", $SelectBoxLdapServer->DrawList());
+ $smarty->assign("gotoLdapServers", $this->ldapList->render());
$smarty->assign("gotoLdapServerList", $list);
$smarty->assign("gotoLdap_inherit", $this->gotoLdap_inherit);
$smarty->assign("JS", session::get('js'));
$smarty->assign("si_active",$this->si_active);
$div = new divSelectBox("WSFAIscriptClasses");
- $div -> SetHeight("110");
+ $div -> SetHeight("100");
if(!$this->si_fai_action_failed && $this->si_active && $this->fai_activated){
$smarty->assign("gotoBootKernels",$this->cache['KERNELS'][$release]);
$smarty->assign("InheritedFAIrelease",$this->InheritedFAIrelease);
- $str_empty = " <img src='images/empty.png' alt=\"\" width='7'>";
+ $str_empty = image('images/empty.png');
if($this->acl_is_writeable("FAIclass")){
- $str_up = " <input type='image' src='images/lists/sort-up.png' name='sort_up_%s' value='%s'>";
- $str_down = " <input type='image' src='images/lists/sort-down.png' name='sort_down_%s' value='%s'>";
- $str_remove = " <input type='image' src='images/lists/trash.png' name='fai_remove_%s' value='%s'>";
+ $str_up = image('images/lists/sort-up.png','sort_up_%s');
+ $str_down = image('images/lists/sort-down.png','sort_down_%s');
+ $str_remove = image('images/lists/trash.png','fai_remove_%s');
}else{
$str_up=$str_down=$str_remove=$str_empty;
}
$desc ="";
foreach($this->cache['CLASSES'][$this->FAIrelease][$class] as $types ){
if(isset($types['Abbr'])){
- $desc.= "<img src='".$objects[$types['Abbr']]['IMG']."' class='center'> ";
+ $desc.= image($objects[$types['Abbr']]['IMG']);
if($types['Type'] == "FAIprofile"){
break;
}
$div->AddEntry(array(
array("string"=>$class.$marker),
array("string"=>$desc),
- array("string"=>preg_replace("/\%s/",base64_encode($class),$str),"attach"=>"style='width:50px;border-right:none;'")
+ array("string"=>preg_replace("/\%s/",postEncode($class),$str),"attach"=>"style='width:60px;border-right:none;'")
));
}
}// END FAI output generation
"plProvidedAcls"=> array(
"gotoLdapServer" => _("Ldap server"),
"gotoBootKernel" => _("Boot kernel"),
+ "bootmode" => _("Boot mode"),
"gotoKernelParameters" => _("Kernel parameter"),
"gotoModules" => _("Kernel modules"),