Dotclear

Changeset 2210:591007da831e


Ignore:
Timestamp:
10/02/13 16:33:49 (12 years ago)
Author:
Dsls
Branch:
default
Children:
2211:dd80020754f1, 2212:f26730fd9f07
Message:

search.php with new actions, closes #1748

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/search.php

    r2166 r2210  
    1515dcPage::check('usage,contentadmin'); 
    1616 
    17 $q = !empty($_GET['q']) ? $_GET['q'] : (!empty($_GET['qx']) ? $_GET['qx'] : null); 
    18 $qtype = !empty($_GET['qtype']) ? $_GET['qtype'] : 'p'; 
     17$q = !empty($_REQUEST['q']) ? $_REQUEST['q'] : (!empty($_REQUEST['qx']) ? $_REQUEST['qx'] : null); 
     18$qtype = !empty($_REQUEST['qtype']) ? $_REQUEST['qtype'] : 'p'; 
    1919if ($qtype != 'c' && $qtype != 'p') { 
    2020     $qtype = 'p'; 
     
    6969} 
    7070 
     71if ($qtype == 'p') { 
     72     $posts_actions_page = new dcPostsActionsPage($core,'search.php',array('q'=>$q,'qtype'=>$qtype)); 
     73 
     74     if ($posts_actions_page->process()) { 
     75          return; 
     76     } 
     77} else { 
     78     $comments_actions_page = new dcCommentsActionsPage($core,'search.php',array('q'=>$q,'qtype'=>$qtype)); 
     79 
     80     if ($comments_actions_page->process()) { 
     81          return; 
     82     } 
     83} 
    7184 
    7285dcPage::open(__('Search'),$starting_scripts, 
     
    95108     if ($qtype == 'p') 
    96109     { 
    97           # Actions combo box 
    98           $combo_action = array(); 
    99           if ($core->auth->check('publish,contentadmin',$core->blog->id)) 
    100           { 
    101                $combo_action[__('publish')] = 'publish'; 
    102                $combo_action[__('unpublish')] = 'unpublish'; 
    103                $combo_action[__('schedule')] = 'schedule'; 
    104                $combo_action[__('mark as pending')] = 'pending'; 
    105           } 
    106           $combo_action[__('change category')] = 'category'; 
    107           if ($core->auth->check('admin',$core->blog->id)) { 
    108                $combo_action[__('change author')] = 'author'; 
    109           } 
    110           if ($core->auth->check('delete,contentadmin',$core->blog->id)) 
    111           { 
    112                $combo_action[__('Delete')] = 'delete'; 
    113           } 
    114            
    115           # --BEHAVIOR-- adminPostsActionsCombo 
    116           $core->callBehavior('adminPostsActionsCombo',array(&$combo_action)); 
    117            
     110      
    118111          if ($counter->f(0) > 0) { 
    119112               printf('<h3>'. 
     
    123116           
    124117          $post_list->display($page,$nb_per_page, 
    125           '<form action="posts_actions.php" method="post" id="form-entries">'. 
     118          '<form action="search.php" method="post" id="form-entries">'. 
    126119           
    127120          '%s'. 
     
    131124           
    132125          '<p class="col right"><label for="action1" class="classic">'.__('Selected entries action:').'</label> '. 
    133           form::combo(array('action','action1'),$combo_action). 
     126          form::combo(array('action','action1'),$posts_actions_page->getCombo()). 
    134127          '<input type="submit" value="'.__('ok').'" /></p>'. 
    135           form::hidden('redir',preg_replace('/%/','%%',$redir)). 
    136128          $core->formNonce(). 
     129          $posts_actions_page->getHiddenFields(). 
    137130          '</div>'. 
    138131          '</form>' 
     
    143136     { 
    144137          # Actions combo box 
    145           $combo_action = array(); 
    146           if ($core->auth->check('publish,contentadmin',$core->blog->id)) 
    147           { 
    148                $combo_action[__('publish')] = 'publish'; 
    149                $combo_action[__('unpublish')] = 'unpublish'; 
    150                $combo_action[__('mark as pending')] = 'pending'; 
    151                $combo_action[__('mark as junk')] = 'junk'; 
    152           } 
    153           if ($core->auth->check('delete,contentadmin',$core->blog->id)) 
    154           { 
    155                $combo_action[__('Delete')] = 'delete'; 
    156           } 
    157138           
    158139          if ($counter->f(0) > 0) { 
     
    163144           
    164145          $comment_list->display($page,$nb_per_page, 
    165           '<form action="comments_actions.php" method="post" id="form-comments">'. 
     146          '<form action="search.php" method="post" id="form-comments">'. 
    166147           
    167148          '%s'. 
     
    171152           
    172153          '<p class="col right"><label for="action2" class="classic">'.__('Selected comments action:').'</label> '. 
    173           form::combo(array('action','action2'),$combo_action). 
     154          form::combo(array('action','action2'),$comments_actions_page->getCombo()). 
    174155          '<input type="submit" value="'.__('ok').'" /></p>'. 
    175           form::hidden('redir',preg_replace('/%/','%%',$redir)). 
    176156          $core->formNonce(). 
     157          $comments_actions_page->getHiddenFields(). 
    177158          '</div>'. 
    178159          '</form>' 
Note: See TracChangeset for help on using the changeset viewer.

Sites map