This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
lnapp/classes/lnApp/Style.php
2013-05-02 20:37:40 +10:00

44 lines
1.1 KiB
PHP

<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class is for rendering HTML style tags
*
* @package lnApp
* @category lnApp/Helpers
* @author Deon George
* @copyright (c) 2009-2013 Deon George
* @license http://dev.leenooks.net/license.html
*/
abstract class lnApp_Style extends HTMLRender {
protected static $_data = array();
protected static $_spacer = "\n";
protected static $_c = 0;
protected $_items = array('data','media','type');
protected static $_required_keys = array('type','data');
/**
* Render the style tag
*
* @see HTMLRender::render()
*/
protected function render() {
$record = static::$_data[$this->_x];
$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 $output;
}
}
?>