aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--edit.php7
-rw-r--r--index.php15
-rw-r--r--newalbum.php5
-rw-r--r--start.php8
-rw-r--r--upload.php4
-rw-r--r--viewalbum.php2
-rw-r--r--viewimage.php6
7 files changed, 43 insertions, 4 deletions
diff --git a/edit.php b/edit.php
index b84d74724..0f099a9ad 100644
--- a/edit.php
+++ b/edit.php
@@ -35,6 +35,13 @@
forward();
}
+ $page_owner = page_owner_entity();
+ if ($page_owner instanceof ElggGroup) {
+ add_submenu_item( sprintf(elgg_echo('album:group'),$page_owner->name),
+ $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username);
+ }
+
+
$area2 .= elgg_view_title($title);
$area2 .= elgg_view('tidypics/forms/edit', array('entity' => $entity, 'subtype' => $subtype));
$body = elgg_view_layout('two_column_left_sidebar', $area1, $area2);
diff --git a/index.php b/index.php
index ac480b528..fb3e94dd4 100644
--- a/index.php
+++ b/index.php
@@ -10,6 +10,14 @@
//get the owner of the current page
$owner = page_owner_entity();
+ //$album
+
+ if ($owner instanceof ElggGroup) {
+
+ }
+
+ error_log($owner->guid);
+
//if page owner cannot be found, forward to user's pictures instead (or world if not logged in)
if (is_null($owner->username) || empty($owner->username)) {
//if not logged in, see world pictures instead
@@ -21,6 +29,8 @@
// setup group menu for album index
if ($owner instanceof ElggGroup) {
+ add_submenu_item( sprintf(elgg_echo('album:group'),$owner->name),
+ $CONFIG->wwwroot . "pg/photos/owned/" . $owner->username);
add_submenu_item( elgg_echo('album:create'),
$CONFIG->wwwroot . 'pg/photos/new/' . $owner->username,
'tidypics');
@@ -33,7 +43,10 @@
// Get objects
set_context('search');
set_input('search_viewtype', 'gallery');
- $area2 .= list_entities("object", "album", page_owner(), 10);
+ if ($owner instanceof ElggGroup)
+ $area2 .= list_entities_groups("album", 0, $owner->guid, 10);
+ else
+ $area2 .= list_entities("object", "album", $owner->guid, 10);
set_context('photos');
$body = elgg_view_layout('two_column_left_sidebar', '', $area2);
diff --git a/newalbum.php b/newalbum.php
index 95cdb7860..44e0e07a7 100644
--- a/newalbum.php
+++ b/newalbum.php
@@ -16,6 +16,11 @@
set_page_owner($_SESSION['guid']);
}
+ if ($page_owner instanceof ElggGroup) {
+ add_submenu_item( sprintf(elgg_echo('album:group'),$page_owner->name),
+ $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username);
+ }
+
$area2 = elgg_view_title(elgg_echo('album:add'));
$area2 .= elgg_view("tidypics/forms/edit");
diff --git a/start.php b/start.php
index f9df12603..e2fbbe15e 100644
--- a/start.php
+++ b/start.php
@@ -53,9 +53,11 @@
$page_owner = page_owner_entity();
if ($page_owner instanceof ElggGroup) {
- if ($page_owner->photos_enable != "no") {
- add_submenu_item( sprintf(elgg_echo('album:group'),$page_owner->name),
- $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username);
+ if (get_context() == "groups") {
+ if ($page_owner->photos_enable != "no") {
+ add_submenu_item( sprintf(elgg_echo('album:group'),$page_owner->name),
+ $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username);
+ }
}
}
// context is only set to photos on individual pages, not on group pages
diff --git a/upload.php b/upload.php
index 48a8ea522..71beb8752 100644
--- a/upload.php
+++ b/upload.php
@@ -25,6 +25,10 @@
set_page_owner($container);
$page_owner = page_owner_entity();
+ if ($page_owner instanceof ElggGroup) {
+ add_submenu_item( sprintf(elgg_echo('album:group'),$page_owner->name),
+ $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username);
+ }
set_context('photos');
$title = elgg_echo('album:addpix') . ': ' . $album->title;
diff --git a/viewalbum.php b/viewalbum.php
index c216273cd..2a89742a1 100644
--- a/viewalbum.php
+++ b/viewalbum.php
@@ -23,6 +23,8 @@
// setup group menu
if ($owner instanceof ElggGroup) {
+ add_submenu_item( sprintf(elgg_echo('album:group'),$owner->name),
+ $CONFIG->wwwroot . "pg/photos/owned/" . $owner->username);
add_submenu_item( elgg_echo('album:create'),
$CONFIG->wwwroot . 'pg/photos/new/' . $owner->username,
'photos');
diff --git a/viewimage.php b/viewimage.php
index 6734fdffd..a303fbe3c 100644
--- a/viewimage.php
+++ b/viewimage.php
@@ -25,6 +25,12 @@
set_page_owner($owner_guid);
}
+ $page_owner = page_owner_entity();
+ if ($page_owner instanceof ElggGroup) {
+ add_submenu_item( sprintf(elgg_echo('album:group'),$page_owner->name),
+ $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username);
+ }
+
add_submenu_item( elgg_echo('image:edit'),
$CONFIG->wwwroot . 'pg/photos/edit/' . $photo_guid,
'photos');