当前位置: 首页>>代码示例>>PHP>>正文


PHP AbstractForm::save方法代码示例

本文整理汇总了PHP中wcf\form\AbstractForm::save方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractForm::save方法的具体用法?PHP AbstractForm::save怎么用?PHP AbstractForm::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wcf\form\AbstractForm的用法示例。


在下文中一共展示了AbstractForm::save方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: save

 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     AbstractForm::save();
     $this->label = 'wcf.acp.label.label' . $this->labelObj->labelID;
     if (I18nHandler::getInstance()->isPlainValue('label')) {
         I18nHandler::getInstance()->remove($this->label);
         $this->label = I18nHandler::getInstance()->getValue('label');
     } else {
         I18nHandler::getInstance()->save('label', $this->label, 'wcf.acp.label', 1);
     }
     // update label
     $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');
     foreach ($objectTypes as $objectType) {
         $objectType->getProcessor()->save();
     }
     $this->saved();
     // reset values if non-custom value was choosen
     if ($this->cssClassName != 'custom') {
         $this->customCssClassName = '';
     }
     // show success
     WCF::getTPL()->assign(array('success' => true));
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:28,代码来源:LabelEditForm.class.php

示例2: save

 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     AbstractForm::save();
     // set cookies
     if ($this->useCookies == 1) {
         UserAuthenticationFactory::getInstance()->getUserAuthentication()->storeAccessData($this->user, $this->username, $this->password);
     }
     $oldSessionID = WCF::getSession()->sessionID;
     // change user
     WCF::getSession()->changeUser($this->user);
     // get redirect url
     $this->checkURL();
     $this->saved();
     if (isset($_REQUEST['s']) && $_REQUEST['s'] == $oldSessionID && $oldSessionID != WCF::getSession()->sessionID) {
         // force instant redirect to avoid issues with non-cookie login and the already defined SID_ARG_* constants
         if (preg_match('~[?&]s=[a-f0-9]{40}~i', $this->url)) {
             $this->url = preg_replace('~([?&])s=[a-f0-9]{40}~i', '$1s=' . WCF::getSession()->sessionID, $this->url);
         } else {
             $this->url .= mb_strpos($this->url, '?') === false ? '?' : '&';
             $this->url .= 's=' . WCF::getSession()->sessionID;
         }
         HeaderUtil::redirect($this->url);
         exit;
     }
     // redirect to url
     WCF::getTPL()->assign('__hideUserMenu', true);
     HeaderUtil::delayedRedirect($this->url, WCF::getLanguage()->get('wcf.user.login.redirect'));
     exit;
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:32,代码来源:LoginForm.class.php

示例3: save

	/**
	 * @see	wcf\form\IForm::save()
	 */
	public function save() {
		AbstractForm::save();
		
		$this->description = 'wcf.acp.cronjob.description.cronjob'.$this->cronjob->cronjobID;
		if (I18nHandler::getInstance()->isPlainValue('description')) {
			I18nHandler::getInstance()->remove($this->description, 1);
			$this->description = I18nHandler::getInstance()->getValue('description');
		}
		else {
			I18nHandler::getInstance()->save('description', $this->description, 'wcf.acp.cronjob', $this->cronjob->packageID);
		}
		
		// update cronjob
		$data = array(
			'className' => $this->className,
			'description' => $this->description,
			'startMinute' => $this->startMinute,
			'startHour' => $this->startHour,
			'startDom' => $this->startDom,
			'startMonth' => $this->startMonth,
			'startDow' => $this->startDow
		);
		
		$this->objectAction = new CronjobAction(array($this->cronjobID), 'update', array('data' => $data));
		$this->objectAction->executeAction();
		
		$this->saved();
		
		// show success
		WCF::getTPL()->assign(array(
			'success' => true
		));
	}
开发者ID:0xLeon,项目名称:WCF,代码行数:36,代码来源:CronjobEditForm.class.php

示例4: save

 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     parent::save();
     $this->objectAction = new CaptchaQuestionAction(array(), 'create', array('data' => array_merge($this->additionalFields, array('answers' => I18nHandler::getInstance()->isPlainValue('answers') ? I18nHandler::getInstance()->getValue('answers') : '', 'isDisabled' => $this->isDisabled, 'question' => I18nHandler::getInstance()->isPlainValue('question') ? I18nHandler::getInstance()->getValue('question') : ''))));
     $returnValues = $this->objectAction->executeAction();
     $questionID = $returnValues['returnValues']->questionID;
     // set i18n values
     $questionUpdates = array();
     if (!I18nHandler::getInstance()->isPlainValue('question')) {
         I18nHandler::getInstance()->save('question', 'wcf.captcha.question.question.question' . $questionID, 'wcf.captcha.question', 1);
         $questionUpdates['question'] = 'wcf.captcha.question.question.question' . $questionID;
     }
     if (!I18nHandler::getInstance()->isPlainValue('answers')) {
         I18nHandler::getInstance()->save('answers', 'wcf.captcha.question.answers.question' . $questionID, 'wcf.captcha.question', 1);
         $questionUpdates['answers'] = 'wcf.captcha.question.answers.question' . $questionID;
     }
     if (!empty($questionUpdates)) {
         $questionEditor = new CaptchaQuestionEditor($returnValues['returnValues']);
         $questionEditor->update($questionUpdates);
     }
     $this->saved();
     // reset values
     I18nHandler::getInstance()->reset();
     $this->isDisabled = 0;
     // show success message
     WCF::getTPL()->assign('success', true);
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:30,代码来源:CaptchaQuestionAddForm.class.php

