Make $this->additionalFields available in every AbstractForm
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 27 Nov 2013 23:42:17 +0000 (00:42 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 27 Nov 2013 23:43:58 +0000 (00:43 +0100)
46 files changed:
wcfsetup/install/files/lib/acp/form/ApplicationEditForm.class.php
wcfsetup/install/files/lib/acp/form/BBCodeAddForm.class.php
wcfsetup/install/files/lib/acp/form/BBCodeEditForm.class.php
wcfsetup/install/files/lib/acp/form/BBCodeMediaProviderAddForm.class.php
wcfsetup/install/files/lib/acp/form/BBCodeMediaProviderEditForm.class.php
wcfsetup/install/files/lib/acp/form/CronjobAddForm.class.php
wcfsetup/install/files/lib/acp/form/CronjobEditForm.class.php
wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php
wcfsetup/install/files/lib/acp/form/LabelEditForm.class.php
wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php
wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php
wcfsetup/install/files/lib/acp/form/LanguageServerAddForm.class.php
wcfsetup/install/files/lib/acp/form/LanguageServerEditForm.class.php
wcfsetup/install/files/lib/acp/form/PackageUpdateServerAddForm.class.php
wcfsetup/install/files/lib/acp/form/PackageUpdateServerEditForm.class.php
wcfsetup/install/files/lib/acp/form/PageMenuItemAddForm.class.php
wcfsetup/install/files/lib/acp/form/PageMenuItemEditForm.class.php
wcfsetup/install/files/lib/acp/form/SmileyAddForm.class.php
wcfsetup/install/files/lib/acp/form/SmileyEditForm.class.php
wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php
wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php
wcfsetup/install/files/lib/acp/form/TagAddForm.class.php
wcfsetup/install/files/lib/acp/form/TagEditForm.class.php
wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php
wcfsetup/install/files/lib/acp/form/TemplateEditForm.class.php
wcfsetup/install/files/lib/acp/form/TemplateGroupAddForm.class.php
wcfsetup/install/files/lib/acp/form/TemplateGroupEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserOptionCategoryAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserOptionCategoryEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserOptionEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserRankAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserRankEditForm.class.php
wcfsetup/install/files/lib/form/AbstractForm.class.php
wcfsetup/install/files/lib/form/AccountManagementForm.class.php
wcfsetup/install/files/lib/form/AvatarEditForm.class.php
wcfsetup/install/files/lib/form/EmailActivationForm.class.php
wcfsetup/install/files/lib/form/EmailNewActivationCodeForm.class.php
wcfsetup/install/files/lib/form/LostPasswordForm.class.php
wcfsetup/install/files/lib/form/NewPasswordForm.class.php
wcfsetup/install/files/lib/form/RegisterNewActivationCodeForm.class.php
wcfsetup/install/files/lib/form/SettingsForm.class.php
wcfsetup/install/files/lib/form/SignatureEditForm.class.php

index f0f0f8714e107bda2e6ec2e0ccd9aa11e810984e..8364d7d75cf4ffa7157b40cd4eb23e7cadfaa971 100644 (file)
@@ -189,12 +189,12 @@ class ApplicationEditForm extends AbstractForm {
                parent::save();
                
                // save application
-               $this->objectAction = new ApplicationAction(array($this->application->getDecoratedObject()), 'update', array('data' => array(
+               $this->objectAction = new ApplicationAction(array($this->application->getDecoratedObject()), 'update', array('data' => array_merge($this->additionalFields, array(
                        'cookieDomain' => $this->cookieDomain,
                        'cookiePath' => $this->cookiePath,
                        'domainName' => $this->domainName,
                        'domainPath' => $this->domainPath
-               )));
+               ))));
                $this->objectAction->executeAction();
                
                $this->saved();
index e7f8c18636c4694b243b9be09c5d2f682e602dd9..2ddc366fdc3727f4090713900d425037685ac8d3 100644 (file)
@@ -216,7 +216,7 @@ class BBCodeAddForm extends AbstractForm {
                parent::save();
                
                // save bbcode
-               $this->objectAction = new BBCodeAction(array(), 'create', array('data' => array(
+               $this->objectAction = new BBCodeAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
                        'allowedChildren' => $this->allowedChildren,
                        'bbcodeTag' => $this->bbcodeTag,
                        'buttonLabel' => $this->buttonLabel,
@@ -227,7 +227,7 @@ class BBCodeAddForm extends AbstractForm {
                        'packageID' => 1,
                        'showButton' => ($this->showButton ? 1 : 0),
                        'wysiwygIcon' => $this->wysiwygIcon
-               )));
+               ))));
                $returnValues = $this->objectAction->executeAction();
                foreach ($this->attributes as $attribute) {
                        $attributeAction = new BBCodeAttributeAction(array(), 'create', array('data' => array(
index 7ba672203ccce26a1ded13c5808040f99db7f6f0..a1e8a13d38c53061f99c77b902121d8bdcbc9a45 100644 (file)
@@ -92,7 +92,7 @@ class BBCodeEditForm extends BBCodeAddForm {
                }
                
                // update bbcode
-               $this->objectAction = new BBCodeAction(array($this->bbcodeID), 'update', array('data' => array(
+               $this->objectAction = new BBCodeAction(array($this->bbcodeID), 'update', array('data' => array_merge($this->additionalFields, array(
                        'allowedChildren' => $this->allowedChildren,
                        'bbcodeTag' => $this->bbcodeTag,
                        'buttonLabel' => $this->buttonLabel,
@@ -102,7 +102,7 @@ class BBCodeEditForm extends BBCodeAddForm {
                        'isSourceCode' => ($this->isSourceCode ? 1 : 0),
                        'showButton' => ($this->showButton ? 1 : 0),
                        'wysiwygIcon' => $this->wysiwygIcon
-               )));
+               ))));
                $this->objectAction->executeAction();
                
                // clear existing attributes
index d8c131bd930d69fa8557dea83c3af00b3c5492b3..35cdb1f8214fe7b72a2ed556bf353614acb6aea9 100644 (file)
@@ -93,11 +93,11 @@ class BBCodeMediaProviderAddForm extends AbstractForm {
                parent::save();
                
                // save media provider
-               $this->objectAction = new BBCodeMediaProviderAction(array(), 'create', array('data' => array(
+               $this->objectAction = new BBCodeMediaProviderAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
                        'title' => $this->title,
                        'regex' => $this->regex,
                        'html' => $this->html
-               )));
+               ))));
                $this->objectAction->executeAction();
                $this->saved();
                
index ef1df2e2face91696be384976f43840b020de759..4651741009710d0865198b5aa4ba6a41dba76871 100644 (file)
@@ -59,11 +59,11 @@ class BBCodeMediaProviderEditForm extends BBCodeMediaProviderAddForm {
                AbstractForm::save();
                
                // update media-provider
-               $this->objectAction = new BBCodeMediaProviderAction(array($this->providerID), 'update', array('data' => array(
+               $this->objectAction = new BBCodeMediaProviderAction(array($this->providerID), 'update', array('data' => array_merge($this->additionalFields, array(
                        'title' => $this->title,
                        'regex' => $this->regex,
                        'html' => $this->html
-               )));
+               ))));
                $this->objectAction->executeAction();
                
                $this->saved();
index 14eef8bb622f19629b6c3494a511c398e7a36003..b768169786e875f54c2146b9ec0d8fca7de3251b 100755 (executable)
@@ -151,7 +151,7 @@ class CronjobAddForm extends AbstractForm {
                parent::save();
                
                // save cronjob
-               $data = array(
+               $data = array_merge($this->additionalFields, array(
                        'className' => $this->className,
                        'packageID' => $this->packageID,
                        'description' => $this->description,
@@ -160,7 +160,7 @@ class CronjobAddForm extends AbstractForm {
                        'startDom' => $this->startDom,
                        'startMonth' => $this->startMonth,
                        'startDow' => $this->startDow
-               );
+               ));
                
                $this->objectAction = new CronjobAction(array(), 'create', array('data' => $data));
                $this->objectAction->executeAction();
index a800e1a111f49b225af9317fc632bace914b56db..4744c4544a8cdac7d5d45e25d040574f4521257c 100755 (executable)
@@ -66,7 +66,7 @@ class CronjobEditForm extends CronjobAddForm {
                }
                
                // update cronjob
-               $data = array(
+               $data = array_merge($this->additionalFields, array(
                        'className' => $this->className,
                        'description' => $this->description,
                        'startMinute' => $this->startMinute,
@@ -74,7 +74,7 @@ class CronjobEditForm extends CronjobAddForm {
                        'startDom' => $this->startDom,
                        'startMonth' => $this->startMonth,
                        'startDow' => $this->startDow
-               );
+               ));
                
                $this->objectAction = new CronjobAction(array($this->cronjobID), 'update', array('data' => $data));
                $this->objectAction->executeAction();
index 0b3222350d7eccf26fedc463ef668e3b94a37465..3d6a08075525c7122b48c8876d1ed36435df0197 100644 (file)
@@ -150,11 +150,11 @@ class LabelAddForm extends AbstractForm {
                parent::save();
                
                // save label
-               $this->objectAction = new LabelAction(array(), 'create', array('data' => array(
+               $this->objectAction = new LabelAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
                        'label' => $this->label,
                        'cssClassName' => ($this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName),
                        'groupID' => $this->groupID
-               )));
+               ))));
                $this->objectAction->executeAction();
                
                if (!I18nHandler::getInstance()->isPlainValue('label')) {
index 29a7cfdd7112bdfcb37ebdccf4b51e7492bf8094..70454693145bb40d0b97fb37d39a8e5f8b87a82f 100644 (file)
@@ -70,11 +70,11 @@ class LabelEditForm extends LabelAddForm {
                }
                
                // update label
-               $this->objectAction = new LabelAction(array($this->labelID), 'update', array('data' => array(
+               $this->objectAction = new LabelAction(array($this->labelID), 'update', array('data' => array_merge($this->additionalFields, array(
                        'label' => $this->label,
                        'cssClassName' => ($this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName),
                        'groupID' => $this->groupID
-               )));
+               ))));
                $this->objectAction->executeAction();
                
                $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.label.objectType');
index 37f051a2da873ed57b2be040a3b5ad9f19653c4c..40885b38a7cf37b101349b8fe5cf03adda4f783a 100644 (file)
@@ -132,10 +132,10 @@ class LabelGroupAddForm extends AbstractForm {
                parent::save();
                
                // save label
-               $this->objectAction = new LabelGroupAction(array(), 'create', array('data' => array(
+               $this->objectAction = new LabelGroupAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
                        'forceSelection' => ($this->forceSelection ? 1 : 0),
                        'groupName' => $this->groupName
-               )));
+               ))));
                $returnValues = $this->objectAction->executeAction();
                
                // save acl
index 6bce03e90600337037aef504d0b83563d77db879..b56252b7a5e7e2a84cf5782912005f57803d7dc7 100644 (file)
@@ -60,10 +60,10 @@ class LabelGroupEditForm extends LabelGroupAddForm {
                AbstractForm::save();
                
                // update label
-               $this->objectAction = new LabelGroupAction(array($this->groupID), 'update', array('data' => array(
+               $this->objectAction = new LabelGroupAction(array($this->groupID), 'update', array('data' => array_merge($this->additionalFields, array(
                        'forceSelection' => ($this->forceSelection ? 1 : 0),
                        'groupName' => $this->groupName
-               )));
+               ))));
                $this->objectAction->executeAction();
                
                // update acl
index c7d829bee6fa6b2fdb53ffbe830aa2bdc524d17e..378dd094154aded419b9b53079a850267c745d6f 100644 (file)
@@ -66,9 +66,9 @@ class LanguageServerAddForm extends AbstractForm {
                parent::save();
                
                // save server
-               $this->objectAction = new LanguageServerAction(array(), 'create', array('data' => array(
+               $this->objectAction = new LanguageServerAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
                        'serverURL' => $this->server
-               )));
+               ))));
                $this->objectAction->executeAction();
                $this->saved();
                
