Changeset 1879:9948ea7d24e8
- Timestamp:
- 08/15/13 00:32:10 (12 years ago)
- Branch:
- Ticket #1181
- Location:
- plugins/pages
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/pages/_admin.php
r1179 r1879 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 48 function pages_PostsActionsContent($core,$action,$hidden_fields,$form_uri="posts_actions.php") 49 { 50 51 if ($action == 'reorder' && !empty($_POST['order'])) { 52 try { 53 54 foreach($_POST['order'] as $post_id => $value) { 55 56 if (!$core->auth->check('publish,contentadmin',$core->blog->id)) 57 throw new Exception(__('You are not allowed to change this entry status')); 58 59 $strReq = "WHERE blog_id = '".$core->con->escape($core->blog->id)."' ". 60 "AND post_id ".$core->con->in($post_id); 61 62 #If user can only publish, we need to check the post's owner 63 if (!$core->auth->check('contentadmin',$core->blog->id)) 64 $strReq .= "AND user_id = '".$core->con->escape($core->auth->userID())."' "; 65 66 $cur = $core->con->openCursor($core->prefix.'post'); 67 68 $cur->post_position = (integer) $value-1; 69 $cur->post_upddt = date('Y-m-d H:i:s'); 70 71 $cur->update($strReq); 72 $core->blog->triggerBlog(); 73 74 } 75 76 http::redirect($_POST['redir']); 77 } catch (Exception $e) { 78 $core->error->add($e->getMessage()); 79 } 80 } 81 } 82 44 83 $_menu['Blog']->addItem(__('Pages'),'plugin.php?p=pages','index.php?pf=pages/icon.png', 45 84 preg_match('/plugin.php\?p=pages(&.*)?$/',$_SERVER['REQUEST_URI']), -
plugins/pages/list.php
r1878 r1879 103 103 104 104 $res .= 105 '<td class="handle minimal">'.form::field(array('order['.$count.']'),2,3,$count+1,'position','',false,'title="'.sprintf(__('position of %s'),html::escapeHTML($this->rs->post_title)).'"'). 106 form::hidden(array('dynorder[]','dynorder-'.$count),$count).'</td>'. 105 '<td class="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>'. 107 106 '<td class="nowrap">'. 108 107 form::checkbox(array('entries[]'),$this->rs->post_id,'','','',!$this->rs->isEditable(),'title="'.__('select this page').'"').'</td>'. … … 150 149 if ($core->auth->check('publish,contentadmin',$core->blog->id)) 151 150 { 151 $combo_action[__('reorder')] = 'reorder'; 152 152 $combo_action[__('publish')] = 'publish'; 153 153 $combo_action[__('unpublish')] = 'unpublish';
Note: See TracChangeset
for help on using the changeset viewer.