From 4f5380ec889e89958dbab6cb45a2436743ae8c33 Mon Sep 17 00:00:00 2001
From: Cash Costello
Date: Sat, 6 Jun 2009 23:57:56 +0000
Subject: can now turn off group permissions override - menus are still
available though
---
actions/settings.php | 5 +++++
languages/en.php | 1 +
start.php | 3 ++-
views/default/tidypics/forms/admin.php | 5 +++++
4 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/actions/settings.php b/actions/settings.php
index 79839ceef..23fade8d9 100644
--- a/actions/settings.php
+++ b/actions/settings.php
@@ -36,6 +36,11 @@
else
set_plugin_setting('exif', 'disabled', 'tidypics');
+ if (is_array(get_input('grp_perm_override')))
+ set_plugin_setting('grp_perm_override', 'enabled', 'tidypics');
+ else
+ set_plugin_setting('grp_perm_override', 'disabled', 'tidypics');
+
// image sizes
$image_sizes = array();
diff --git a/languages/en.php b/languages/en.php
index 863fe554e..1b760e7a7 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -45,6 +45,7 @@
'tidypics:settings:download_link' => "Show download link",
'tidypics:settings:tagging' => "Enable photo tagging",
'tidypics:settings:exif' => "Show EXIF data",
+ 'tidypics:settings:grp_perm_override' => "Allow group members full access to group albums",
'tidypics:settings:maxfilesize' => "Maximum image size in megabytes (MB):",
'tidypics:settings:watermark' => "Enter text to appear in the watermark - ImageMagick must be selected for the image library",
'tidypics:settings:im_path' => "Enter the path to your ImageMagick commands",
diff --git a/start.php b/start.php
index 3a78700c6..2d4d40782 100644
--- a/start.php
+++ b/start.php
@@ -49,7 +49,8 @@
if (function_exists('add_group_tool_option'))
add_group_tool_option('photos',elgg_echo('tidypics:enablephotos'),true);
- register_plugin_hook('permissions_check', 'object', 'tidypics_permission_override');
+ if (get_plugin_setting('grp_perm_override', 'tidypics') != "disabled")
+ register_plugin_hook('permissions_check', 'object', 'tidypics_permission_override');
// Register for notifications
if (is_callable('register_notification_object')) {
diff --git a/views/default/tidypics/forms/admin.php b/views/default/tidypics/forms/admin.php
index af84def00..64e1ed3d1 100644
--- a/views/default/tidypics/forms/admin.php
+++ b/views/default/tidypics/forms/admin.php
@@ -96,6 +96,11 @@
$form_body .= 'height:
';
+ // Group permission override
+ $grp_perm_override = $plugin->grp_perm_override;
+ if(!$grp_perm_override) $grp_perm_override = "enabled";
+ $form_body .= '' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:grp_perm_override') => 'enabled'), 'internalname' => 'grp_perm_override', 'value' => $grp_perm_override )) . "
";
+
$form_body .= elgg_view('input/submit', array('value' => elgg_echo("save")));
echo elgg_view('input/form', array('action' => $action, 'body' => $form_body));
\ No newline at end of file
--
cgit v1.2.3