Changeset 1882:433e8676f9ac
- Timestamp:
- 08/19/13 18:58:08 (11 years ago)
- Branch:
- Ticket #1181
- Location:
- plugins/pages
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/pages/_admin.php
r1179 r1882 15 15 $core->addBehavior('adminDashboardFavs','pages_dashboard_favs'); 16 16 $core->addBehavior('adminDashboardFavsIcon','pages_dashboard_favs_icon'); 17 18 $core->addBehavior('adminPostsActionsContent','pages_PostsActionsContent'); 19 17 20 function pages_dashboard($core,$icons) 18 21 { … … 42 45 } 43 46 47 function pages_PostsActionsContent($core,$action,$hidden_fields,$form_uri="posts_actions.php") 48 { 49 50 if ($action == 'reorder' && !empty($_POST['order'])) { 51 try { 52 53 foreach($_POST['order'] as $post_id => $value) { 54 55 if (!$core->auth->check('publish,contentadmin',$core->blog->id)) 56 throw new Exception(__('You are not allowed to change this entry status')); 57 58 $strReq = "WHERE blog_id = '".$core->con->escape($core->blog->id)."' ". 59 "AND post_id ".$core->con->in($post_id); 60 61 #If user can only publish, we need to check the post's owner 62 if (!$core->auth->check('contentadmin',$core->blog->id)) 63 $strReq .= "AND user_id = '".$core->con->escape($core->auth->userID())."' "; 64 65 $cur = $core->con->openCursor($core->prefix.'post'); 66 67 $cur->post_position = (integer) $value-1; 68 $cur->post_upddt = date('Y-m-d H:i:s'); 69 70 $cur->update($strReq); 71 $core->blog->triggerBlog(); 72 73 } 74 75 http::redirect($_POST['redir']); 76 } catch (Exception $e) { 77 $core->error->add($e->getMessage()); 78 } 79 } 80 } 81 44 82 $_menu['Blog']->addItem(__('Pages'),'plugin.php?p=pages','index.php?pf=pages/icon.png', 45 83 preg_match('/plugin.php\?p=pages(&.*)?$/',$_SERVER['REQUEST_URI']), -
plugins/pages/list.php
r1464 r1882 31 31 32 32 $html_block = 33 '<table class=" clear"><tr>'.34 '<th colspan=" 2">'.__('Title').'</th>'.33 '<table class="maximal dragable"><thead><tr>'. 34 '<th colspan="3">'.__('Title').'</th>'. 35 35 '<th>'.__('Date').'</th>'. 36 36 '<th>'.__('Author').'</th>'. … … 38 38 '<th>'.__('Trackbacks').'</th>'. 39 39 '<th>'.__('Status').'</th>'. 40 '</tr> %s</table>';40 '</tr></thead><tbody id="pageslist">%s</tbody></table>'; 41 41 42 42 if ($enclose_block) { … … 50 50 echo $blocks[0]; 51 51 52 $count = 0; 52 53 while ($this->rs->fetch()) 53 54 { 54 echo $this->postLine(); 55 echo $this->postLine($count); 56 $count ++; 55 57 } 56 58 … … 61 63 } 62 64 63 private function postLine( )65 private function postLine($count) 64 66 { 65 67 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; … … 100 102 101 103 $res .= 104 '<td class="nowrap handle minimal">'.form::field(array('order['.$this->rs->post_id.']'),2,3,$count+1,'position','',false,'title="'.sprintf(__('position of %s'),html::escapeHTML($this->rs->post_title)).'"').'</td>'. 102 105 '<td class="nowrap">'. 103 106 form::checkbox(array('entries[]'),$this->rs->post_id,'','','',!$this->rs->isEditable(),'title="'.__('Select this page').'"').'</td>'. … … 145 148 if ($core->auth->check('publish,contentadmin',$core->blog->id)) 146 149 { 150 $combo_action[__('Reorder')] = 'reorder'; 147 151 $combo_action[__('Publish')] = 'publish'; 148 152 $combo_action[__('Unpublish')] = 'unpublish'; … … 167 171 <head> 168 172 <title><?php echo __('Pages'); ?></title> 169 <script type="text/javascript" src="js/_posts_list.js"></script> 173 <?php 174 echo dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 175 dcPage::jsLoad('index.php?pf=pages/list.js'); 176 ?> 170 177 <script type="text/javascript"> 171 178 //<![CDATA[
Note: See TracChangeset
for help on using the changeset viewer.