Dotclear

Changeset 1999:a0ed28c2da5a for inc


Ignore:
Timestamp:
09/22/13 11:38:22 (12 years ago)
Author:
Dsls
Branch:
default
Parents:
1998:dae906985ebb (diff), 1905:d72d24250853 (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 actionsreloaded

Location:
inc
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/lib.pager.php

    r1905 r1999  
    1212if (!defined('DC_RC_PATH')) { return; } 
    1313 
     14class dcPager extends pager 
     15{ 
     16     protected $form_action; 
     17     protected $form_hidden; 
     18      
     19     protected function getLink($li_class,$href,$img_src,$img_src_nolink,$img_alt,$enable_link) { 
     20          if ($enable_link) { 
     21               $formatter = '<li class="%s btn"><a href="%s"><img src="%s" alt="%s"/></a><span class="hidden">%s</span></li>'; 
     22               return sprintf ($formatter, 
     23                    $li_class,$href,$img_src,$img_alt,$img_alt); 
     24          } else { 
     25               $formatter = '<li class="%s no-link btn"><img src="%s" alt="%s"/></li>'; 
     26               return sprintf ($formatter, 
     27                    $li_class,$img_src_nolink,$img_alt,$img_alt); 
     28          } 
     29     } 
     30     public function setURL() { 
     31          parent::setURL(); 
     32          $url = parse_url($_SERVER['REQUEST_URI']); 
     33          if (isset($url['query'])) { 
     34               parse_str($url['query'],$args); 
     35          } else { 
     36               $args=array(); 
     37          } 
     38          # Removing session information 
     39          if (session_id()) 
     40          { 
     41               if (isset($args[session_name()])) 
     42                    unset($args[session_name()]); 
     43          } 
     44          if (isset($args[$this->var_page])) { 
     45               unset($args[$this->var_page]); 
     46          } 
     47          if (isset($args['ok'])) { 
     48               unset($args['ok']); 
     49          } 
     50          $this->form_hidden = ''; 
     51          foreach ($args as $k=>$v) { 
     52               if (is_array($v)) { 
     53                    foreach ($v as $k2=>$v2) { 
     54                         $this->form_hidden .= form::hidden(array($k.'[]'),$v2); 
     55                    } 
     56               } else { 
     57                    $this->form_hidden .= form::hidden(array($k),$v); 
     58               } 
     59          } 
     60          $this->form_action = $url['path']; 
     61     } 
     62      
     63     /** 
     64     * Pager Links 
     65     * 
     66     * Returns pager links 
     67     * 
     68     * @return string 
     69     */ 
     70     public function getLinks() 
     71     { 
     72          $this->setURL(); 
     73          $htmlFirst = $this->getLink( 
     74               "first", 
     75               sprintf($this->page_url,1), 
     76               "images/pagination/first.png", 
     77               "images/pagination/no-first.png", 
     78               __('First page'), 
     79               ($this->env > 1) 
     80          ); 
     81          $htmlPrev = $this->getLink( 
     82               "prev", 
     83               sprintf($this->page_url,$this->env-1), 
     84               "images/pagination/previous.png", 
     85               "images/pagination/no-previous.png", 
     86               __('Previous page'), 
     87               ($this->env > 1) 
     88          ); 
     89          $htmlNext = $this->getLink( 
     90               "next", 
     91               sprintf($this->page_url,$this->env+1), 
     92               "images/pagination/next.png", 
     93               "images/pagination/no-next.png", 
     94               __('Next page'), 
     95               ($this->env < $this->nb_pages) 
     96          ); 
     97          $htmlLast = $this->getLink( 
     98               "last", 
     99               sprintf($this->page_url,$this->nb_pages), 
     100               "images/pagination/last.png", 
     101               "images/pagination/no-last.png", 
     102               __('Last page'), 
     103               ($this->env < $this->nb_pages) 
     104          ); 
     105          $htmlCurrent =  
     106               '<li class="active"><strong>'. 
     107               sprintf(__('Page %s / %s'),$this->env,$this->nb_pages). 
     108               '</strong></li>'; 
     109                
     110          $htmlDirect =  
     111               ($this->nb_pages > 1 ? 
     112                    sprintf('<li class="direct-access">'.__('Direct access page %s'), 
     113                         form::field(array('page'),3,10)). 
     114                    '<input type="submit" value="'.__('ok').'" class="reset" '. 
     115                    'name="ok" />'.$this->form_hidden.'</li>' : ''); 
     116           
     117          $res =     
     118               '<form action="'.$this->form_action.'" method="get">'. 
     119               '<div class="pager"><ul>'. 
     120               $htmlFirst. 
     121               $htmlPrev. 
     122               $htmlCurrent. 
     123               $htmlNext. 
     124               $htmlLast. 
     125               $htmlDirect. 
     126               '</ul>'. 
     127               '</div>'. 
     128               '</form>' 
     129          ; 
     130           
     131          return $this->nb_elements > 0 ? $res : ''; 
     132     } 
     133} 
     134 
    14135class adminGenericList 
    15136{ 
     
    38159          else 
    39160          { 
    40                $pager = new pager($page,$this->rs_count,$nb_per_page,10); 
    41                $pager->html_prev = $this->html_prev; 
    42                $pager->html_next = $this->html_next; 
    43                $pager->var_page = 'page'; 
     161               $pager = new dcPager($page,$this->rs_count,$nb_per_page,10); 
    44162               $entries = array(); 
    45163               if (isset($_REQUEST['entries'])) { 
     
    63181               } 
    64182                
    65                echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
     183               echo $pager->getLinks(); 
    66184                
    67185               $blocks = explode('%s',$html_block); 
     
    76194               echo $blocks[1]; 
    77195                
    78                echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
     196               echo $pager->getLinks(); 
    79197          } 
    80198     } 
     
    158276          else 
    159277          { 
    160                $pager = new pager($page,$this->rs_count,$nb_per_page,10); 
    161                $pager->html_prev = $this->html_prev; 
    162                $pager->html_next = $this->html_next; 
    163                $pager->var_page = 'page'; 
     278               $pager = new dcPager($page,$this->rs_count,$nb_per_page,10); 
    164279                
    165280               $html_block = 
     
    175290               } 
    176291                
    177                echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
     292               echo $pager->getLinks(); 
    178293                
    179294               $blocks = explode('%s',$html_block); 
     
    188303               echo $blocks[1]; 
    189304                
    190                echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
     305               echo $pager->getLinks(); 
    191306          } 
    192307     } 
     
    253368          else 
    254369          { 
    255                $pager = new pager($page,$this->rs_count,$nb_per_page,10); 
    256                $pager->html_prev = $this->html_prev; 
    257                $pager->html_next = $this->html_next; 
    258                $pager->var_page = 'page'; 
     370               $pager = new dcPager($page,$this->rs_count,$nb_per_page,10); 
     371                
    259372               $comments = array(); 
    260373               if (isset($_REQUEST['comments'])) { 
     
    276389               } 
    277390                
    278                echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
     391               echo $pager->getLinks(); 
    279392                
    280393               $blocks = explode('%s',$html_block); 
     
    284397               while ($this->rs->fetch()) 
    285398               { 
    286                     echo $this->commentLine(isset($comments[$this->rs->comment_id])); 
     399                    echo $this->commentLine(); 
    287400               } 
    288401                
    289402               echo $blocks[1]; 
    290403                
    291                echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
     404               echo $pager->getLinks(); 
    292405          } 
    293406     } 
     
    341454          $res .= 
    342455          '<td class="nowrap">'. 
    343           form::checkbox(array('comments[]'),$this->rs->comment_id,$checked,'','',0).'</td>'. 
    344           '<td class="nowrap" abbr="'.__('Type and author').'" scope="raw">'. 
     456          form::checkbox(array('comments[]'),$this->rs->comment_id,'','','',0).'</td>'. 
     457          '<td class="nowrap" abbr="'.__('Type and author').'" scope="row">'. 
    345458               '<a href="'.$comment_url.'" title="'.$comment_title.'">'. 
    346459               '<img src="images/edit-mini.png" alt="'.__('Edit').'"/> '. 
     
    369482          else 
    370483          { 
    371                $pager = new pager($page,$this->rs_count,$nb_per_page,10); 
    372                $pager->html_prev = $this->html_prev; 
    373                $pager->html_next = $this->html_next; 
    374                $pager->var_page = 'page'; 
     484               $pager = new dcPager($page,$this->rs_count,$nb_per_page,10); 
    375485                
    376486               $html_block = 
     
    387497               } 
    388498                
    389                echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
     499               echo $pager->getLinks(); 
    390500                
    391501               $blocks = explode('%s',$html_block); 
     
    400510               echo $blocks[1]; 
    401511                
    402                echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
     512               echo $pager->getLinks(); 
    403513          } 
    404514     } 
  • inc/admin/lib.pager.php

    r1998 r1999  
    370370               $pager = new dcPager($page,$this->rs_count,$nb_per_page,10); 
    371371                
     372               $comments = array(); 
     373               if (isset($_REQUEST['comments'])) { 
     374                    foreach ($_REQUEST['comments'] as $v) { 
     375                         $comments[(integer)$v]=true; 
     376                    } 
     377               }               
    372378               $html_block = 
    373379               '<table><caption class="hidden">'.__('Comments and trackbacks list').'</caption><tr>'. 
     
    400406     } 
    401407      
    402      private function commentLine() 
     408     private function commentLine($checked) 
    403409     { 
    404410          global $author, $status, $sortby, $order, $nb_per_page; 
  • inc/prepend.php

    r1905 r1999  
    5959$__autoload['adminCommentList']         = dirname(__FILE__).'/admin/lib.pager.php'; 
    6060$__autoload['adminUserList']            = dirname(__FILE__).'/admin/lib.pager.php'; 
     61$__autoload['dcPager']        = dirname(__FILE__).'/admin/lib.pager.php'; 
    6162$__autoload['dcAdminCombos']            = dirname(__FILE__).'/admin/lib.admincombos.php'; 
    6263 
     
    291292     { 
    292293          if ($l == 'en' || l10n::set(dirname(__FILE__).'/../locales/'.$l.'/main') !== false) { 
     294               l10n::lang($l); 
    293295               break; 
    294296          } 
  • inc/prepend.php

    r1949 r1999  
    6565$__autoload['context']                  = dirname(__FILE__).'/public/lib.tpl.context.php'; 
    6666$__autoload['dcUrlHandlers']            = dirname(__FILE__).'/public/lib.urlhandlers.php'; 
     67$__autoload['dcPostsActionsPage']            = dirname(__FILE__).'/admin/actions/class.dcactionposts.php'; 
     68$__autoload['dcCommentsActionsPage']              = dirname(__FILE__).'/admin/actions/class.dcactioncomments.php'; 
     69$__autoload['dcActionsPage']            = dirname(__FILE__).'/admin/actions/class.dcaction.php'; 
    6770 
    6871# Clearbricks extensions 
Note: See TracChangeset for help on using the changeset viewer.

Sites map