diff options
author | Sarven Capadisli <csarven@status.net> | 2009-10-04 16:26:04 +0000 |
---|---|---|
committer | Sarven Capadisli <csarven@status.net> | 2009-10-04 16:26:04 +0000 |
commit | 7addccacaab5bf7510fbe537b512bc8d5c3f558f (patch) | |
tree | 132fdf39065dc897862fd8599fad2c1738ec1377 /plugins/MobileProfile/MobileProfilePlugin.php | |
parent | c64e1792bf108961c288ffa91667be34d9e6ca6a (diff) |
Added ability to define mobile stylesheets (handheld, screen) at the
theme level. If there are no mobile stylesheets in the theme
directory, it will use the ones that come with the plugin.
Diffstat (limited to 'plugins/MobileProfile/MobileProfilePlugin.php')
-rw-r--r-- | plugins/MobileProfile/MobileProfilePlugin.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/MobileProfile/MobileProfilePlugin.php b/plugins/MobileProfile/MobileProfilePlugin.php index 02a732493..35756cfe7 100644 --- a/plugins/MobileProfile/MobileProfilePlugin.php +++ b/plugins/MobileProfile/MobileProfilePlugin.php @@ -158,6 +158,30 @@ class MobileProfilePlugin extends WAP20Plugin } + function onStartShowStatusNetStyles($action) { + if (file_exists(theme_file('css/mp-screen.css'))) { + $action->cssLink('css/mp-screen.css', null, 'screen'); + } + else { + $action->element('link', array('rel' => 'stylesheet', + 'type' => 'text/css', + 'href' => common_path('plugins/MobileProfile/mp-screen.css') . '?version=' . STATUSNET_VERSION, + 'media' => 'screen')); + } + + if (file_exists(theme_file('css/mp-handheld.css'))) { + $action->cssLink('css/mp-handheld.css', null, 'handheld'); + } + else { + $action->element('link', array('rel' => 'stylesheet', + 'type' => 'text/css', + 'href' => common_path('plugins/MobileProfile/mp-handheld.css') . '?version=' . STATUSNET_VERSION, + 'media' => 'handheld')); + } + + return false; + } + function onStartShowAside($action) { |