Dotclear

Changeset 1885:d4803b6eba12


Ignore:
Timestamp:
08/23/13 11:06:43 (10 years ago)
Author:
Lepeltier kévin
Branch:
Ticket #1181
Parents:
1884:0f968de01eb6 (diff), 1529:9f6e5c3c8344 (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.
Message:

Fusion avec default

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/pages/_admin.php

    r1503 r1885  
    1616$core->addBehavior('adminDashboardFavsIcon','pages_dashboard_favs_icon'); 
    1717$core->addBehavior('adminUsersActionsHeaders','pages_users_actions_headers'); 
     18$core->addBehavior('adminPostsActionsContent','pages_PostsActionsContent'); 
    1819 
    1920function pages_dashboard($core,$icons) 
     
    4344     } 
    4445} 
     46 
     47function 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} 
    4581function pages_users_actions_headers() 
    4682{ 
  • plugins/pages/_admin.php

    r1882 r1885  
    1515$core->addBehavior('adminDashboardFavs','pages_dashboard_favs'); 
    1616$core->addBehavior('adminDashboardFavsIcon','pages_dashboard_favs_icon'); 
    17  
     17$core->addBehavior('adminUsersActionsHeaders','pages_users_actions_headers'); 
    1818$core->addBehavior('adminPostsActionsContent','pages_PostsActionsContent'); 
    1919 
     
    7979     } 
    8080} 
     81function pages_users_actions_headers() 
     82{ 
     83     return dcPage::jsLoad('index.php?pf=pages/_users_actions.js'); 
     84} 
    8185 
    8286$_menu['Blog']->addItem(__('Pages'),'plugin.php?p=pages','index.php?pf=pages/icon.png', 
Note: See TracChangeset for help on using the changeset viewer.

Sites map