Changeset 1999:a0ed28c2da5a for inc
- Timestamp:
- 09/22/13 11:38:22 (12 years ago)
- Branch:
- default
- Parents:
- 1998:dae906985ebb (diff), 1905:d72d24250853 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- inc
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/lib.pager.php
r1905 r1999 12 12 if (!defined('DC_RC_PATH')) { return; } 13 13 14 class dcPager extends pager 15 { 16 protected $form_action; 17 protected $form_hidden; 18 19 protected function getLink($li_class,$href,$img_src,$img_src_nolink,$img_alt,$enable_link) { 20 if ($enable_link) { 21 $formatter = '<li class="%s btn"><a href="%s"><img src="%s" alt="%s"/></a><span class="hidden">%s</span></li>'; 22 return sprintf ($formatter, 23 $li_class,$href,$img_src,$img_alt,$img_alt); 24 } else { 25 $formatter = '<li class="%s no-link btn"><img src="%s" alt="%s"/></li>'; 26 return sprintf ($formatter, 27 $li_class,$img_src_nolink,$img_alt,$img_alt); 28 } 29 } 30 public function setURL() { 31 parent::setURL(); 32 $url = parse_url($_SERVER['REQUEST_URI']); 33 if (isset($url['query'])) { 34 parse_str($url['query'],$args); 35 } else { 36 $args=array(); 37 } 38 # Removing session information 39 if (session_id()) 40 { 41 if (isset($args[session_name()])) 42 unset($args[session_name()]); 43 } 44 if (isset($args[$this->var_page])) { 45 unset($args[$this->var_page]); 46 } 47 if (isset($args['ok'])) { 48 unset($args['ok']); 49 } 50 $this->form_hidden = ''; 51 foreach ($args as $k=>$v) { 52 if (is_array($v)) { 53 foreach ($v as $k2=>$v2) { 54 $this->form_hidden .= form::hidden(array($k.'[]'),$v2); 55 } 56 } else { 57 $this->form_hidden .= form::hidden(array($k),$v); 58 } 59 } 60 $this->form_action = $url['path']; 61 } 62 63 /** 64 * Pager Links 65 * 66 * Returns pager links 67 * 68 * @return string 69 */ 70 public function getLinks() 71 { 72 $this->setURL(); 73 $htmlFirst = $this->getLink( 74 "first", 75 sprintf($this->page_url,1), 76 "images/pagination/first.png", 77 "images/pagination/no-first.png", 78 __('First page'), 79 ($this->env > 1) 80 ); 81 $htmlPrev = $this->getLink( 82 "prev", 83 sprintf($this->page_url,$this->env-1), 84 "images/pagination/previous.png", 85 "images/pagination/no-previous.png", 86 __('Previous page'), 87 ($this->env > 1) 88 ); 89 $htmlNext = $this->getLink( 90 "next", 91 sprintf($this->page_url,$this->env+1), 92 "images/pagination/next.png", 93 "images/pagination/no-next.png", 94 __('Next page'), 95 ($this->env < $this->nb_pages) 96 ); 97 $htmlLast = $this->getLink( 98 "last", 99 sprintf($this->page_url,$this->nb_pages), 100 "images/pagination/last.png", 101 "images/pagination/no-last.png", 102 __('Last page'), 103 ($this->env < $this->nb_pages) 104 ); 105 $htmlCurrent = 106 '<li class="active"><strong>'. 107 sprintf(__('Page %s / %s'),$this->env,$this->nb_pages). 108 '</strong></li>'; 109 110 $htmlDirect = 111 ($this->nb_pages > 1 ? 112 sprintf('<li class="direct-access">'.__('Direct access page %s'), 113 form::field(array('page'),3,10)). 114 '<input type="submit" value="'.__('ok').'" class="reset" '. 115 'name="ok" />'.$this->form_hidden.'</li>' : ''); 116 117 $res = 118 '<form action="'.$this->form_action.'" method="get">'. 119 '<div class="pager"><ul>'. 120 $htmlFirst. 121 $htmlPrev. 122 $htmlCurrent. 123 $htmlNext. 124 $htmlLast. 125 $htmlDirect. 126 '</ul>'. 127 '</div>'. 128 '</form>' 129 ; 130 131 return $this->nb_elements > 0 ? $res : ''; 132 } 133 } 134 14 135 class adminGenericList 15 136 { … … 38 159 else 39 160 { 40 $pager = new pager($page,$this->rs_count,$nb_per_page,10); 41 $pager->html_prev = $this->html_prev; 42 $pager->html_next = $this->html_next; 43 $pager->var_page = 'page'; 161 $pager = new dcPager($page,$this->rs_count,$nb_per_page,10); 44 162 $entries = array(); 45 163 if (isset($_REQUEST['entries'])) { … … 63 181 } 64 182 65 echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>';183 echo $pager->getLinks(); 66 184 67 185 $blocks = explode('%s',$html_block); … … 76 194 echo $blocks[1]; 77 195 78 echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>';196 echo $pager->getLinks(); 79 197 } 80 198 } … … 158 276 else 159 277 { 160 $pager = new pager($page,$this->rs_count,$nb_per_page,10); 161 $pager->html_prev = $this->html_prev; 162 $pager->html_next = $this->html_next; 163 $pager->var_page = 'page'; 278 $pager = new dcPager($page,$this->rs_count,$nb_per_page,10); 164 279 165 280 $html_block = … … 175 290 } 176 291 177 echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>';292 echo $pager->getLinks(); 178 293 179 294 $blocks = explode('%s',$html_block); … … 188 303 echo $blocks[1]; 189 304 190 echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>';305 echo $pager->getLinks(); 191 306 } 192 307 } … … 253 368 else 254 369 { 255 $pager = new pager($page,$this->rs_count,$nb_per_page,10); 256 $pager->html_prev = $this->html_prev; 257 $pager->html_next = $this->html_next; 258 $pager->var_page = 'page'; 370 $pager = new dcPager($page,$this->rs_count,$nb_per_page,10); 371 259 372 $comments = array(); 260 373 if (isset($_REQUEST['comments'])) { … … 276 389 } 277 390 278 echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>';391 echo $pager->getLinks(); 279 392 280 393 $blocks = explode('%s',$html_block); … … 284 397 while ($this->rs->fetch()) 285 398 { 286 echo $this->commentLine( isset($comments[$this->rs->comment_id]));399 echo $this->commentLine(); 287 400 } 288 401 289 402 echo $blocks[1]; 290 403 291 echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>';404 echo $pager->getLinks(); 292 405 } 293 406 } … … 341 454 $res .= 342 455 '<td class="nowrap">'. 343 form::checkbox(array('comments[]'),$this->rs->comment_id, $checked,'','',0).'</td>'.344 '<td class="nowrap" abbr="'.__('Type and author').'" scope="r aw">'.456 form::checkbox(array('comments[]'),$this->rs->comment_id,'','','',0).'</td>'. 457 '<td class="nowrap" abbr="'.__('Type and author').'" scope="row">'. 345 458 '<a href="'.$comment_url.'" title="'.$comment_title.'">'. 346 459 '<img src="images/edit-mini.png" alt="'.__('Edit').'"/> '. … … 369 482 else 370 483 { 371 $pager = new pager($page,$this->rs_count,$nb_per_page,10); 372 $pager->html_prev = $this->html_prev; 373 $pager->html_next = $this->html_next; 374 $pager->var_page = 'page'; 484 $pager = new dcPager($page,$this->rs_count,$nb_per_page,10); 375 485 376 486 $html_block = … … 387 497 } 388 498 389 echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>';499 echo $pager->getLinks(); 390 500 391 501 $blocks = explode('%s',$html_block); … … 400 510 echo $blocks[1]; 401 511 402 echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>';512 echo $pager->getLinks(); 403 513 } 404 514 } -
inc/admin/lib.pager.php
r1998 r1999 370 370 $pager = new dcPager($page,$this->rs_count,$nb_per_page,10); 371 371 372 $comments = array(); 373 if (isset($_REQUEST['comments'])) { 374 foreach ($_REQUEST['comments'] as $v) { 375 $comments[(integer)$v]=true; 376 } 377 } 372 378 $html_block = 373 379 '<table><caption class="hidden">'.__('Comments and trackbacks list').'</caption><tr>'. … … 400 406 } 401 407 402 private function commentLine( )408 private function commentLine($checked) 403 409 { 404 410 global $author, $status, $sortby, $order, $nb_per_page; -
inc/prepend.php
r1905 r1999 59 59 $__autoload['adminCommentList'] = dirname(__FILE__).'/admin/lib.pager.php'; 60 60 $__autoload['adminUserList'] = dirname(__FILE__).'/admin/lib.pager.php'; 61 $__autoload['dcPager'] = dirname(__FILE__).'/admin/lib.pager.php'; 61 62 $__autoload['dcAdminCombos'] = dirname(__FILE__).'/admin/lib.admincombos.php'; 62 63 … … 291 292 { 292 293 if ($l == 'en' || l10n::set(dirname(__FILE__).'/../locales/'.$l.'/main') !== false) { 294 l10n::lang($l); 293 295 break; 294 296 } -
inc/prepend.php
r1949 r1999 65 65 $__autoload['context'] = dirname(__FILE__).'/public/lib.tpl.context.php'; 66 66 $__autoload['dcUrlHandlers'] = dirname(__FILE__).'/public/lib.urlhandlers.php'; 67 $__autoload['dcPostsActionsPage'] = dirname(__FILE__).'/admin/actions/class.dcactionposts.php'; 68 $__autoload['dcCommentsActionsPage'] = dirname(__FILE__).'/admin/actions/class.dcactioncomments.php'; 69 $__autoload['dcActionsPage'] = dirname(__FILE__).'/admin/actions/class.dcaction.php'; 67 70 68 71 # Clearbricks extensions
Note: See TracChangeset
for help on using the changeset viewer.