/**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     AbstractForm::save();
     $this->objectAction = new UserGroupAssignmentAction(array($this->assignment), 'update', array('data' => array_merge($this->additionalFields, array('groupID' => $this->groupID, 'isDisabled' => $this->isDisabled, 'title' => $this->title))));
     $returnValues = $this->objectAction->executeAction();
     // transform conditions array into one-dimensional array
     $conditions = array();
     foreach ($this->conditions as $groupedObjectTypes) {
         $conditions = array_merge($conditions, $groupedObjectTypes);
     }
     ConditionHandler::getInstance()->updateConditions($this->assignment->assignmentID, $this->assignment->getConditions(), $conditions);
     $this->saved();
     WCF::getTPL()->assign('success', true);
 }
 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     parent::save();
     $this->objectAction = new UserGroupAssignmentAction(array(), 'create', array('data' => array_merge($this->additionalFields, array('groupID' => $this->groupID, 'isDisabled' => $this->isDisabled, 'title' => $this->title))));
     $returnValues = $this->objectAction->executeAction();
     // transform conditions array into one-dimensional array
     $conditions = array();
     foreach ($this->conditions as $groupedObjectTypes) {
         $conditions = array_merge($conditions, $groupedObjectTypes);
     }
     ConditionHandler::getInstance()->createConditions($returnValues['returnValues']->assignmentID, $conditions);
     $this->saved();
     // reset values
     $this->groupID = 0;
     $this->isDisabled = 0;
     $this->title = '';
     foreach ($this->conditions as $conditions) {
         foreach ($conditions as $condition) {
             $condition->getProcessor()->reset();
         }
     }
     WCF::getTPL()->assign('success', true);
 }
 /**
  * @see	\wcf\data\IDeleteAction::delete()
  */
 public function delete()
 {
     ConditionHandler::getInstance()->deleteConditions('com.woltlab.wcf.condition.userGroupAssignment', $this->objectIDs);
     return parent::delete();
 }
Exemplo n.º 4
0
 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     parent::save();
     $this->objectAction = new AdAction(array(), 'create', array('data' => array_merge($this->additionalFields, array('ad' => $this->ad, 'adName' => $this->adName, 'isDisabled' => $this->isDisabled, 'objectTypeID' => $this->objectTypeID, 'showOrder' => $this->showOrder))));
     $returnValues = $this->objectAction->executeAction();
     // transform conditions array into one-dimensional array
     $conditions = array();
     foreach ($this->groupedConditionObjectTypes as $groupedObjectTypes) {
         foreach ($groupedObjectTypes as $objectTypes) {
             if (is_array($objectTypes)) {
                 $conditions = array_merge($conditions, $objectTypes);
             } else {
                 $conditions[] = $objectTypes;
             }
         }
     }
     ConditionHandler::getInstance()->createConditions($returnValues['returnValues']->adID, $conditions);
     $this->saved();
     // reset values
     $this->ad = '';
     $this->adName = '';
     $this->isDisabled = 0;
     $this->objectTypeID = 0;
     $this->showOrder = 0;
     foreach ($conditions as $condition) {
         $condition->getProcessor()->reset();
     }
     WCF::getTPL()->assign('success', true);
 }
Exemplo n.º 5
0
 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     AbstractForm::save();
     $this->objectAction = new NoticeAction(array($this->notice), 'update', array('data' => array_merge($this->additionalFields, array('cssClassName' => $this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName, 'isDisabled' => $this->isDisabled, 'isDismissible' => $this->isDismissible, 'notice' => I18nHandler::getInstance()->isPlainValue('notice') ? I18nHandler::getInstance()->getValue('notice') : 'wcf.notice.notice.notice' . $this->notice->noticeID, 'noticeName' => $this->noticeName, 'noticeUseHtml' => $this->noticeUseHtml, 'showOrder' => $this->showOrder))));
     $this->objectAction->executeAction();
     if (I18nHandler::getInstance()->isPlainValue('notice')) {
         if ($this->notice->notice == 'wcf.notice.notice.notice' . $this->notice->noticeID) {
             I18nHandler::getInstance()->remove($this->notice->notice);
         }
     } else {
         I18nHandler::getInstance()->save('notice', 'wcf.notice.notice.notice' . $this->notice->noticeID, 'wcf.notice', 1);
     }
     // transform conditions array into one-dimensional array
     $conditions = array();
     foreach ($this->groupedConditionObjectTypes as $groupedObjectTypes) {
         foreach ($groupedObjectTypes as $objectTypes) {
             if (is_array($objectTypes)) {
                 $conditions = array_merge($conditions, $objectTypes);
             } else {
                 $conditions[] = $objectTypes;
             }
         }
     }
     ConditionHandler::getInstance()->updateConditions($this->notice->noticeID, $this->notice->getConditions(), $conditions);
     if ($this->resetIsDismissed) {
         $sql = "DELETE FROM\twcf" . WCF_N . "_notice_dismissed\n\t\t\t\tWHERE\t\tnoticeID = ?";
         $statement = WCF::getDB()->prepareStatement($sql);
         $statement->execute(array($this->notice->noticeID));
         $this->resetIsDismissed = 0;
         UserStorageHandler::getInstance()->resetAll('dismissedNotices');
     }
     $this->saved();
     // reload notice object for proper 'isDismissible' value
     $this->notice = new Notice($this->noticeID);
     WCF::getTPL()->assign('success', true);
 }
