Expose UI for renaming admin settings

This commit is contained in:
2011-08-29 19:20:28 +01:00
parent 5d851dd977
commit 196f80bbf5
5 changed files with 134 additions and 2 deletions

View File

@@ -0,0 +1,44 @@
{if $confirm}
{if $success}
"actions": {
"rename_setting_confirm": {
"old_name": {$old_name|json_encode},
"old_id": {$old_id|json_encode},
"name": {$name|json_encode},
{include file="fragments/admin-setting-row.tpl" assign="content"}
"content": {$content|json_encode}
}
},
{/if}
"success": {$success|json_encode}
{else}
"page_replacements": {
"dialogheadertitle": {
"content": "Rename Setting"
},
"dialogcontent": {
{include file="fragments/rename-setting-dialog.tpl" assign="content"}
"content": {$content|json_encode}
}
},
"dialog": {
"show": true,
"buttons": {
"type": "okcancel",
"actions": {
"ok": [
"rename_setting",
"close-dialog"
],
"cancel": "close-dialog"
},
"params": {
"name": {$name|json_encode},
"new_name_field": "settings_rename_name"
}
}
}
{/if}

View File

@@ -2,6 +2,7 @@
<td>
<p>
{$name}<br />
<input type="button" id="setting_{$id}_rename" value="Rename" onclick="rc.settings.rename_setting('{$id}', '{$name}');" />
<input type="button" id="setting_{$id}_remove" value="Remove" onclick="rc.settings.remove_setting('{$id}', '{$name}');" />
</p>
</td>

View File

@@ -0,0 +1,6 @@
<div>
<p>
Enter a new name for setting '{$name|escape}' below.
</p>
<input type="text" id="settings_rename_name" value="" />
</div>