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
2014-02-18 15:27:08 +11:00

45 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 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 $_unique_vals = array('data');
protected static $_required_keys = array('type','data');
/**
* Render the style tag
*
* @see HTMLRender::render()
*/
protected function render() {
$record = self::$_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;
}
}
?>