示例5: save

 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     parent::save();
     if ($this->captchaObjectType) {
         $this->captchaObjectType->getProcessor()->reset();
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:10,代码来源:AbstractCaptchaForm.class.php

示例6: save

	/**
	 * @see	wcf\form\IForm::save()
	 */
	public function save() {
		AbstractForm::save();
		
		// save menu item
		I18nHandler::getInstance()->save('pageMenuItem', $this->menuItem->menuItem, 'wcf.page');
		
		// save menu item link
		$this->menuItemLink = 'wcf.page.menuItemLink'.$this->menuItem->menuItemID;
		if (I18nHandler::getInstance()->isPlainValue('menuItemLink')) {
			I18nHandler::getInstance()->remove($this->menuItemLink);
			$this->menuItemLink= I18nHandler::getInstance()->getValue('menuItemLink');
		}
		else {
			I18nHandler::getInstance()->save('menuItemLink', $this->menuItemLink, 'wcf.page');
		}
		
		// save menu item
		$this->objectAction = new PageMenuItemAction(array($this->menuItem), 'update', array('data' => array(
			'isDisabled' => ($this->isDisabled) ? 1 : 0,
			'menuItemController' => $this->menuItemController,
			'menuItemLink' => $this->menuItemLink,
			'parentMenuItem' => ($this->menuItem->menuPosition == 'header' ? $this->parentMenuItem : ''),
			'showOrder' => $this->showOrder
		)));
		$this->objectAction->executeAction();
		
		$this->saved();
		
		WCF::getTPL()->assign('success', true);
	}
开发者ID:0xLeon,项目名称:WCF,代码行数:33,代码来源:PageMenuItemEditForm.class.php

示例7: save

 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     AbstractForm::save();
     $this->groupName = 'wcf.acp.label.group' . $this->group->groupID;
     if (I18nHandler::getInstance()->isPlainValue('groupName')) {
         I18nHandler::getInstance()->remove($this->groupName);
         $this->groupName = I18nHandler::getInstance()->getValue('groupName');
     } else {
         I18nHandler::getInstance()->save('groupName', $this->groupName, 'wcf.acp.label', 1);
     }
     // update label
     $this->objectAction = new LabelGroupAction(array($this->groupID), 'update', array('data' => array_merge($this->additionalFields, array('forceSelection' => $this->forceSelection ? 1 : 0, 'groupName' => $this->groupName, 'groupDescription' => $this->groupDescription, 'showOrder' => $this->showOrder))));
     $this->objectAction->executeAction();
     // update acl
     ACLHandler::getInstance()->save($this->groupID, $this->objectTypeID);
     ACLHandler::getInstance()->disableAssignVariables();
     // update object type relations
     $this->saveObjectTypeRelations($this->groupID);
     foreach ($this->labelObjectTypes as $objectTypeID => $labelObjectType) {
         $labelObjectType->save();
     }
     $this->saved();
     // show success
     WCF::getTPL()->assign(array('success' => true));
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:28,代码来源:LabelGroupEditForm.class.php

示例8: save

 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     AbstractForm::save();
     // update tag
     $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) {
         // remove synonyms first
         $sql = "UPDATE\twcf" . WCF_N . "_tag\n\t\t\t\tSET\tsynonymFor = ?\n\t\t\t\tWHERE\tsynonymFor = ?";
         $statement = WCF::getDB()->prepareStatement($sql);
         $statement->execute(array(null, $this->tagID));
         $editor = new TagEditor($this->tagObj);
         foreach ($this->synonyms as $synonym) {
             if (empty($synonym)) {
                 continue;
             }
             // find existing tag
             $synonymObj = Tag::getTag($synonym, $this->tagObj->languageID);
             if ($synonymObj === null) {
                 $synonymAction = new TagAction(array(), 'create', array('data' => array('name' => $synonym, 'languageID' => $this->tagObj->languageID, 'synonymFor' => $this->tagID)));
                 $synonymAction->executeAction();
             } else {
                 $editor->addSynonym($synonymObj);
             }
         }
     }
     $this->saved();
     // show success
     WCF::getTPL()->assign(array('success' => true));
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:33,代码来源:TagEditForm.class.php

