Code

Added new range selector behavior
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 24 Nov 2005 06:31:36 +0000 (06:31 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 24 Nov 2005 06:31:36 +0000 (06:31 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2028 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/addons/addressbook/class_addressbook.inc

index 5d5a24a9b85ce5c3e280a69e06ffd8a2d046f28e..a35a4d597737bd2da749cd04f31d677a17e69598 100644 (file)
@@ -17,6 +17,8 @@ class addressbook extends plugin
   var $storage_base= "";
   var $orig_storage_base= "";
 
+  var $range = 20;
+
   var $sn= "";
   var $cn= "";
   var $givenName= "";
@@ -478,7 +480,12 @@ $this->telephone_list[$attrs['sn'][0].$attrs['dn']]=
                        $smarty->assign("storage_info", _("Creating new entry in"));
                }
        } else {
-               $range= 20;
+
+       
+               if(isset($_POST['EntryPerPage'])){
+                       $this->range = $_POST['EntryPerPage'];
+               }
+               $range = $this->range;  
                $smarty->assign("internal", 1);
        }
        if (isset($_GET['start'])){
@@ -500,10 +507,15 @@ $this->telephone_list[$attrs['sn'][0].$attrs['dn']]=
                }
                $output.= "<tr $col>\n$val</tr>\n";
        }
+
        $smarty->assign("search_result", $output);
        $smarty->assign("apply", apply_filter());
        $smarty->assign("alphabet", $alphabet);
-       $smarty->assign("range_selector", range_selector(count($this->telephone_list), $this->start, $range));
+       if($range < 20){
+               $smarty->assign("range_selector", range_selector(count($this->telephone_list), $this->start, $range));
+       }else{
+               $smarty->assign("range_selector", range_selector(count($this->telephone_list), $this->start, $range, "EntryPerPage"));
+       }
        $tmp= array("*" => _("All"), "sn" => _("Name"), "givenName" => _("Given name"),
                        "telephoneNumber" => _("Work phone"), "mobile" => _("Cell phone"),
                        "homePhone" => _("Home phone"), "uid" => _("User ID"));