This repository has been archived on 2019-04-06. You can view files and clone it, but cannot push or open issues or pull requests.
onemove/application/classes/controller/header.php
Alexander Yakovlev 8c8b61dd29 Added error handling.
Also in development mode now you can install the database - provided you configured Kohana.
2011-10-15 12:57:18 +07:00

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('');}
}