You are here: Foswiki>Tasks Web>Item12883 (29 Apr 2022, MichaelDaum)Edit Attach

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

pencil
Priority: Enhancement
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: EditChapterPlugin
Branches: master
Reported By: DavidAllen
Waiting For:
Last Change By: MichaelDaum
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

Added native support for "force new revision" as well as RevCommentPlugin in version 6.0

-- MichaelDaum - 29 Apr 2022
 
Topic revision: r2 - 29 Apr 2022, MichaelDaum
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