Changeset 3402:8681798c6491 for inc/admin
- Timestamp:
- 11/11/16 00:10:02 (9 years ago)
- Branch:
- default
- Location:
- inc/admin
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/lib.pager.php
r3265 r3402 662 662 } 663 663 664 class adminBlogList extends adminGenericList 665 { 666 public function display($page,$nb_per_page,$enclose_block='',$filter=false) 667 { 668 if ($this->rs->isEmpty()) 669 { 670 if($filter) { 671 echo '<p><strong>'.__('No blog matches the filter').'</strong></p>'; 672 } else { 673 echo '<p><strong>'.__('No blog').'</strong></p>'; 674 } 675 } 676 else 677 { 678 $blogs = array(); 679 if (isset($_REQUEST['blogs'])) { 680 foreach ($_REQUEST['blogs'] as $v) { 681 $blogs[$v]=true; 682 } 683 } 684 685 $pager = new dcPager($page,$this->rs_count,$nb_per_page,10); 686 687 $cols = array( 688 'blog' => '<th colspan="2" scope="col" abbr="comm" class="first nowrap">'.__('Blog id').'</th>', 689 'name' => '<th scope="col" abbr="name">'.__('Blog name').'</th>', 690 'url' => '<th scope="col" class="nowrap">'.__('URL').'</th>', 691 'posts' => '<th scope="col" class="nowrap">'.__('Entries (all types)').'</th>', 692 'upddt' => '<th scope="col" class="nowrap">'.__('Last update').'</th>', 693 'status' => '<th scope="col" class="txt-center">'.__('Status').'</th>' 694 ); 695 696 $cols = new ArrayObject($cols); 697 $this->core->callBehavior('adminBlogListHeader',$this->core,$this->rs,$cols); 698 699 $html_block = 700 '<div class="table-outer"><table>'. 701 ($filter ? 702 '<caption>'. 703 sprintf(__('%d blog matches the filter.','%d blogs match the filter.',$this->rs_count),$this->rs_count). 704 '</caption>' 705 : 706 '<caption class="hidden">'.__('Blogs list').'</caption>' 707 ). 708 '<tr>'.implode(iterator_to_array($cols)).'</tr>%s</table></div>'; 709 710 if ($enclose_block) { 711 $html_block = sprintf($enclose_block,$html_block); 712 } 713 714 $blocks = explode('%s',$html_block); 715 716 echo $pager->getLinks(); 717 718 echo $blocks[0]; 719 720 while ($this->rs->fetch()) { 721 echo $this->blogLine(isset($blogs[$this->rs->blog_id])); 722 } 723 724 echo $blocks[1]; 725 726 echo $pager->getLinks(); 727 } 728 } 729 730 private function blogLine($checked=false) 731 { 732 $blog_id = html::escapeHTML($this->rs->blog_id); 733 734 $cols = array( 735 'check' => 736 '<td class="nowrap">'. 737 form::checkbox(array('blogs[]'),$this->rs->blog_id,$checked,'','',0). 738 '</td>', 739 'blog' => 740 '<td class="nowrap">'. 741 '<a href="'.$this->core->adminurl->get("admin.blog",array('id' => $blog_id)).'" '. 742 'title="'.sprintf(__('Edit blog settings for %s'),$blog_id).'">'. 743 '<img src="images/edit-mini.png" alt="'.__('Edit blog settings').'" /> '.$blog_id.'</a> '. 744 '</td>', 745 'name' => 746 '<td class="maximal">'. 747 '<a href="'.$this->core->adminurl->get("admin.home",array('switchblog' => $this->rs->blog_id)).'" '. 748 'title="'.sprintf(__('Switch to blog %s'),$this->rs->blog_id).'">'. 749 html::escapeHTML($this->rs->blog_name).'</a>'. 750 '</td>', 751 'url' => 752 '<td class="nowrap">'. 753 '<a class="outgoing" href="'. 754 html::escapeHTML($this->rs->blog_url).'">'.html::escapeHTML($this->rs->blog_url). 755 ' <img src="images/outgoing-blue.png" alt="" /></a></td>', 756 'posts' => 757 '<td class="nowrap count">'. 758 $this->core->countBlogPosts($this->rs->blog_id). 759 '</td>', 760 'upddt' => 761 '<td class="nowrap count">'. 762 dt::str(__('%Y-%m-%d %H:%M'),strtotime($this->rs->blog_upddt) + dt::getTimeOffset($this->core->auth->getInfo('user_tz'))). 763 '</td>', 764 'status' => 765 '<td class="nowrap status txt-center">'. 766 sprintf( 767 '<img src="images/%1$s.png" alt="%2$s" title="%2$s" />', 768 ($this->rs->blog_status == 1 ? 'check-on' : ($this->rs->blog_status == 0 ? 'check-off' : 'check-wrn')), 769 $this->core->getBlogStatus($this->rs->blog_status) 770 ). 771 '</td>' 772 ); 773 774 $cols = new ArrayObject($cols); 775 $this->core->callBehavior('adminBlogListValue',$this->core,$this->rs,$cols); 776 777 return 778 '<tr class="line" id="b'.$blog_id.'">'. 779 implode(iterator_to_array($cols)). 780 '</tr>'; 781 } 782 } 783 664 784 class adminUserList extends adminGenericList 665 785 {
Note: See TracChangeset
for help on using the changeset viewer.