You are here: Foswiki>Tasks Web>Item12883 (03 May 2014, DavidAllen)Edit Attach

Item12883: Would like inclusion point for additional form content in EditChapterPlugin dialog.

pencil
Priority: Enhancement
Current State: New
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: EditChapterPlugin
Branches:
Reported By: DavidAllen
Waiting For:
Last Change By: DavidAllen
Two features are missing in the edit chapter dialog that are critical to users of my site, "Summary of changes" from RevCommentPlugin and "Force new revision".

I was unable to override the behavior of edit.chapter.tmpl with my own edit.myskin.tmpl which has forced me to change edit.chapter.tmpl directly to include these form inputs. I am now worried that my changes will be lost with new versions of EditChapterPlugin. Perhaps there is a better way to do this that I have not recognized.

If an inclusion point were added to the end of the form in edit.chapter.tmpl then I would be able to specify my site specific content in edit.myskin.tmpl with little worry about plugin upgrades.

For example, edit.chapter.tmpl could be changed to include a reference to "editchapterforminclude":
%TMPL:DEF{"dialog"}%<div class="jqUIDialog {%TMPL:P{"dialog::params"}%}" title="%MAKETEXT{"Edit chapter '[_1]'" args="%URLPARAM{"title" default="%URLPARAM{"from"}%"}%"}%">
  <form name="EditForm" action="%SCRIPTURLPATH{"save"}%" method="post" class="ecpForm">
  <input type="hidden" name="topic" value="%WEB%.%TOPIC%" />
  <input type="hidden" name="t" value="%GMTIME{"$epoch"}%" />
  <input type="hidden" name="redirectto" value="%SCRIPTURL{"view"}%/%WEB%/%TOPIC%#%URLPARAM{"id"}%" />
  <textarea name="beforetext" style="display:none" >%EXTRACTCHAPTER{before="%URLPARAM{"from" default="0"}%" encode="on"}%</textarea>
  <textarea name="chapter" class="foswikiTextarea natedit" rows="%EDITBOXHEIGHT%" cols="%EDITBOXWIDTH%" wrap="virtual">%EXTRACTCHAPTER{from="%URLPARAM{"from" default="0"}%" to="%URLPARAM{"to"}%" encode="on"}%</textarea>
  <textarea name="aftertext" style="display:none">%EXTRACTCHAPTER{after="%URLPARAM{"to"}%" encode="on"}%</textarea>
  <textarea name="text" style="display:none" >%EXTRACTCHAPTER{encode="on"}%</textarea>
  <input type="hidden" name="from" value="%URLPARAM{"from" default="0"}%" />
  <input type="hidden" name="to" value="%URLPARAM{"to"}%" />
  %{ include optional form content }%
  %TMPL:P{"editchapterforminclude"}%
  </form>
  <a class="jqUIDialogButton jqUIDialogSubmit {icon:'ui-icon-disk'}">%MAKETEXT{"OK"}%</a>
  <a class="jqUIDialogButton jqUIDialogClose {icon:'ui-icon-cancel'}">%MAKETEXT{"Cancel"}%</a>
  <a class="jqUIDialogButton {icon:'ui-icon-pencil'}" href="%SCRIPTURL{"edit"}%/%WEB%/%TOPIC%?t=%GMTIME{"$epoch"}%">%MAKETEXT{"Edit all"}%</a>
</div>%TMPL:END%

Then in edit.myskin.tmpl, I could add my site specific content:
%TMPL:DEF{"editchapterforminclude"}%
   %{ add revision comment input }%
   %IF{ "context RevCommentPluginEnabled" then="&nbsp;<div class='revComment'><label for='comment'>Summary of changes</label> <input class='foswikiInputField' type='text' style='width:50%' name='comment' id='comment' />"</div>" else=""}%
   %{ add force new rev checkbox }%
  <div class="patternSaveOptionsContents"><input type="checkbox" class="foswikiCheckbox" title="Creates a new topic revision when saving" id="forcenewrevision" name="forcenewrevision" %FORCENEWREVISIONCHECKBOX% /><label for="forcenewrevision">%MAKETEXT{"Force new revision"}%</label></div>
%TMPL:END%

-- DavidAllen - 03 May 2014

 

ItemTemplate edit

Summary Would like inclusion point for additional form content in EditChapterPlugin dialog.
ReportedBy DavidAllen
Codebase 1.1.9
SVN Range
AppliesTo Extension
Component EditChapterPlugin
Priority Enhancement
CurrentState New
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
Release01x01Checkins
Topic revision: r1 - 03 May 2014, DavidAllen - This page was cached on 04 Jun 2020 - 03:56.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy