Commit | Line | Data |
---|---|---|
158bd3ca TD |
1 | <?php |
2 | namespace wcf\acp\form; | |
158bd3ca | 3 | use wcf\data\user\group\UserGroup; |
158bd3ca | 4 | use wcf\system\language\LanguageFactory; |
158bd3ca TD |
5 | |
6 | /** | |
7 | * This class provides default implementations for a list of dynamic user options. | |
6e048dca | 8 | * |
158bd3ca | 9 | * @author Marcel Werk |
ca4ba303 | 10 | * @copyright 2001-2014 WoltLab GmbH |
158bd3ca TD |
11 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> |
12 | * @package com.woltlab.wcf | |
13 | * @subpackage acp.form | |
9f959ced | 14 | * @category Community Framework |
158bd3ca TD |
15 | */ |
16 | abstract class UserOptionListForm extends AbstractOptionListForm { | |
f277d540 | 17 | /** |
0ad90fc3 | 18 | * @see \wcf\acp\form\AbstractOptionListForm::$optionHandlerClassName |
f277d540 | 19 | */ |
a33e86da | 20 | public $optionHandlerClassName = 'wcf\system\option\user\UserOptionHandler'; |
f277d540 AE |
21 | |
22 | /** | |
0ad90fc3 | 23 | * @see \wcf\acp\form\AbstractOptionListForm::$supportI18n |
f277d540 | 24 | */ |
a33e86da | 25 | public $supportI18n = false; |
158bd3ca TD |
26 | |
27 | /** | |
28 | * Returns a list of all available user groups. | |
29 | * | |
30 | * @return array | |
31 | */ | |
32 | protected function getAvailableGroups() { | |
b8047f12 MS |
33 | $userGroups = UserGroup::getAccessibleGroups(array(), array(UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS)); |
34 | ||
35 | uasort($userGroups, function(UserGroup $groupA, UserGroup $groupB) { | |
36 | return strcmp($groupA->getName(), $groupB->getName()); | |
37 | }); | |
38 | ||
39 | return $userGroups; | |
158bd3ca TD |
40 | } |
41 | ||
158bd3ca | 42 | /** |
01bd2eff | 43 | * Returns the default form language id. |
158bd3ca | 44 | * |
39bea7dd | 45 | * @return integer $languageID |
158bd3ca TD |
46 | */ |
47 | protected function getDefaultFormLanguageID() { | |
61022658 | 48 | return LanguageFactory::getInstance()->getDefaultLanguageID(); |
158bd3ca | 49 | } |
dcb3a44c | 50 | } |