/** * @see Action::execute() */ public function execute() { parent::execute(); // check permission WCF::getUser()->checkPermission('admin.user.option.canDeleteOptionCategory'); // delete category $this->category->delete(); // delete cache WCF::getCache()->clear(WCF_DIR . 'cache', 'cache.user-option-*'); $this->executed(); // forward to list page HeaderUtil::redirect('index.php?page=UserOptionCategoryList&deletedCategoryID=' . $this->categoryID . '&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED); exit; }
/** * @see Form::save() */ public function save() { ACPForm::save(); // save $this->category->update($this->category->categoryName, 'profile', $this->category->categoryIconS, $this->category->categoryIconM, $this->showOrder); // update language variable require_once WCF_DIR . 'lib/system/language/LanguageEditor.class.php'; $language = new LanguageEditor(WCF::getLanguage()->getLanguageID()); $language->updateItems(array('wcf.user.option.category.' . $this->category->categoryName => $this->categoryName), 0, PACKAGE_ID, array('wcf.user.option.category.' . $this->category->categoryName => 1)); // delete cache WCF::getCache()->clear(WCF_DIR . 'cache', 'cache.user-option-*'); $this->saved(); // show success message WCF::getTPL()->assign('success', true); }
/** * @see Form::save() */ public function save() { parent::save(); // create random name $name = "userOptionCategory" . time(); // save $userOptionCategory = UserOptionCategoryEditor::create($name, 'profile', '', '', $this->showOrder); // change name $userOptionCategory->update('userOptionCategory' . $userOptionCategory->categoryID, 'profile', '', '', $this->showOrder); // save name as language variable require_once WCF_DIR . 'lib/system/language/LanguageEditor.class.php'; $language = new LanguageEditor(WCF::getLanguage()->getLanguageID()); $language->updateItems(array('wcf.user.option.category.' . 'userOptionCategory' . $userOptionCategory->categoryID => $this->categoryName)); // delete cache WCF::getCache()->clear(WCF_DIR . 'cache', 'cache.user-option-*'); $this->saved(); // reset values $this->categoryName = ''; $this->showOrder = 0; // show success message WCF::getTPL()->assign('success', true); }