Skip to content

Commit

Permalink
feature 2606: (multiple size config screen redesign) turn the "restor…
Browse files Browse the repository at this point in the history
…e" button

in a "reset to default values" link in the "Multiple size" fieldset.


git-svn-id: http://piwigo.org/svn/trunk@14251 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
plegall committed Apr 21, 2012
1 parent a2ea98d commit d3c6983
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 8 additions & 1 deletion admin/configuration.php
Expand Up @@ -248,11 +248,18 @@
//------------------------------------------------------ $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
Expand Down
8 changes: 4 additions & 4 deletions admin/themes/default/template/configuration.tpl
Expand Up @@ -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}

Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit d3c6983

Please sign in to comment.