Alexander Yakovlev
8c8b61dd29
Also in development mode now you can install the database - provided you configured Kohana.
27 lines
1.1 KiB
PHP
27 lines
1.1 KiB
PHP
<?php defined('SYSPATH') or die('No direct script access.');
|
|
|
|
class Controller_Header extends Controller_Template {
|
|
public $template = 'header';
|
|
public function action_standard() {
|
|
$this->template->title = $this->request->post('title');
|
|
$styles = $this->request->post('styles');
|
|
$scripts = $this->request->post('scripts');
|
|
$temp = "";
|
|
if (is_array($styles)){
|
|
foreach($styles as $style=>$media):
|
|
if ($media != 'screen' and $media != 'print'){
|
|
$style=$media;
|
|
$media='screen';
|
|
}
|
|
$temp .= '<link rel="stylesheet" type="text/css" media="'. $media .'" href="'.URL::site('assets/css/'.$style).'">'."\n";
|
|
endforeach;
|
|
$this->template->styles = $temp;
|
|
}
|
|
else $this->template->styles = '<link rel="stylesheet" type="text/css" media="screen" href="'.URL::site('assets/css/'.$styles)."\">\n";
|
|
if (is_array($scripts)) foreach($scripts as $script):
|
|
$temp .= '<script type="text/javascript" charset="utf-8" src="'.URL::site('assets/javascript/'.$script).'"></script>'."\n";
|
|
endforeach;
|
|
$this->template->scripts = $temp;
|
|
}
|
|
public function action_view(){$this->request->redirect('');}
|
|
} |