diff options
author | Sarven Capadisli <csarven@controlyourself.ca> | 2009-02-13 04:33:43 +0000 |
---|---|---|
committer | Sarven Capadisli <csarven@controlyourself.ca> | 2009-02-13 04:33:43 +0000 |
commit | 070d1a3f247dd20e855bda1486121545ec667e9a (patch) | |
tree | d3fb991d538ea5250c7c9afca045cac5e96103f2 /lib | |
parent | 47e595b092a0d8cd1d26a0170571c013fd992904 (diff) |
Hooks for: custom, laconica, UA specific stylesheets
Diffstat (limited to 'lib')
-rw-r--r-- | lib/action.php | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/lib/action.php b/lib/action.php index 602118cdf..cd0db5399 100644 --- a/lib/action.php +++ b/lib/action.php @@ -151,25 +151,34 @@ class Action extends HTMLOutputter // lawsuit */ function showStylesheets() { - $this->element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => theme_path('css/display.css', 'base') . '?version=' . LACONICA_VERSION, - 'media' => 'screen, projection, tv')); - $this->element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => theme_path('css/display.css', null) . '?version=' . LACONICA_VERSION, - 'media' => 'screen, projection, tv')); - $this->comment('[if IE]><link rel="stylesheet" type="text/css" '. - 'href="'.theme_path('css/ie.css', 'base').'?version='.LACONICA_VERSION.'" /><![endif]'); - foreach (array(6,7) as $ver) { - if (file_exists(theme_file('css/ie'.$ver.'.css', 'base'))) { - // Yes, IE people should be put in jail. - $this->comment('[if lte IE '.$ver.']><link rel="stylesheet" type="text/css" '. - 'href="'.theme_path('css/ie'.$ver.'.css', 'base').'?version='.LACONICA_VERSION.'" /><![endif]'); + if (Event::handle('StartShowStyles', array($this))) { + if (Event::handle('StartShowLaconicaStyles', array($this))) { + $this->element('link', array('rel' => 'stylesheet', + 'type' => 'text/css', + 'href' => theme_path('css/display.css', 'base') . '?version=' . LACONICA_VERSION, + 'media' => 'screen, projection, tv')); + $this->element('link', array('rel' => 'stylesheet', + 'type' => 'text/css', + 'href' => theme_path('css/display.css', null) . '?version=' . LACONICA_VERSION, + 'media' => 'screen, projection, tv')); + Event::handle('EndShowLaconicaStyles', array($this)); } + if (Event::handle('StartShowUAStyles', array($this))) { + $this->comment('[if IE]><link rel="stylesheet" type="text/css" '. + 'href="'.theme_path('css/ie.css', 'base').'?version='.LACONICA_VERSION.'" /><![endif]'); + foreach (array(6,7) as $ver) { + if (file_exists(theme_file('css/ie'.$ver.'.css', 'base'))) { + // Yes, IE people should be put in jail. + $this->comment('[if lte IE '.$ver.']><link rel="stylesheet" type="text/css" '. + 'href="'.theme_path('css/ie'.$ver.'.css', 'base').'?version='.LACONICA_VERSION.'" /><![endif]'); + } + } + $this->comment('[if IE]><link rel="stylesheet" type="text/css" '. + 'href="'.theme_path('css/ie.css', null).'?version='.LACONICA_VERSION.'" /><![endif]'); + Event::handle('EndShowUAStyles', array($this)); + } + Event::handle('EndShowStyles', array($this)); } - $this->comment('[if IE]><link rel="stylesheet" type="text/css" '. - 'href="'.theme_path('css/ie.css', null).'?version='.LACONICA_VERSION.'" /><![endif]'); } /** |