Пример #1
0
" />
	<title><?php 
echo $page_title ? HTML::chars($page_title) . ' | ' : '';
echo Kohana::$config->load('site.site_name');
?>
</title>
	<link rel="icon" type="image/png" href="/ui/favicon.png" />

	<?php 
foreach ($styles as $file => $attributes) {
    echo HTML::style($file, $attributes), "\n";
}
?>
	<?php 
foreach ($skins as $skin_name => $available_skin) {
    echo Less::style($available_skin['path'], array('title' => $skin_name, 'rel' => $skin_name == $skin ? 'stylesheet' : 'alternate stylesheet'), false, $skin_imports);
}
?>
	<?php 
echo HTML::style('ui/site.css');
?>

	<?php 
echo HTML::script(Kohana::$environment == Kohana::PRODUCTION ? 'js/head.min.js' : 'js/head.js');
?>
	<?php 
/*echo HTML::script_source("
head
	.js(
		{ 'jquery': 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' },
		{ 'jquery-ui': 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js' },
Пример #2
0
Файл: page.php Проект: anqh/core
 /**
  * Destroy controller.
  */
 public function after()
 {
     if ($this->_request_type !== Controller::REQUEST_INITIAL) {
         // AJAX and HMVC requests
         $this->response->body((string) $this->response->body());
     } else {
         if ($this->auto_render) {
             // Normal requests
             // Stylesheets
             $styles = array('ui/jquery-ui.css', 'http://fonts.googleapis.com/css?family=Terminal+Dosis');
             // Skins
             $selected_skin = $this->session->get('skin', 'blue');
             // Less files needed to build a skin
             $less_imports = array('ui/mixin.less', 'ui/anqh.less');
             $skins = array(HTML::style('static/css/bootstrap.css'), HTML::style('static/css/bootstrap-responsive.css'));
             foreach (array('blue') as $skin) {
                 $skinsi[] = Less::style('ui/' . $skin . '.less', array('title' => $skin, 'rel' => $skin == $selected_skin ? 'stylesheet' : 'alternate stylesheet'), false, $less_imports);
             }
             // Footer
             $section = new View_Events_List();
             $section->class .= ' span4';
             $section->title = __('New events');
             $section->events = Model_Event::factory()->find_new(10);
             Widget::add('footer', $section);
             $section = new View_Topics_List();
             $section->class .= ' span4';
             $section->title = __('New posts');
             $section->topics = Model_Forum_Topic::factory()->find_by_latest_post(10);
             Widget::add('footer', $section);
             $section = new View_Blogs_List();
             $section->class .= ' span4';
             $section->title = __('New blogs');
             $section->blog_entries = Model_Blog_Entry::factory()->find_new(10);
             Widget::add('footer', $section);
             // Open Graph
             $og = array();
             foreach ((array) Anqh::open_graph() as $key => $value) {
                 $og[] = '<meta property="' . $key . '" content="' . HTML::chars($value) . '" />';
             }
             if (!empty($og)) {
                 Widget::add('head', implode("\n", $og));
             }
             // Analytics
             if ($google_analytics = Kohana::$config->load('site.google_analytics')) {
                 Widget::add('head', HTML::script_source("\nvar tracker;\nhead.js(\n\t{ 'google-analytics': 'http://www.google-analytics.com/ga.js' },\n\tfunction() {\n\t\ttracker = _gat._getTracker('" . $google_analytics . "');\n\t\ttracker._trackPageview();\n\t}\n);\n"));
             }
             // Ads
             /*			$ads = Kohana::$config->load('site.ads');
             			if ($ads && $ads['enabled']) {
             				foreach ($ads['slots'] as $ad => $slot) {
             					if ($slot == 'side') {
             						$this->view->add(View_Page::COLUMN_SIDE, View::factory('ads/' . $ad));
             					} else {
             						Widget::add($slot, View::factory('ads/' . $ad), Widget::MIDDLE);
             					}
             				}
             			}*/
             // Do some CSS magic to page class
             $page_class = array_merge(array($this->language, $this->request->action(), self::$user ? 'authenticated' : 'unauthenticated'), explode(' ', $this->page_class));
             $page_class = implode(' ', array_unique($page_class));
             // Set the generic page variables
             $this->view->styles = $styles;
             $this->view->skins = $skins;
             $this->view->language = $this->language;
             $this->view->id = $this->page_id;
             $this->view->class = $page_class;
             if ($this->page_actions) {
                 $this->view->tabs = $this->page_actions;
             }
             if ($this->page_breadcrumbs) {
                 $this->view->breadcrumbs = $this->page_breadcrumbs;
             }
             // And finally the profiler stats
             if (self::$user && self::$user->has_role('admin')) {
                 //in_array(Kohana::$environment, array(Kohana::DEVELOPMENT, Kohana::TESTING))) {
                 Widget::add('foot', View::factory('generic/debug'));
                 Widget::add('foot', View::factory('profiler/stats'));
             }
         }
     }
     parent::after();
 }