--- /dev/null
+<?php
+namespace wcf\system\form\builder;
+use wcf\data\object\type\ObjectType;
+use wcf\system\exception\InvalidObjectTypeException;
+
+/**
+ * Represents a form node that relies on a specific object type.
+ *
+ * @author Matthias Schmidt
+ * @copyright 2001-2019 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\System\Form\Builder\Field
+ * @since 5.2
+ */
+interface IObjectTypeFormNode {
+ /**
+ * Returns the object type.
+ *
+ * @return ObjectType object type
+ *
+ * @throws \BadMethodCallException if object type has not been set
+ */
+ public function getObjectType();
+
+ /**
+ * Sets the name of the object type and returns this field.
+ *
+ * @param string $objectType object type name
+ * @return IObjectTypeFormNode this field
+ *
+ * @throws \BadMethodCallException if object type has already been set
+ * @throws \UnexpectedValueException if object type definition returned by `getObjectTypeDefinition()` is unknown
+ * @throws InvalidObjectTypeException if given object type name is invalid
+ */
+ public function objectType($objectType);
+
+ /**
+ * Returns the name of the object type definition the set object type must be of.
+ *
+ * @return string name of object type's definition
+ */
+ public function getObjectTypeDefinition();
+}
--- /dev/null
+<?php
+namespace wcf\system\form\builder;
+use wcf\data\object\type\ObjectType;
+use wcf\data\object\type\ObjectTypeCache;
+use wcf\system\exception\InvalidObjectTypeException;
+
+/**
+ * Provides default implementations of `IObjectTypeFormNode` methods.
+ *
+ * @author Matthias Schmidt
+ * @copyright 2001-2019 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\System\Form\Builder\Field
+ * @since 5.2
+ */
+trait TObjectTypeFormNode {
+ /**
+ * object type
+ * @var null|ObjectType
+ */
+ protected $objectType;
+
+ /**
+ * Returns the object type.
+ *
+ * @return ObjectType object type
+ *
+ * @throws \BadMethodCallException if object type has not been set
+ */
+ public function getObjectType() {
+ if ($this->objectType === null) {
+ throw new \BadMethodCallException("Object type has not been set.");
+ }
+
+ return $this->objectType;
+ }
+
+ /**
+ * Sets the name of the object type and returns this field.
+ *
+ * @param string $objectType object type name
+ * @return static this field
+ *
+ * @throws \BadMethodCallException if object type has already been set
+ * @throws \UnexpectedValueException if object type definition returned by `getObjectTypeDefinition()` is unknown
+ * @throws InvalidObjectTypeException if given object type name is invalid
+ */
+ public function objectType($objectType) {
+ if ($this->objectType !== null) {
+ throw new \BadMethodCallException("Object type has already been set.");
+ }
+
+ if (ObjectTypeCache::getInstance()->getDefinitionByName($this->getObjectTypeDefinition()) === null) {
+ throw new \UnexpectedValueException("Unknown definition name '{$this->getObjectTypeDefinition()}'.");
+ }
+
+ $this->objectType = ObjectTypeCache::getInstance()->getObjectTypeByName($this->getObjectTypeDefinition(), $objectType);
+ if ($this->objectType === null) {
+ throw new InvalidObjectTypeException($objectType, $this->getObjectTypeDefinition());
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the name of the object type definition the set object type must be of.
+ *
+ * @return string name of object type's definition
+ */
+ abstract public function getObjectTypeDefinition();
+}
<?php
namespace wcf\system\form\builder\button\wysiwyg;
use wcf\system\form\builder\button\FormButton;
-use wcf\system\form\builder\field\IObjectTypeFormNode;
-use wcf\system\form\builder\field\TObjectTypeFormNode;
+use wcf\system\form\builder\IObjectTypeFormNode;
+use wcf\system\form\builder\TObjectTypeFormNode;
use wcf\system\form\builder\TWysiwygFormNode;
/**
/**
* actual wysiwyg form field
- * @var WysiwygFormNode
+ * @var WysiwygFormField
*/
protected $wysiwygField;
use wcf\system\form\builder\field\data\processor\CustomFormFieldDataProcessor;
use wcf\system\form\builder\field\DateFormField;
use wcf\system\form\builder\field\IntegerFormField;
-use wcf\system\form\builder\field\IObjectTypeFormNode;
use wcf\system\form\builder\field\poll\PollOptionsFormField;
use wcf\system\form\builder\field\TextFormField;
-use wcf\system\form\builder\field\TObjectTypeFormNode;
use wcf\system\form\builder\field\validation\FormFieldValidationError;
use wcf\system\form\builder\field\validation\FormFieldValidator;
use wcf\system\form\builder\IFormDocument;
+use wcf\system\form\builder\IObjectTypeFormNode;
+use wcf\system\form\builder\TObjectTypeFormNode;
use wcf\system\form\builder\TWysiwygFormNode;
use wcf\system\poll\IPollHandler;
<?php
namespace wcf\system\form\builder\field;
use wcf\system\captcha\ICaptchaHandler;
+use wcf\system\form\builder\IObjectTypeFormNode;
+use wcf\system\form\builder\TObjectTypeFormNode;
/**
* Implementation of a form field for a captcha.
+++ /dev/null
-<?php
-namespace wcf\system\form\builder\field;
-use wcf\data\object\type\ObjectType;
-use wcf\system\exception\InvalidObjectTypeException;
-
-/**
- * Represents a form node that relies on a specific object type.
- *
- * @author Matthias Schmidt
- * @copyright 2001-2019 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package WoltLabSuite\Core\System\Form\Builder\Field
- * @since 5.2
- */
-interface IObjectTypeFormNode {
- /**
- * Returns the object type.
- *
- * @return ObjectType object type
- *
- * @throws \BadMethodCallException if object type has not been set
- */
- public function getObjectType();
-
- /**
- * Sets the name of the object type and returns this field.
- *
- * @param string $objectType object type name
- * @return IObjectTypeFormNode this field
- *
- * @throws \BadMethodCallException if object type has already been set
- * @throws \UnexpectedValueException if object type definition returned by `getObjectTypeDefinition()` is unknown
- * @throws InvalidObjectTypeException if given object type name is invalid
- */
- public function objectType($objectType);
-
- /**
- * Returns the name of the object type definition the set object type must be of.
- *
- * @return string name of object type's definition
- */
- public function getObjectTypeDefinition();
-}
+++ /dev/null
-<?php
-namespace wcf\system\form\builder\field;
-use wcf\data\object\type\ObjectType;
-use wcf\data\object\type\ObjectTypeCache;
-use wcf\system\exception\InvalidObjectTypeException;
-
-/**
- * Provides default implementations of `IObjectTypeFormNode` methods.
- *
- * @author Matthias Schmidt
- * @copyright 2001-2019 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package WoltLabSuite\Core\System\Form\Builder\Field
- * @since 5.2
- */
-trait TObjectTypeFormNode {
- /**
- * object type
- * @var null|ObjectType
- */
- protected $objectType;
-
- /**
- * Returns the object type.
- *
- * @return ObjectType object type
- *
- * @throws \BadMethodCallException if object type has not been set
- */
- public function getObjectType() {
- if ($this->objectType === null) {
- throw new \BadMethodCallException("Object type has not been set.");
- }
-
- return $this->objectType;
- }
-
- /**
- * Sets the name of the object type and returns this field.
- *
- * @param string $objectType object type name
- * @return static this field
- *
- * @throws \BadMethodCallException if object type has already been set
- * @throws \UnexpectedValueException if object type definition returned by `getObjectTypeDefinition()` is unknown
- * @throws InvalidObjectTypeException if given object type name is invalid
- */
- public function objectType($objectType) {
- if ($this->objectType !== null) {
- throw new \BadMethodCallException("Object type has already been set.");
- }
-
- if (ObjectTypeCache::getInstance()->getDefinitionByName($this->getObjectTypeDefinition()) === null) {
- throw new \UnexpectedValueException("Unknown definition name '{$this->getObjectTypeDefinition()}'.");
- }
-
- $this->objectType = ObjectTypeCache::getInstance()->getObjectTypeByName($this->getObjectTypeDefinition(), $objectType);
- if ($this->objectType === null) {
- throw new InvalidObjectTypeException($objectType, $this->getObjectTypeDefinition());
- }
-
- return $this;
- }
-
- /**
- * Returns the name of the object type definition the set object type must be of.
- *
- * @return string name of object type's definition
- */
- abstract public function getObjectTypeDefinition();
-}
use wcf\system\acl\ACLHandler;
use wcf\system\form\builder\field\AbstractFormField;
use wcf\system\form\builder\field\data\processor\CustomFormFieldDataProcessor;
-use wcf\system\form\builder\field\IObjectTypeFormNode;
-use wcf\system\form\builder\field\TObjectTypeFormNode;
use wcf\system\form\builder\IFormDocument;
+use wcf\system\form\builder\IObjectTypeFormNode;
+use wcf\system\form\builder\TObjectTypeFormNode;
/**
* Implementation of a form field for setting acl option values.
use wcf\data\IStorableObject;
use wcf\system\form\builder\field\AbstractFormField;
use wcf\system\form\builder\field\data\processor\CustomFormFieldDataProcessor;
-use wcf\system\form\builder\field\IObjectTypeFormNode;
use wcf\system\form\builder\field\TDefaultIdFormField;
-use wcf\system\form\builder\field\TObjectTypeFormNode;
use wcf\system\form\builder\IFormDocument;
+use wcf\system\form\builder\IObjectTypeFormNode;
+use wcf\system\form\builder\TObjectTypeFormNode;
use wcf\system\tagging\TagEngine;
use wcf\util\ArrayUtil;
use wcf\system\form\builder\field\data\processor\CustomFormFieldDataProcessor;
use wcf\system\form\builder\field\IMaximumLengthFormField;
use wcf\system\form\builder\field\IMinimumLengthFormField;
-use wcf\system\form\builder\field\IObjectTypeFormNode;
use wcf\system\form\builder\field\TMaximumLengthFormField;
use wcf\system\form\builder\field\TMinimumLengthFormField;
-use wcf\system\form\builder\field\TObjectTypeFormNode;
use wcf\system\form\builder\field\validation\FormFieldValidationError;
use wcf\system\form\builder\IFormDocument;
+use wcf\system\form\builder\IObjectTypeFormNode;
+use wcf\system\form\builder\TObjectTypeFormNode;
use wcf\system\html\input\HtmlInputProcessor;
use wcf\util\StringUtil;
* Sets the identifier used to autosave the field value and returns this field.
*
* @param string $autosaveId identifier used to autosave field value
- *
- * @return WysiwygFormNode this field
+ * @return WysiwygFormField this field
*/
public function autosaveId($autosaveId) {
$this->autosaveId = $autosaveId;
* Sets the last time this field has been edited and returns this field.
*
* @param int $lastEditTime last time field has been edited
- *
- * @return WysiwygFormNode this field
+ * @return WysiwygFormField this field
*/
public function lastEditTime($lastEditTime) {
$this->lastEditTime = $lastEditTime;
* Sets if the form field supports attachments and returns this field.
*
* @param boolean $supportAttachments
- *
- * @return WysiwygFormNode
+ * @return WysiwygFormField this field
*/
public function supportAttachments($supportAttachments = true) {
$this->supportAttachments = $supportAttachments;
* Sets if the form field supports mentions and returns this field.
*
* @param boolean $supportMentions
- *
- * @return WysiwygFormNode
+ * @return WysiwygFormField this field
*/
public function supportMentions($supportMentions = true) {
$this->supportMentions = $supportMentions;