From c901039a1f15f74ab304cc52d943bb0e1f25a079 Mon Sep 17 00:00:00 2001 From: Ian Denhardt Date: Tue, 21 Dec 2010 16:25:11 -0500 Subject: [PATCH] added link to photo upload page. --- .../GNUsocialPhotos/GNUsocialPhotosPlugin.php | 2 +- plugins/GNUsocialPhotos/actions/photos.php | 5 ++ plugins/GNUsocialPhotos/lib/photonav.php | 55 +++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 plugins/GNUsocialPhotos/lib/photonav.php diff --git a/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php b/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php index b6bf220e5a..deddd502aa 100644 --- a/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php +++ b/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php @@ -40,6 +40,7 @@ class GNUsocialPhotosPlugin extends Plugin $dir = dirname(__FILE__); include_once $dir . '/lib/tempphoto.php'; + include_once $dir . '/lib/photonav.php'; switch ($cls) { case 'PhotosAction': @@ -53,7 +54,6 @@ class GNUsocialPhotosPlugin extends Plugin default: break; } - include_once $dir . '/classes/gnusocialphoto.php'; include_once $dir . '/classes/gnusocialphotoalbum.php'; return true; diff --git a/plugins/GNUsocialPhotos/actions/photos.php b/plugins/GNUsocialPhotos/actions/photos.php index d5597191a8..3092389330 100644 --- a/plugins/GNUsocialPhotos/actions/photos.php +++ b/plugins/GNUsocialPhotos/actions/photos.php @@ -64,6 +64,11 @@ class PhotosAction extends Action } } + function showLocalNav() + { + $nav = new GNUsocialPhotoNav($this); + $nav->show(); + } function showContent() { diff --git a/plugins/GNUsocialPhotos/lib/photonav.php b/plugins/GNUsocialPhotos/lib/photonav.php new file mode 100644 index 0000000000..c464648803 --- /dev/null +++ b/plugins/GNUsocialPhotos/lib/photonav.php @@ -0,0 +1,55 @@ +. + * + * @package GNU Social + * @author Ian Denhardt + * @copyright 2010 Free Software Foundation, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + */ + +if(!defined('STATUSNET')) { + exit(1); +} + +class GNUsocialPhotoNav extends Widget { + var $action = null; + + function __construct($action = null) + { + parent::__construct($action); + $this->action = $action; + } + + function show() + { + $nickname = $this->action->trimmed('nickname'); + + $this->out->elementStart('ul', array('class' => 'nav')); + + $this->out->menuItem(common_local_url('photos', array('nickname' => $nickname)), + 'Photos', null, true); + + $this->out->menuItem(common_local_url('photoupload', array()), + 'Upload Photos'); + + $this->out->elementEnd('ul'); + } +}