示例9: save

 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     AbstractForm::save();
     if ($this->showButton) {
         $this->buttonLabel = 'wcf.bbcode.buttonLabel' . $this->bbcode->bbcodeID;
         if (I18nHandler::getInstance()->isPlainValue('buttonLabel')) {
             I18nHandler::getInstance()->remove($this->buttonLabel);
             $this->buttonLabel = I18nHandler::getInstance()->getValue('buttonLabel');
         } else {
             I18nHandler::getInstance()->save('buttonLabel', $this->buttonLabel, 'wcf.bbcode', 1);
         }
     }
     // update bbcode
     $this->objectAction = new BBCodeAction(array($this->bbcodeID), 'update', array('data' => array_merge($this->additionalFields, array('allowedChildren' => $this->allowedChildren, 'bbcodeTag' => $this->bbcodeTag, 'buttonLabel' => $this->buttonLabel, 'className' => $this->className, 'htmlClose' => $this->htmlClose, 'htmlOpen' => $this->htmlOpen, 'isSourceCode' => $this->isSourceCode ? 1 : 0, 'showButton' => $this->showButton ? 1 : 0, 'wysiwygIcon' => $this->wysiwygIcon))));
     $this->objectAction->executeAction();
     // clear existing attributes
     $sql = "DELETE FROM\twcf" . WCF_N . "_bbcode_attribute\n\t\t\tWHERE\t\tbbcodeID = ?";
     $statement = WCF::getDB()->prepareStatement($sql);
     $statement->execute(array($this->bbcodeID));
     foreach ($this->attributes as $attribute) {
         $attributeAction = new BBCodeAttributeAction(array(), 'create', array('data' => array('bbcodeID' => $this->bbcodeID, 'attributeNo' => $attribute->attributeNo, 'attributeHtml' => $attribute->attributeHtml, 'validationPattern' => $attribute->validationPattern, 'required' => $attribute->required, 'useText' => $attribute->useText)));
         $attributeAction->executeAction();
     }
     $this->saved();
     // show success
     WCF::getTPL()->assign(array('success' => true));
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:30,代码来源:BBCodeEditForm.class.php

示例10: save

 /**
  * @see	wcf\form\IForm::save()
  * @todo
  */
 public function save()
 {
     AbstractForm::save();
     $this->title = 'ict.project.project' . $this->projectObj->projectID;
     if (I18nHandler::getInstance()->isPlainValue('title')) {
         I18nHandler::getInstance()->remove($this->title, PackageCache::getInstance()->getPackageID('info.codingcorner.ict'));
         $this->title = I18nHandler::getInstance()->getValue('title');
     } else {
         I18nHandler::getInstance()->save('title', $this->title, 'ict.project', PackageCache::getInstance()->getPackageID('info.codingcorner.ict'));
     }
     $this->subTitle = 'ict.project.project' . $this->projectObj->projectID . '.subTitle';
     if (I18nHandler::getInstance()->isPlainValue('subTitle')) {
         I18nHandler::getInstance()->remove($this->subTitle, PackageCache::getInstance()->getPackageID('info.codingcorner.ict'));
         $this->subTitle = I18nHandler::getInstance()->getValue('subTitle');
     } else {
         I18nHandler::getInstance()->save('subTitle', $this->subTitle, 'ict.project', PackageCache::getInstance()->getPackageID('info.codingcorner.ict'));
     }
     $this->description = 'ict.project.project' . $this->projectObj->projectID . '.description';
     if (I18nHandler::getInstance()->isPlainValue('description')) {
         I18nHandler::getInstance()->remove($this->description, PackageCache::getInstance()->getPackageID('info.codingcorner.ict'));
         $this->description = I18nHandler::getInstance()->getValue('description');
     } else {
         I18nHandler::getInstance()->save('description', $this->description, 'ict.project', PackageCache::getInstance()->getPackageID('info.codingcorner.ict'));
     }
     // update project
     $this->objectAction = new ProjectAction(array($this->projectID), 'update', array('data' => array_merge($this->additionalFields, array('title' => $this->title, 'subTitle' => $this->subTitle, 'description' => $this->description, 'descriptionUseHtml' => $this->descriptionUseHtml ? 1 : 0, 'position' => $this->position, 'isInvisible' => $this->isInvisible ? 1 : 0, 'isClosed' => $this->isClosed ? 1 : 0, 'issuesPerPage' => $this->issuesPerPage, 'commentsPerPage' => $this->commentsPerPage, 'styleID' => $this->styleID ?: null))));
     $this->objectAction->executeAction();
     if (WCF::getSession()->getPermission('admin.project.canEditPermissions')) {
         ACLHandler::getInstance()->save($this->projectObj->projectID, $this->objectTypeID);
     }
     $this->saved();
     ACLHandler::getInstance()->disableAssignVariables();
     // show success
     WCF::getTPL()->assign(array('success' => true));
 }
