improvement: ability to hide setup warnings for upload. Warnings will
automatically come back at next user session. git-svn-id: http://piwigo.org/svn/branches/2.1@6628 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
64863a781f
commit
b23cc71576
2 changed files with 39 additions and 21 deletions
|
@ -487,11 +487,11 @@ $template->assign(
|
||||||
);
|
);
|
||||||
|
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | setup errors |
|
// | setup errors/warnings |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
|
|
||||||
|
// Errors
|
||||||
$setup_errors = array();
|
$setup_errors = array();
|
||||||
$setup_warnings = array();
|
|
||||||
|
|
||||||
$error_message = ready_for_upload_message();
|
$error_message = ready_for_upload_message();
|
||||||
if (!empty($error_message))
|
if (!empty($error_message))
|
||||||
|
@ -504,33 +504,50 @@ if (!function_exists('gd_info'))
|
||||||
array_push($setup_errors, l10n('GD library is missing'));
|
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(
|
$_SESSION['upload_hide_warnings'] = true;
|
||||||
$setup_warnings,
|
|
||||||
l10n('Exif extension not available, admin should disable exif use')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_ini_size('upload_max_filesize') > get_ini_size('post_max_size'))
|
if (!isset($_SESSION['upload_hide_warnings']))
|
||||||
{
|
{
|
||||||
array_push(
|
$setup_warnings = array();
|
||||||
$setup_warnings,
|
|
||||||
sprintf(
|
if ($conf['use_exif'] and !function_exists('read_exif_data'))
|
||||||
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),
|
array_push(
|
||||||
get_ini_size('post_max_size', false)
|
$setup_warnings,
|
||||||
|
l10n('Exif extension not available, admin should disable exif use')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
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_warnings' => $setup_warnings,
|
||||||
|
'hide_warnings_link' => PHOTOS_ADD_BASE_URL.'&upload_mode='.$upload_mode.'&hide_warnings=1'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign(
|
|
||||||
array(
|
|
||||||
'setup_errors'=> $setup_errors,
|
|
||||||
'setup_warnings' => $setup_warnings,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | sending html code |
|
// | sending html code |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
|
|
|
@ -250,6 +250,7 @@ var sizeLimit = {$upload_max_filesize};
|
||||||
<li>{$warning}</li>
|
<li>{$warning}</li>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</ul>
|
</ul>
|
||||||
|
<div class="hideButton" style="text-align:center"><a href="{$hide_warnings_link}">{'Hide'|@translate}</a></div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue