<commit_before><?php defined('SYSPATH') OR die('No direct access allowed.');
/**
 * S7Ncms - www.s7n.de
 *
 * Copyright (c) 2007-2009, <NAME> <eduard at baun.de>
 * All rights reserved.
 *
 * See license.txt for full text and disclaimer
 *
 * @author <NAME> <eduard at baun.de>
 * @copyright <NAME>, 2007-2009
 * @version $Id$
 */
class Administration_Controller extends Template_Controller {

	public $session;
	public $db;
	public $head;

	public function __construct()
	{
		// don't use config::set() here
		Kohana::config_set('s7n.use_admin_theme', TRUE);

		parent::__construct();

		$this->session = Session::instance();
		$this->db = Database::instance();

		// check if user is logged in or not. also check if he has admin role
		if ( ! Auth::factory()->logged_in('admin'))
		{
			$this->session->set('redirect_me_to', url::current());
			url::redirect('admin/auth/login');
		}
		$this->head = Head::instance();

		// Javascripts
		$this->head->javascript->append_file('vendor/jquery/jquery.js');
		$this->head->javascript->append_file('vendor/jquery/jquery-ui.min.js');
		$this->head->javascript->append_file('vendor/jquery/ui/ui.tree.js');
		$this->head->javascript->append_file('themes/admin/js/stuff.js');

		// Stylesheets
		$this->head->css->append_file('themes/admin/css/ui/jquery-ui');
		$this->head->css->append_file('themes/admin/css/layout');
		$this->head->css->append_file('themes/admin/css/ui.tabs');

		$this->head->title->set('S7Nadmin');

		$this->template->set_global('tasks', array());
		$this->template->set_global('sidebar', array());

		$this->template->title = '';
		$this->template->message = $this->session->get('info_message', NULL);
		$this->template->error = $this->session->get('error_message', NULL);
		$this->template->content = '';
		$this->template->set_global('head', $this->head);

		$this->template->searchbar = FALSE;
		$this->template->searchvalue = '';
	}

	public function recent_entries($number = 10) {
		return '';
	}

}<commit_msg>added global view variable: theme_url<commit_after><?php defined('SYSPATH') OR die('No direct access allowed.');
/**
 * S7Ncms - www.s7n.de
 *
 * Copyright (c) 2007-2009, <NAME> <<EMAIL>ard at baun.de>
 * All rights reserved.
 *
 * See license.txt for full text and disclaimer
 *
 * @author <NAME> <<EMAIL>ard at baun.de>
 * @copyright <NAME>, 2007-2009
 * @version $Id$
 */
class Administration_Controller extends Template_Controller {

	public $session;
	public $db;
	public $head;

	public function __construct()
	{
		// don't use config::set() here
		Kohana::config_set('s7n.use_admin_theme', TRUE);

		parent::__construct();

		$this->session = Session::instance();
		$this->db = Database::instance();

		// check if user is logged in or not. also check if he has admin role
		if ( ! Auth::factory()->logged_in('admin'))
		{
			$this->session->set('redirect_me_to', url::current());
			url::redirect('admin/auth/login');
		}
		$this->head = Head::instance();

		// Javascripts
		$this->head->javascript->append_file('vendor/jquery/jquery.js');
		$this->head->javascript->append_file('vendor/jquery/jquery-ui.min.js');
		$this->head->javascript->append_file('vendor/jquery/ui/ui.tree.js');
		$this->head->javascript->append_file('themes/admin/js/stuff.js');

		// Stylesheets
		$this->head->css->append_file('themes/admin/css/ui/jquery-ui');
		$this->head->css->append_file('themes/admin/css/layout');
		$this->head->css->append_file('themes/admin/css/ui.tabs');

		$this->head->title->set('S7Nadmin');

		$this->template->set_global('theme_url', 'themes/'.config::get('s7n.theme').'/');
		$this->template->set_global('tasks', array());
		$this->template->set_global('sidebar', array());

		$this->template->title = '';
		$this->template->message = $this->session->get('info_message', NULL);
		$this->template->error = $this->session->get('error_message', NULL);
		$this->template->content = '';
		$this->template->set_global('head', $this->head);

		$this->template->searchbar = FALSE;
		$this->template->searchvalue = '';
	}

	public function recent_entries($number = 10) {
		return '';
	}

}
{'fraction_non_alphanumeric': 0.20661764705882352, 'fraction_numerical': 0.011029411764705883, 'mean_word_length': 4.575136612021858, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 123, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3097844', 'n_tokens_mistral': 1496, 'n_tokens_neox': 1351, 'n_words': 234}