aliroAdminPageNav.php

Go to the documentation of this file.
00001 <?php
00002 
00003 /*******************************************************************************
00004  * Aliro - the modern, accessible content management system
00005  *
00006  * Aliro is open source software, free to use, and licensed under GPL.
00007  * You can find the full licence at http://www.gnu.org/copyleft/gpl.html GNU/GPL
00008  *
00009  * The author freely draws attention to the fact that Aliro derives from Mambo,
00010  * software that is controlled by the Mambo Foundation.  However, this section
00011  * of code is totally new.  If it should contain any fragments that are similar
00012  * to Mambo, please bear in mind (1) there are only so many ways to do things
00013  * and (2) the author of Aliro is also the author and copyright owner for large
00014  * parts of Mambo 4.6.
00015  *
00016  * Tribute should be paid to all the developers who took Mambo to the stage
00017  * it had reached at the time Aliro was created.  It is a feature rich system
00018  * that contains a good deal of innovation.
00019  *
00020  * Your attention is also drawn to the fact that Aliro relies on other items of
00021  * open source software, which is very much in the spirit of open source.  Aliro
00022  * wishes to give credit to those items of code.  Please refer to
00023  * http://aliro.org/credits for details.  The credits are not included within
00024  * the Aliro package simply to avoid providing a marker that allows hackers to
00025  * identify the system.
00026  *
00027  * Copyright in this code is strictly reserved by its author, Martin Brampton.
00028  * If it seems appropriate, the copyright will be vested in the Aliro Organisation
00029  * at a suitable time.
00030  *
00031  * Copyright (c) 2007 Martin Brampton
00032  *
00033  * http://aliro.org
00034  *
00035  * counterpoint@aliro.org
00036  *
00037  * aliroAdminPageNav is the class that creates page navigation of lists for the
00038  * admin side.  It extends the basic abstract page navigation class.
00039  *
00040  */
00041 
00042 class aliroAdminPageNav extends aliroAbstractPageNav  {
00043     protected $isAdmin = true;
00044 
00048     function getLimitBox () {
00049         $legend = T_('Refresh page');
00050         $html = aliroHTML::getInstance()->selectList($this->makeLimitSteps(), 'limit', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $this->limit);
00051         $html .= <<<PER_PAGE
00052         
00053         <input type="hidden" name="limitstart" value="$this->limitstart" />
00054         <noscript><input type="submit" class="button" value="$legend" /></noscript>
00055         
00056 PER_PAGE;
00057         return $html;
00058     }
00059 
00060     function writeLimitBox () {
00061         echo $this->getLimitBox();
00062     }
00063 
00064     function writePagesCounter() {
00065         echo $this->getPagesCounter();
00066     }
00067 
00071     function writePagesLinks($link='') {
00072         echo $this->getPagesLinks($link);
00073     }
00077     public function getPagesLinks($link='') {
00078         if (!$link) $link = aliroAdminRequest::getInstance()->simpleURL();
00079         return parent::writePagesLinks ($link);
00080     }
00081 
00082     function getListFooter() {
00083         $display = T_('Display #');
00084         $html = <<<LIST_FOOTER
00085 
00086         <table class="adminlist">
00087             <thead>
00088                 <tr>
00089                     <th colspan="3">
00090                         {$this->getPagesLinks()}
00091                     </th>
00092                 </tr>
00093             </thead>
00094             <tbody>
00095                 <tr>
00096                     <td nowrap="nowrap" width="48%" class="right">
00097                         $display
00098                     </td>
00099                     <td>
00100                         {$this->getLimitBox()}
00101                     </td>
00102                     <td nowrap="nowrap" width="48%">
00103                         {$this->getPagesCounter()}
00104                     </td>
00105                 </tr>
00106             </tbody>
00107         </table>
00108 
00109 LIST_FOOTER;
00110 
00111         return $html;
00112     }
00117     public function rowNumber( $i ) {
00118         return $i + 1 + $this->limitstart;
00119     }
00126     public function orderUpIcon( $i, $condition=true, $task='orderup', $alt='Move Up' ) {
00127         if (($i > 0 || ($i+$this->limitstart > 0)) && $condition) {
00128             return '<a href="#reorder" onclick="return listItemTask(\'cb'.$i.'\',\''.$task.'\')" title="'.$alt.'">
00129                 <img src="images/uparrow.png" width="12" height="12" border="0" alt="'.$alt.'" />
00130             </a>';
00131         } else {
00132             return '&nbsp;';
00133         }
00134     }
00135 
00136     public function noJavaOrderUpIcon( $i, $condition=true, $url ) {
00137         if (($i > 0 OR ($i+$this->limitstart > 0)) AND $condition) {
00138             $alt = T_('Move up');
00139             return <<<ORDERUP
00140             <a href="$url" title="$alt">
00141                 <img src="images/uparrow.png" width="12" height="12" border="0" alt="$alt" />
00142             </a>
00143 ORDERUP;
00144         } else {
00145             return '&nbsp;';
00146         }
00147     }
00148 
00156     public function orderDownIcon( $i, $n, $condition=true, $task='orderdown', $alt='Move Down' ) {
00157         if (($i < $n-1 || $i+$this->limitstart < $this->total-1) && $condition) {
00158             return '<a href="#reorder" onclick="return listItemTask(\'cb'.$i.'\',\''.$task.'\')" title="'.$alt.'">
00159                 <img src="images/downarrow.png" width="12" height="12" border="0" alt="'.$alt.'" />
00160             </a>';
00161         } else {
00162             return '&nbsp;';
00163         }
00164     }
00165 
00166     public function noJavaOrderDownIcon( $i, $n, $condition=true, $url ) {
00167         if (($i < $n-1 OR $i+$this->limitstart < $this->total-1) AND $condition) {
00168             $alt = T_('Move down');
00169             return <<<ORDERDOWN
00170             <a href="$url" title="$alt">
00171                 <img src="images/downarrow.png" width="12" height="12" border="0" alt="$alt" />
00172             </a>
00173 ORDERDOWN;
00174         } else {
00175             return '&nbsp;';
00176         }
00177     }
00178 
00179 }
00180 ?>

Generated on Thu Apr 17 13:03:26 2008 for ALIRO by  doxygen 1.5.5