aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin/configuration.php9
-rw-r--r--admin/themes/default/template/configuration.tpl8
2 files changed, 12 insertions, 5 deletions
diff --git a/admin/configuration.php b/admin/configuration.php
index c89203d4f..0de99e40f 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -248,11 +248,18 @@ WHERE param = \''.$row['param'].'\'
//------------------------------------------------------ $conf reinitialization
load_conf_from_db();
}
-elseif (isset($_POST['restore_settings']))
+
+// restore default derivatives settings
+if ('sizes' == $page['section'] and isset($_GET['action']) and 'restore_settings' == $_GET['action'])
{
ImageStdParams::set_and_save( ImageStdParams::get_default_sizes() );
pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param = \'disabled_derivatives\'');
clear_derivative_cache();
+
+ array_push(
+ $page['infos'],
+ l10n('Your configuration settings are saved')
+ );
}
//----------------------------------------------------- template initialization
diff --git a/admin/themes/default/template/configuration.tpl b/admin/themes/default/template/configuration.tpl
index 94f9b4529..631423d3a 100644
--- a/admin/themes/default/template/configuration.tpl
+++ b/admin/themes/default/template/configuration.tpl
@@ -439,11 +439,14 @@ input[type="text"].dError {border-color:#ff7070; background-color:#FFe5e5;}
{/foreach}
</table>
-<p style="margin:20px 0 0 0;{if isset($ferrors)} display:block;{/if}" class="sizeDetails">
+<p style="margin:10px 0 0 0;{if isset($ferrors)} display:block;{/if}" class="sizeDetails">
{'Image Quality'|@translate}
<input type="text" name="resize_quality" value="{$resize_quality}" size="3" maxlength="3"{if isset($ferrors.resize_quality)} class="dError"{/if}> %
{if isset($ferrors.resize_quality)}<span class="dErrorDesc" title="{$ferrors.resize_quality}">!</span>{/if}
</p>
+<p style="margin:10px 0 0 0;{if isset($ferrors)} display:block;{/if}" class="sizeDetails">
+ <a href="{$F_ACTION}&action=restore_settings" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');">{'Reset to default values'|@translate}</a>
+</p>
</fieldset>
{/if}
@@ -642,9 +645,6 @@ input[type="text"].dError {border-color:#ff7070; background-color:#FFe5e5;}
{if !isset($default)}
<p class="formButtons">
<input type="submit" name="submit" value="{'Save Settings'|@translate}">
-{if isset($sizes)}
- <input type="submit" name="restore_settings" value="{'Restore'|@translate}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');">
-{/if}
</p>
</form>
{/if}