Minor internal layout changes

This commit is contained in:
Deon George 2012-01-12 19:53:33 +11:00
parent 14d5f1939e
commit 9e21f60066
3 changed files with 18 additions and 19 deletions

View File

@ -122,19 +122,25 @@ abstract class Controller_lnApp_TemplateDefault extends Controller_Template {
$this->meta = new meta;
View::bind_global('meta',$this->meta);
// Our default style sheet
Style::add(array(
'type'=>'file',
'data'=>'css/default.css',
));
// Our default style sheet(s)
foreach (array('file'=>array_reverse(array(
'css/default.css',
))) as $type => $datas) {
// Our default scripts
// This is in a reverse list, since we push them to the beginging of the scripts to render.
foreach (array('file'=>array(
'js/jquery.cookie.js',
'js/jquery.jstree-1.0rc3.js',
foreach ($datas as $data) {
Style::add(array(
'type'=>$type,
'data'=>$data,
),TRUE);
}
}
// Our default script(s)
foreach (array('file'=>array_reverse(array(
'js/jquery-1.6.4.min.js',
)) as $type => $datas) {
'js/jquery.jstree-1.0rc3.js',
'js/jquery.cookie.js',
))) as $type => $datas) {
foreach ($datas as $data) {
Script::add(array(

View File

@ -34,18 +34,13 @@ class lnApp_Script extends HTMLRender {
$foutput = $soutput = '';
$mediapath = Route::get(static::$_media_path);
$i = $j = 0;
foreach (static::$_data as $value) {
switch ($value['type']) {
case 'file':
$foutput .= HTML::script($mediapath->uri(array('file'=>$value['data'])));
if ($i++)
$foutput .= static::$_spacer;
break;
case 'stdin':
$soutput .= sprintf("<script type=\"text/javascript\">//<![CDATA[\n%s\n//]]></script>",$value['data']);
if ($j++)
$soutput .= static::$_spacer;
break;
default:
throw new Kohana_Exception('Unknown style type :type',array(':type'=>$value['type']));

View File

@ -14,6 +14,7 @@ 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');
/**
* Return an instance of this class
@ -33,7 +34,6 @@ class lnApp_Style extends HTMLRender {
$foutput = $soutput = '';
$mediapath = Route::get(static::$_media_path);
$i = $j = 0;
foreach (static::$_data as $value) {
switch ($value['type']) {
case 'file':
@ -42,8 +42,6 @@ class lnApp_Style extends HTMLRender {
break;
case 'stdin':
$soutput .= sprintf("<style type=\"text/css\">%s</style>",$value['data']);
if ($j++)
$soutput .= static::$_spacer;
break;
default:
throw new Kohana_Exception('Unknown style type :type',array(':type'=>$value['type']));