Dotclear

Changeset 945:a373e04f8ac3


Ignore:
Timestamp:
10/31/12 10:13:50 (13 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Add/complement display modes (all pages, home page only, except on home page) for all widgets, fixes #1345

Files:
11 edited

Legend:

Unmodified
Added
Removed
  • locales/fr/plugins.po

    r917 r945  
    306306msgstr "Toutes les catégories" 
    307307 
     308msgid "Display on:" 
     309msgstr "Afficher :" 
     310 
    308311msgid "Home page only" 
    309312msgstr "En page d'accueil seulement" 
     313 
     314msgid "All pages" 
     315msgstr "Sur toutes les pages" 
     316 
     317msgid "Except on home page" 
     318msgstr "Sauf en page d'accueil" 
    310319 
    311320msgid "You must provide a link title" 
  • plugins/blogroll/_public.php

    r904 r945  
    140140          global $core; 
    141141           
    142           if ($w->homeonly && $core->url->type != 'default') { 
     142          if (($w->homeonly == 1 && $core->url->type != 'default') || 
     143               ($w->homeonly == 2 && $core->url->type == 'default')) { 
    143144               return; 
    144145          } 
  • plugins/blogroll/_widgets.php

    r904 r945  
    3434          $w->links->setting('category',__('Category'),'','combo',$categories); 
    3535           
    36           $w->links->setting('homeonly',__('Home page only'),1,'check'); 
     36          $w->links->setting('homeonly',__('Display on:'),1,'combo', 
     37               array( 
     38                    __('All pages') => 0, 
     39                    __('Home page only') => 1, 
     40                    __('Except on home page') => 2 
     41                    ) 
     42          ); 
    3743          $w->links->setting('class',__('CSS class:'),''); 
    3844     } 
  • plugins/pages/_public.php

    r911 r945  
    221221          global $core, $_ctx; 
    222222           
    223           if ($w->homeonly && $core->url->type != 'default') { 
     223          if (($w->homeonly == 1 && $core->url->type != 'default') || 
     224               ($w->homeonly == 2 && $core->url->type == 'default')) { 
    224225               return; 
    225226          } 
  • plugins/pages/_widgets.php

    r904 r945  
    2121          $w->create('pages',__('Pages'),array('tplPages','pagesWidget')); 
    2222          $w->pages->setting('title',__('Title:'),__('Pages')); 
    23           $w->pages->setting('homeonly',__('Home page only'),1,'check'); 
     23          $w->pages->setting('homeonly',__('Display on:'),1,'combo', 
     24               array( 
     25                    __('All pages') => 0, 
     26                    __('Home page only') => 1, 
     27                    __('Except on home page') => 2 
     28                    ) 
     29          ); 
    2430          $w->pages->setting('sortby',__('Order by:'),'post_title','combo', 
    2531               array( 
  • plugins/simpleMenu/_public.php

    r683 r945  
    4242          global $core, $_ctx; 
    4343           
    44           if ($w->homeonly && $core->url->type != 'default') { 
     44          if (($w->homeonly == 1 && $core->url->type != 'default') || 
     45               ($w->homeonly == 2 && $core->url->type == 'default')) { 
    4546               return; 
    4647          } 
     
    5152          } 
    5253 
    53           return '<div class="simple-menu">'.($w->title ? '<h2>'.html::escapeHTML($w->title).'</h2>' : '').$menu.'</div>'; 
     54          return '<div class="simple-menu'. 
     55               ($w->class ? ' '.html::escapeHTML($w->class) : '').'">'. 
     56               ($w->title ? '<h2>'.html::escapeHTML($w->title).'</h2>' : '').$menu.'</div>'; 
    5457     } 
    5558      
  • plugins/simpleMenu/_widgets.php

    r587 r945  
    2020          $w->create('simplemenu',__('Simple menu'),array('tplSimpleMenu','simpleMenuWidget')); 
    2121          $w->simplemenu->setting('title',__('Title:'),__('Menu')); 
    22           $w->simplemenu->setting('homeonly',__('Home page only'),1,'check'); 
     22          $w->simplemenu->setting('homeonly',__('Display on:'),0,'combo', 
     23               array( 
     24                    __('All pages') => 0, 
     25                    __('Home page only') => 1, 
     26                    __('Except on home page') => 2 
     27                    ) 
     28          ); 
     29          $w->simplemenu->setting('class',__('CSS class:'),''); 
    2330     } 
    2431} 
  • plugins/tags/_public.php

    r932 r945  
    225225          global $core; 
    226226           
     227          if (($w->homeonly == 1 && $core->url->type != 'default') || 
     228               ($w->homeonly == 2 && $core->url->type == 'default')) { 
     229               return; 
     230          } 
     231 
    227232          $params = array('meta_type' => 'tag'); 
    228233           
  • plugins/tags/_widgets.php

    r904 r945  
    2929          ); 
    3030          $w->tags->setting('alltagslinktitle',__('Link to all tags:'),__('All tags')); 
     31          $w->tags->setting('homeonly',__('Display on:'),0,'combo', 
     32               array( 
     33                    __('All pages') => 0, 
     34                    __('Home page only') => 1, 
     35                    __('Except on home page') => 2 
     36                    ) 
     37          ); 
    3138          $w->tags->setting('class',__('CSS class:'),''); 
    3239     } 
  • plugins/widgets/_default_widgets.php

    r904 r945  
    2020$__widgets->create('search',__('Search engine'),array('defaultWidgets','search')); 
    2121$__widgets->search->setting('title',__('Title:'),__('Search')); 
     22$__widgets->search->setting('homeonly',__('Display on:'),0,'combo', 
     23     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
    2224$__widgets->search->setting('class',__('CSS class:'),''); 
    2325 
    2426$__widgets->create('navigation',__('Navigation links'),array('defaultWidgets','navigation')); 
    2527$__widgets->navigation->setting('title',__('Title:'),''); 
     28$__widgets->navigation->setting('homeonly',__('Display on:'),0,'combo', 
     29     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
    2630$__widgets->navigation->setting('class',__('CSS class:'),''); 
    2731 
     
    2933$__widgets->bestof->setting('title',__('Title:'),__('Best of me')); 
    3034$__widgets->bestof->setting('orderby',__('Sort:'),'asc','combo',array(__('Ascending') => 'asc', __('Descending') => 'desc')); 
    31 $__widgets->bestof->setting('homeonly',__('Home page only'),1,'check'); 
     35$__widgets->bestof->setting('homeonly',__('Display on:'),1,'combo', 
     36     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
    3237$__widgets->bestof->setting('class',__('CSS class:'),''); 
    3338 
    3439$__widgets->create('langs',__('Blog languages'),array('defaultWidgets','langs')); 
    3540$__widgets->langs->setting('title',__('Title:'),__('Languages')); 
    36 $__widgets->langs->setting('homeonly',__('Home page only'),1,'check'); 
     41$__widgets->langs->setting('homeonly',__('Display on:'),1,'combo', 
     42     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
    3743$__widgets->langs->setting('class',__('CSS class:'),''); 
    3844 
     
    4046$__widgets->categories->setting('title',__('Title:'),__('Categories')); 
    4147$__widgets->categories->setting('postcount',__('With entries counts'),0,'check'); 
     48$__widgets->categories->setting('homeonly',__('Display on:'),0,'combo', 
     49     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
    4250$__widgets->categories->setting('class',__('CSS class:'),''); 
    4351 
     
    4553$__widgets->subscribe->setting('title',__('Title:'),__('Subscribe')); 
    4654$__widgets->subscribe->setting('type',__('Feeds type:'),'atom','combo',array('Atom' => 'atom', 'RSS' => 'rss2')); 
    47 $__widgets->subscribe->setting('homeonly',__('Home page only'),0,'check'); 
     55$__widgets->subscribe->setting('homeonly',__('Display on:'),1,'combo', 
     56     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
    4857$__widgets->subscribe->setting('class',__('CSS class:'),''); 
    4958 
     
    5261$__widgets->feed->setting('url',__('Feed URL:'),''); 
    5362$__widgets->feed->setting('limit',__('Entries limit:'),10); 
    54 $__widgets->feed->setting('homeonly',__('Home page only'),1,'check'); 
     63$__widgets->feed->setting('homeonly',__('Display on:'),1,'combo', 
     64     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
    5565$__widgets->feed->setting('class',__('CSS class:'),''); 
    5666 
     
    5868$__widgets->text->setting('title',__('Title:'),''); 
    5969$__widgets->text->setting('text',__('Text:'),'','textarea'); 
    60 $__widgets->text->setting('homeonly',__('Home page only'),0,'check'); 
     70$__widgets->text->setting('homeonly',__('Display on:'),0,'combo', 
     71     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
    6172$__widgets->text->setting('class',__('CSS class:'),''); 
    6273 
     
    7485} 
    7586$__widgets->lastposts->setting('limit',__('Entries limit:'),10); 
    76 $__widgets->lastposts->setting('homeonly',__('Home page only'),1,'check'); 
     87$__widgets->lastposts->setting('homeonly',__('Display on:'),1,'combo', 
     88     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
    7789$__widgets->lastposts->setting('class',__('CSS class:'),''); 
    7890 
     
    8092$__widgets->lastcomments->setting('title',__('Title:'),__('Last comments')); 
    8193$__widgets->lastcomments->setting('limit',__('Comments limit:'),10); 
    82 $__widgets->lastcomments->setting('homeonly',__('Home page only'),1,'check'); 
     94$__widgets->lastcomments->setting('homeonly',__('Display on:'),1,'combo', 
     95     array(__('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2)); 
    8396$__widgets->lastcomments->setting('class',__('CSS class:'),''); 
    8497 
  • plugins/widgets/_widgets_functions.php

    r905 r945  
    1818          global $core; 
    1919           
     20          if (($w->homeonly == 1 && $core->url->type != 'default') || 
     21               ($w->homeonly == 2 && $core->url->type == 'default')) { 
     22               return; 
     23          } 
     24 
    2025          $value = isset($GLOBALS['_search']) ? html::escapeHTML($GLOBALS['_search']) : ''; 
    2126           
     
    3641          global $core; 
    3742           
     43          if (($w->homeonly == 1 && $core->url->type != 'default') || 
     44               ($w->homeonly == 2 && $core->url->type == 'default')) { 
     45               return; 
     46          } 
     47 
    3848          $res = 
    3949          '<div id="topnav"'.($w->class ? ' class="'.html::escapeHTML($w->class).'"' : '').'>'. 
     
    6272          global $core, $_ctx; 
    6373           
     74          if (($w->homeonly == 1 && $core->url->type != 'default') || 
     75               ($w->homeonly == 2 && $core->url->type == 'default')) { 
     76               return; 
     77          } 
     78 
    6479          $rs = $core->blog->getCategories(array('post_type'=>'post')); 
    6580          if ($rs->isEmpty()) { 
     
    111126          global $core; 
    112127           
    113           if ($w->homeonly && $core->url->type != 'default') { 
     128          if (($w->homeonly == 1 && $core->url->type != 'default') || 
     129               ($w->homeonly == 2 && $core->url->type == 'default')) { 
    114130               return; 
    115131          } 
     
    145161          global $core, $_ctx; 
    146162           
    147           if ($w->homeonly && $core->url->type != 'default' && $core->url->type != 'lang') { 
     163          if (($w->homeonly == 1 && $core->url->type != 'default' && $core->url->type != 'lang') || 
     164               ($w->homeonly == 2 && ($core->url->type == 'default' || $core->url->type == 'lang'))) { 
    148165               return; 
    149166          } 
     
    185202          global $core; 
    186203           
    187           if ($w->homeonly && $core->url->type != 'default') { 
     204          if (($w->homeonly == 1 && $core->url->type != 'default') || 
     205               ($w->homeonly == 2 && $core->url->type == 'default')) { 
    188206               return; 
    189207          } 
     
    228246          global $core; 
    229247           
    230           if ($w->homeonly && $core->url->type != 'default') { 
     248          if (($w->homeonly == 1 && $core->url->type != 'default') || 
     249               ($w->homeonly == 2 && $core->url->type == 'default')) { 
    231250               return; 
    232251          } 
     
    278297          global $core; 
    279298           
    280           if ($w->homeonly && $core->url->type != 'default') { 
     299          if (($w->homeonly == 1 && $core->url->type != 'default') || 
     300               ($w->homeonly == 2 && $core->url->type == 'default')) { 
    281301               return; 
    282302          } 
     
    295315          global $core; 
    296316           
    297           if ($w->homeonly && $core->url->type != 'default') { 
     317          if (($w->homeonly == 1 && $core->url->type != 'default') || 
     318               ($w->homeonly == 2 && $core->url->type == 'default')) { 
    298319               return; 
    299320          } 
     
    347368          global $core; 
    348369           
    349           if ($w->homeonly && $core->url->type != 'default') { 
     370          if (($w->homeonly == 1 && $core->url->type != 'default') || 
     371               ($w->homeonly == 2 && $core->url->type == 'default')) { 
    350372               return; 
    351373          } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map