From 3665e2ce16701da340dcbc6a2b4a167344785aa6 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 2 Jun 2006 05:00:25 +0000 Subject: [PATCH] Updated Multiselect dialog - Filter, if it is empty - Force max height for divlist, currently not working when JA in on git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3618 594d385d-05f5-0310-b6e9-bd551577e9d8 --- ihtml/themes/default/MultiSelectWindow.tpl | 8 ++++--- include/class_MultiSelectWindow.inc | 25 ++++++++++++++++++++++ include/class_divlist.inc | 3 +++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/ihtml/themes/default/MultiSelectWindow.tpl b/ihtml/themes/default/MultiSelectWindow.tpl index 2532ee08e..7f735e038 100644 --- a/ihtml/themes/default/MultiSelectWindow.tpl +++ b/ihtml/themes/default/MultiSelectWindow.tpl @@ -1,6 +1,6 @@ - +
- {else}
+

{$Summary} {$hint} @@ -11,7 +11,7 @@

-
+
{$DivList}
@@ -29,6 +29,7 @@
{$UserBox2}
+ {if !$Skip_Filter_Part }

[F]{t}Filters{/t} @@ -53,6 +54,7 @@ {$apply}

{$UserBox3} + {/if}
diff --git a/include/class_MultiSelectWindow.inc b/include/class_MultiSelectWindow.inc index df2e0ee37..89dd459c8 100644 --- a/include/class_MultiSelectWindow.inc +++ b/include/class_MultiSelectWindow.inc @@ -29,6 +29,10 @@ class MultiSelectWindow{ var $DepartmentsAdded = false; var $selectedBase = ""; + var $DivHeight = ""; + + var $HideFilterPart = false; + var $SaveAdditionalVars = array(); // Additional Post vars to store @@ -37,6 +41,16 @@ class MultiSelectWindow{ $this->array_Elements = array(); } + function ForceMaximumDivHeight($height = "") + { + $this->DivHeight = $height; + } + + + function HideFilterPart($bool = true) + { + $this->HideFilterPart = $bool; + } /* Adds a regex input field to the current dialog */ function AddRegex($name,$string,$value,$conn,$image="images/search.png") @@ -229,6 +243,10 @@ class MultiSelectWindow{ $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 */ @@ -288,6 +306,13 @@ class MultiSelectWindow{ } $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); diff --git a/include/class_divlist.inc b/include/class_divlist.inc index 52eaecce8..69d43a1fb 100644 --- a/include/class_divlist.inc +++ b/include/class_divlist.inc @@ -16,6 +16,8 @@ class divlist { var $i_currentPage; var $i_entriesPerPage; + var $height_forced = false; + // Added php 4 constructor function divlist($pageid){ @@ -49,6 +51,7 @@ class divlist { function SetHeight($s_height) { $this->s_height= $s_height; + $this->height_forced =true; } function SetWidth($s_width) { -- 2.30.2