Dotclear


Ignore:
Timestamp:
08/30/13 18:41:29 (12 years ago)
Author:
Lepeltier kévin
Branch:
Ticket #1181
Message:

Ticket #1181 : création de pages_actions.php calqué sur posts_actions.php

Location:
plugins/pages
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/pages/_admin.php

    r1886 r1891  
    1616$core->addBehavior('adminDashboardFavsIcon','pages_dashboard_favs_icon'); 
    1717$core->addBehavior('adminUsersActionsHeaders','pages_users_actions_headers'); 
    18 $core->addBehavior('adminPostsActionsContent','pages_posts_actions_content'); 
    1918 
    2019function pages_dashboard($core,$icons) 
     
    4443     } 
    4544} 
    46  
    47 function pages_posts_actions_content($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 } 
    8145function pages_users_actions_headers() 
    8246{ 
Note: See TracChangeset for help on using the changeset viewer.

Sites map