From d94bfb36201438a48cbe2c521e28e18232682a51 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 10 Jul 2011 12:57:56 +0000 Subject: admins can turn off flash uploader --- actions/admin/settings.php | 6 ++++++ languages/en.php | 1 + pages/upload.php | 7 ++++++- views/default/tidypics/forms/settings.php | 7 +++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/actions/admin/settings.php b/actions/admin/settings.php index 2c529d950..d3801f655 100644 --- a/actions/admin/settings.php +++ b/actions/admin/settings.php @@ -51,6 +51,12 @@ if (is_array(get_input('view_count'))) { set_plugin_setting('view_count', 'disabled', 'tidypics'); } +if (is_array(get_input('uploader'))) { + set_plugin_setting('uploader', 'enabled', 'tidypics'); +} else { + set_plugin_setting('uploader', 'disabled', 'tidypics'); +} + if (is_array(get_input('grp_perm_override'))) { set_plugin_setting('grp_perm_override', 'enabled', 'tidypics'); } else { diff --git a/languages/en.php b/languages/en.php index fce4b392a..d9c9a302b 100644 --- a/languages/en.php +++ b/languages/en.php @@ -71,6 +71,7 @@ $english = array( 'tidypics:settings:photo_ratings' => "Enable photo ratings (requires rate plugin of Miguel Montes or compatible)", 'tidypics:settings:exif' => "Show EXIF data", 'tidypics:settings:view_count' => "View counter", + 'tidypics:settings:uploader' => "Use Flash uploader", 'tidypics:settings:grp_perm_override' => "Allow group members full access to group albums", 'tidypics:settings:maxfilesize' => "Maximum image size in megabytes (MB):", 'tidypics:settings:quota' => "User/Group Quota (MB) - 0 equals no quota", diff --git a/pages/upload.php b/pages/upload.php index b6a828cf9..7ac4930b5 100644 --- a/pages/upload.php +++ b/pages/upload.php @@ -14,7 +14,12 @@ if (!$album_guid) { forward(); } -$uploader = get_input('uploader', 'ajax'); +if (get_plugin_setting('uploader', 'tidypics') != "disabled") { + $uploader = get_input('uploader', 'ajax'); +} else { + $uploader = 'basic'; +} + $album = get_entity($album_guid); diff --git a/views/default/tidypics/forms/settings.php b/views/default/tidypics/forms/settings.php index c8a1b4bd9..5eae9becc 100644 --- a/views/default/tidypics/forms/settings.php +++ b/views/default/tidypics/forms/settings.php @@ -48,6 +48,13 @@ if (!$view_count) { } $form_body .= '

' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:view_count') => 'enabled'), 'internalname' => 'view_count', 'value' => $view_count )) . "

"; +// Use flash uploader +$uploader = $plugin->uploader; +if (!$uploader) { + $uploader = "enabled"; +} +$form_body .= '

' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:uploader') => 'enabled'), 'internalname' => 'uploader', 'value' => $uploader )) . "

"; + // Watermark Text $form_body .= "

" . elgg_echo('tidypics:settings:watermark') . "
"; $form_body .= elgg_view("input/text",array('internalname' => 'params[watermark_text]', 'value' => $plugin->watermark_text)) . "

"; -- cgit v1.2.3