'; protected static $_required_keys = array('body'); /** * Add a block to be rendered * * @param array Block attributes */ public static function add($block,$prepend=FALSE) { parent::add($block); // Detect any style sheets. if (! empty($block['style']) && is_array($block['style'])) foreach ($block['style'] as $data=>$media) Style::add(array( 'type'=>'file', 'data'=>$data, 'media'=>$media, )); } /** * Return an instance of this class * * @return Block */ public static function factory() { return new Block; } /** * Render this block * * @see HTMLRender::render() */ protected function render() { $output = ''; $styles = array(); $i = 0; foreach (static::$_data as $value) { if ($i++) $output .= static::$_spacer; $output .= ''; if (! empty($value['title'])) $output .= sprintf('',$value['title']); if (! empty($value['subtitle'])) $output .= sprintf('',$value['subtitle']); $output .= sprintf('',$value['body']); if (! empty($value['footer'])) $output .= sprintf('',$value['footer']); $output .= '
%s
%s
%s
'; } return $output; } } ?>