aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2010-06-29 20:18:10 +0000
committerplegall <plg@piwigo.org>2010-06-29 20:18:10 +0000
commitfbe9b7122d279214592beebb42195e58a6222e83 (patch)
tree02d1bcaf65583c9e6bca8ad84762bb3861cb0487 /admin
parenteb72d60641c11275d5b71e0383964bf1aeb9ef71 (diff)
merge r6628 from branch 2.1 to trunk
improvement: ability to hide setup warnings for upload. Warnings will automatically come back at next user session. git-svn-id: http://piwigo.org/svn/trunk@6629 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin')
-rw-r--r--admin/photos_add_direct.php59
-rw-r--r--admin/themes/default/template/photos_add_direct.tpl1
2 files changed, 39 insertions, 21 deletions
diff --git a/admin/photos_add_direct.php b/admin/photos_add_direct.php
index 1026abd17..d12d8971d 100644
--- a/admin/photos_add_direct.php
+++ b/admin/photos_add_direct.php
@@ -487,11 +487,11 @@ $template->assign(
);
// +-----------------------------------------------------------------------+
-// | setup errors |
+// | setup errors/warnings |
// +-----------------------------------------------------------------------+
+// Errors
$setup_errors = array();
-$setup_warnings = array();
$error_message = ready_for_upload_message();
if (!empty($error_message))
@@ -504,32 +504,49 @@ if (!function_exists('gd_info'))
array_push($setup_errors, l10n('GD library is missing'));
}
-if ($conf['use_exif'] and !function_exists('read_exif_data'))
+$template->assign(
+ array(
+ 'setup_errors'=> $setup_errors,
+ )
+ );
+
+// Warnings
+if (isset($_GET['hide_warnings']))
{
- array_push(
- $setup_warnings,
- l10n('Exif extension not available, admin should disable exif use')
- );
+ $_SESSION['upload_hide_warnings'] = true;
}
-if (get_ini_size('upload_max_filesize') > get_ini_size('post_max_size'))
+if (!isset($_SESSION['upload_hide_warnings']))
{
- array_push(
- $setup_warnings,
- sprintf(
- l10n('In your php.ini file, the upload_max_filesize (%sB) is bigger than post_max_size (%sB), you should change this setting'),
- get_ini_size('upload_max_filesize', false),
- get_ini_size('post_max_size', false)
- )
- );
-}
+ $setup_warnings = array();
+
+ if ($conf['use_exif'] and !function_exists('read_exif_data'))
+ {
+ array_push(
+ $setup_warnings,
+ l10n('Exif extension not available, admin should disable exif use')
+ );
+ }
-$template->assign(
+ if (get_ini_size('upload_max_filesize') > get_ini_size('post_max_size'))
+ {
+ array_push(
+ $setup_warnings,
+ sprintf(
+ l10n('In your php.ini file, the upload_max_filesize (%sB) is bigger than post_max_size (%sB), you should change this setting'),
+ get_ini_size('upload_max_filesize', false),
+ get_ini_size('post_max_size', false)
+ )
+ );
+ }
+
+ $template->assign(
array(
- 'setup_errors'=> $setup_errors,
'setup_warnings' => $setup_warnings,
- )
- );
+ 'hide_warnings_link' => PHOTOS_ADD_BASE_URL.'&amp;upload_mode='.$upload_mode.'&amp;hide_warnings=1'
+ )
+ );
+}
// +-----------------------------------------------------------------------+
// | sending html code |
diff --git a/admin/themes/default/template/photos_add_direct.tpl b/admin/themes/default/template/photos_add_direct.tpl
index 91d191ecb..b1c9e1b7b 100644
--- a/admin/themes/default/template/photos_add_direct.tpl
+++ b/admin/themes/default/template/photos_add_direct.tpl
@@ -250,6 +250,7 @@ var sizeLimit = {$upload_max_filesize};
<li>{$warning}</li>
{/foreach}
</ul>
+ <div class="hideButton" style="text-align:center"><a href="{$hide_warnings_link}">{'Hide'|@translate}</a></div>
</div>
{/if}