Code

Updated Multiselect dialog
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Jun 2006 05:00:25 +0000 (05:00 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Jun 2006 05:00:25 +0000 (05:00 +0000)
- 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
include/class_MultiSelectWindow.inc
include/class_divlist.inc

index 2532ee08e0c771e43ed337e0ecfcab7a16714bfb..7f735e038ba6dd818e1771c6a7125092d8945895 100644 (file)
@@ -1,6 +1,6 @@
-<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=4>
+       <table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=4>
        <tr>
-               <td style="vertical-align:top; width:50%;">
+                       <td style="vertical-align:top; width:50%;">
                        <div class="contentboxh">
                                <p class="contentboxh">
                                        {$Summary} {$hint} 
@@ -11,7 +11,7 @@
                        </div>
                        <div style='height:4px;'>
                        </div>
-                       <div class="contentboxb" style="border-top:1px solid #B0B0B0;">
+                               <div class="contentboxb" style="border-top:1px solid #B0B0B0;">
                        {$DivList}
                        <input type=hidden name="edit_helper">
                        </div>
@@ -29,6 +29,7 @@
                        </div>
                        {$UserBox2}
                        <br>
+                       {if !$Skip_Filter_Part }
                        <div class="contentboxh">
                        <p class="contentboxh">
                                        <img src="{$launchimage}" align="right" alt="[F]">{t}Filters{/t}
@@ -53,6 +54,7 @@
                        {$apply}
                        </div>
                        {$UserBox3}
+                       {/if}
                </td>
                {else}
                <td style="vertical-align:top;">
index df2e0ee37867836de5b68668dd33207bf327a215..89dd459c833f3cbe20cf60656c103369b5ce113a 100644 (file)
@@ -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);
index 52eaecce87fb642fae430ec7c3afbf368377b0d6..69d43a1fb1b97005c0c3ba17f11d575cf1a41168 100644 (file)
@@ -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) {