Changeset 2566:9bf417837888 for inc/admin/lib.pager.php
- Timestamp:
- 11/17/13 20:25:53 (12 years ago)
- Branch:
- 2.6
- Children:
- 2567:6c11245cbf04, 2568:61c67a7d17fa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/lib.pager.php
r2386 r2566 16 16 protected $form_action; 17 17 protected $form_hidden; 18 18 19 19 protected function getLink($li_class,$href,$img_src,$img_src_nolink,$img_alt,$enable_link) { 20 20 if ($enable_link) { … … 60 60 $this->form_action = $url['path']; 61 61 } 62 62 63 63 /** 64 64 * Pager Links … … 103 103 ($this->env < $this->nb_pages) 104 104 ); 105 $htmlCurrent = 105 $htmlCurrent = 106 106 '<li class="active"><strong>'. 107 107 sprintf(__('Page %s / %s'),$this->env,$this->nb_pages). 108 108 '</strong></li>'; 109 110 $htmlDirect = 109 110 $htmlDirect = 111 111 ($this->nb_pages > 1 ? 112 112 sprintf('<li class="direct-access">'.__('Direct access page %s'), … … 114 114 '<input type="submit" value="'.__('ok').'" class="reset" '. 115 115 'name="ok" />'.$this->form_hidden.'</li>' : ''); 116 117 $res = 116 117 $res = 118 118 '<form action="'.$this->form_action.'" method="get">'. 119 119 '<div class="pager"><ul>'. … … 128 128 '</form>' 129 129 ; 130 130 131 131 return $this->nb_elements > 0 ? $res : ''; 132 132 } … … 138 138 protected $rs; 139 139 protected $rs_count; 140 140 141 141 public function __construct($core,$rs,$rs_count) 142 142 { … … 173 173 '<div class="table-outer">'. 174 174 '<table>'; 175 175 176 176 if( $filter ) { 177 177 $html_block .= '<caption>'.sprintf(__('List of %s entries match the filter.'), $this->rs_count).'</caption>'; … … 179 179 $html_block .= '<caption class="hidden">'.__('Entries list').'</caption>'; 180 180 } 181 181 182 182 $html_block .= '<tr>'. 183 183 '<th colspan="2" class="first">'.__('Title').'</th>'. … … 189 189 '<th scope="col">'.__('Status').'</th>'. 190 190 '</tr>%s</table></div>'; 191 191 192 192 if ($enclose_block) { 193 193 $html_block = sprintf($enclose_block,$html_block); 194 194 } 195 196 echo $pager->getLinks(); 197 195 196 echo $pager->getLinks(); 197 198 198 $blocks = explode('%s',$html_block); 199 199 200 200 echo $blocks[0]; 201 201 202 202 while ($this->rs->fetch()) 203 203 { 204 204 echo $this->postLine(isset($entries[$this->rs->post_id])); 205 205 } 206 206 207 207 echo $blocks[1]; 208 209 echo $pager->getLinks(); 210 } 211 } 212 208 209 echo $pager->getLinks(); 210 } 211 } 212 213 213 private function postLine($checked) 214 214 { … … 218 218 $cat_link = '%2$s'; 219 219 } 220 220 221 221 if ($this->rs->cat_title) { 222 222 $cat_title = sprintf($cat_link,$this->rs->cat_id, … … 225 225 $cat_title = __('(No cat)'); 226 226 } 227 227 228 228 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 229 229 switch ($this->rs->post_status) { … … 241 241 break; 242 242 } 243 243 244 244 $protected = ''; 245 245 if ($this->rs->post_password) { 246 246 $protected = sprintf($img,__('Protected'),'locker.png'); 247 247 } 248 248 249 249 $selected = ''; 250 250 if ($this->rs->post_selected) { 251 251 $selected = sprintf($img,__('Selected'),'selected.png'); 252 252 } 253 253 254 254 $attach = ''; 255 255 $nb_media = $this->rs->countMedia(); … … 258 258 $attach = sprintf($img,sprintf($attach_str,$nb_media),'attach.png'); 259 259 } 260 260 261 261 $res = '<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'. 262 262 ' id="p'.$this->rs->post_id.'">'; 263 263 264 264 $res .= 265 265 '<td class="nowrap">'. … … 274 274 '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>'. 275 275 '</tr>'; 276 276 277 277 return $res; 278 278 } … … 290 290 { 291 291 $pager = new dcPager($page,$this->rs_count,$nb_per_page,10); 292 292 293 293 $html_block = 294 294 '<div class="table-outer clear">'. … … 299 299 '<th scope="col">'.__('Status').'</th>'. 300 300 '</tr>%s</table></div>'; 301 301 302 302 if ($enclose_block) { 303 303 $html_block = sprintf($enclose_block,$html_block); 304 304 } 305 306 echo $pager->getLinks(); 307 305 306 echo $pager->getLinks(); 307 308 308 $blocks = explode('%s',$html_block); 309 309 310 310 echo $blocks[0]; 311 311 312 312 while ($this->rs->fetch()) 313 313 { 314 314 echo $this->postLine(); 315 315 } 316 316 317 317 echo $blocks[1]; 318 319 echo $pager->getLinks(); 320 } 321 } 322 318 319 echo $pager->getLinks(); 320 } 321 } 322 323 323 private function postLine() 324 324 { … … 338 338 break; 339 339 } 340 340 341 341 $protected = ''; 342 342 if ($this->rs->post_password) { 343 343 $protected = sprintf($img,__('Protected'),'locker.png'); 344 344 } 345 345 346 346 $selected = ''; 347 347 if ($this->rs->post_selected) { 348 348 $selected = sprintf($img,__('Selected'),'selected.png'); 349 349 } 350 350 351 351 $attach = ''; 352 352 $nb_media = $this->rs->countMedia(); … … 355 355 $attach = sprintf($img,sprintf($attach_str,$nb_media),'attach.png'); 356 356 } 357 357 358 358 $res = '<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'. 359 359 ' id="p'.$this->rs->post_id.'">'; 360 360 361 361 $res .= 362 362 '<td scope="row" class="maximal"><a href="'.$this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'" '. … … 367 367 '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>'. 368 368 '</tr>'; 369 369 370 370 return $res; 371 371 } … … 387 387 { 388 388 $pager = new dcPager($page,$this->rs_count,$nb_per_page,10); 389 389 390 390 $comments = array(); 391 391 if (isset($_REQUEST['comments'])) { … … 393 393 $comments[(integer)$v]=true; 394 394 } 395 } 395 } 396 396 $html_block = 397 397 '<div class="table-outer">'. 398 398 '<table>'; 399 399 400 400 if( $filter ) { 401 401 $html_block .= '<caption>'. … … 408 408 $html_block .= '<caption class="hidden">'.__('Comments and trackbacks list').'</caption>'; 409 409 } 410 410 411 411 $html_block .= '<tr>'. 412 412 '<th colspan="2" scope="col" abbr="comm" class="first">'.__('Type').'</th>'. … … 420 420 $html_block = sprintf($enclose_block,$html_block); 421 421 } 422 423 echo $pager->getLinks(); 424 422 423 echo $pager->getLinks(); 424 425 425 $blocks = explode('%s',$html_block); 426 426 427 427 echo $blocks[0]; 428 428 429 429 while ($this->rs->fetch()) 430 430 { 431 431 echo $this->commentLine(isset($comments[$this->rs->comment_id])); 432 432 } 433 433 434 434 echo $blocks[1]; 435 436 echo $pager->getLinks(); 437 } 438 } 439 435 436 echo $pager->getLinks(); 437 } 438 } 439 440 440 private function commentLine($checked=false) 441 441 { 442 442 global $author, $status, $sortby, $order, $nb_per_page; 443 443 444 444 $author_url = 445 445 'comments.php?n='.$nb_per_page. … … 448 448 '&order='.$order. 449 449 '&author='.rawurlencode($this->rs->comment_author); 450 450 451 451 $post_url = $this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id); 452 452 453 453 $comment_url = 'comment.php?id='.$this->rs->comment_id; 454 454 455 455 $comment_dt = 456 456 dt::dt2str($this->core->blog->settings->system->date_format.' - '. 457 457 $this->core->blog->settings->system->time_format,$this->rs->comment_dt); 458 458 459 459 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 460 460 switch ($this->rs->comment_status) { … … 472 472 break; 473 473 } 474 474 475 475 $post_title = html::escapeHTML($this->rs->post_title); 476 476 if (mb_strlen($post_title) > 70) { … … 480 480 $this->rs->comment_trackback ? __('trackback') : __('comment'), 481 481 html::escapeHTML($this->rs->comment_author)); 482 482 483 483 $res = '<tr class="line'.($this->rs->comment_status != 1 ? ' offline' : '').'"'. 484 484 ' id="c'.$this->rs->comment_id.'">'; 485 485 486 486 $res .= 487 487 '<td class="nowrap">'. … … 497 497 html::escapeHTML($post_title).'</a>'. 498 498 ($this->rs->post_type != 'post' ? ' ('.html::escapeHTML($this->rs->post_type).')' : '').'</td>'; 499 499 500 500 $res .= '</tr>'; 501 501 502 502 return $res; 503 503 } … … 519 519 { 520 520 $pager = new dcPager($page,$this->rs_count,$nb_per_page,10); 521 521 522 522 $html_block = 523 523 '<div class="table-outer clear">'. 524 524 '<table>'; 525 525 526 526 if( $filter ) { 527 527 $html_block .= '<caption>'.sprintf(__('List of %s users match the filter.'), $this->rs_count).'</caption>'; … … 529 529 $html_block .= '<caption class="hidden">'.__('Users list').'</caption>'; 530 530 } 531 531 532 532 $html_block .= '<tr>'. 533 533 '<th colspan="2" scope="col" class="first">'.__('Username').'</th>'. … … 537 537 '<th scope="col" class="nowrap">'.__('Entries (all types)').'</th>'. 538 538 '</tr>%s</table></div>'; 539 539 540 540 if ($enclose_block) { 541 541 $html_block = sprintf($enclose_block,$html_block); 542 542 } 543 544 echo $pager->getLinks(); 545 543 544 echo $pager->getLinks(); 545 546 546 $blocks = explode('%s',$html_block); 547 547 548 548 echo $blocks[0]; 549 549 550 550 while ($this->rs->fetch()) 551 551 { 552 552 echo $this->userLine(); 553 553 } 554 554 555 555 echo $blocks[1]; 556 557 echo $pager->getLinks(); 558 } 559 } 560 556 557 echo $pager->getLinks(); 558 } 559 } 560 561 561 private function userLine() 562 562 { 563 563 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 564 564 $img_status = ''; 565 565 566 566 $p = $this->core->getUserPermissions($this->rs->user_id); 567 567 568 568 if (isset($p[$this->core->blog->id]['p']['admin'])) { 569 569 $img_status = sprintf($img,__('admin'),'admin.png');
Note: See TracChangeset
for help on using the changeset viewer.