index b3df504d6a0fd1ec9fad27c372b120e5adc2e8c6..9dd83864c87abca7542ae2ccb0f2686a501b7a49 100644 (file)
var $DepartmentsAdded = false;
var $selectedBase = "";
- var $SaveAdditionalVars = array(); // Additional Post vars to store
+ var $DivHeight = "";
+
+ var $HideFilterPart = false;
+ var $SaveAdditionalVars = array(); // Additional Post vars to store
function ClearElementsList()
{
$this->array_Elements = array();
}
+ function HideFilterPart($bool = true)
+ {
+ $this->HideFilterPart = $bool;
+ }
+
+ function SetHeight($height)
+ {
+ $this->DivHeight=$height;
+ }
/* Adds a regex input field to the current dialog */
function AddRegex($name,$string,$value,$conn,$image="images/search.png")
$this->CloseButtonString = _("Close");
$this->filterName = $filterName;
- /* Set default base */
- if(!isset($_SESSION['CurrentMainBase'])){
- $_SESSION['CurrentMainBase'] = $this->config->current['BASE'];
- }
$this->selectedBase = $_SESSION['CurrentMainBase'];
/* Check default values for SaveAdditionalVars */
$divlist = new divlist($this->string_Title);
$divlist->SetSummary($this->string_Summary);
$divlist->SetEntriesPerPage(0); // 0 for scrollable list
+
+ if($this->DivHeight != ""){
+ $divlist->SetHeight($this->DivHeight);
+ }
/* set Header informations
*/
}
$smarty->assign("regexes" , $regexes );
+ /* Hide Filter Part if Requested or empty */
+ if((empty($boxes)) && (empty($regexes)) || ($this->HideFilterPart)){
+ $smarty->assign("Skip_Filter_Part", true);
+ }else{
+ $smarty->assign("Skip_Filter_Part", false);
+ }
+
/* Assign alphabet and display it
*/
$smarty->assign("Display_alphabet", $this->bool_DisplayAlpahabet);
Store data also into a session var, to keep the checkboxes check after reload */
function save_object()
{
+ /* Get up to date config */
+ if(isset($this->parent->config)){
+ $this->config = $this->parent->config;
+ }
+
/* Update current base */
if($this->DepartmentsAdded){
$s_action ="";
/* Homebutton is posted */
if($s_action=="home"){
- $ui= get_userinfo();
- $this->selectedBase=(preg_replace("/^[^,]+,/","",$ui->dn));
- $this->selectedBase=(preg_replace("/^[^,]+,/","",$this->selectedBase));
+ $ui= get_userinfo();
+ $base = get_base_from_people($ui->dn);
+ $this->selectedBase= $base;
}
/* Open selected department
this is posted by the parent class MultiSelectWindow */
if(isset($_GET['act'])&& ($_GET['act'] == "dep_open")){
$s_entry = base64_decode($_GET['dep_id']);
- $this->selectedBase = $this->config->departments[trim($s_entry)];
+ if (!isset($this->config->departments[$s_entry])){
+ print_red(_("Error: The requested subtree has an inconsistent DN encoding, check your LDAP!"));
+ } else {
+ $this->selectedBase = $this->config->departments[$s_entry];
+ }
}
/* back to the roots ^^ */
$val = preg_replace("/\*\**/","*",$val);
$this->array_Regexes[$key]['value'] = $val;
$this->$box['name'] = $val;
+ $_SESSION['MultiDialogFilters'][$this->filterName][$box['name']] = $val;
}
}
}
-
}
+
+ /* Create header snapshot value */
+ function get_snapshot_header()
+ {
+ $str = " ";
+ if($this->parent->snapshotEnabled()){
+ $ok = false;
+ foreach($this->parent->get_used_snapshot_bases() as $base){
+ $ok |= count($this->parent->getAllDeletedSnapshots($base)) >= 1 ;
+ }
+ if($ok){
+ $str = "<input class='center' type='image' align='middle' src='images/restore.png'
+ title='"._("Restore snapshopts of already deleted objects")."'
+ alt='"._("Restore")."' name='RestoreDeletedSnapShot'> ";
+ }else{
+ $str = "<img class='center' src='images/restore_grey.png'> ";
+ }
+
+ $str .= "<img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
+ }
+ return($str);
+ }
+
+
+ function GetSnapShotActions($dn)
+ {
+ $str= "";
+ if($this->parent->snapshotEnabled()){
+
+ if(count($this->parent->Available_SnapsShots($dn))){
+ $str.= "<input class='center' type='image' src='images/restore.png'
+ alt='"._("Restore snapshot")."' name='RestoreSnapShotDialog_".base64_encode($dn)."' title='"._("Restore snapshot")."'> ";
+ } else {
+ $str = "<img class='center' src='images/restore_grey.png'> ";
+ }
+
+ $str.= "<input class='center' type='image' src='images/snapshot.png'
+ alt='"._("Create snapshot")."' name='CreateSnapShotDialog_".base64_encode($dn)."' title='"._("Create a new snapshot from this object")."'> ";
+ }
+
+ return($str);
+ }
+
+
/* this function adds the sub-departments of the current tree to the list */
function AddDepartments($base = false,$numtabs = 3)
{
}
}
-
/* Add to divlist */
$row = array();
- $row[] = $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='department'>", "attach" => "style='text-align:center;width:20px;'");
- $row[] = $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style=''");
+ $row[]=$field1=array("string"=>"<img src='images/".$non_empty."folder.png' alt='department'>","attach"=>"style='text-align:center;width:20px;'");
+ $row[]=$field2=array("string"=>sprintf($linkopen,base64_encode($key),$val), "attach" => "style=''");
if($numtabs > 2){
for($i = 2 ; $i <$numtabs;$i++){
- if($i ==($numtabs-1)){
- $row[] = array("string"=>" ","attach" => "style='width:60px;border-right:0px;text-align:right;'");
- }else{
- $row[] = array("string"=>" ");
- }
+ if(isset( $this->array_Header[$i]['attach'])){
+ $row[] = array("string"=>" ","attach" => $this->array_Header[$i]['attach']);
+ }else{
+ $row[] = array("string"=>" ");
+ }
}
}