function __construct() { parent::__construct(); $session = Session::instance(); // Load Header & Footer $this->template->header = new View('mhi/mhi_header'); $this->template->footer = new View('mhi/mhi_footer'); $this->template->footer->ushahidi_stats = Stats_Model::get_javascript(); $this->template->header->site_name = Kohana::config('settings.site_name'); // Initialize JS variables. js_files is an array of ex: html::script('media/js/jquery.validate.min'); // Add the sign in box javascript $this->template->header->js = new View('mhi/mhi_js_signin'); $this->template->header->js_files = array(); // Google Analytics $google_analytics = Kohana::config('settings.google_analytics'); $this->template->footer->google_analytics = $this->_google_analytics($google_analytics); // If we aren't at the top level MHI site or MHI isn't enabled, don't allow access to any of this jazz /* if (Kohana::config('config.enable_mhi') == FALSE OR Kohana::config('settings.subdomain') != '') throw new Kohana_User_Exception('MHI Access Error', "MHI disabled for this site."); */ // Login Form variables $this->template->header->errors = ''; $this->template->header->form = array('username' => ''); $this->template->header->form_error = ''; $this->template->header->mhi_user_id = $session->get('mhi_user_id'); }
public function __construct() { parent::__construct(); // Load cache $this->cache = new Cache; // Load Session $this->session = Session::instance(); // Load Header & Footer $this->template->header = new View('tasukeaijapan/header'); $this->template->footer = new View('tasukeaijapan/footer'); // Themes Helper $this->themes = new TasukeaijapanThemes; $this->themes->api_url = Kohana::config('settings.api_url'); // Set Table Prefix $this->table_prefix = Kohana::config('database.default.table_prefix'); // Retrieve Default Settings $site_name = Kohana::config('settings.site_name'); $this->template->header->site_name = $site_name; $this->template->footer->site_name = $site_name; $this->template->header->this_page = ""; // Google Analytics $google_analytics = Kohana::config('settings.google_analytics'); $this->template->footer->google_analytics = $this->themes->google_analytics($google_analytics); // Load profiler // $profiler = new Profiler; // Get tracking javascript for stats if(Kohana::config('settings.allow_stat_sharing') == 1){ $this->template->footer->ushahidi_stats = Stats_Model::get_javascript(); }else{ $this->template->footer->ushahidi_stats = ''; } // add copyright info $this->template->footer->site_copyright_statement = ''; $site_copyright_statement = trim(Kohana::config('settings.site_copyright_statement')); if($site_copyright_statement != '') { $this->template->footer->site_copyright_statement = $site_copyright_statement; } }
public function __construct() { parent::__construct(); // Load cache $this->cache = new Cache(); // Load Session $this->session = Session::instance(); // Load Header & Footer $this->template->header = new View('empty_header'); $this->template->footer = new View('empty_footer'); // Themes Helper $this->themes = new Themes(); $this->themes->api_url = Kohana::config('settings.api_url'); $this->template->header->submit_btn = $this->themes->submit_btn(); $this->template->header->languages = $this->themes->languages(); $this->template->header->search = $this->themes->search(); // Set Table Prefix $this->table_prefix = Kohana::config('database.default.table_prefix'); // Retrieve Default Settings $site_name = Kohana::config('settings.site_name'); // Prevent Site Name From Breaking up if its too long // by reducing the size of the font if (strlen($site_name) > 20) { $site_name_style = " style=\"font-size:21px;\""; } else { $site_name_style = ""; } $this->template->header->site_name = $site_name; $this->template->header->site_name_style = $site_name_style; $this->template->header->site_tagline = Kohana::config('settings.site_tagline'); // Display Contact Tab? $this->template->header->site_contact_page = Kohana::config('settings.site_contact_page'); // Display Help Tab? $this->template->header->site_help_page = Kohana::config('settings.site_help_page'); // Get Custom Pages $this->template->header->pages = ORM::factory('page')->where('page_active', '1')->find_all(); $this->template->header->this_page = ""; // Google Analytics $google_analytics = Kohana::config('settings.google_analytics'); $this->template->footer->google_analytics = $this->themes->google_analytics($google_analytics); // Load profiler // $profiler = new Profiler; // Get tracking javascript for stats if (Kohana::config('settings.allow_stat_sharing') == 1) { $this->template->footer->ushahidi_stats = Stats_Model::get_javascript(); } else { $this->template->footer->ushahidi_stats = ''; } }
public function ushahidi_stats_js() { if (Kohana::config('settings.allow_stat_sharing') == 1) { return Stats_Model::get_javascript(); } return ''; }
/** * Function: __construct * * Description: A default constructor that sets instance variables. * * Views:enhancedmap/print_map_header, enhancedmap/big_map_footer * * Results: Instance variables are set */ public function __construct() { parent::__construct(); // Load cache $this->cache = new Cache(); // Load Session $this->session = Session::instance(); $this->themes->map_enabled = TRUE; $this->themes->slider_enabled = TRUE; // Load Header & Footer $this->template->header = new View('enhancedmap/print_map_header'); $this->template->footer = new View('enhancedmap/big_map_footer'); // Set Table Prefix $this->table_prefix = Kohana::config('database.default.table_prefix'); // Retrieve Default Settings $site_name = Kohana::config('settings.site_name'); // Prevent Site Name From Breaking up if its too long // by reducing the size of the font if (strlen($site_name) > 20) { $site_name_style = " style=\"font-size:21px;\""; } else { $site_name_style = ""; } $this->site_name = $site_name; $this->template->header->site_name = $site_name; $this->template->header->site_name_style = $site_name_style; $this->template->header->site_tagline = Kohana::config('settings.site_tagline'); $this->template->header->this_page = ""; // Google Analytics $google_analytics = Kohana::config('settings.google_analytics'); $this->template->footer->google_analytics = $this->themes->google_analytics($google_analytics); // Load profiler // $profiler = new Profiler; // Get tracking javascript for stats if (Kohana::config('settings.allow_stat_sharing') == 1) { $this->template->footer->ushahidi_stats = Stats_Model::get_javascript(); } else { $this->template->footer->ushahidi_stats = ''; } $this->template->footer->footer_block = $this->themes->footer_block(); }
public function __construct() { parent::__construct(); $this->auth = new Auth(); $this->auth->auto_login(); // Load Session $this->session = Session::instance(); if (Kohana::config('settings.private_deployment')) { if (!$this->auth->logged_in('login')) { url::redirect('login/front'); } } // Load cache $this->cache = new Cache(); // Load Header & Footer $this->template->header = new View('header'); $this->template->footer = new View('footer'); // Themes Helper $this->themes = new Themes(); $this->themes->api_url = Kohana::config('settings.api_url'); $this->template->header->submit_btn = $this->themes->submit_btn(); $this->template->header->languages = $this->themes->languages(); $this->template->header->search = $this->themes->search(); // Set Table Prefix $this->table_prefix = Kohana::config('database.default.table_prefix'); // Retrieve Default Settings $site_name = Kohana::config('settings.site_name'); // Get banner image and pass to the header if (Kohana::config('settings.site_banner_id') != NULL) { $banner = ORM::factory('media')->find(Kohana::config('settings.site_banner_id')); $this->template->header->banner = url::convert_uploaded_to_abs($banner->media_link); } else { $this->template->header->banner = NULL; } // Prevent Site Name From Breaking up if its too long // by reducing the size of the font $site_name_style = strlen($site_name) > 20 ? " style=\"font-size:21px;\"" : ""; $this->template->header->private_deployment = Kohana::config('settings.private_deployment'); $this->template->header->loggedin_username = FALSE; $this->template->header->loggedin_userid = FALSE; if (isset(Auth::instance()->get_user()->username) and isset(Auth::instance()->get_user()->id)) { // Load User $this->user = Auth::instance()->get_user(); $this->template->header->loggedin_username = html::specialchars(Auth::instance()->get_user()->username); $this->template->header->loggedin_userid = Auth::instance()->get_user()->id; $this->template->header->loggedin_role = Auth::instance()->logged_in('member') ? "members" : "admin"; } $this->template->header->site_name = $site_name; $this->template->header->site_name_style = $site_name_style; $this->template->header->site_tagline = Kohana::config('settings.site_tagline'); //pass the URI to the header so we can dynamically add css classes to the "body" tag $this->template->header->uri_segments = Router::$segments; $this->template->header->this_page = ""; // Google Analytics $google_analytics = Kohana::config('settings.google_analytics'); $this->template->footer->google_analytics = $this->themes->google_analytics($google_analytics); // Load profiler // $profiler = new Profiler; // Get tracking javascript for stats $this->template->footer->ushahidi_stats = Kohana::config('settings.allow_stat_sharing') == 1 ? Stats_Model::get_javascript() : ''; // Enable CDN gradual upgrader $this->template->footer->cdn_gradual_upgrade = Kohana::config('cdn.cdn_gradual_upgrade') != false ? cdn::cdn_gradual_upgrade_js() : ''; // add copyright info $this->template->footer->site_copyright_statement = ''; $site_copyright_statement = trim(Kohana::config('settings.site_copyright_statement')); if ($site_copyright_statement != '') { $this->template->footer->site_copyright_statement = $site_copyright_statement; } // Display news feeds? $this->template->header->allow_feed = Kohana::config('settings.allow_feed'); }
public function __construct() { parent::__construct(); if (Kohana::config('settings.private_deployment')) { $this->auth = new Auth(); $this->session = Session::instance(); $this->auth->auto_login(); if (!$this->auth->logged_in('login')) { url::redirect('login/front'); } } // Load cache $this->cache = new Cache(); // Load Session $this->session = Session::instance(); // Load Header & Footer $this->template->header = new View('header'); $this->template->footer = new View('footer'); // Themes Helper $this->themes = new Themes(); $this->themes->api_url = Kohana::config('settings.api_url'); $this->template->header->submit_btn = $this->themes->submit_btn(); $this->template->header->languages = $this->themes->languages(); $this->template->header->search = $this->themes->search(); // Set Table Prefix $this->table_prefix = Kohana::config('database.default.table_prefix'); // Retrieve Default Settings $site_name = Kohana::config('settings.site_name'); // Prevent Site Name From Breaking up if its too long // by reducing the size of the font if (strlen($site_name) > 20) { $site_name_style = " style=\"font-size:21px;\""; } else { $site_name_style = ""; } $this->template->header->private_deployment = Kohana::config('settings.private_deployment'); $this->template->header->loggedin_username = FALSE; $this->template->header->loggedin_userid = FALSE; if (isset(Auth::instance()->get_user()->username) and isset(Auth::instance()->get_user()->id)) { $this->template->header->loggedin_username = html::specialchars(Auth::instance()->get_user()->username); $this->template->header->loggedin_userid = Auth::instance()->get_user()->id; } $this->template->header->site_name = $site_name; $this->template->header->site_name_style = $site_name_style; $this->template->header->site_tagline = Kohana::config('settings.site_tagline'); $this->template->header->this_page = ""; // Google Analytics $google_analytics = Kohana::config('settings.google_analytics'); $this->template->footer->google_analytics = $this->themes->google_analytics($google_analytics); // Load profiler // $profiler = new Profiler; // Get tracking javascript for stats if (Kohana::config('settings.allow_stat_sharing') == 1) { $this->template->footer->ushahidi_stats = Stats_Model::get_javascript(); } else { $this->template->footer->ushahidi_stats = ''; } // add copyright info $this->template->footer->site_copyright_statement = ''; $site_copyright_statement = trim(Kohana::config('settings.site_copyright_statement')); if ($site_copyright_statement != '') { $this->template->footer->site_copyright_statement = $site_copyright_statement; } }
public function __construct() { parent::__construct(); // Load cache $this->cache = new Cache(); // Load Session $this->session = Session::instance(); // Load Header & Footer $this->template->header = new View('header'); $this->template->footer = new View('footer'); // In case js doesn't get set in the construct, initialize it here $this->template->header->js = ''; // Set Table Prefix $this->table_prefix = Kohana::config('database.default.table_prefix'); // Retrieve Default Settings $site_name = Kohana::config('settings.site_name'); // Prevent Site Name From Breaking up if its too long // by reducing the size of the font if (strlen($site_name) > 20) { $site_name_style = " style=\"font-size:21px;\""; } else { $site_name_style = ""; } $this->template->header->site_name = $site_name; $this->template->header->site_name_style = $site_name_style; $this->template->header->site_tagline = Kohana::config('settings.site_tagline'); $this->template->header->api_url = Kohana::config('settings.api_url'); // Display Contact Tab? $this->template->header->site_contact_page = Kohana::config('settings.site_contact_page'); // Display Help Tab? $this->template->header->site_help_page = Kohana::config('settings.site_help_page'); // Get Custom Pages $this->template->header->pages = ORM::factory('page')->where('page_active', '1')->find_all(); // Get custom CSS file from settings $this->template->header->site_style = Kohana::config('settings.site_style'); // Javascript Header $this->template->header->map_enabled = FALSE; $this->template->header->validator_enabled = TRUE; $this->template->header->treeview_enabled = FALSE; $this->template->header->datepicker_enabled = FALSE; $this->template->header->photoslider_enabled = FALSE; $this->template->header->videoslider_enabled = FALSE; $this->template->header->protochart_enabled = FALSE; $this->template->header->main_page = FALSE; $this->template->header->this_page = ""; // Google Analytics $google_analytics = Kohana::config('settings.google_analytics'); $this->template->footer->google_analytics = $this->_google_analytics($google_analytics); // *** Locales/Languages *** // First Get Available Locales $locales = $this->cache->get('locales'); // If we didn't find any languages, we need to look them up and set the cache if (!$locales) { $locales = locale::get_i18n(); $this->cache->set('locales', $locales, array('locales'), 604800); } $this->template->header->locales_array = $locales; // Locale form submitted? if (isset($_GET['l']) && !empty($_GET['l'])) { $this->session->set('locale', $_GET['l']); } // Has a locale session been set? if ($this->session->get('locale', FALSE)) { // Change current locale Kohana::config_set('locale.language', $_SESSION['locale']); } $this->template->header->l = Kohana::config('locale.language'); // Load profiler // $profiler = new Profiler; // Get tracking javascript for stats $this->template->footer->ushahidi_stats = Stats_Model::get_javascript(); }