This function renders a topic creator form that holds a set of initial input elements to create a topic.
<fieldName1>=<value1>;<fieldName2>=<value2>;...
INCLUDINGWEB.INCLUDINGTOPIC
BASETOPIC
save
or edit
, defaults is specified in referring TopicType
on
BASEWEB
%STARTINCLUDE%%IF{"'%BASEWEB%.%BASETOPIC%' allows 'CREATE' and not (context static)" then="$percntINCLUDE{\"Applications.RenderSimpleTopicCreator\" section=\"%IF{"'%ENABLETWISTY{default="on"}%'='on'" then="twisty" else="form"}%\" TEXT=\"%TEXT{default="%TRANSLATE{"Create a new [_1]" args="%INCLUDINGTOPIC%"}%"}%\" LABEL=\"%LABEL{default="%TRANSLATE{"Title"}%"}%\" BUTTONTEXT=\"%BUTTONTEXT{default="%TRANSLATE{"New"}%"}%\" VALUE=\"%VALUE{default=""}%\" VALUES=\"%VALUES{default=""}%\" FORM=\"%FORM{default="%INCLUDINGWEB%.%INCLUDINGTOPIC%"}%\" _TEMPLATE=\"%TEMPLATE%\" TYPE=\"%TYPE{ default="%RENDERFORMDEF{ form="%FORM{default="%INCLUDINGWEB%.%INCLUDINGTOPIC%"}%" fields="TopicType" format="$value" }%" }%\" PARENT=\"%PARENT{default="%BASETOPIC%"}%\" WHITEBOARD=\"%WHITEBOARD{default="on"}%\" EXTRA=\"%EXTRA{default="<!-- -->"}%\" SCRIPT=\"%SCRIPT{default="%FORMFIELD{"CreateAction" topic="%INCLUDINGWEB%.%INCLUDINGTOPIC%" default="edit" alttext="edit"}%"}%\" EDITOR=\"%EDITOR{default="%FORMFIELD{"Editor" topic="%FORM{default="%INCLUDINGWEB%.%INCLUDINGTOPIC%"}%"}%"}%\" SHOWBUTTONS=\"%SHOWBUTTONS{default="on"}%\" }$percnt" }%%STOPINCLUDE%
%STARTSECTION{"twisty"}%%TWISTY{ link="%BUTTON{ "%BUTTONTEXT%" icon="fa-plus" }%%CLEAR%" mode="div" }% %STARTSECTION{"form"}%<form class='createTopicForm jqValidate' action="%SCRIPTURLPATH{"%SCRIPT%"}%/%THEWEB{default="%BASEWEB%"}%/" method="post"> <div class='foswikiFormSteps'> <input type="hidden" name="web" value="%THEWEB{default="%BASEWEB%"}%" /> <input type="hidden" name="onlynewtopic" value="on" /> <input type="hidden" name="action" value="%IF{"$WHITEBOARD='off'" then="form"}%" /> <input type="hidden" name="onlywikiname" value="off" /> <input type="hidden" name="topicparent" value="%PARENT%" /> <input type="hidden" name="templatetopic" value="%TEMPLATE{default="%FORMFIELD{"Template" topic="%FORM%"}%"}%" /> <input type="hidden" name="formtemplate" value="%FORM%" /> <input type="hidden" name="template" value="%EDITOR%" /> %DBCALL{"%WEB%.%TOPIC%" section="topicnaming" mode="%FORMFIELD{"TopicNamingMode" topic="%FORM%"}%" form="%FORM%" value="%VALUE%" }%<!-- --> %EXTRA% %RENDERFOREDIT{ form="%FORM%" topic="%TEMPLATE{default=""}%" web="%THEWEB{default="%BASEWEB%"}%" fields="%FORMATLIST{"%VALUES%" split=";" pattern="(.*)=(.*)" format="$1" separator="," }%, no such thing" exclude="^(TopicType%RENDERFORDISPLAY{ form="%FORM%" topic="%TEMPLATE{default=""}%" includeattr="\bc\b" format="$name" header="|" separator="|" }%)$" format="<input type='hidden' value='$value' name='$name' />$n" %FORMATLIST{"%VALUES%" separator=" " split=";" pattern="(.*)=(.*)" format="$1_value=\"$2\"" }% }%%IF{"$'TEXT'!=''" then="<h2 >%TEXT%</h2>" }%<!-- --> %RENDERFOREDIT{ form="%FORM%" topic="%TEMPLATE{default=""}%" web="%THEWEB{default="%BASEWEB%"}%" fields="TopicTitle" excludeattr="\bH\b" format="<div class='foswikiFormStep'><h3>$title:$mandatory</h3>$edit<div class='foswikiFormDescription'>$description</div></div>" TopicTitle_value="%VALUE{default=""}%" TopicTitle_title="%LABEL%" }% %RENDERFOREDIT{ form="%FORM%" topic="%TEMPLATE{default=""}%" web="%THEWEB{default="%BASEWEB%"}%" exclude="^(TopicType|TopicTitle)$" includeattr="\bc\b" Summary_value="" format="<div class='foswikiFormStep'><h3>$title:$mandatory</h3>$edit<div class='foswikiFormDescription'>$description</div></div>" %FORMATLIST{"%VALUES%" separator=" " split=";" pattern="(.*)=(.*)" format="$1_value=\"$2\"" }% }% %RENDERFOREDIT{ form="%FORM%" topic="%TEMPLATE{default=""}%" web="%THEWEB{default="%BASEWEB%"}%" fields="TopicType,WikiApplication,Summary" excludeattr="\bc\b" WikiApplication_value="%EXTRACT{text="%BASEWEB%" pattern="^(?:.*[\./])?([^\./]+)$" format="$1"}%" TopicType_value="%TYPE%" Summary_value="" header="" footer="" format="<input type='hidden' name='$name' value='$value' />" separator="$n" }% %IF{"'%SHOWBUTTONS%'='on'" then="<div class='foswikiFormStep foswikiFormButtons clearfix'> $percntBUTTON{\"$percntTRANSLATE{\"Submit\"}$percnt\" type=\"submit\" icon=\"fa-check\"}$percnt </div>" }%</div> </form>%JQREQUIRE{"wikiword"}%%ADDTOZONE{"head" id="RENDERSIMPLETOPICCREATOR" text="<style>.jqTagSuggestions {display:none !important}</style>" }%%ENDSECTION{"form"}% %ENDTWISTY%%ENDSECTION{"twisty"}%
%STARTSECTION{"topicnaming"}%%IF{"'%mode%'=~'^(default)?$'" then="<input type='hidden' name='topic' class='jqWikiWord' data-source='input[name=TopicTitle]' data-transliterate='true' value='%value%' />$n" }%%IF{"'%mode%'='template'" then="<input type='hidden' name='topic' value='%FORMFIELD{"TopicNameTemplate" topic="%form%"}%' />$n" }%%IF{"'%mode%'='derived'" then="<input type='hidden' name='topic' class='jqWikiWord' value='%value%' $percntDBQUERY{ topic=\"%form%\" format=\"data-source='$formfield(TopicNameSource)' \ data-prefix='$formfield(TopicNamePrefix)' \ data-suffix='$formfield(TopicNameSuffix)' \ data-transliterate='$formfield(TopicNameTransliterate)'\" }$percnt/>" }%%IF{"'%mode%'='uuid'" then="<input type='hidden' name='topic' class='jqUUID' value='' />$percntDBCALL{\"%WEB%.%TOPIC%\" section=\"uuid\"}$percnt" }%%ENDSECTION{"topicnaming"}%
%STARTSECTION{"uuid"}%%ADDTOZONE{"script" id="uuid" requires="JQUERYPLUGIN::LIVEQUERY" text=" <script> jQuery(function($) { $('.jqUUID').livequery(function() { $(this).val(crypto.randomUUID().toUpperCase()); }); }); </script>" }%%ENDSECTION{"uuid"}%