index 13506a97ea0cd4695d827dd4547058968978a69b..171627573ed72f54bb6e071497bcca6797d74c69 100644 (file)
@@ -54,9 +54,9 @@ class LanguageServerEditForm extends LanguageServerAddForm {
                AbstractForm::save();
                
                // save server
-               $this->objectAction = new LanguageServerAction(array($this->languageServerID), 'update', array('data' => array(
+               $this->objectAction = new LanguageServerAction(array($this->languageServerID), 'update', array('data' => array_merge($this->additionalFields, array(
                        'serverURL' => $this->server
-               )));
+               ))));
                $this->objectAction->executeAction();
                $this->saved();
                
index 50c892b37ab2b81588e6d138628d11b5dc3048fa..432c266d486819b9915a935e6a63f310d7f77c39 100755 (executable)
@@ -80,11 +80,11 @@ class PackageUpdateServerAddForm extends AbstractForm {
                parent::save();
                
                // save server
-               $this->objectAction = new PackageUpdateServerAction(array(), 'create', array('data' => array(
+               $this->objectAction = new PackageUpdateServerAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
                        'serverURL' => $this->serverURL,
                        'loginUsername' => $this->loginUsername,
                        'loginPassword' => $this->loginPassword
-               )));
+               ))));
                $this->objectAction->executeAction();
                $this->saved();
                
