<defaultvalue>0</defaultvalue>
<admindefaultvalue>1</admindefaultvalue>
</option>
+ <option name="user.profile.aboutMeMaxLength">
+ <categoryname>user.profile</categoryname>
+ <optiontype>integer</optiontype>
+ <defaultvalue>1000</defaultvalue>
+ <admindefaultvalue>10000</admindefaultvalue>
+ <minvalue>100</minvalue>
+ <maxvalue>65535</maxvalue>
+ </option>
<option name="user.profile.avatar.canSeeAvatars">
<categoryname>user.profile.avatar</categoryname>
<!-- profile -->
<option name="aboutMe">
<categoryname>profile.aboutMe</categoryname>
- <optiontype>message</optiontype>
+ <optiontype>aboutMe</optiontype>
<outputclass>wcf\system\option\user\MessageUserOptionOutput</outputclass>
<visible>15</visible>
<editable>3</editable>
- <maxlength>1000</maxlength>
</option>
<option name="birthday">
<categoryname>profile.personal</categoryname>
* available option types
* @var array<string>
*/
- public static $availableOptionTypes = array('birthday', 'boolean', 'date', 'integer', 'float', 'password', 'multiSelect', 'radioButton', 'select', 'text', 'textarea', 'message', 'URL');
+ public static $availableOptionTypes = array('aboutMe', 'birthday', 'boolean', 'date', 'integer', 'float', 'password', 'multiSelect', 'radioButton', 'select', 'text', 'textarea', 'message', 'URL');
/**
* list of option type that require select options
--- /dev/null
+<?php
+namespace wcf\system\option;
+use wcf\data\option\Option;
+use wcf\system\exception\UserInputException;
+use wcf\system\WCF;
+
+/**
+ * Option type implementation for the 'about me' text field.
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2014 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.option
+ * @category Community Framework
+ */
+class AboutMeOptionType extends MessageOptionType {
+ /**
+ * @see \wcf\system\option\IOptionType::validate()
+ */
+ public function validate(Option $option, $newValue) {
+ parent::validate($option, $newValue);
+
+ if (WCF::getSession()->getPermission('user.profile.aboutMeMaxLength') < mb_strlen($newValue)) {
+ throw new UserInputException($option->optionName, 'tooLong');
+ }
+ }
+}
<item name="wcf.acp.group.assignment.list"><![CDATA[Automatische Benutzergruppen-Zuordnungen]]></item>
<item name="wcf.acp.group.assignment.userGroup"><![CDATA[Benutzergruppe]]></item>
<item name="wcf.acp.group.assignment.isDisabled"><![CDATA[Automatische Zuordnung deaktivieren]]></item>
+ <item name="wcf.acp.group.option.user.profile.aboutMeMaxLength"><![CDATA[Maximallänge „Über mich“]]></item>
</category>
<category name="wcf.acp.index">
<item name="wcf.acp.group.assignment.list"><![CDATA[Automatic User Group Assignments]]></item>
<item name="wcf.acp.group.assignment.userGroup"><![CDATA[User Group]]></item>
<item name="wcf.acp.group.assignment.isDisabled"><![CDATA[Disable Automatic Assignment]]></item>
+ <item name="wcf.acp.group.option.user.profile.aboutMeMaxLength"><![CDATA[TODO: Maximallänge „Über mich“]]></item>
</category>
<category name="wcf.acp.index">