X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_MultiSelectWindow.inc;h=8481095f07e457aaf426bc5402a57d0a5ff075e6;hb=478ea60361b0824f073fd6151f1f064c54eb3c52;hp=ae286ca8fe89017fe736f098bb57e2faff63f7f3;hpb=3dbe968ccf5579f4de7e9689a421966e0d7cec82;p=gosa.git
diff --git a/include/class_MultiSelectWindow.inc b/include/class_MultiSelectWindow.inc
index ae286ca8f..8481095f0 100644
--- a/include/class_MultiSelectWindow.inc
+++ b/include/class_MultiSelectWindow.inc
@@ -1,5 +1,7 @@
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")
{
$arr = array();
-
+
/* Check if the given input field name was already used
- for this type of dialog */
+ for this type of dialog */
if(isset($_SESSION['MultiDialogFilters'][$this->filterName][$name])){
$arr['value'] = $_SESSION['MultiDialogFilters'][$this->filterName][$name];
$this->$name = $arr['value'];
@@ -61,6 +78,16 @@ class MultiSelectWindow{
$this->SaveButtonString = _("Save");
$this->CloseButtonString = _("Close");
$this->filterName = $filterName;
+
+ $this->selectedBase = $_SESSION['CurrentMainBase'];
+
+ /* Check default values for SaveAdditionalVars */
+ foreach($this->SaveAdditionalVars as $name){
+ if(isset($_SESSION['MultiDialogFilters'][$this->filterName][$name])){
+ $this->$name = $_SESSION['MultiDialogFilters'][$this->filterName][$name];
+ }
+ }
+
}
/* Enables the headpage mode, which changes the list look */
@@ -70,8 +97,8 @@ class MultiSelectWindow{
}
/* Sets the List internal name (not displayed anywhere)
- it is used to identify every single list
- */
+ it is used to identify every single list
+ */
function SetTitle($str)
{
$this->string_Title = $str;
@@ -102,7 +129,7 @@ class MultiSelectWindow{
}
/* With this function you can change the text of the information box */
- function SetInformation($str)i
+ function SetInformation($str)
{
$this->string_Information = $str;
}
@@ -126,26 +153,44 @@ class MultiSelectWindow{
}
/* Add a checkbox to the filter element,
- the name specifies an existing class var to store the 'selection' */
- function AddCheckBox($name,$value,$string,$default)
+ the name specifies an existing class var to store the 'selection' */
+ function AddCheckBox($name,$value="Unset",$string="Unset",$default=false)
{
$arr = array();
-
- /* Check if there was already a variable
- for this dialog which we should use instead of the default*/
- if(isset($_SESSION['MultiDialogFilters'][$this->filterName][$name])){
- $arr['default'] = $_SESSION['MultiDialogFilters'][$this->filterName][$name];
- $this->$name = $arr['default'];
+
+ if($name == SEPERATOR){
+ $arr['name'] = SEPERATOR;
}else{
- $arr['default'] = $default;
- }
+ /* Check if there was already a variable
+ for this dialog which we should use instead of the default*/
+ if(isset($_SESSION['MultiDialogFilters'][$this->filterName][$name])){
+ $arr['default'] = $_SESSION['MultiDialogFilters'][$this->filterName][$name];
+ $this->$name = $arr['default'];
+ }else{
+ $arr['default'] = $default;
+ $this->$name = $default;
+ }
+ $arr['name'] = $name;
+ $arr['string'] = $string;
+ $arr['value'] = $value;
+ $arr['enabled'] = true;
- $arr['name'] = $name;
- $arr['string'] = $string;
- $arr['value'] = $value;
+ }
$this->array_Checkboxes[] = $arr;
}
+
+ /* Hides or unhides the checkbox with the given name */
+ function DisableCheckBox($name,$HideShow = false)
+ {
+ foreach($this->array_Checkboxes as $key => $chkbox){
+ if($chkbox['name'] == $name){
+ $this->array_Checkboxes[$key]['enabled'] = $HideShow;
+ }
+ }
+ }
+
+
/* Returns true if the close button was pressed */
function isClosed()
{
@@ -164,14 +209,36 @@ class MultiSelectWindow{
$this->bool_DisplaySaveButton = $bool;
}
+ /* Add a list specific filter object to position
+ 1 on top of Information
+ 2 Between Information && Filter
+ 3 Below the Filter Part */
+ function AddUserBoxToFilter($position)
+ {
+ return("");
+ }
+
/* Draw the list with all list elements and filters */
function Draw()
{
+
+ /* Check for exeeded sizelimit */
+ if (($message= check_sizelimit()) != ""){
+ return($message);
+ }
+
$smarty = get_smarty();
+ $smarty->assign("UserBox1",$this->AddUserBoxToFilter(1));
+ $smarty->assign("UserBox2",$this->AddUserBoxToFilter(2));
+ $smarty->assign("UserBox3",$this->AddUserBoxToFilter(3));
$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
*/
@@ -193,6 +260,16 @@ class MultiSelectWindow{
$boxes = "";
$boxClick = " onClick='document.mainform.submit();' ";
foreach($this->array_Checkboxes as $box){
+
+ if($box['name'] == SEPERATOR){
+ $boxes .= "