Dotclear


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/widgets/class.widgets.php

    r2566 r2667  
    185185     } 
    186186 
     187     /* Widget rendering tool 
     188     --------------------------------------------------- */ 
     189     public function renderDiv($content_only,$class,$attr,$content) 
     190     { 
     191          if ($content_only) { 
     192               return $content; 
     193          } 
     194          $ret = '<div class="widget'.($class ? ' '.html::escapeHTML($class) : '').'"'.($attr ? ' '.$attr : '').'>'."\n"; 
     195          $ret .= $content."\n"; 
     196          $ret .= '</div>'."\n"; 
     197 
     198          return $ret; 
     199     } 
     200 
     201     public function renderTitle($title) 
     202     { 
     203          global $core; 
     204 
     205          if (!$title) { 
     206               return ''; 
     207          } 
     208 
     209          $wtscheme = $core->themes->moduleInfo($core->blog->settings->system->theme,'widgettitleformat'); 
     210          if (empty($wtscheme)) { 
     211               $tplset = $core->themes->moduleInfo($core->blog->settings->system->theme,'tplset'); 
     212               if (empty($tplset) || $tplset == DC_DEFAULT_TPLSET) { 
     213                    // Use H2 for mustek based themes 
     214                    $wtscheme = '<h2>%s</h2>'; 
     215               } else { 
     216                    // Use H3 for currywurst based themes 
     217                    $wtscheme = '<h3>%s</h3>'; 
     218               } 
     219          } 
     220          $ret = sprintf($wtscheme,$title); 
     221 
     222          return $ret; 
     223     } 
     224 
     225     public function renderSubtitle($title,$render=true) 
     226     { 
     227          global $core; 
     228 
     229          if (!$title && $render) { 
     230               return ''; 
     231          } 
     232 
     233          $wtscheme = $core->themes->moduleInfo($core->blog->settings->system->theme,'widgetsubtitleformat'); 
     234          if (empty($wtscheme)) { 
     235               $tplset = $core->themes->moduleInfo($core->blog->settings->system->theme,'tplset'); 
     236               if (empty($tplset) || $tplset == DC_DEFAULT_TPLSET) { 
     237                    // Use H2 for mustek based themes 
     238                    $wtscheme = '<h3>%s</h3>'; 
     239               } else { 
     240                    // Use H3 for currywurst based themes 
     241                    $wtscheme = '<h4>%s</h4>'; 
     242               } 
     243          } 
     244          if (!$render) { 
     245               return $wtscheme; 
     246          } 
     247 
     248          $ret = sprintf($wtscheme,$title); 
     249          return $ret; 
     250     } 
     251 
    187252     /* Widget settings 
    188253     --------------------------------------------------- */ 
Note: See TracChangeset for help on using the changeset viewer.

Sites map