Cleaned up code in some of my extensions

Removed function testImage in ext/chatbox/test.php because it no longer applies (there is a cache now)
This commit is contained in:
DrudexSoftware
2013-03-01 17:29:28 +01:00
parent a55c5efc4f
commit 7155804505
4 changed files with 12 additions and 27 deletions

View File

@@ -11,23 +11,18 @@
class google_analytics extends Extension {
# Add analytics to config
public function onSetupBuilding(SetupBuildingEvent $event) {
global $config;
$sb = new SetupBlock("Google Analytics");
$sb->add_text_option("google_analytics_id", "Analytics ID: ");
$sb->add_label("<br>(eg. UA-xxxxxxxx-x)");
$event->panel->add_block($sb);
}
# Load Analytics tracking code on page request
public function onPageRequest(PageRequestEvent $event) {
global $config;
global $page;
global $config, $page;
$google_analytics_id = $config->get_string('google_analytics_id','');
if (stristr($google_analytics_id, "UA-"))
{
if (stristr($google_analytics_id, "UA-")) {
$page->add_html_header("<script type='text/javascript'>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '$google_analytics_id']);