Exemplo n.º 6
0
 /**
  * Returns the conditions of the notice.
  * 
  * @return	array<\wcf\data\condition\Condition>
  */
 public function getConditions()
 {
     return ConditionHandler::getInstance()->getConditions('com.woltlab.wcf.condition.notice', $this->noticeID);
 }
Exemplo n.º 7
0
 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     AbstractForm::save();
     $this->objectAction = new AdAction(array($this->adObject), 'update', array('data' => array_merge($this->additionalFields, array('ad' => $this->ad, 'adName' => $this->adName, 'isDisabled' => $this->isDisabled, 'objectTypeID' => $this->objectTypeID, 'showOrder' => $this->showOrder))));
     $this->objectAction->executeAction();
     // transform conditions array into one-dimensional array
     $conditions = array();
     foreach ($this->groupedConditionObjectTypes as $groupedObjectTypes) {
         foreach ($groupedObjectTypes as $objectTypes) {
             if (is_array($objectTypes)) {
                 $conditions = array_merge($conditions, $objectTypes);
             } else {
                 $conditions[] = $objectTypes;
             }
         }
     }
     ConditionHandler::getInstance()->updateConditions($this->adObject->adID, $this->adObject->getConditions(), $conditions);
     $this->saved();
     WCF::getTPL()->assign('success', true);
 }
Exemplo n.º 8
0
 /**
  * Returns the conditions of the automatic assignement to a user group.
  * 
  * @return	array<\wcf\data\condition\Condition>
  */
 public function getConditions()
 {
     return ConditionHandler::getInstance()->getConditions('com.woltlab.wcf.condition.userGroupAssignment', $this->assignmentID);
 }
Exemplo n.º 9
0
 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     parent::save();
     $this->objectAction = new NoticeAction(array(), 'create', array('data' => array_merge($this->additionalFields, array('cssClassName' => $this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName, 'isDisabled' => $this->isDisabled, 'isDismissible' => $this->isDismissible, 'notice' => I18nHandler::getInstance()->isPlainValue('notice') ? I18nHandler::getInstance()->getValue('notice') : '', 'noticeName' => $this->noticeName, 'noticeUseHtml' => $this->noticeUseHtml, 'showOrder' => $this->showOrder))));
     $returnValues = $this->objectAction->executeAction();
     if (!I18nHandler::getInstance()->isPlainValue('notice')) {
         I18nHandler::getInstance()->save('notice', 'wcf.notice.notice.notice' . $returnValues['returnValues']->noticeID, 'wcf.notice', 1);
         // update notice name
         $noticeEditor = new NoticeEditor($returnValues['returnValues']);
         $noticeEditor->update(array('notice' => 'wcf.notice.notice.notice' . $returnValues['returnValues']->noticeID));
     }
     // transform conditions array into one-dimensional array
     $conditions = array();
     foreach ($this->groupedConditionObjectTypes as $groupedObjectTypes) {
         foreach ($groupedObjectTypes as $objectTypes) {
             if (is_array($objectTypes)) {
                 $conditions = array_merge($conditions, $objectTypes);
             } else {
                 $conditions[] = $objectTypes;
             }
         }
     }
     ConditionHandler::getInstance()->createConditions($returnValues['returnValues']->noticeID, $conditions);
     $this->saved();
     // reset values
     $this->cssClassName = '';
     $this->customCssClassName = '';
     $this->isDisabled = 0;
     $this->isDismissible = 0;
     $this->noticeName = '';
     $this->noticeUseHtml = 0;
     $this->showOrder = 0;
     I18nHandler::getInstance()->reset();
     foreach ($conditions as $condition) {
         $condition->getProcessor()->reset();
     }
     WCF::getTPL()->assign('success', true);
 }