本文整理汇总了PHP中Themes::google_analytics方法的典型用法代码示例。如果您正苦于以下问题:PHP Themes::google_analytics方法的具体用法?PHP Themes::google_analytics怎么用?PHP Themes::google_analytics使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Themes
的用法示例。
在下文中一共展示了Themes::google_analytics方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
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');
}