Dotclear


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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