示例#1
0
 /**
  * render
  *
  * @param string $block
  *
  * @return  string
  */
 public static function render($block)
 {
     $positions = static::getBlockPositions($block);
     $count = count($positions);
     $defaultChromeStyle = Template::getParam('defaultChromeStyle', 'xhtml');
     switch ($count) {
         case 1:
             $span = 12;
             break;
         case 2:
             $span = 6;
             break;
         case 3:
             $span = 4;
             break;
         case 4:
             $span = 3;
             break;
         default:
             $span = 3;
             break;
     }
     $tags = array();
     foreach ($positions as $position => $num) {
         $html = '<jdoc:include type="modules" name="' . $position . '" style="' . $defaultChromeStyle . '" />';
         $html = '<div class="span' . $span . '">' . $html . '</div>';
         $tags[] = $html;
     }
     return implode("\n", $tags);
 }