diff options
author | Zach Copley <zach@status.net> | 2009-12-04 22:43:34 +0000 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2009-12-04 22:43:34 +0000 |
commit | 1fd7e5e3794621993b01a5833faa8b6fa26c3847 (patch) | |
tree | 20ed6ac919ee164a9cca963c4f6b67a44f436747 /lib | |
parent | 4881be47c798688c3ae20f621d06e15adbc9c17e (diff) | |
parent | 5c973876ac7aef093f2b8ff72b0e23f9c2b1c498 (diff) |
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'lib')
-rw-r--r-- | lib/htmloutputter.php | 42 | ||||
-rw-r--r-- | lib/plugin.php | 10 |
2 files changed, 34 insertions, 18 deletions
diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index 3fabc4037..a0066594f 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -350,14 +350,17 @@ class HTMLOutputter extends XMLOutputter */ function script($src, $type='text/javascript') { - $url = parse_url($src); - if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment)) - { - $src = common_path($src) . '?version=' . STATUSNET_VERSION; + if(Event::handle('StartScriptElement', array($this,&$src,&$type))) { + $url = parse_url($src); + if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment)) + { + $src = common_path($src) . '?version=' . STATUSNET_VERSION; + } + $this->element('script', array('type' => $type, + 'src' => $src), + ' '); + Event::handle('EndScriptElement', array($this,$src,$type)); } - $this->element('script', array('type' => $type, - 'src' => $src), - ' '); } /** @@ -390,19 +393,22 @@ class HTMLOutputter extends XMLOutputter */ function cssLink($src,$theme=null,$media=null) { - $url = parse_url($src); - if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment)) - { - if(file_exists(Theme::file($src,$theme))){ - $src = Theme::path($src, $theme) . '?version=' . STATUSNET_VERSION; - }else{ - $src = common_path($src); + if(Event::handle('StartCssLinkElement', array($this,&$src,&$theme,&$media))) { + $url = parse_url($src); + if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment)) + { + if(file_exists(Theme::file($src,$theme))){ + $src = Theme::path($src, $theme) . '?version=' . STATUSNET_VERSION; + }else{ + $src = common_path($src); + } } + $this->element('link', array('rel' => 'stylesheet', + 'type' => 'text/css', + 'href' => $src, + 'media' => $media)); + Event::handle('EndCssLinkElement', array($this,$src,$theme,$media)); } - $this->element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => $src, - 'media' => $media)); } /** diff --git a/lib/plugin.php b/lib/plugin.php index 87d7be5a7..2c77c3e12 100644 --- a/lib/plugin.php +++ b/lib/plugin.php @@ -76,4 +76,14 @@ class Plugin { return true; } + + protected function log($level, $msg) + { + common_log($level, get_class($this) . ': '.$msg); + } + + protected function debug($msg) + { + $this->log(LOG_DEBUG, $msg); + } } |