Dotclear

Changeset 2309:850b5f27bcad


Ignore:
Timestamp:
10/08/13 00:15:04 (12 years ago)
Author:
Eve Le Cellier <linux@…>
Branch:
default
Message:

Add attachment filter for post list, see ticket #989 -- thanks Franck for the patch

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • admin/posts.php

    r2305 r2309  
    7676     ); 
    7777      
     78     $attachment_combo = array( 
     79     '-' => '', 
     80     __('With attachments') => '1', 
     81     __('Without attachments') => '0' 
     82     ); 
     83 
    7884     # Months array 
    7985     $dt_m_combo = array_merge( 
     
    118124$status = isset($_GET['status']) ? $_GET['status'] : ''; 
    119125$selected = isset($_GET['selected']) ?  $_GET['selected'] : ''; 
     126$attachment = isset($_GET['attachment']) ?   $_GET['attachment'] : ''; 
    120127$month = !empty($_GET['month']) ?       $_GET['month'] : ''; 
    121128$lang = !empty($_GET['lang']) ?         $_GET['lang'] : ''; 
     
    168175} else { 
    169176     $selected=''; 
     177} 
     178 
     179# - Selected filter 
     180if ($attachment !== '' && in_array($attachment,$attachment_combo)) { 
     181     $params['media'] = $attachment; 
     182     $show_filters = true; 
     183} else { 
     184     $attachment=''; 
    170185} 
    171186 
     
    260275     '<p><label for="selected" class="ib">'.__('Selected:').'</label> '. 
    261276     form::combo('selected',$selected_combo,$selected).'</p>'. 
     277     '<p><label for="attachment" class="ib">'.__('Attachments:').'</label> '. 
     278     form::combo('attachment',$attachment_combo,$attachment).'</p>'. 
    262279     '<p><label for="month" class="ib">'.__('Month:').'</label> '. 
    263280     form::combo('month',$dt_m_combo,$month).'</p>'. 
     
    298315     form::hidden(array('status'),$status). 
    299316     form::hidden(array('selected'),$selected). 
     317     form::hidden(array('attachment'),$attachment). 
    300318     form::hidden(array('month'),$month). 
    301319     form::hidden(array('lang'),$lang). 
  • inc/admin/actions/class.dcactionposts.php

    r2181 r2309  
    1717          parent::__construct($core,$uri,$redirect_args); 
    1818          $this->redirect_fields = array('user_id','cat_id','status', 
    19           'selected','month','lang','sortby','order','page','nb'); 
     19          'selected','attachment','month','lang','sortby','order','page','nb'); 
    2020          $this->loadDefaults(); 
    2121     } 
  • inc/core/class.dc.blog.php

    r2073 r2309  
    806806          'INNER JOIN '.$this->prefix.'user U ON U.user_id = P.user_id '. 
    807807          'LEFT OUTER JOIN '.$this->prefix.'category C ON P.cat_id = C.cat_id '; 
     808 
     809          if (isset($params['media'])) { 
     810               if ($params['media'] == '0') { 
     811                    $strReq .= 'LEFT OUTER JOIN '.$this->prefix.'post_media M on P.post_id = M.post_id '; 
     812               } else { 
     813                    $strReq .= 'INNER JOIN '.$this->prefix.'post_media M on P.post_id = M.post_id '; 
     814               } 
     815          } 
    808816           
    809817          if (!empty($params['from'])) { 
     
    937945          } 
    938946           
     947          if (isset($params['media'])) { 
     948               if ($params['media'] == '0') { 
     949                    $strReq .= ' AND M.post_id IS NULL '; 
     950               } 
     951          } 
     952 
    939953          if (!empty($params['sql'])) { 
    940954               $strReq .= $params['sql'].' '; 
    941955          } 
    942956           
     957          if (!$count_only && isset($params['media'])) { 
     958               $strReq .= ' GROUP BY P.post_id '; 
     959          } 
     960 
    943961          if (!$count_only) 
    944962          { 
     
    957975               return $strReq; 
    958976          } 
    959            
     977 
    960978          $rs = $this->con->select($strReq); 
    961979          $rs->core = $this->core; 
  • locales/fr/main.po

    r2307 r2309  
    40394039msgid "Number of trackbacks" 
    40404040msgstr "Nombre de rétroliens" 
     4041 
     4042msgid "Attachments:" 
     4043msgstr "Annexes :" 
     4044 
     4045msgid "With attachments" 
     4046msgstr "Avec annexe(s)" 
     4047 
     4048msgid "Without attachments" 
     4049msgstr "Sans annexes" 
Note: See TracChangeset for help on using the changeset viewer.

Sites map