Sergiu Dumitriu wrote:
On 02/25/2010 03:44 AM, cjdelisle (SVN) wrote:
Author: cjdelisle
Date: 2010-02-25 03:44:04 +0100 (Thu, 25 Feb 2010)
New Revision: 27275
Modified:
platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/Configurable.xml
Log:
XAADMINISTRATION-112: Allow applications to bring configuration forms into the
administration app without modifying it - Fixed save buttons so they use ajax save and
continue if available
Modified:
platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/Configurable.xml
===================================================================
---
platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/Configurable.xml 2010-02-24
18:50:50 UTC (rev 27274)
+++
platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/Configurable.xml 2010-02-25
02:44:04 UTC (rev 27275)
@@ -388,12 +388,11 @@
<p class="admin-buttons">
<span class="buttonwrapper">
## Ajax form submission Javascript.
We don't allow onclick to be used.
Guess I'm going to have to fix the lightbox buttons on the
registration page. It's tough copy-pasting something from another
page when I can't tell if it's deprecated.
[user@fc9p4 applications]$ find ./ -name '*.xml' -exec grep -n
'onclick=' {} \; -print | sed -n -e 's/\(^\.\/.*$\)/\1/p'
/photoalbum/src/main/resources/Photos/WebHome.xml
/panels/src/main/resources/Panels/SyntaxHelp.xml
/panels/src/main/resources/Panels/EditModes.xml
/administration/src/main/resources/XWiki/Registration.xml
/administration/src/main/resources/XWiki/XWikiPreferences.xml
/administration/src/main/resources/XWiki/XWikiGroupSheet.xml
/administration/src/main/resources/XWiki/AdminInlineSheet.xml
/workstream/src/main/resources/Workstream/Javascript.xml
/workstream/src/main/resources/Workstream/WebHome.xml
/workstream/src/main/resources/Workstream/Panel.xml
/scheduler/src/main/resources/Scheduler/WebHome.xml
/wiki-manager/src/main/resources/WikiManager/CreateNewWiki.xml
and
[user@fc9p4 templates]$ find ./ -name '*.vm' -exec grep -n
'onclick=' {} \; -print | sed -n -e 's/\(^\.\/.*$\)/\1/p'
/importinline.vm
/chw/datapage.vm
/chw/typepage.vm
/chw/tdwwizard.vm
/chw/tdwnavigationimages.vm
/chw/colorpicker.vm
/chw/navigationimages.vm
/chw/titlepage.vm
/recentdocwysiwyg.vm
/edituser.vm
/uploadattachwysiwyg.vm
/chwmain.vm
/searchwysiwyg.vm
/stylesheetlinks.vm
/editgroup.vm
/addnewgroup.vm
/editmodes.vm
/attachmentsinline.vm
/objects.vm
/historyinline.vm
/tagedit.vm
/macros.vm
/rights.vm
/rightsUI.vm
/browsewysiwyg.vm
/recyclebinlist.vm
/viewheader.vm
/attachwysiwyg.vm
/status.vm
/comments2.vm
/listattachwysiwyg.vm
/registeruser.vm
- #set($onclick =
"document.forms.update.action='" + $xwiki.getURL($app.getFullName(),
'saveandcontinue') + "'; "
- + "if (document.forms.update.onsubmit)
document.forms.update.onsubmit();"
- + "if (checkDocumentContent())
document.forms.update.submit(); return false;")
+ #set($onclick = "(" + $xwiki.getURL($app.getFullName(),
'saveandcontinue') + "'; return false;")
## Text to display on the button
#set($buttonText = "$msg.get('admin.save')
$escapedAppName")
-<input class="button" type="submit"
name="formactionsac" value="$buttonText" onclick="$onclick"
/>
+ $xwiki.jsfx.use('js/xwiki/actionbuttons/actionButtons.js',
true)
+<input class="button" type="submit"
name="action_saveandcontinue" value="$buttonText"
onclick="$onclick" />
</span>
</p>
</div> ## bottombuttons
@@ -406,9 +405,18 @@
#end## If app author has permission to edit admin page
#end## If the current user has permission to edit the configurable application.
#end## Foreach document name in names to configure
+ {{html clean=false wiki=false}}
+<script type="text/javascript">
+ /*<![CDATA[ */
+ ## Alt+Shift+S presses the first saveAndContinue button it finds, not what we want so
we will disable edit shortcuts.
+ XWiki.actionButtons.EditActions = Object.extend(XWiki.actionButtons.EditActions,
{addShortcuts : function() { }});
##
## TODO: cancel and "submit all" buttons.
+ //]]>
+</script>
+ {{/html}}
##
+ ##
#else
##
##------------------------------------------------------------------------------------------------------------