index 9739e0da6f2fd6a50d7daf31c10ef296388bc809..b460bfb5da536291a45cc84ed3c89721fc940a8e 100755 (executable)
@@ -49,11 +49,11 @@ class PackageUpdateServerEditForm extends PackageUpdateServerAddForm {
                AbstractForm::save();
                
                // save server
-               $this->objectAction = new PackageUpdateServerAction(array($this->packageUpdateServerID), 'update', array('data' => array(
+               $this->objectAction = new PackageUpdateServerAction(array($this->packageUpdateServerID), 'update', array('data' => array_merge($this->additionalFields, array(
                        'serverURL' => $this->serverURL,
                        'loginUsername' => $this->loginUsername,
                        'loginPassword' => $this->loginPassword
-               )));
+               ))));
                $this->objectAction->executeAction();
                $this->saved();
                
index 5e8675ded71a0a1ce92c53d45558e35cda50f4c7..d8bd2c32332ca4b83d9f2eebb9a30e942427fb75 100644 (file)
@@ -208,7 +208,7 @@ class PageMenuItemAddForm extends AbstractForm {
        public function save() {
                parent::save();
                
-               $this->objectAction = new PageMenuItemAction(array(), 'create', array('data' => array(
+               $this->objectAction = new PageMenuItemAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
                        'isDisabled' => ($this->isDisabled) ? 1 : 0,
                        'menuItem' => $this->pageMenuItem,
                        'menuItemController' => $this->menuItemController,
@@ -216,7 +216,7 @@ class PageMenuItemAddForm extends AbstractForm {
                        'menuPosition' => $this->menuPosition,
                        'parentMenuItem' => $this->parentMenuItem,
                        'showOrder' => $this->showOrder
-               )));
+               ))));
                $this->objectAction->executeAction();
                
                $returnValues = $this->objectAction->getReturnValues();
index 16d883f8c7a8618dabfff0d12765db66c63ef98e..b037bb014294d4e047e1e97768a90186b9e24a22 100644 (file)
@@ -104,14 +104,14 @@ class PageMenuItemEditForm extends PageMenuItemAddForm {
                }
                
                // save menu item
