parent = $parent;
$this->ui = get_userinfo();
/* Set list strings */
$this->SetTitle(_("List of departments"));
$this->SetSummary(_("List of departments"));
$this->EnableAplhabet (true);
/* Result page will look like a headpage */
$this->SetHeadpageMode();
$this->SetInformation(_("This menu allows you to create, delete and edit selected departments. Having a large size of departments, you might prefer the range selectors on top of the department list."));
/* Disable buttonsm */
$this->EnableCloseButton(false);
$this->EnableSaveButton (false);
/* set Page header */
$this->AddHeader(array("string" => " ", "attach" => "style='text-align:center;width:20px;'"));
$this->AddHeader(array("string"=>_("Department name"), "attach" => "style=''"));
$this->AddHeader(array("string" =>_("Actions"), "attach" => "style='width:60px;border-right:0px;text-align:right;'"));
/* Add SubSearch checkbox */
$this->AddCheckBox("SubSearch", _("Select to search within subtrees"), _("Ignore subtrees"), false);
/* Name ,Text ,Default , Connect with alphabet */
$this->AddRegex ("Regex", _("Regular expression for matching group names"), "*" , true);
}
function GenHeader()
{
/* Prepare departments,
which are shown in the listbox on top of the listbox
*/
$options= "";
foreach ($this->config->idepartments as $key => $value){
if ($this->selectedBase == $key){
$options.= "";
} else {
$options.= "";
}
}
/* Add default header */
$listhead = MultiSelectWindow::get_default_header();
$listhead.=" ".
"
".
_("Base")." ".
" ".
"";
$this->SetListHeader($listhead);
}
function execute()
{
$this->ClearElementsList();
$this->GenHeader();
}
function setEntries($list)
{
$actions= "";
$actions.= "";
$linkopen = "%s";
foreach($list as $key => $val) {
if(!isset($this->config->departments[trim($key)])){
$this->config->departments[trim($key)]="";
}
$non_empty="";
$keys= str_replace("/","\/",$key);
foreach($this->config->departments as $keyd=>$vald ){
if(preg_match("/".$keys."\/.*/",$keyd)){
$non_empty="full";
}
}
$title = preg_replace('/ /', ' ', @LDAP::fix($this->config->departments[$key]));
$field0 = array("string" => "
", "attach" => "style='text-align:center;width:20px;'");
$field1 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style='' title='".$title."'");
$field2 = array("string" => preg_replace("/%KEY%/", base64_encode($key), $actions), "attach" => "style='width:60px;border-right:0px;text-align:
right;'");
$this->AddElement( array($field0,$field1,$field2));
}
}
function Save()
{
MultiSelectWindow::Save();
}
function save_object()
{
/* Save automatic created POSTs like regex, checkboxes */
MultiSelectWindow::save_object();
}
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>