Dotclear

Changeset 1610:2d5ebb2fcdfd


Ignore:
Timestamp:
08/29/13 09:38:58 (10 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Fixes #472, <tpl:Categories> (new without_empty="0" attribute) and categories' widget ("Include empty categories" checkbox) may includes empty categories.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.blog.php

    r1532 r1610  
    311311          $counter = $this->getCategoriesCounter($c_params); 
    312312           
    313           $without_empty = $this->core->auth->userID() == false; # For public display 
     313          if (isset($params['without_empty']) && ($params['without_empty'] == false)) { 
     314               $without_empty = false; 
     315          } else { 
     316               $without_empty = $this->core->auth->userID() == false; # Get all categories if in admin display 
     317          } 
    314318           
    315319          $start = isset($params['start']) ? (integer) $params['start'] : 0; 
  • inc/public/class.dc.template.php

    r1280 r1610  
    955955               $p .= "\$params['level'] = ".(integer) $attr['level'].";\n"; 
    956956          } 
     957 
     958          if (isset($attr['without_empty']) && ((boolean) $attr['without_empty'] == false)) { 
     959               $p .= '$params[\'without_empty\'] = false;'; 
     960          } 
    957961           
    958962          $res = "<?php\n"; 
  • inc/public/lib.urlhandlers.php

    r1179 r1610  
    263263               $params = new ArrayObject(array( 
    264264                    'cat_url' => $args, 
    265                     'post_type' => 'post')); 
     265                    'post_type' => 'post', 
     266                    'without_empty' => false)); 
    266267                
    267268               $core->callBehavior('publicCategoryBeforeGetCategories',$params,$args); 
  • locales/fr/plugins.po

    r1609 r1610  
    16751675msgstr "Avec le nombre de billets" 
    16761676 
     1677msgid "Include empty categories" 
     1678msgstr "Inclure les catégories vides" 
     1679 
    16771680msgid "Subscribe links" 
    16781681msgstr "Liens de souscription" 
  • plugins/widgets/_default_widgets.php

    r1179 r1610  
    4747$__widgets->langs->setting('class',__('CSS class:'),''); 
    4848 
    49 $__widgets->create('categories',__('Categories list'),array('defaultWidgets','categories'),null,'List of categories'); 
     49$__widgets->create('categories',__('Categories'),array('defaultWidgets','categories'),null,'List of categories'); 
    5050$__widgets->categories->setting('title',__('Title:'),__('Categories')); 
    5151$__widgets->categories->setting('postcount',__('With entries counts'),0,'check'); 
     52$__widgets->categories->setting('with_empty',__('Include empty categories'),0,'check'); 
    5253$__widgets->categories->setting('homeonly',__('Display on:'),0,'combo', 
    5354     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
  • plugins/widgets/_widgets_functions.php

    r1280 r1610  
    7777          } 
    7878 
    79           $rs = $core->blog->getCategories(array('post_type'=>'post')); 
     79          $rs = $core->blog->getCategories(array('post_type'=>'post','without_empty'=> !$w->with_empty)); 
    8080          if ($rs->isEmpty()) { 
    8181               return; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map