anflex_ga_admin_options_name); if ($anflex_ga_saved_preferences['exclude_admin'] == true) { if (current_user_can('level_8')||current_user_can('activate_plugins')) { return true; } } return false; } /* Code addition */ function anflex_ga_add_code() { if ($this->anflex_ga_admin_exclude_flag()==false) { $anflex_ga_saved_preferences = get_option($this->anflex_ga_admin_options_name); $anflex_ga_gaid = $anflex_ga_saved_preferences['gaid']; $anflex_ga_link_tracking_external = $anflex_ga_saved_preferences['link_tracking_external']; $anflex_ga_link_tracking_external_exclude_list = $anflex_ga_saved_preferences['link_tracking_external_exclude_list']; $anflex_ga_link_tracking_download = $anflex_ga_saved_preferences['link_tracking_download']; $anflex_ga_link_tracking_download_extension_list = $anflex_ga_saved_preferences['link_tracking_download_extension_list']; ?> anflex_ga_admin_exclude_flag()==true) { ?> $this->anflex_ga_default_gaid, 'tracking' => true, 'exclude_admin' => true, 'link_tracking_external' => false, 'link_tracking_external_exclude_list' => '', 'link_tracking_download' => false, 'link_tracking_download_extension_list' => $this->anflex_ga_default_extension_list, 'event_tracking' => false ); anflex_message('anflex_ga_get_preferences: default preferences array called'); /* Get previously saved preference and overwrite defaults */ $anflex_ga_saved_preferences = get_option($this->anflex_ga_admin_options_name); if (!empty($anflex_ga_saved_preferences)) { foreach ($anflex_ga_saved_preferences as $key => $option) { $anflex_ga_settings_array[$key] = $option; } } update_option($this->anflex_ga_admin_options_name, $anflex_ga_settings_array); return $anflex_ga_settings_array; } function anflex_ga_admin_init() { $this->anflex_ga_get_preferences(); } function anflex_ga_print_adminpanel() { $anflex_ga_settings = $this->anflex_ga_get_preferences(); if (isset($_POST['anflex_ga_update_gaid'])) { $anflex_ga_settings['gaid'] = isset($_POST['gaid'])?$_POST['gaid']:$anflex_ga_settings['gaid']; update_option($this->anflex_ga_admin_options_name, $anflex_ga_settings); ?>