From c73398fb257367f0599cea36d9b1cb06a2568c9a Mon Sep 17 00:00:00 2001 From: Max Shinn Date: Tue, 28 Dec 2010 09:10:22 -0600 Subject: [PATCH] External css --- plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php | 5 +++++ plugins/GNUsocialPhotos/actions/photos.php | 2 -- plugins/GNUsocialPhotos/res/style.css | 8 ++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 plugins/GNUsocialPhotos/res/style.css diff --git a/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php b/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php index f6173c29c6..7be8b0a962 100644 --- a/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php +++ b/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php @@ -194,5 +194,10 @@ class GNUsocialPhotosPlugin extends Plugin array('nickname' => $nav->action->trimmed('nickname'))), _('Photos'), _('Photo gallery'), $nav->action->trimmed('action') == 'photos', 'nav_photos'); } + + function onEndShowStyles($action) + { + $action->cssLink('/plugins/GNUsocialPhotos/res/style.css'); + } } diff --git a/plugins/GNUsocialPhotos/actions/photos.php b/plugins/GNUsocialPhotos/actions/photos.php index ede8ba0f73..bfa77b9c35 100644 --- a/plugins/GNUsocialPhotos/actions/photos.php +++ b/plugins/GNUsocialPhotos/actions/photos.php @@ -84,7 +84,6 @@ class PhotosAction extends Action GNUsocialPhotoAlbum::newAlbum($cur->id, 'Default'); } while ($album->fetch()) { - $this->element('style', array(), '.albumcontainer { display: block; background-color: green; float: left; padding: 30px; margin: 20px; }'); $this->elementStart('div', array('class' => 'photocontainer')); $this->elementStart('a', array('href' => $album->getPageLink())); $this->element('img', array('src' => $album->getThumbUri())); @@ -115,7 +114,6 @@ class PhotosAction extends Action $this->element('a', array('href' => $album->getPageLink() . '?pageid=' . ($page+1) ), 'Next page'); } - $this->element('style', array(), '.photocontainer { display: block; background-color: yellow; float: left; padding: 30px; margin: 20px; }'); foreach ($photos as $photo) { $this->elementStart('a', array('href' => $photo->getPageLink())); $this->elementStart('div', array('class' => 'photocontainer')); diff --git a/plugins/GNUsocialPhotos/res/style.css b/plugins/GNUsocialPhotos/res/style.css new file mode 100644 index 0000000000..78cd01f926 --- /dev/null +++ b/plugins/GNUsocialPhotos/res/style.css @@ -0,0 +1,8 @@ +.photocontainer, .albumcontainer { + display: block; + background-color: yellow; + float: left; + padding: 20px; + margin: 15px; +} +