Dotclear


Ignore:
Location:
plugins/pages
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/pages/index.php

    r1179 r1888  
    1212if (!defined('DC_CONTEXT_ADMIN')) { return; } 
    1313 
    14 $act = (!empty($_REQUEST['act']) && $_REQUEST['act'] == 'page') ? 'page' : 'list'; 
     14$act = !empty($_REQUEST['act']) ? $_REQUEST['act'] : 'list'; 
    1515 
    1616 
    1717if ($act == 'page') { 
    1818     include dirname(__FILE__).'/page.php'; 
     19} else if ($act == 'actions') { 
     20     include dirname(__FILE__).'/pages_actions.php'; 
    1921} else { 
    2022     include dirname(__FILE__).'/list.php'; 
    2123} 
    22  
    23 ?> 
  • plugins/pages/list.php

    r1464 r1893  
    3131                
    3232               $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>'. 
    3535               '<th>'.__('Date').'</th>'. 
    3636               '<th>'.__('Author').'</th>'. 
     
    3838               '<th>'.__('Trackbacks').'</th>'. 
    3939               '<th>'.__('Status').'</th>'. 
    40                '</tr>%s</table>'; 
     40               '</tr></thead><tbody id="pageslist">%s</tbody></table>'; 
    4141                
    4242               if ($enclose_block) { 
     
    5050               echo $blocks[0]; 
    5151                
     52               $count = 0; 
    5253               while ($this->rs->fetch()) 
    5354               { 
    54                     echo $this->postLine(); 
     55                    echo $this->postLine($count); 
     56                    $count ++; 
    5557               } 
    5658                
     
    6163     } 
    6264      
    63      private function postLine() 
     65     private function postLine($count) 
    6466     { 
    6567          $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 
     
    100102           
    101103          $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>'. 
    102105          '<td class="nowrap">'. 
    103106          form::checkbox(array('entries[]'),$this->rs->post_id,'','','',!$this->rs->isEditable(),'title="'.__('Select this page').'"').'</td>'. 
     
    145148if ($core->auth->check('publish,contentadmin',$core->blog->id)) 
    146149{ 
    147      $combo_action[__('Publish')] = 'publish'; 
    148      $combo_action[__('Unpublish')] = 'unpublish'; 
    149      $combo_action[__('Schedule')] = 'schedule'; 
    150      $combo_action[__('Mark as pending')] = 'pending'; 
    151 } 
    152 if ($core->auth->check('admin',$core->blog->id)) { 
    153      $combo_action[__('Change author')] = 'author'; 
     150     $combo_action[__('Status')] = array( 
     151          __('Publish') => 'publish', 
     152          __('Unpublish') => 'unpublish', 
     153          __('Schedule') => 'schedule', 
     154          __('Mark as pending') => 'pending' 
     155     ); 
     156} 
     157     $combo_action[__('Change')] = array( 
     158          __('Change language') => 'lang' 
     159     ); 
     160if ($core->auth->check('admin',$core->blog->id)) 
     161{ 
     162     $combo_action[__('Change')] = array_merge($combo_action[__('Change')], array( 
     163          __('Change author') => 'author') 
     164     ); 
    154165} 
    155166if ($core->auth->check('delete,contentadmin',$core->blog->id)) 
    156167{ 
    157      $combo_action[__('Delete')] = 'delete'; 
     168     $combo_action[__('Delete')] = array( 
     169          __('Delete') => 'delete' 
     170     ); 
    158171} 
    159172 
     
    167180<head> 
    168181  <title><?php echo __('Pages'); ?></title> 
    169   <script type="text/javascript" src="js/_posts_list.js"></script> 
     182  <?php 
     183     echo dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 
     184          dcPage::jsLoad('index.php?pf=pages/list.js'); 
     185  ?> 
    170186  <script type="text/javascript"> 
    171187  //<![CDATA[ 
     
    190206     # Show pages 
    191207     $post_list->display($page,$nb_per_page, 
    192      '<form action="posts_actions.php" method="post" id="form-entries">'. 
     208     '<form action="plugin.php?p=pages&act=actions" method="post" id="form-entries">'. 
    193209      
    194210     '%s'. 
     
    202218     form::hidden(array('post_type'),'page'). 
    203219     form::hidden(array('redir'),html::escapeHTML($_SERVER['REQUEST_URI'])). 
     220     '</div>'. 
    204221     $core->formNonce(). 
    205      '</div>'. 
     222     '<br class="clear"/>'. 
     223     '<input type="submit" value="'.__('Save categories order').'" name="reorder" class="clear"/>'. 
    206224     '</form>'); 
    207225} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map