Exemplo n.º 1
0
 protected function _postSave()
 {
     parent::_postSave();
     if ($this->getOption(self::OPTION_UPDATE_CATEGORY)) {
         $this->rebuildCategoryCounter();
     }
 }
Exemplo n.º 2
0
 protected function _postSave()
 {
     /* @var $userScopeModel bdApi_Model_UserScope */
     $userScopeModel = $this->getModelFromCache('bdApi_Model_UserScope');
     $userScopeModel->updateUserScopes($this->getMergedData());
     parent::_postSave();
 }
Exemplo n.º 3
0
 protected function _postSave()
 {
     if ($this->isInsert() or $this->isChanged('tag_text')) {
         $this->_rebuildCache();
     }
     return parent::_postSave();
 }
Exemplo n.º 4
0
 protected function _postSave()
 {
     if ($this->getOption(self::OPTION_UPDATE_CALLBACKS)) {
         $this->_getSubscriptionModel()->updateCallbacksForTopic($this->get('topic'));
     }
     parent::_postSave();
 }
Exemplo n.º 5
0
 protected function _postSave()
 {
     $this->getModelFromCache('XenForo_Model_Permission')->rebuildPermissionCache();
     // insert a dummy page
     $pageDw = XenForo_DataWriter::create('LiquidPro_SimpleForms_DataWriter_Page');
     $pageDw->bulkSet(array('form_id' => $this->get('form_id'), 'page_number' => 1, 'title' => '', 'description' => ''));
     $pageDw->save();
     parent::_postSave();
 }
Exemplo n.º 6
0
 protected function _postSave()
 {
     if ($this->isInsert()) {
         // insert a dummy page
         $pageDw = XenForo_DataWriter::create('LiquidPro_SimpleForms_DataWriter_Page');
         $pageDw->bulkSet(array('form_id' => $this->get('form_id'), 'page_number' => 1, 'title' => '', 'description' => ''));
         $pageDw->save();
     }
     parent::_postSave();
 }
Exemplo n.º 7
0
 protected function _postSave()
 {
     $this->updateFields();
     if ($this->_executeDestinations) {
         $destinationModel = $this->_getDestinationModel();
         $destinationOptionModel = $this->_getDestinationOptionModel();
         // attachment handling
         $attachmentHash = $this->getExtraData(self::DATA_ATTACHMENT_HASH);
         if ($attachmentHash) {
             $attachmentModel = $this->_getAttachmentModel();
             $attachments = $attachmentModel->getAttachmentsByTempHash($attachmentHash);
         }
         // redirect handling
         $form = $this->_getFormModel()->getFormById($this->get('form_id'));
         $redirectDestination = null;
         if ($form['redirect_method'] == 'destination') {
             $redirectDestination = $form['redirect_destination'];
         }
         // get the destinations for a form and loop through them to handle them if necessary
         $destinations = $destinationModel->getDestinationsByFormId($form['form_id']);
         foreach ($destinations as $destination) {
             // only handle active destinations
             if ($destination['active']) {
                 // get the destination options
                 $destinationOptions = $destinationOptionModel->prepareDestinationOptions($destinationOptionModel->getDestinationOptionsByFormDestinationId($destination['form_destination_id']), true);
                 // create the destination
                 $formDestination = new $destination['handler_class']($form['form_id'], $this->_updateFields, $destinationOptions, null, $this->get('response_id'));
                 // handle attachments
                 if ($destinationOptionModel->getAttachmentsEnabled($form['form_id']) && $attachments) {
                     // create new temporary hash
                     $newAttachmentHash = md5(uniqid('', true));
                     // duplicate the attachment so others can use it
                     foreach ($attachments as $attachmentId => $attachment) {
                         $duplicateAttachmentId = $attachmentModel->insertTemporaryAttachment($attachment['data_id'], $newAttachmentHash);
                     }
                     $formDestination->setAttachmentHash($attachmentId, $duplicateAttachmentId, $newAttachmentHash);
                 }
                 // save the destination
                 $formDestination->save();
                 // get the redirect url from the destination
                 if (isset($redirectDestination) && $destination['form_destination_id'] == $redirectDestination) {
                     $redirectMethod = $destination['redirect_method'];
                     $this->_redirectUrl = $formDestination->{$redirectMethod}();
                 }
             }
         }
         // delete the temporary attachment hash
         if ($attachmentHash) {
             foreach ($attachments as $attachmentId => $attachment) {
                 $dw = XenForo_DataWriter::create('XenForo_DataWriter_Attachment');
                 $dw->setExistingData($attachment);
                 $dw->delete();
             }
         }
     }
     parent::_postSave();
 }
 protected function _postSave()
 {
     $this->updateDestinationOptions();
     $this->getModelFromCache('XenForo_Model_Permission')->rebuildPermissionCache();
     parent::_postSave();
 }
Exemplo n.º 9
0
 protected function _postSave()
 {
     $this->_insertOrUpdateMasterPhrase($this->_getWidgetModel()->getWidgetTitlePhrase($this->get('widget_id')), $this->get('title'), '', array('global_cache' => 1));
     if ($this->_isTemplateWidget($this->get('class'))) {
         $this->_getWidgetRendererTemplateModel()->dwPostSave($this->getMergedData(), $this->getWidgetOptions());
     } elseif ($this->isChanged('class') && $this->_isTemplateWidget($this->getExisting('class'))) {
         $this->_getWidgetRendererTemplateModel()->dwPostDelete($this->getMergedExistingData(), $this->getWidgetOptions(true));
     }
     parent::_postSave();
 }
 protected function _postSave()
 {
     $this->updateDestinationOptions();
     parent::_postSave();
 }
Exemplo n.º 11
0
 protected function _postSave()
 {
     parent::_postSave();
     $this->_insertIntoSearchIndex();
 }
Exemplo n.º 12
0
 protected function _postSave()
 {
     $this->_updateTag($this->isInsert() ? 1 : 0);
     return parent::_postSave();
 }