开发者ID:RouL,项目名称:Icy-Tracker,代码行数:39,代码来源:ProjectEditForm.class.php

示例11: save

 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     AbstractForm::save();
     // save multilingual inputs
     $languageVariable = 'cms.page.title' . $this->pageID;
     if (I18nHandler::getInstance()->isPlainValue('title')) {
         I18nHandler::getInstance()->remove($languageVariable);
     } else {
         I18nHandler::getInstance()->save('title', $languageVariable, 'cms.page');
         $this->title = $languageVariable;
     }
     $languageVariable = 'cms.page.description' . $this->pageID;
     if (I18nHandler::getInstance()->isPlainValue('description')) {
         I18nHandler::getInstance()->remove($languageVariable);
     } else {
         I18nHandler::getInstance()->save('description', $languageVariable, 'cms.page');
         $this->description = $languageVariable;
     }
     $languageVariable = 'cms.page.metaDescription' . $this->pageID;
     if (I18nHandler::getInstance()->isPlainValue('metaDescription')) {
         I18nHandler::getInstance()->remove($languageVariable);
     } else {
         I18nHandler::getInstance()->save('metaDescription', $languageVariable, 'cms.page');
         $this->metaDescription = $languageVariable;
     }
     $languageVariable = 'cms.page.metaKeywords' . $this->pageID;
     if (I18nHandler::getInstance()->isPlainValue('metaKeywords')) {
         I18nHandler::getInstance()->remove($languageVariable);
     } else {
         I18nHandler::getInstance()->save('metaKeywords', $languageVariable, 'cms.page');
         $this->metaKeywords = $languageVariable;
     }
     $data = array('title' => $this->title, 'alias' => $this->alias, 'description' => $this->description, 'metaDescription' => $this->metaDescription, 'metaKeywords' => $this->metaKeywords, 'allowIndexing' => $this->allowIndexing, 'parentID' => $this->parentID ?: null, 'showOrder' => $this->showOrder, 'invisible' => $this->invisible, 'menuItemID' => $this->menuItemID ?: null, 'isCommentable' => $this->isCommentable, 'availableDuringOfflineMode' => $this->availableDuringOfflineMode, 'allowSubscribing' => $this->allowSubscribing, 'styleID' => $this->styleID ?: null, 'sidebarOrientation' => $this->sidebarOrientation);
     // publication
     if ($this->enableDelayedPublication) {
         $data['isPublished'] = 0;
         $data['publicationDate'] = @strtotime($this->publicationDate);
     } else {
         $data['isPublished'] = 1;
     }
     if ($this->enableDelayedDeactivation) {
         $data['isDisabled'] = 0;
         $data['deactivationDate'] = @strtotime($this->publicationDate);
     }
     $pageData = array('data' => $data, 'stylesheetIDs' => $this->stylesheetIDs);
     $this->objectAction = new PageAction(array($this->pageID), 'update', $pageData);
     $this->objectAction->executeAction();
     // save ACL
     ACLHandler::getInstance()->save($this->pageID, $this->objectTypeID);
     // create revision
     $objectAction = new PageAction(array($this->pageID), 'createRevision', array('action' => 'update'));
     $objectAction->executeAction();
     // update search index
     $objectAction = new PageAction(array($this->pageID), 'refreshSearchIndex');
     $objectAction->executeAction();
     $this->saved();
     WCF::getTPL()->assign('success', true);
 }
开发者ID:knzo,项目名称:Fireball,代码行数:61,代码来源:PageEditForm.class.php

示例12: save

 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     AbstractForm::save();
     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_merge($this->additionalFields, array('showOrder' => $this->showOrder))));
     $this->objectAction->executeAction();
     $this->saved();
     WCF::getTPL()->assign('success', true);
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:12,代码来源:UserOptionCategoryEditForm.class.php

示例13: save

 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     AbstractForm::save();
     $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));
     $this->objectAction->executeAction();
     $this->saved();
     // show success
     WCF::getTPL()->assign(array('success' => true));
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:12,代码来源:TemplateEditForm.class.php

示例14: save

 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     AbstractForm::save();
     $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();
     // show success
     WCF::getTPL()->assign(array('success' => true));
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:12,代码来源:TemplateGroupEditForm.class.php

示例15: save

 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     parent::save();
     WCF::getSession()->register('disclaimerAccepted', true);
     $this->saved();
     WCF::getSession()->update();
     HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Register'));
     exit;
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:12,代码来源:DisclaimerForm.class.php


注:本文中的wcf\form\AbstractForm::save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。