Major theme rework

This commit is contained in:
Deon George
2012-01-29 17:23:24 +11:00
parent 3d1c43687c
commit 89bb9004ed
49 changed files with 663 additions and 1320 deletions

View File

@@ -62,24 +62,26 @@ class lnApp_Breadcrumb extends HTMLRender {
* Render this Breadcrumb
*/
protected function render() {
// @todo Make this into a view
$output = '<table class="pagecontrol"><tr><td class="none">';
$output .= HTML::anchor('/',_('Home'));
$output = '<ul id="breadcrumb">';
$output .= '<li>'.HTML::anchor('/',_('Home')).'</li>';
$data = empty(static::$_data['path']) ? explode('/',preg_replace('/^\//','',Request::detect_uri())) : static::$_data['path'];
$c = count($data);
$i=0;
foreach ($data as $k => $v) {
$output .= static::$_spacer;
$i++;
$p = join('/',array_slice($data,0,$k+1));
$output .= $i==$c ? '<li id="active">' : '<li>';
$output .= HTML::anchor(
(empty(static::$_data['url'][$p]) ? $p : static::$_data['url'][$p]),
(empty(static::$_data['name'][$p]) ? ucfirst($v) : static::$_data['name'][$p])
);
$output .= '</li>';
}
$output .= '</td></tr></table>';
$output .= '</ul>';
return $output;
}
}

View File

@@ -75,7 +75,7 @@ abstract class lnApp_Config extends Kohana_Config {
// Called in Invoice/Emailing to embed the file.
public static function logo_file() {
list ($path,$suffix) = explode('.',static::$logo);
return Kohana::find_file(sprintf('media/%s',Config::siteid()),$path,$suffix);
return ($a=Kohana::find_file(sprintf('media/site/%s',Config::siteid()),$path,$suffix)) ? $a : Kohana::find_file('media',$path,$suffix);
}
public static function logo_uri() {
@@ -87,6 +87,10 @@ abstract class lnApp_Config extends Kohana_Config {
return HTML::image(static::logo_uri(),array('class'=>'headlogo','alt'=>_('Logo')));
}
public static function login_uri() {
return ($ao = Auth::instance()->get_user()) ? HTML::anchor('user/account/edit',$ao->name()) : HTML::anchor('login',_('Login'));
}
/**
* Return our caching mechanism
*/
@@ -129,5 +133,9 @@ abstract class lnApp_Config extends Kohana_Config {
else
return $config[$template];
}
public static function theme() {
return Kohana::config('config.theme');
}
}
?>