gs(); if ($ss['ea'] == true) { if (current_user_can('level_8')||current_user_can('activate_plugins')) { return true; } } return false; } /* function aac() Adds Google Analytics code to page */ function aac() { anflex_msg('aac() started'); if ($this->aef()==false) { $ss = $this->gs(); ?> aef()==true) { ?> $this->d_gaid, 't' => false, 'ea' => true, 'lt_e' => false, 'lt_el' => '', 'lt_d' => false, 'lt_dl' => $this->d_el, ); /* Get previously saved preference and overwrite defaults */ $ss = get_option($this->aon); /* delete whole database entry if oblivious setting is in the db */ if($ss['tracking']) { anflex_msg('gs() old settings detected'); delete_option($this->aon); anflex_msg('gs() old settings deleted'); } if(!empty($ss)) { /* oblivious setting cleanup */ foreach ($ss as $key => $option) { if($key=='tracking') {$s['t']==$option;unset($ss[$key]);} if($key=='exclude_admin') {$s['ea']==$option;unset($ss[$key]);} if($key=='link_tracking_external') {$s['lt_e']==$option;unset($ss[$key]);} if($key=='link_tracking_external_exclude_list') {$s['lt_el']==$option;unset($ss[$key]);} if($key=='link_tracking_download') {$s['lt_d']==$option;unset($ss[$key]);} if($key=='link_tracking_download_extension_list') {$s['lt_dl']==$option;unset($ss[$key]);} if($key=='event_tracking') {unset($ss[$key]);} } /* integrate with new setting */ foreach ($ss as $key => $option) { $s[$key] = $option; } } update_option($this->aon,$s); return $s; } /* function ap() Prints admin panel HTML */ function ap() { anflex_msg('ap() started'); $s = $this->gs(); if (isset($_POST['update_gaid'])) { $s['gaid'] = isset($_POST['gaid'])?$_POST['gaid']:$s['gaid']; update_option($this->aon, $s); ?>