-{include file='__formFieldHeader'}
-
{if $includeAclJavaScript}
{include file='aclPermissions'}
{/if}
{include file='aclPermissionJavaScript' containerID=$field->getPrefixedId()|concat:'Container' categoryName=$field->getCategoryName() objectID=$field->getObjectID() objectTypeID=$field->getObjectType()->objectTypeID}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<ol class="flexibleButtonGroup">
<li>
<input type="radio" id="{@$field->getPrefixedId()}" name="{@$field->getPrefixedId()}" value="1" data-no-input-id="{@$field->getPrefixedId()}_no"{if $field->isAutofocused()} autofocus{/if}{if $field->isRequired()} required{/if}{if $field->isImmutable()} disabled{/if}{if $field->getValue()} checked{/if}>
<label for="{@$field->getPrefixedId()}_no" class="red"><span class="icon icon16 fa-times"></span> {lang}wcf.global.form.boolean.no{/lang}</label>
</li>
</ol>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<noscript>
<select name="{@$field->getPrefixedId()}" id="{@$field->getPrefixedId()}"{if $field->isImmutable()} disabled{/if}>
{if !$field->isRequired()}
)
});
</script>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<input {*
*}type="{if $field->supportsTime()}datetime{else}date{/if}" {*
*}id="{@$field->getPrefixedId()}" {*
*}{if $field->getEarliestDate() !== null} min="{$dateFormFieldEarliestDate}"{/if}{*
*}{if $field->getLatestDate() !== null} max="{$dateFormFieldLatestDate}"{/if}{*
*}>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<input type="email" {*
*}id="{@$field->getPrefixedId()}" {*
*}name="{@$field->getPrefixedId()}" {*
{if $field->isI18n()}
{include file='multipleLanguageInputJavascript'}
{/if}
-
-{include file='__formFieldFooter'}
--- /dev/null
+<dl id="{@$field->getPrefixedId()}Container" {if !$field->getClasses()|empty} class="{implode from=$field->getClasses() item='class' glue=' '}{$class}{/implode}"{/if}{foreach from=$field->getAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{if !$field->checkDependencies()} style="display: none;"{/if}>
+ <dt>{if $field->getLabel() !== null}<label for="{@$field->getPrefixedId()}">{@$field->getLabel()}</label>{/if}</dt>
+ <dd>
+ {@$field->getFieldHtml()}
+
+ {include file='__formFieldDescription'}
+ {include file='__formFieldErrors'}
+ {include file='__formFieldDependencies'}
+ {include file='__formFieldDataHandler'}
+ </dd>
+</dl>
+++ /dev/null
- {include file='__formFieldDescription'}
- {include file='__formFieldErrors'}
- {include file='__formFieldDependencies'}
- {include file='__formFieldDataHandler'}
- </dd>
-</dl>
+++ /dev/null
-<dl id="{@$field->getPrefixedId()}Container" {if !$field->getClasses()|empty} class="{implode from=$field->getClasses() item='class' glue=' '}{$class}{/implode}"{/if}{foreach from=$field->getAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{if !$field->checkDependencies()} style="display: none;"{/if}>
- <dt>{if $field->getLabel() !== null}<label for="{@$field->getPrefixedId()}">{@$field->getLabel()}</label>{/if}</dt>
- <dd>
-{include file='__formFieldHeader'}
-
<span{if $field->getValue()} class="icon icon64 fa-{$field->getValue()}"{/if} id="{@$field->getPrefixedId()}_icon"></span>
{if !$field->isImmutable()}
<a href="#" class="button small" id="{@$field->getPrefixedId()}_openIconDialog">{lang}wcf.global.button.edit{/lang}</a>
});
</script>
{/if}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<input type="text" id="{@$field->getPrefixedId()}" name="{@$field->getPrefixedId()}" class="long"{if $field->isAutofocused()} autofocus{/if}{if $field->isImmutable()} disabled{/if}>
<script data-relocate="true">
);
});
</script>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<ul class="labelList jsOnly" data-object-id="{@$field->getLabelGroup()->groupID}">
<li class="dropdown labelChooser" data-group-id="{@$field->getLabelGroup()->groupID}">
<div class="dropdownToggle" data-toggle="labelGroup{@$field->getLabelGroup()->groupID}">
);
});
</script>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<textarea id="{@$field->getPrefixedId()}" {*
*}name="{@$field->getPrefixedId()}" {*
*}rows="{@$field->getRows()}"{*
{if $field->isI18n()}
{include file='multipleLanguageInputJavascript'}
{/if}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
{if $field->isFilterable()}
<script data-relocate="true">
require(['Language', 'WoltLabSuite/Core/Ui/ItemList/Filter'], function(Language, UiItemListFilter) {
</label>
{/foreach}
{/if}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
{if $field->getSuffix() !== null}
<div class="inputAddon">
{/if}
<span class="inputSuffix">{@$field->getSuffix()}</span>
</div>
{/if}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<ol class="sortableList"></ol>
-{include file='__formFieldFooter'}
-
<script data-relocate="true">
require(['Dom/Traverse', 'Dom/Util', 'Language', 'WoltLabSuite/Core/Ui/Poll/Editor'], function(DomTraverse, DomUtil, Language, UiPollEditor) {
Language.addObject({
-{include file='__formFieldHeader'}
-
{foreach from=$field->getOptions() key=$__fieldValue item=__fieldLabel}
<label>
<input {*
*}> {@$__fieldLabel}
</label>
{/foreach}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<ul class="ratingList jsOnly">
{foreach from=$field->getRatings() item=rating}
<li data-rating="{@$rating}"><span class="icon icon24 {if $rating <= $field->getValue()}{implode from=$field->getActiveCssClasses() item=cssClass glue=' '}{@$cssClass}{/implode}{else}{implode from=$field->getDefaultCssClasses() item=cssClass glue=' '}{@$cssClass}{/implode}{/if} pointer jsTooltip" title="{lang maximumRating=$field->getMaximum()}wcf.form.field.rating.ratingTitle{/lang}"></span></li>
);
});
</script>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
{if $field->isImmutable() && $field->getValue()}
{if $field->getMedia()->isImage && $field->getMedia()->hasThumbnail('small')}
<div id="{@$field->getPrefixedId()}_preview" class="selectedImagePreview">
});
</script>
{/if}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
{if $field->isFilterable()}
<script data-relocate="true">
require(['Language', 'WoltLabSuite/Core/Ui/ItemList/Filter'], function(Language, UiItemListFilter) {
{/foreach}
</select>
{/if}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<input id="{@$field->getPrefixedId()}" type="text" value="" class="long">
<script data-relocate="true">
);
});
</script>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<input type="text" {*
*}id="{@$field->getPrefixedId()}" {*
*}name="{@$field->getPrefixedId()}" {*
{if $field->isI18n()}
{include file='multipleLanguageInputJavascript'}
{/if}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
{@$__wcf->getUploadHandler()->renderField($field->getPrefixedId())}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<input type="text" {*
*}id="{@$field->getPrefixedId()}" {*
*}name="{@$field->getPrefixedId()}" {*
});
});
</script>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<input type="text" {*
*}id="{@$field->getPrefixedId()}" {*
*}name="{@$field->getPrefixedId()}" {*
*}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
*}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
*}>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<ul id="{@$field->getPrefixedID()}_attachmentList" {*
*}class="formAttachmentList"{*
*}{if !$field->getAttachmentHandler()->getAttachmentList()|count} style="display: none"{/if} {*
</script>
<input type="hidden" id="{@$field->getPrefixedID()}_tmpHash" name="{@$field->getPrefixedID()}_tmpHash" value="{$field->getAttachmentHandler()->getTmpHashes()[0]}">
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<textarea {*
*}id="{@$field->getPrefixedId()}" {*
*}name="{@$field->getPrefixedId()}" {*
});
</script>
{/if}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
{if $includeAclJavaScript}
{include file='aclPermissions'}
{/if}
{include file='aclPermissionJavaScript' containerID=$field->getPrefixedId()|concat:'Container' categoryName=$field->getCategoryName() objectID=$field->getObjectID() objectTypeID=$field->getObjectType()->objectTypeID}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<ol class="flexibleButtonGroup">
<li>
<input type="radio" id="{@$field->getPrefixedId()}" name="{@$field->getPrefixedId()}" value="1" data-no-input-id="{@$field->getPrefixedId()}_no"{if $field->isAutofocused()} autofocus{/if}{if $field->isRequired()} required{/if}{if $field->isImmutable()} disabled{/if}{if $field->getValue()} checked{/if}>
<label for="{@$field->getPrefixedId()}_no" class="red"><span class="icon icon16 fa-times"></span> {lang}wcf.global.form.boolean.no{/lang}</label>
</li>
</ol>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<noscript>
<select name="{@$field->getPrefixedId()}" id="{@$field->getPrefixedId()}"{if $field->isImmutable()} disabled{/if}>
{if !$field->isRequired()}
)
});
</script>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<input {*
*}type="{if $field->supportsTime()}datetime{else}date{/if}" {*
*}id="{@$field->getPrefixedId()}" {*
*}{if $field->getEarliestDate() !== null} min="{$dateFormFieldEarliestDate}"{/if}{*
*}{if $field->getLatestDate() !== null} max="{$dateFormFieldLatestDate}"{/if}{*
*}>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<input type="email" {*
*}id="{@$field->getPrefixedId()}" {*
*}name="{@$field->getPrefixedId()}" {*
{if $field->isI18n()}
{include file='multipleLanguageInputJavascript'}
{/if}
-
-{include file='__formFieldFooter'}
--- /dev/null
+<dl id="{@$field->getPrefixedId()}Container" {if !$field->getClasses()|empty} class="{implode from=$field->getClasses() item='class' glue=' '}{$class}{/implode}"{/if}{foreach from=$field->getAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{if !$field->checkDependencies()} style="display: none;"{/if}>
+ <dt>{if $field->getLabel() !== null}<label for="{@$field->getPrefixedId()}">{@$field->getLabel()}</label>{/if}</dt>
+ <dd>
+ {@$field->getFieldHtml()}
+
+ {include file='__formFieldDescription'}
+ {include file='__formFieldErrors'}
+ {include file='__formFieldDependencies'}
+ {include file='__formFieldDataHandler'}
+ </dd>
+</dl>
+++ /dev/null
- {include file='__formFieldDescription'}
- {include file='__formFieldErrors'}
- {include file='__formFieldDependencies'}
- {include file='__formFieldDataHandler'}
- </dd>
-</dl>
+++ /dev/null
-<dl id="{@$field->getPrefixedId()}Container" {if !$field->getClasses()|empty} class="{implode from=$field->getClasses() item='class' glue=' '}{$class}{/implode}"{/if}{foreach from=$field->getAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{if !$field->checkDependencies()} style="display: none;"{/if}>
- <dt>{if $field->getLabel() !== null}<label for="{@$field->getPrefixedId()}">{@$field->getLabel()}</label>{/if}</dt>
- <dd>
-{include file='__formFieldHeader'}
-
<span{if $field->getValue()} class="icon icon64 fa-{$field->getValue()}"{/if} id="{@$field->getPrefixedId()}_icon"></span>
{if !$field->isImmutable()}
<a href="#" class="button small" id="{@$field->getPrefixedId()}_openIconDialog">{lang}wcf.global.button.edit{/lang}</a>
});
</script>
{/if}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<input type="text" id="{@$field->getPrefixedId()}" name="{@$field->getPrefixedId()}" class="long"{if $field->isAutofocused()} autofocus{/if}{if $field->isImmutable()} disabled{/if}>
<script data-relocate="true">
);
});
</script>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<ul class="labelList jsOnly" data-object-id="{@$field->getLabelGroup()->groupID}">
<li class="dropdown labelChooser" data-group-id="{@$field->getLabelGroup()->groupID}">
<div class="dropdownToggle" data-toggle="labelGroup{@$field->getLabelGroup()->groupID}">
);
});
</script>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<textarea id="{@$field->getPrefixedId()}" {*
*}name="{@$field->getPrefixedId()}" {*
*}rows="{@$field->getRows()}"{*
{if $field->isI18n()}
{include file='multipleLanguageInputJavascript'}
{/if}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
{if $field->isFilterable()}
<script data-relocate="true">
require(['Language', 'WoltLabSuite/Core/Ui/ItemList/Filter'], function(Language, UiItemListFilter) {
</label>
{/foreach}
{/if}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
{if $field->getSuffix() !== null}
<div class="inputAddon">
{/if}
<span class="inputSuffix">{@$field->getSuffix()}</span>
</div>
{/if}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<ol class="sortableList"></ol>
-{include file='__formFieldFooter'}
-
<script data-relocate="true">
require(['Dom/Traverse', 'Dom/Util', 'Language', 'WoltLabSuite/Core/Ui/Poll/Editor'], function(DomTraverse, DomUtil, Language, UiPollEditor) {
Language.addObject({
-{include file='__formFieldHeader'}
-
{foreach from=$field->getOptions() key=$__fieldValue item=__fieldLabel}
<label>
<input {*
*}> {@$__fieldLabel}
</label>
{/foreach}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<ul class="ratingList jsOnly">
{foreach from=$field->getRatings() item=rating}
<li data-rating="{@$rating}"><span class="icon icon24 {if $rating <= $field->getValue()}{implode from=$field->getActiveCssClasses() item=cssClass glue=' '}{@$cssClass}{/implode}{else}{implode from=$field->getDefaultCssClasses() item=cssClass glue=' '}{@$cssClass}{/implode}{/if} pointer jsTooltip" title="{lang maximumRating=$field->getMaximum()}wcf.form.field.rating.ratingTitle{/lang}"></span></li>
);
});
</script>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
{if $field->isImmutable() && $field->getValue()}
{if $field->getMedia()->isImage && $field->getMedia()->hasThumbnail('small')}
<div id="{@$field->getPrefixedId()}_preview" class="selectedImagePreview">
});
</script>
{/if}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
{if $field->isFilterable()}
<script data-relocate="true">
require(['Language', 'WoltLabSuite/Core/Ui/ItemList/Filter'], function(Language, UiItemListFilter) {
{/foreach}
</select>
{/if}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<input id="{@$field->getPrefixedId()}" type="text" value="" class="long">
<script data-relocate="true">
);
});
</script>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<input type="text" {*
*}id="{@$field->getPrefixedId()}" {*
*}name="{@$field->getPrefixedId()}" {*
{if $field->isI18n()}
{include file='multipleLanguageInputJavascript'}
{/if}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
{@$__wcf->getUploadHandler()->renderField($field->getPrefixedId())}
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<input type="text" {*
*}id="{@$field->getPrefixedId()}" {*
*}name="{@$field->getPrefixedId()}" {*
});
});
</script>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<input type="text" {*
*}id="{@$field->getPrefixedId()}" {*
*}name="{@$field->getPrefixedId()}" {*
*}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
*}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
*}>
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<ul id="{@$field->getPrefixedID()}_attachmentList" {*
*}class="formAttachmentList"{*
*}{if !$field->getAttachmentHandler()->getAttachmentList()|count} style="display: none"{/if} {*
</script>
<input type="hidden" id="{@$field->getPrefixedID()}_tmpHash" name="{@$field->getPrefixedID()}_tmpHash" value="{$field->getAttachmentHandler()->getTmpHashes()[0]}">
-
-{include file='__formFieldFooter'}
-{include file='__formFieldHeader'}
-
<textarea {*
*}id="{@$field->getPrefixedId()}" {*
*}name="{@$field->getPrefixedId()}" {*
});
</script>
{/if}
-
-{include file='__formFieldFooter'}
/**
* @inheritDoc
*/
- public function getHtml() {
+ public function getFieldHtml() {
if ($this->templateName === null) {
throw new \LogicException("\$templateName property has not been set for class '" . static::class . "'.");
}
+ return WCF::getTPL()->fetch(
+ $this->templateName,
+ 'wcf',
+ array_merge($this->getHtmlVariables(), [
+ 'field' => $this,
+ 'javaScriptDataHandlerModule' => $this->javaScriptDataHandlerModule
+ ]),
+ true
+ );
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function getHtml() {
if ($this->requiresLabel() && $this->getLabel() === null) {
throw new \UnexpectedValueException("Form field '{$this->getPrefixedId()}' requires a label.");
}
return WCF::getTPL()->fetch(
- $this->templateName,
+ '__formField',
'wcf',
array_merge($this->getHtmlVariables(), [
'field' => $this,
*/
public function addValidator(IFormFieldValidator $validator);
+ /**
+ * Returns the html representation of the form field only without any of the surrounding
+ * structural html elements.
+ *
+ * @return string html representation of node
+ */
+ public function getFieldHtml();
+
/**
* Returns the name of the object property this field represents.
*
return parent::getHtml();
}
+ /**
+ * @inheritDoc
+ * @throws \BadMethodCallException if the method is called, before the field is populated
+ */
+ public function getFieldHtml() {
+ if (!$this->isPopulated) {
+ throw new \BadMethodCallException("The field must be populated, before calling this method.");
+ }
+
+ return parent::getFieldHtml();
+ }
+
/**
* @inheritDoc
*
/**
* @inheritDoc
*/
- public function getHtml() {
+ public function getFieldHtml() {
if ($this->supportsQuotes()) {
MessageQuoteManager::getInstance()->assignVariables();
}
WCF::getSession()->getPermission($disallowedBBCodesPermission)
));
- return parent::getHtml();
+ return parent::getFieldHtml();
}
/**