|
';
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('%s |
',$value['title']);
if (! empty($value['subtitle']))
$output .= sprintf('%s |
',$value['subtitle']);
$output .= sprintf('%s |
',$value['body']);
if (! empty($value['footer']))
$output .= sprintf('',$value['footer']);
$output .= '
';
}
return $output;
}
}
?>