aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/settings.php27
-rw-r--r--languages/en.php20
-rw-r--r--views/default/tidypics/forms/admin.php10
3 files changed, 33 insertions, 24 deletions
diff --git a/actions/settings.php b/actions/settings.php
index 427ca2520..c0f53c71d 100644
--- a/actions/settings.php
+++ b/actions/settings.php
@@ -8,19 +8,28 @@
gatekeeper();
action_gatekeeper();
-
- $params = get_input('params');
+
+ // Params array (text boxes and drop downs)
+ $params = get_input('params');
+ $result = false;
foreach ($params as $k => $v) {
-
- error_log("$k : $v");
-
+ if (!set_plugin_setting($k, $v, 'tidypics')) {
+ register_error(sprintf(elgg_echo('plugins:settings:save:fail'), 'tidypics'));
+ forward($_SERVER['HTTP_REFERER']);
+ }
}
+
+ // check boxes
+ if (is_array(get_input('download_link'))) // this can be done due to way Elgg uses checkboxes
+ set_plugin_setting('download_link', 'enabled', 'tidypics');
+ else
+ set_plugin_setting('download_link', 'disabled', 'tidypics');
- if (get_input('download_link') == true)
- error_log('download link is on');
- if (get_input('tagging') == true)
- error_log('tagging is on');
+ if (is_array(get_input('tagging')))
+ set_plugin_setting('tagging', 'enabled', 'tidypics');
+ else
+ set_plugin_setting('tagging', 'disabled', 'tidypics');
system_message(elgg_echo('tidypics:settings:save:ok'));
diff --git a/languages/en.php b/languages/en.php
index ffa13b3a2..8ee72b815 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -19,15 +19,6 @@
'album:group' => "Group albums",
'item:object:image' => "Photos",
'item:object:album' => "Albums",
- 'tidypics:adminsettings' => 'Tidypics Settings',
- 'tidypics:admin:instructions' => 'These are the core Tidypics settings. Change them for your setup and then click save.',
- 'tidypics:settings:image_lib' => "Image Library: ",
- 'tidypics:settings:download_link' => "Show download link",
- 'tidypics:settings:tagging' => "Enable photo tagging",
- 'tidypics:settings:maxfilesize' => "Maximum file 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",
- 'tidypics:settings:river_view' => "Show entries in river for each batch of uploaded images",
'tidypics:enablephotos' => 'Enable Group Photo Albums',
'tidypics:editprops' => 'Edit Image Properties',
'tidypics:mostviewed' => 'Most viewed images',
@@ -40,7 +31,15 @@
'tidypics:highestrated' => "Highest Rated Images",
//settings
- 'tidypics:image_lib' => "Image Library",
+ 'tidypics:adminsettings' => 'Tidypics Settings',
+ 'tidypics:admin:instructions' => 'These are the core Tidypics settings. Change them for your setup and then click save.',
+ 'tidypics:settings:image_lib' => "Image Library: ",
+ 'tidypics:settings:download_link' => "Show download link",
+ 'tidypics:settings:tagging' => "Enable photo tagging",
+ 'tidypics:settings:maxfilesize' => "Maximum file 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",
+ 'tidypics:settings:river_view' => "Show entries in river for each batch of uploaded images",
//actions
@@ -121,6 +120,7 @@
'album:delete:confirm' => "Are you sure you want to delete this album?",
'album:created' => "Your new album has been created.",
'tidypics:status:processing' => "Please wait while we process your picture....",
+ 'tidypics:settings:save:ok' => 'Successfully saved the Tidypics plugin settings',
//Error messages
diff --git a/views/default/tidypics/forms/admin.php b/views/default/tidypics/forms/admin.php
index 69089c877..de7062bba 100644
--- a/views/default/tidypics/forms/admin.php
+++ b/views/default/tidypics/forms/admin.php
@@ -17,7 +17,7 @@
// Image Library
$image_lib = $plugin->image_lib;
if (!$image_lib) $image_lib = 'GD';
- $form_body = 'Not functional!!!!!!! <p>' . elgg_echo('tidypics:settings:image_lib');
+ $form_body = '<p>' . elgg_echo('tidypics:settings:image_lib');
$form_body .= elgg_view('input/pulldown', array(
'internalname' => 'params[image_lib]',
'options_values' => array(
@@ -36,14 +36,14 @@
$form_body .= elgg_view("input/text",array('internalname' => 'params[im_path]', 'value' => $im_path)) . "</p>";
// Tagging
- $tagging = $tagging;
+ $tagging = $plugin->tagging;
if(!$tagging) $tagging = "enabled";
- $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:tagging') => true), 'internalname' => 'tagging', 'value' => ($tagging=='enabled' ? true : false) )) . "</p>";
+ $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:tagging') => 'enabled'), 'internalname' => 'tagging', 'value' => $tagging )) . "</p>";
// Download Link
- $download_link = $download_link;
+ $download_link = $plugin->download_link;
if(!$download_link) $download_link = "enabled";
- $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:download_link') => true), 'internalname' => 'download_link', 'value' => ($download_link=='enabled' ? true : false) )) . "</p>";
+ $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:download_link') => 'enabled'), 'internalname' => 'download_link', 'value' => $download_link )) . "</p>";
// Watermark Text
$form_body .= "<p>" . elgg_echo('tidypics:settings:watermark') . "<br />";