Dotclear


Ignore:
Timestamp:
02/22/14 10:04:16 (11 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Add widget class on every widget, fixes #1901

File:
1 edited

Legend:

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

    r2662 r2667  
    187187     /* Widget rendering tool 
    188188     --------------------------------------------------- */ 
     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 
    189201     public function renderTitle($title) 
    190202     { 
     
    208220          $ret = sprintf($wtscheme,$title); 
    209221 
     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); 
    210249          return $ret; 
    211250     } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map