-               $this->objectAction = new PageMenuItemAction(array($this->menuItem), 'update', array('data' => array(
+               $this->objectAction = new PageMenuItemAction(array($this->menuItem), 'update', array('data' => array_merge($this->additionalFields, array(
                        'isDisabled' => ($this->isDisabled) ? 1 : 0,
                        'menuItemController' => $this->menuItemController,
                        'menuItemLink' => ($this->menuItemController ? $this->menuItemParameters : $this->menuItemLink),
                        'parentMenuItem' => ($this->menuPosition == 'header' ? $this->parentMenuItem : ''),
                        'menuPosition' => $this->menuPosition,
                        'showOrder' => $this->showOrder
-               )));
+               ))));
                $this->objectAction->executeAction();
                
                // update children
index e3fde733dce743a5776135e583b12d1bec98f932..4d6cfcc59c619d4f02812b3459e8f88bd588f155 100644 (file)
@@ -142,7 +142,7 @@ class SmileyAddForm extends AbstractForm {
                parent::save();
                
                $this->objectAction = new SmileyAction(array(), 'create', array(
-                       'data' => array(
+                       'data' => array_merge($this->additionalFields, array(
                                'smileyTitle' => $this->smileyTitle,
                                'smileyCode' => $this->smileyCode,
                                'aliases' => $this->aliases,
@@ -150,7 +150,7 @@ class SmileyAddForm extends AbstractForm {
                                'showOrder' => $this->showOrder,
                                'categoryID' => $this->categoryID ?: null,
                                'packageID' => 1
-                       )
+                       ))
                ));
                $this->objectAction->executeAction();
                $returnValues = $this->objectAction->getReturnValues();
index e736dcbbe41c6a90e7b46330b21336a10522a1fb..444f5148349a8efdae35be3393f4ab4c23c7ddbc 100644 (file)
@@ -69,14 +69,14 @@ class SmileyEditForm extends SmileyAddForm {
                }
                
                // update bbcode
-               $this->objectAction = new SmileyAction(array($this->smileyID), 'update', array('data' => array(
+               $this->objectAction = new SmileyAction(array($this->smileyID), 'update', array('data' => array_merge($this->additionalFields, array(
                        'smileyTitle' => $this->smileyTitle,
                        'smileyCode' => $this->smileyCode,
                        'aliases' => $this->aliases,
                        'smileyPath' => $this->smileyPath,
                        'showOrder' => $this->showOrder,
                        'categoryID' => $this->categoryID ?: null
-               )));
+               ))));
                $this->objectAction->executeAction();
                
                $this->saved();
index 7b5f685a59bb7eff5cf27308cfa67b28ae407fdc..4b43b84a535a29bac04983272c14a6dae89fbbc7 100644 (file)
@@ -466,7 +466,7 @@ class StyleAddForm extends AbstractForm {
                parent::save();
                
                $this->objectAction = new StyleAction(array(), 'create', array(
-                       'data' => array(
+                       'data' => array_merge($this->additionalFields, array(
                                'styleName' => $this->styleName,
                                'templateGroupID' => $this->templateGroupID,
                                'isDisabled' => 1, // styles are disabled by default
@@ -478,7 +478,7 @@ class StyleAddForm extends AbstractForm {
                                'license' => $this->license,
                                'authorName' => $this->authorName,
                                'authorURL' => $this->authorURL
-                       ),
+                       )),
                        'tmpHash' => $this->tmpHash,
                        'variables' => $this->variables
                ));
index 270387ca2392542c89a6cc9fbe14faf3d3a9f4ba..6305de9938cf11da05f390e13eea90336b7b4fe0 100644 (file)
@@ -92,7 +92,7 @@ class StyleEditForm extends StyleAddForm {
                AbstractForm::save();
                
                $this->objectAction = new StyleAction(array($this->style), 'update', array(
-                       'data' => array(
+                       'data' => array_merge($this->additionalFields, array(
                                'styleName' => $this->styleName,
                                'templateGroupID' => $this->templateGroupID,
                                'styleVersion' => $this->styleVersion,
@@ -102,7 +102,7 @@ class StyleEditForm extends StyleAddForm {
                                'license' => $this->license,
                                'authorName' => $this->authorName,
                                'authorURL' => $this->authorURL
-                       ),
+                       )),
                        'tmpHash' => $this->tmpHash,
                        'variables' => $this->variables
                ));
index 88ba2afc0f4f7c8a01b97cc7eb2b3044681406f7..432420ebc46a63e71aed0eb45ae0791f3a7e018c 100644 (file)
@@ -141,10 +141,10 @@ class TagAddForm extends AbstractForm {
                parent::save();
                
                // save tag
-               $this->objectAction = new TagAction(array(), 'create', array('data' => array(
+               $this->objectAction = new TagAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
                        'name' => $this->name,
                        'languageID' => $this->languageID
-               )));
+               ))));
                $this->objectAction->executeAction();
                $returnValues = $this->objectAction->getReturnValues();
                $editor = new TagEditor($returnValues['returnValues']);
index 48a782f2f72aaa0301bee90709eb8d5982ab01cb..0788085307f75bebb8f644dac683ca82dc306151 100644 (file)
@@ -61,9 +61,9 @@ class TagEditForm extends TagAddForm {
                AbstractForm::save();
                
                // update tag
-               $this->objectAction = new TagAction(array($this->tagID), 'update', array('data' => array(
+               $this->objectAction = new TagAction(array($this->tagID), 'update', array('data' => array_merge($this->additionalFields, array(
                        'name' => $this->name
-               )));
+               ))));
                $this->objectAction->executeAction();
                
                if ($this->tagObj->synonymFor === null) {
index f238c1827a7d0d3d4640725031ae919e884c4b77..40ce50aa5910ca14cc20a9e09d67db0f497c6e80 100644 (file)
@@ -187,12 +187,12 @@ class TemplateAddForm extends AbstractForm {
                        $this->application = Package::getAbbreviation(PackageCache::getInstance()->getPackage($this->packageID)->package);
                }
                
-               $this->objectAction = new TemplateAction(array(), 'create', array('data' => array(
+               $this->objectAction = new TemplateAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
                        'application' => $this->application,
                        'templateName' => $this->tplName,
                        'packageID' => $this->packageID,
                        'templateGroupID' => $this->templateGroupID
-               ), 'source' => $this->templateSource));
+               )), 'source' => $this->templateSource));
                $this->objectAction->executeAction();
                $this->saved();
                
index 4fde41e0ffbfbf9b4ef1ad9a217b416a083f5c7d..7edd432b59b8e0c79aa1ba59d8d260949f7ef759 100644 (file)
@@ -72,11 +72,11 @@ class TemplateEditForm extends TemplateAddForm {
        public function save() {
                AbstractForm::save();
                
-               $this->objectAction = new TemplateAction(array($this->template), 'update', array('data' => array(
+               $this->objectAction = new TemplateAction(array($this->template), 'update', array('data' => array_merge($this->additionalFields, array(
                        'templateName' => $this->tplName,
                        'templateGroupID' => $this->templateGroupID,
                        'lastModificationTime' => TIME_NOW
-               ), 'source' => $this->templateSource));
+               )), 'source' => $this->templateSource));
                $this->objectAction->executeAction();
                $this->saved();
                
index 0ec74cda74a4a440b766d12d54c5b5ed7d02e2b7..371017879dc498846ad0c277968962fc69f67c8c 100644 (file)
@@ -125,11 +125,11 @@ class TemplateGroupAddForm extends AbstractForm {
        public function save() {
                parent::save();
                
-               $this->objectAction = new TemplateGroupAction(array(), 'create', array('data' => array(
+               $this->objectAction = new TemplateGroupAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
                        'templateGroupName' => $this->templateGroupName,
                        'templateGroupFolderName' => $this->templateGroupFolderName,
                        'parentTemplateGroupID' => ($this->parentTemplateGroupID ?: null)
-               )));
+               ))));
                $this->objectAction->executeAction();
                $this->saved();
                
index 654f95a84cd171bef7857fe5d09df92596cc0ecf..d70e1d959ef5a466f7c9764a5d7119bf75141d7a 100644 (file)
@@ -72,11 +72,11 @@ class TemplateGroupEditForm extends TemplateGroupAddForm {
        public function save() {
                AbstractForm::save();
                
-               $this->objectAction = new TemplateGroupAction(array($this->templateGroup), 'update', array('data' => array(
+               $this->objectAction = new TemplateGroupAction(array($this->templateGroup), 'update', array('data' => array_merge($this->additionalFields, array(
                        'templateGroupName' => $this->templateGroupName,
                        'templateGroupFolderName' => $this->templateGroupFolderName,
                        'parentTemplateGroupID' => ($this->parentTemplateGroupID ?: null)
-               )));
+               ))));
                $this->objectAction->executeAction();
                $this->saved();
                
index cb641659e34452249a95f683aab2bb6d4c280205..9eb0c143a9c7ae6599ffde4d620da2672ea5a4a0 100644 (file)
@@ -82,12 +82,6 @@ class UserAddForm extends UserOptionListForm {
         */
        public $visibleLanguages = array();
        
-       /**
-        * additional fields
-        * @var array<mixed>
-        */
-       public $additionalFields = array();
-       
        /**
         * title of the user
         * @var string
index a1d315fc84328cd3296b1638c083ba2c81c2ddbc..3c225c93d7d9f0428b01c112971b1d9c94c6e52a 100755 (executable)
@@ -58,12 +58,6 @@ class UserGroupAddForm extends AbstractOptionListForm {
         */
        protected $groupDescription = '';
        
-       /**
-        * additional fields
-        * @var array
-        */
-       public $additionalFields = array();
-       
        /**
         * list of values of group 'Anyone'
         * @var array
index 43720d2c99f0e83e9530c0ce5544cc8af4354ae0..e4f90b7e15edd399c9fe3d1883fa120b91c6acef 100755 (executable)
@@ -150,13 +150,13 @@ class UserGroupEditForm extends UserGroupAddForm {
                }
                
                $data = array(
-                       'data' => array_merge(array(
+                       'data' => array_merge($this->additionalFields, array(
                                'groupName' => $this->groupName,
                                'groupDescription' => $this->groupDescription,
                                'priority' => $this->priority,
                                'userOnlineMarking' => $this->userOnlineMarking,
                                'showOnTeamPage' => $this->showOnTeamPage
-                       ), $this->additionalFields),
+                       )),
                        'options' => $optionValues
                );
                $this->objectAction = new UserGroupAction(array($this->groupID), 'update', $data);
index c518433b57b280e160d57b151cd66852a3cbcb65..f9c67cd96ab94a58031229a47e050bf711eb004a 100644 (file)
@@ -228,7 +228,7 @@ class UserOptionAddForm extends AbstractForm {
        public function save() {
                parent::save();
                
-               $this->objectAction = new UserOptionAction(array(), 'create', array('data' => array(
+               $this->objectAction = new UserOptionAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
                        'optionName' => StringUtil::getRandomID(),
                        'categoryName' => $this->categoryName,
                        'optionType' => $this->optionType,
@@ -244,7 +244,7 @@ class UserOptionAddForm extends AbstractForm {
                        'visible' => $this->visible,
                        'packageID' => 1,
                        'additionalData' => ($this->optionType == 'select' ? serialize(array('allowEmptyValue' => true)) : '')
-               )));
+               ))));
                $this->objectAction->executeAction();
                
                $returnValues = $this->objectAction->getReturnValues();
index 9076d20156beafa565cbca61aa1e897b92c71746..6c7cd060cdc94d390bd2f37b87875a70650f5ee1 100644 (file)
@@ -79,11 +79,11 @@ class UserOptionCategoryAddForm extends AbstractForm {
                parent::save();
                
                // save label
-               $this->objectAction = new UserOptionCategoryAction(array(), 'create', array('data' => array(
+               $this->objectAction = new UserOptionCategoryAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
                        'parentCategoryName' => 'profile',
                        'categoryName' => $this->categoryName,
                        'showOrder' => $this->showOrder
-               )));
+               ))));
                $this->objectAction->executeAction();
                
                // update name
index 26ca2ac0bb357be306a428e8c4c6e7b16282dc00..e5c9249f4f37804892d276cb230308005a20c04c 100644 (file)
@@ -56,9 +56,9 @@ class UserOptionCategoryEditForm extends UserOptionCategoryAddForm {
                
                I18nHandler::getInstance()->save('categoryName', 'wcf.user.option.category.'.$this->category->categoryName, 'wcf.user.option');
                
-               $this->objectAction = new UserOptionCategoryAction(array($this->category), 'update', array('data' => array(
+               $this->objectAction = new UserOptionCategoryAction(array($this->category), 'update', array('data' => array_merge($this->additionalFields, array(
                        'showOrder' => $this->showOrder
-               )));
+               ))));
                $this->objectAction->executeAction();
                $this->saved();
                
index 2a5878266be8ff1045482d7f64d3ffa95d444d3e..541d3b6c15755647aa1ed9ec37e4a115cb3a814d 100644 (file)
@@ -57,7 +57,7 @@ class UserOptionEditForm extends UserOptionAddForm {
                I18nHandler::getInstance()->save('optionName', 'wcf.user.option.'.$this->userOption->optionName, 'wcf.user.option');
                I18nHandler::getInstance()->save('optionDescription', 'wcf.user.option.'.$this->userOption->optionName.'.description', 'wcf.user.option');
                
-               $this->objectAction = new UserOptionAction(array($this->userOption), 'update', array('data' => array(
+               $this->objectAction = new UserOptionAction(array($this->userOption), 'update', array('data' => array_merge($this->additionalFields, array(
                        'categoryName' => $this->categoryName,
                        'optionType' => $this->optionType,
                        'defaultValue' => $this->defaultValue,
@@ -70,7 +70,7 @@ class UserOptionEditForm extends UserOptionAddForm {
                        'searchable' => $this->searchable,
                        'editable' => $this->editable,
                        'visible' => $this->visible
-               )));
+               ))));
                $this->objectAction->executeAction();
                $this->saved();
                
index e3239c5e95a6d9d629d941ea1e6def8adc36bf31..e53b81ce2c3e6f60d7b90ce51614b14c4a7c3b73 100644 (file)
@@ -176,7 +176,7 @@ class UserRankAddForm extends AbstractForm {
                parent::save();
                
                // save label
-               $this->objectAction = new UserRankAction(array(), 'create', array('data' => array(
+               $this->objectAction = new UserRankAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
                        'rankTitle' => $this->rankTitle,
                        'cssClassName' => ($this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName),
                        'groupID' => $this->groupID,
@@ -184,7 +184,7 @@ class UserRankAddForm extends AbstractForm {
                        'rankImage' => $this->rankImage,
                        'repeatImage' => $this->repeatImage,
                        'requiredGender' => $this->requiredGender
-               )));
+               ))));
                $this->objectAction->executeAction();
                
                if (!I18nHandler::getInstance()->isPlainValue('rankTitle')) {
index c6d8972c9f333c25d4af14d0aa5a82de5a601ec8..d6060fc1766fca9ae5a6b9028dcb7e732ab2c134 100644 (file)
@@ -64,7 +64,7 @@ class UserRankEditForm extends UserRankAddForm {
                }
                
                // update label
-               $this->objectAction = new UserRankAction(array($this->rank), 'update', array('data' => array(
+               $this->objectAction = new UserRankAction(array($this->rank), 'update', array('data' => array_merge($this->additionalFields, array(
                        'rankTitle' => $this->rankTitle,
                        'cssClassName' => ($this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName),
                        'groupID' => $this->groupID,
@@ -72,7 +72,7 @@ class UserRankEditForm extends UserRankAddForm {
                        'rankImage' => $this->rankImage,
                        'repeatImage' => $this->repeatImage,
                        'requiredGender' => $this->requiredGender
-               )));
+               ))));
                $this->objectAction->executeAction();
                $this->saved();
                
index 39b06e1687a3f6d141e26bedcda8ff6c8926514f..5f57f2895c0e0688de674f367283668bb6c22c71 100644 (file)
@@ -42,6 +42,12 @@ abstract class AbstractForm extends AbstractPage implements IForm {
         */
        public $objectAction = null;
        
+       /**
+        * additional fields
+        * @var array<mixed>
+        */
+       public $additionalFields = array();
+       
        /**
         * @see \wcf\form\IForm::submit()
         */
index d7aaa0b6808b13ef69b0b97698f45257924963ce..04cb78fc960f39479ab9a206866e13ac19967888 100644 (file)
@@ -433,7 +433,7 @@ class AccountManagementForm extends AbstractForm {
                
                $data = array();
                if (!empty($updateParameters)) {
-                       $data['data'] = $updateParameters;
+                       $data['data'] = array_merge($this->additionalFields, $updateParameters);
                }
                if (!empty($updateOptions)) {
                        $data['options'] = $updateOptions;
index 80b25b40c196e131aecd3e72cd059d59edb5f95e..8e94e2b287b4b07f20cdb796ea4de7d76e4214d6 100644 (file)
@@ -2,7 +2,7 @@
 namespace wcf\form;
 use wcf\data\user\avatar\Gravatar;
 use wcf\data\user\avatar\UserAvatarAction;
-use wcf\data\user\UserEditor;
+use wcf\data\user\UserAction;
 use wcf\system\exception\PermissionDeniedException;
 use wcf\system\exception\UserInputException;
 use wcf\system\menu\user\UserMenu;
@@ -97,28 +97,29 @@ class AvatarEditForm extends AbstractForm {
                // update user
                switch ($this->avatarType) {
                        case 'none':
-                               $editor = new UserEditor(WCF::getUser());
-                               $editor->update(array(
+                               $data = array(
                                        'avatarID' => null,
                                        'enableGravatar' => 0
-                               ));
+                               );
                        break;
                                
                        case 'custom':
-                               $editor = new UserEditor(WCF::getUser());
-                               $editor->update(array(
+                               $data = array(
                                        'enableGravatar' => 0
-                               ));
+                               );
                        break;
                                
                        case 'gravatar':
-                               $editor = new UserEditor(WCF::getUser());
-                               $editor->update(array(
+                               $data = array(
                                        'avatarID' => null,
                                        'enableGravatar' => 1
-                               ));
+                               );
                        break;
                }
+               $this->objectAction = new UserAction(array(WCF::getUser()), 'update', array(
+                       'data' => array_merge($this->additionalFields, $data)
+               ));
+               $this->objectAction->executeAction();
                
                $this->saved();
                WCF::getTPL()->assign('success', true);
index 67bd205e210d874a213e209fb843cad1dc0d7eb6..129b35c61f0f1f9ff618bffd532d845be206ac13 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 namespace wcf\form;
 use wcf\data\user\User;
-use wcf\data\user\UserEditor;
+use wcf\data\user\UserAction;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\NamedUserException;
 use wcf\system\exception\UserInputException;
@@ -66,7 +66,7 @@ class EmailActivationForm extends AbstractForm {
                parent::validate();
                
                // check given user id
-               $this->user = new UserEditor(new User($this->userID));
+               $this->user = new User($this->userID);
                if (!$this->user->userID) {
                        throw new UserInputException('u', 'notValid');
                }
@@ -94,11 +94,14 @@ class EmailActivationForm extends AbstractForm {
                parent::save();
                
                // enable new email
-               $this->user->update(array(
-                       'email' => $this->user->newEmail,
-                       'newEmail' => '',
-                       'reactivationCode' => 0
+               $this->objectAction = new UserAction(array($this->user), 'update', array(
+                       'data' => array_merge($this->additionalFields, array(
+                               'email' => $this->user->newEmail,
+                               'newEmail' => '',
+                               'reactivationCode' => 0
+                       ))
                ));
+               $this->objectAction->executeAction();
                $this->saved();
                
                // forward to index page
index 7a437474c15272ea1ca552e3e20e9c1022472465..32c3f39b449daaa63ff1cec18c8f62d7c8fc8966 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 namespace wcf\form;
 use wcf\data\user\User;
-use wcf\data\user\UserEditor;
+use wcf\data\user\UserAction;
 use wcf\system\exception\UserInputException;
 use wcf\system\mail\Mail;
 use wcf\system\request\LinkHandler;
@@ -59,8 +59,12 @@ class EmailNewActivationCodeForm extends RegisterNewActivationCodeForm {
                $activationCode = UserRegistrationUtil::getActivationCode();
                
                // save user
-               $userEditor = new UserEditor($this->user);
-               $userEditor->update(array('reactivationCode' => $activationCode));
+               $this->objectAction = new UserAction(array($this->user), 'update', array(
+                       'data' => array_merge($this->additionalFields, array(
+                               'reactivationCode' => $activationCode
+                       ))
+               ));
+               $this->objectAction->executeAction();
                
                // send activation mail
                $messageData = array(
index 883a31478afc40e843f1df81cc50332a00b8167c..322fb548478bbd8b0cdc3af0f3421d2c53fdc36e 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 namespace wcf\form;
 use wcf\data\user\User;
-use wcf\data\user\UserEditor;
+use wcf\data\user\UserAction;
 use wcf\system\exception\NamedUserException;
 use wcf\system\exception\UserInputException;
 use wcf\system\mail\Mail;
@@ -105,11 +105,13 @@ class LostPasswordForm extends RecaptchaForm {
                $lostPasswordKey = StringUtil::getRandomID();
                
                // save key and request time in database
-               $userEditor = new UserEditor($this->user);
-               $userEditor->update(array(
-                       'lostPasswordKey' => $lostPasswordKey,
-                       'lastLostPasswordRequestTime' => TIME_NOW
+               $this->objectAction = new UserAction(array($this->user), 'update', array(
+                       'data' => array_merge($this->additionalFields, array(
+                               'lostPasswordKey' => $lostPasswordKey,
+                               'lastLostPasswordRequestTime' => TIME_NOW
+                       ))
                ));
+               $this->objectAction->executeAction();
                
                // send mail
                $mail = new Mail(array($this->user->username => $this->user->email), WCF::getLanguage()->getDynamicVariable('wcf.user.lostPassword.mail.subject'), WCF::getLanguage()->getDynamicVariable('wcf.user.lostPassword.mail', array(
index 9319ed5022451a419103ac0cb712389abe641ab6..ec5fd7289ff33a02e748491db3fac516d8837857 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 namespace wcf\form;
 use wcf\data\user\User;
-use wcf\data\user\UserEditor;
+use wcf\data\user\UserAction;
 use wcf\page\AbstractPage;
 use wcf\system\exception\UserInputException;
 use wcf\system\mail\Mail;
@@ -94,12 +94,14 @@ class NewPasswordForm extends AbstractForm {
                $this->newPassword = PasswordUtil::getRandomPassword((REGISTER_PASSWORD_MIN_LENGTH > 9 ? REGISTER_PASSWORD_MIN_LENGTH : 9));
                
                // update user
-               $userEditor = new UserEditor($this->user);
-               $userEditor->update(array(
-                       'password' => $this->newPassword,
-                       'lastLostPasswordRequestTime' => 0,
-                       'lostPasswordKey' => ''
+               $this->objectAction = new UserAction(array($this->user), 'update', array(
+                       'data' => array_merge($this->additionalFields, array(
+                               'password' => $this->newPassword,
+                               'lastLostPasswordRequestTime' => 0,
+                               'lostPasswordKey' => ''
+                       ))
                ));
+               $this->objectAction->executeAction();
                
                // send mail
                $mail = new Mail(array($this->user->username => $this->user->email), WCF::getLanguage()->getDynamicVariable('wcf.user.newPassword.mail.subject'), WCF::getLanguage()->getDynamicVariable('wcf.user.newPassword.mail', array(
index b33073ab5b574c660f5ad9f8ac27a98784000871..11446b86cee2420c45bdb3c7b60f879b45d65064 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 namespace wcf\form;
 use wcf\data\user\User;
-use wcf\data\user\UserEditor;
+use wcf\data\user\UserAction;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\UserInputException;
 use wcf\system\mail\Mail;
@@ -132,10 +132,12 @@ class RegisterNewActivationCodeForm extends AbstractForm {
                $activationCode = UserRegistrationUtil::getActivationCode();
                
                // save user
-               $userEditor = new UserEditor($this->user);
                $parameters = array('activationCode' => $activationCode);
                if (!empty($this->email)) $parameters['email'] = $this->email;
-               $userEditor->update($parameters);
+               $this->objectAction = new UserAction(array($this->user), 'update', array(
+                       'data' => array_merge($this->additionalFields, $parameters)
+               ));
+               $this->objectAction->executeAction();
                
                // reload user to reflect changes
                $this->user = new User($this->user->userID);
index 0b2697ca1ab6764d411a1265b5e2992a5380f933..7cb5e9830a4dda06d357fa20d5d00a9e48d27b69 100644 (file)
@@ -192,10 +192,10 @@ class SettingsForm extends AbstractForm {
                $parameters = array('options' => $saveOptions);
                // static options
                if ($this->category == 'general') {
-                       $parameters['data'] = array(
+                       $parameters['data'] = array_merge($this->additionalFields, array(
                                'languageID' => $this->languageID,
                                'styleID' => $this->styleID
-                       );
+                       ));
                        $parameters['languageIDs'] = $this->contentLanguageIDs;
                }
                
index 6c5743141972254adfdb3d817af0a0c3d1757feb..835e11ec30c546875c2f1332b8297b8e7a67101b 100644 (file)
@@ -143,12 +143,12 @@ class SignatureEditForm extends MessageForm {
                parent::save();
                
                $this->objectAction = new UserAction(array(WCF::getUser()), 'update', array(
-                       'data' => array(
+                       'data' => array_merge($this->additionalFields, array(
                                'signature' => $this->text,
                                'signatureEnableBBCodes' => $this->enableBBCodes,
                                'signatureEnableHtml' => $this->enableHtml,
                                'signatureEnableSmilies' => $this->enableSmilies
-                       )
+                       ))
                ));
                $this->objectAction->executeAction();
                SignatureCache::getInstance()->getSignature(new User(WCF::getUser()->userID));