Dotclear

Changeset 1905:d72d24250853 for inc


Ignore:
Timestamp:
09/16/13 13:28:17 (12 years ago)
Author:
Dsls
Branch:
actionsreloaded
Children:
1999:a0ed28c2da5a, 2037:cdcd97549428
Message:

RIP admin/comments_actions.php

Location:
inc
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/actions/class.dcaction.php

    r1903 r1905  
    3838     /** @var array list of url parameters (usually $_POST) */ 
    3939     protected $from; 
     40     /** @var string form field name for "entries" (usually "entries") */ 
     41     protected $field_entries; 
    4042      
    4143     /** @var string title for checkboxes list, if displayed */ 
     
    6365          $this->entries = array(); 
    6466          $this->from = new ArrayObject($_POST); 
     67          $this->field_entries = 'entries'; 
    6568     } 
    6669      
     
    8891                    $this->combo[$k] = array_merge ($this->combo[$k],$a); 
    8992               } elseif ($a instanceof formSelectOption) { 
    90                     $values = $a->value; 
     93                    $values = array($a->value); 
    9194                    $this->combo[$k] = $a->value; 
    9295               } else { 
    93                     $values = $a; 
     96                    $values = array($a); 
    9497                    $this->combo[$k] = $a; 
    9598               } 
     
    135138          $ret = ''; 
    136139          foreach  ($this->entries as $id->$v) { 
    137                $ret .= form::hidden('entries[]',$id); 
     140               $ret .= form::hidden($this->field_entries.'[]',$id); 
    138141          } 
    139142          return $ret; 
     
    206209          $redir_args = array_merge($params,$this->redir_args); 
    207210          if ($with_selected_entries) { 
    208                $redir_args['entries'] = array_keys($this->entries); 
     211               $redir_args[$this->field_entries] = array_keys($this->entries); 
    209212          } 
    210213          return $this->uri.'?'.http_build_query($redir_args); 
     
    282285               $ret .=  
    283286                    '<tr><td>'. 
    284                     form::checkbox(array('entries[]'),$id,true,'','').'</td>'. 
     287                    form::checkbox(array($this->field_entries.'[]'),$id,true,'','').'</td>'. 
    285288                    '<td>'.   $title.'</td></tr>'; 
    286289          } 
  • inc/admin/lib.pager.php

    r1670 r1905  
    257257               $pager->html_next = $this->html_next; 
    258258               $pager->var_page = 'page'; 
    259                 
     259               $comments = array(); 
     260               if (isset($_REQUEST['comments'])) { 
     261                    foreach ($_REQUEST['comments'] as $v) { 
     262                         $comments[(integer)$v]=true; 
     263                    } 
     264               }               
    260265               $html_block = 
    261266               '<table><caption class="hidden">'.__('Comments and trackbacks list').'</caption><tr>'. 
     
    279284               while ($this->rs->fetch()) 
    280285               { 
    281                     echo $this->commentLine(); 
     286                    echo $this->commentLine(isset($comments[$this->rs->comment_id])); 
    282287               } 
    283288                
     
    288293     } 
    289294      
    290      private function commentLine() 
     295     private function commentLine($checked) 
    291296     { 
    292297          global $author, $status, $sortby, $order, $nb_per_page; 
     
    336341          $res .= 
    337342          '<td class="nowrap">'. 
    338           form::checkbox(array('comments[]'),$this->rs->comment_id,'','','',0).'</td>'. 
     343          form::checkbox(array('comments[]'),$this->rs->comment_id,$checked,'','',0).'</td>'. 
    339344          '<td class="nowrap" abbr="'.__('Type and author').'" scope="raw">'. 
    340345               '<a href="'.$comment_url.'" title="'.$comment_title.'">'. 
  • inc/prepend.php

    r1806 r1905  
    6565$__autoload['dcUrlHandlers']            = dirname(__FILE__).'/public/lib.urlhandlers.php'; 
    6666$__autoload['dcPostsActionsPage']            = dirname(__FILE__).'/admin/actions/class.dcactionposts.php'; 
     67$__autoload['dcCommentsActionsPage']              = dirname(__FILE__).'/admin/actions/class.dcactioncomments.php'; 
    6768$__autoload['dcActionsPage']            = dirname(__FILE__).'/admin/actions/class.dcaction.php'; 
    6869 
Note: See TracChangeset for help on using the changeset viewer.

Sites map