public function Tinhte_XenTag_actionSave(XenResource_DataWriter_Resource $dw) { /* @var $tagModel Tinhte_XenTag_Model_Tag */ $tagModel = $this->getModelFromCache('Tinhte_XenTag_Model_Tag'); $resource = $dw->getMergedData(); if ($tagModel->canTagResource($resource)) { $tags = $tagModel->processInput($this->_input); if ($tags !== false) { $dw->Tinhte_XenTag_setTags($tags); } } // just to be safe... unset($GLOBALS[Tinhte_XenTag_Constants::GLOBALS_CONTROLLERPUBLIC_RESOURCE_SAVE]); }
public function bdSocialShare_actionIcon(XenResource_DataWriter_Resource $resourceDw) { $resource = $resourceDw->getMergedData(); $queueDate = $resource['resource_date'] + bdSocialShare_Shareable_XenResource_Resource::SECONDS_WAIT_FOR_ICON; $shareQueueModel = $this->getModelFromCache('bdSocialShare_Model_ShareQueue'); $queue = $shareQueueModel->getQueueAt($queueDate); if (!empty($queue)) { foreach ($queue as $id => $record) { $data = bdSocialShare_Helper_Common::unserializeOrFalse($record, 'queue_data'); if (!empty($data) and !empty($data['shareable'])) { $shareable = bdSocialShare_Shareable_Abstract::createFromRecoveryData($data['shareable']); if ($shareable instanceof bdSocialShare_Shareable_XenResource_Resource and $shareable->getId() == $resource['resource_id']) { $shareQueueModel->reInsertQueue($record, XenForo_Application::$time); } } } } unset($GLOBALS[bdSocialShare_Listener::XENRESOURCE_CONTROLLERPUBLIC_RESOURCE_ICON]); }
/** * Called when a resource is removed from view in this category. * Can apply to moves, deletes, etc. * * @param XenResource_DataWriter_Resource $resource */ public function resourceRemoved(XenResource_DataWriter_Resource $resource) { if ($resource->getExisting('resource_state') != 'visible') { // nothing to do return; } $this->updateResourceCount(-1); $this->updateFeaturedCount(); if ($this->get('last_resource_id') == $resource->get('resource_id')) { $this->updateLastUpdate(); } }
public function bdPaygate_actionSave(XenResource_DataWriter_Resource $dw) { $input = $this->_input->filter(array('bdpaygate_price' => XenForo_Input::UNUM, 'bdpaygate_currency' => XenForo_Input::STRING, 'file_hash' => XenForo_Input::STRING)); if (!empty($input['file_hash'])) { $dw->getVersionDw()->setExtraData(XenResource_DataWriter_Version::DATA_ATTACHMENT_HASH, $input['file_hash']); } if (!empty($input['bdpaygate_price']) or !empty($input['bdpaygate_currency'])) { $dw->set('price', $input['bdpaygate_price']); $dw->set('currency', $input['bdpaygate_currency']); } unset($GLOBALS[bdPaygate_Constant::GLOBALS_XFRM_CONTROLLERPUBLIC_RESOURCE_SAVE]); }