Themeing work based on bootstrap
This commit is contained in:
@@ -12,17 +12,10 @@
|
||||
abstract class lnApp_Style extends HTMLRender {
|
||||
protected static $_data = array();
|
||||
protected static $_spacer = "\n";
|
||||
protected static $_required_keys = array('type','data');
|
||||
protected static $_unique_vals = array('file'=>'type');
|
||||
protected static $_c = 0;
|
||||
protected $_items = array('data','media','type');
|
||||
|
||||
/**
|
||||
* Return an instance of this class
|
||||
*
|
||||
* @return Style
|
||||
*/
|
||||
public static function factory() {
|
||||
return new Style;
|
||||
}
|
||||
protected static $_required_keys = array('type','data');
|
||||
|
||||
/**
|
||||
* Render the style tag
|
||||
@@ -30,24 +23,21 @@ abstract class lnApp_Style extends HTMLRender {
|
||||
* @see HTMLRender::render()
|
||||
*/
|
||||
protected function render() {
|
||||
$foutput = $soutput = '';
|
||||
$mediapath = Route::get(static::$_media_path);
|
||||
$record = static::$_data[$this->_x];
|
||||
|
||||
foreach (static::$_data as $value) {
|
||||
switch ($value['type']) {
|
||||
case 'file':
|
||||
$foutput .= HTML::style($mediapath->uri(array('file'=>$value['data'])),
|
||||
array('media'=>(! empty($value['media'])) ? $value['media'] : 'screen'),TRUE);
|
||||
break;
|
||||
case 'stdin':
|
||||
$soutput .= sprintf("<style type=\"text/css\">%s</style>",$value['data']);
|
||||
break;
|
||||
default:
|
||||
throw new Kohana_Exception('Unknown style type :type',array(':type'=>$value['type']));
|
||||
}
|
||||
$output = '';
|
||||
switch ($record['type']) {
|
||||
case 'file':
|
||||
$output .= HTML::style($record['data'],array('media'=>(! empty($record['media'])) ? $record['media'] : 'screen'));
|
||||
break;
|
||||
case 'stdin':
|
||||
$output .= sprintf("<style type=\"text/css\">%s</style>",$record['data']);
|
||||
break;
|
||||
default:
|
||||
throw new Kohana_Exception('Unknown style type :type',array(':type'=>$record['type']));
|
||||
}
|
||||
|
||||
return $foutput.static::$_spacer.$soutput;
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user