Changeset 782:01efbf050a8a for plugins/pages
- Timestamp:
- 12/06/11 11:43:14 (14 years ago)
- Branch:
- formfilters
- Parents:
- 781:b509ac00bf4a (diff), 779:58c45f1b96e5 (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. - Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/pages/list.php
r578 r782 15 15 /* Pager class 16 16 -------------------------------------------------------- */ 17 class adminPageList extends admin GenericList17 class adminPageList extends adminPostList 18 18 { 19 public function display($page,$nb_per_page,$enclose_block='')19 public function setColumns() 20 20 { 21 if ($this->rs->isEmpty()) 22 { 23 echo '<p><strong>'.__('No page').'</strong></p>'; 24 } 25 else 26 { 27 $pager = new pager($page,$this->rs_count,$nb_per_page,10); 28 $pager->html_prev = $this->html_prev; 29 $pager->html_next = $this->html_next; 30 $pager->var_page = 'page'; 31 32 $html_block = 33 '<table class="clear"><tr>'. 34 '<th colspan="2">'.__('Title').'</th>'. 35 '<th>'.__('Date').'</th>'. 36 '<th>'.__('Author').'</th>'. 37 '<th>'.__('Comments').'</th>'. 38 '<th>'.__('Trackbacks').'</th>'. 39 '<th>'.__('Status').'</th>'. 40 '</tr>%s</table>'; 41 42 if ($enclose_block) { 43 $html_block = sprintf($enclose_block,$html_block); 44 } 45 46 echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 47 48 $blocks = explode('%s',$html_block); 49 50 echo $blocks[0]; 51 52 while ($this->rs->fetch()) 53 { 54 echo $this->postLine(); 55 } 56 57 echo $blocks[1]; 58 59 echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 60 } 21 $this->addColumn('title',__('Title'),array('adminPostList','getTitle'),' class="maximal"',false); 22 $this->addColumn('date',__('Date'),array('adminPostList','getDate')); 23 $this->addColumn('author',__('Author'),array('adminPostList','getAuthor')); 24 $this->addColumn('comment',__('Comments'),array('adminPostList','getComments')); 25 $this->addColumn('trackback',__('Trackbacks'),array('adminPostList','getTrackbacks')); 26 $this->addColumn('status',__('Status'),array('adminPostList','getStatus')); 61 27 } 62 28 63 pr ivate function postLine()29 protected function getDefaultCaption() 64 30 { 65 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 66 switch ($this->rs->post_status) { 67 case 1: 68 $img_status = sprintf($img,__('published'),'check-on.png'); 69 break; 70 case 0: 71 $img_status = sprintf($img,__('unpublished'),'check-off.png'); 72 break; 73 case -1: 74 $img_status = sprintf($img,__('scheduled'),'scheduled.png'); 75 break; 76 case -2: 77 $img_status = sprintf($img,__('pending'),'check-wrn.png'); 78 break; 79 } 80 81 $protected = ''; 82 if ($this->rs->post_password) { 83 $protected = sprintf($img,__('protected'),'locker.png'); 84 } 85 86 $selected = ''; 87 if ($this->rs->post_selected) { 88 $selected = sprintf($img,__('selected'),'selected.png'); 89 } 90 91 $attach = ''; 92 $nb_media = $this->rs->countMedia(); 93 if ($nb_media > 0) { 94 $attach_str = $nb_media == 1 ? __('%d attachment') : __('%d attachments'); 95 $attach = sprintf($img,sprintf($attach_str,$nb_media),'attach.png'); 96 } 97 98 $res = '<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'. 99 ' id="p'.$this->rs->post_id.'">'; 100 101 $res .= 102 '<td class="nowrap">'. 103 form::checkbox(array('entries[]'),$this->rs->post_id,'','','',!$this->rs->isEditable(),'title="'.__('select this page').'"').'</td>'. 104 '<td class="maximal"><a href="'.$this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'">'. 105 html::escapeHTML($this->rs->post_title).'</a></td>'. 106 '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>'. 107 108 '<td class="nowrap">'.$this->rs->user_id.'</td>'. 109 '<td class="nowrap">'.$this->rs->nb_comment.'</td>'. 110 '<td class="nowrap">'.$this->rs->nb_trackback.'</td>'. 111 '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>'. 112 '</tr>'; 113 114 return $res; 31 return __('Pages list'); 115 32 } 116 33 } -
plugins/pages/list.php
r457 r782 4 4 # This file is part of Dotclear 2. 5 5 # 6 # Copyright (c) 2003-201 0Olivier Meunier & Association Dotclear6 # Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or … … 64 64 $combo_action[__('publish')] = 'publish'; 65 65 $combo_action[__('unpublish')] = 'unpublish'; 66 $combo_action[__('schedule')] = 'schedule'; 66 67 $combo_action[__('mark as pending')] = 'pending'; 67 68 } … … 93 94 <body> 94 95 <?php 95 echo '<h2>'.html::escapeHTML($core->blog->name).' › '.__('Pages').'</h2>'.96 echo '<h2>'.html::escapeHTML($core->blog->name).' › <span class="page-title">'.__('Pages').'</span></h2>'. 96 97 '<p class="top-add"><a class="button add" href="'.$p_url.'&act=page">'.__('New page').'</a></p>'; 97 98
Note: See TracChangeset
for help on using the changeset viewer.