[ Index ] |
|
Code source de LifeType 1.2.4 |
1 <?php 2 3 /** 4 * Shamelessly ripped off from the phpbb pager 5 */ 6 function smarty_function_adminpager($params, &$smarty) 7 { 8 lt_include( PLOG_CLASS_PATH."class/template/smarty/plugins/function.pager.php" ); 9 // fetch the parameters 10 if( isset( $params["data"])) 11 $pager = $params["data"]; 12 else { 13 // see if we can load the pager from the smarty context 14 if( isset( $smarty->_tpl_vars["pager"] )) 15 $pager = $smarty->_tpl_vars["pager"]; 16 else 17 $smarty->trigger_error( "'data' parameter missing for pager!" ); 18 } 19 20 // Style parameter. It can either "links", "list", "forwardonly" and "backonly" 21 isset( $params["style"] ) ? $style = $params["style"] : $style = "links"; 22 23 $base_url = $pager->getBaseUrl(); 24 $total_pages = $pager->getTotalPages(); 25 $per_page = $pager->getRegsForPage(); 26 $start_item = 1; 27 $add_prevnext_text = true; 28 $on_page = $pager->getCurrentPage(); 29 30 if( $style == "list" ) { 31 $page_string .= "<span class=\"pager\">"; 32 if( !$pager->isFirstPage() && !$pager->isEmpty()) { 33 $page_string .= "<span class=\"list_action_button\"> 34 <a href=\"".$pager->getPrevPageLink()."\"><img src=\"imgs/admin/icon_left-16.png\" /></a> 35 </span>"; 36 } 37 $page_string .= "<select name=\"plogPager\" id=\"plogPager\" onChange=\"top.location.href=this.options[this.selectedIndex].value\""; 38 if( $pager->isEmpty()) { 39 $page_string .= "disabled=\"disabled\""; 40 } 41 $page_string .= ">"; 42 foreach( $pager->getPageLinks() as $pageId => $pageLink ) { 43 $page_string .= "<option value=\"$pageLink\""; 44 if( $pageId == $pager->getCurrentPage()) 45 $page_string .= "selected=\"selected\""; 46 $page_string .= ">$pageId</option>"; 47 } 48 49 $page_string .= "</select>"; 50 51 if( !$pager->isLastPage() && !$pager->isEmpty()) { 52 $page_string .= "<span class=\"list_action_button\">"; 53 $page_string .= "<a href=\"".$pager->getNextPageLink()."\"><img src=\"imgs/admin/icon_right-16.png\" /></a>"; 54 $page_string .= "</span>"; 55 } 56 $page_string .= "</span>"; 57 } 58 else { 59 smarty_function_pager( $params, $smarty ); 60 } 61 62 return $page_string; 63 } 64 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 21:04:15 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |