diff options
author | Cash Costello <cash.costello@gmail.com> | 2009-03-28 14:46:35 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2009-03-28 14:46:35 +0000 |
commit | 91b909acb2708e256f4a653dc0b11cd796d00a62 (patch) | |
tree | e778bfc6199f9f00df633d31ea45dfecbe705f84 | |
parent | bdf0d61336b878f2e26fc42f98327834423fb409 (diff) | |
download | elgg-91b909acb2708e256f4a653dc0b11cd796d00a62.tar.gz elgg-91b909acb2708e256f4a653dc0b11cd796d00a62.tar.bz2 |
not displaying edit menus for those without group membership
-rw-r--r-- | index.php | 9 | ||||
-rw-r--r-- | viewalbum.php | 30 | ||||
-rw-r--r-- | viewimage.php | 16 |
3 files changed, 28 insertions, 27 deletions
@@ -10,13 +10,6 @@ //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)) {
@@ -31,9 +24,11 @@ if ($owner instanceof ElggGroup) {
add_submenu_item( sprintf(elgg_echo('album:group'),$owner->name),
$CONFIG->wwwroot . "pg/photos/owned/" . $owner->username);
+ if (can_write_to_container(0, $owner->guid)) {
add_submenu_item( elgg_echo('album:create'),
$CONFIG->wwwroot . 'pg/photos/new/' . $owner->username,
'tidypics');
+ }
}
//set the title
diff --git a/viewalbum.php b/viewalbum.php index 2a89742a1..4bdd1a2c7 100644 --- a/viewalbum.php +++ b/viewalbum.php @@ -25,21 +25,25 @@ 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');
}
- add_submenu_item( elgg_echo('album:addpix'),
- $CONFIG->wwwroot . 'pg/photos/upload/' . $album_guid,
- 'photos');
- add_submenu_item( elgg_echo('album:edit'),
- $CONFIG->wwwroot . 'pg/photos/edit/' . $album_guid,
- 'photos');
- add_submenu_item( elgg_echo('album:delete'),
- $CONFIG->wwwroot . 'pg/photos/delete/' . $album_guid,
- 'photos',
- true);
+ if (can_write_to_container(0, $album->container_guid)) {
+ if ($owner instanceof ElggGroup) {
+ add_submenu_item( elgg_echo('album:create'),
+ $CONFIG->wwwroot . 'pg/photos/new/' . $owner->username,
+ 'photos');
+ }
+ add_submenu_item( elgg_echo('album:addpix'),
+ $CONFIG->wwwroot . 'pg/photos/upload/' . $album_guid,
+ 'photos');
+ add_submenu_item( elgg_echo('album:edit'),
+ $CONFIG->wwwroot . 'pg/photos/edit/' . $album_guid,
+ 'photos');
+ add_submenu_item( elgg_echo('album:delete'),
+ $CONFIG->wwwroot . 'pg/photos/delete/' . $album_guid,
+ 'photos',
+ true);
+ }
// set title and body
$title = $album->title;
diff --git a/viewimage.php b/viewimage.php index a303fbe3c..fa05bda00 100644 --- a/viewimage.php +++ b/viewimage.php @@ -31,13 +31,15 @@ $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username);
}
- add_submenu_item( elgg_echo('image:edit'),
- $CONFIG->wwwroot . 'pg/photos/edit/' . $photo_guid,
- 'photos');
- add_submenu_item( elgg_echo('image:delete'),
- $CONFIG->wwwroot . 'pg/photos/delete/' . $photo_guid,
- 'photos',
- true);
+ if (can_write_to_container(0, $album->container_guid)) {
+ add_submenu_item( elgg_echo('image:edit'),
+ $CONFIG->wwwroot . 'pg/photos/edit/' . $photo_guid,
+ 'photos');
+ add_submenu_item( elgg_echo('image:delete'),
+ $CONFIG->wwwroot . 'pg/photos/delete/' . $photo_guid,
+ 'photos',
+ true);
+ }
$title = $photo->title;
$area2 = elgg_view_title($title);
|