forked from jayallen/melody
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#196 state:resolved] Added support for a new callback allowing devel…
…opers to modify the template context of plugin config forms. [#190 state:resolved] Added support for a new dialog developers can spawn which will contain a plugin's settings. [#189 state:resolved] Added blog_id variable to the template context for all plugin config forms. DOCUMENTATION: To spawn a dialog: <a href="javascript:void(0)" onclick="openDialog(null,'plugin_config_dialog','<query string>');return false;"> Link Text </a> The querystring should contain: * plugin => the plugin's ID * blog_id => for setting the scope of the settings
- Loading branch information
1 parent
c43db35
commit 65ffac6
Showing
3 changed files
with
157 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<mt:setvarblock name="page_title"><__trans phrase="Settings for [_1]" params="<$mt:var name="plugin_name"$>"></mt:setvarblock> | ||
|
||
<mt:setvarblock name="html_head" append="1"> | ||
|
||
<mt:if name="finish"> | ||
<script type="text/javascript"> | ||
<!-- | ||
function init() { | ||
closeDialog(); | ||
var w = window; | ||
while (w.parent && (w.parent != w)) w = w.parent; | ||
if (w.onUploadDialogClose) { | ||
w.onUploadDialogClose(); | ||
} | ||
} | ||
TC.attachLoadEvent( init ); | ||
//--> | ||
</script> | ||
</mt:if> | ||
</mt:setvarblock> | ||
|
||
<mt:include name="dialog/header.tmpl"> | ||
|
||
<mt:if name="error"> | ||
<mtapp:statusmsg | ||
id="error" | ||
class="error"> | ||
<mt:var name="error"> | ||
</mtapp:statusmsg> | ||
</mt:if> | ||
|
||
<form method="post" action="<$mt:var name="script_url"$>" | ||
id="plugin-<$mt:var name="plugin_id" dirify="1"$>-form"> | ||
<input type="hidden" name="__mode" value="save_plugin_config" /> | ||
<mt:if name="blog_id"> | ||
<input type="hidden" name="blog_id" value="<$mt:var name="blog_id"$>" /> | ||
</mt:if> | ||
<input type="hidden" name="return_args" value="<$mt:var name="return_args" escape="html"$>" /> | ||
<input type="hidden" name="plugin_sig" value="<$mt:var name="plugin_sig" escape="html"$>" /> | ||
<input type="hidden" name="magic_token" value="<$mt:var name="magic_token"$>" /> | ||
<input type="hidden" name="dialog" value="1" /> | ||
<fieldset> | ||
<$mt:var name="config_html"$> | ||
</fieldset> | ||
<div class="actions-bar settings-actions-bar"> | ||
<div class="actions-bar-inner pkg actions"> | ||
<button | ||
mt:mode="save_plugin_config" | ||
type="submit" | ||
class="primary-button" | ||
><__trans phrase="Save Changes"></button> | ||
<mt:if name="plugin_settings_id"> | ||
<button | ||
onclick="resetPlugin(getByID('plugin-<mt:var name="plugin_id">-form')); return false" | ||
type="submit" | ||
><__trans phrase="Reset to Defaults"></button> | ||
</mt:if> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
<mt:include name="dialog/footer.tmpl"> |