function perform(&$request, &$response) { $request->set_status(REQUEST_STATUS_SUCCESS); if ($request->has_attribute('popup')) { $response->write(close_popup_response($request)); } if (!($object = wrap_with_site_object(fetch_requested_object()))) { return; } $site_object_controller =& $object->get_controller(); $action = $site_object_controller->determine_action($request); switch ($action) { case 'publish': $status = $this->get_publish_status($object); break; case 'unpublish': $status = $this->get_unpublish_status($object); break; default: return; break; } $object->set_attribute('status', $status); $object->update(false); $this->_apply_access_policy($object, $action); flush_fetcher_cache(); }
function _valid_perform(&$request, &$response) { $object_data =& $this->_load_object_data(); $this->_valid_perform_prepare_data($object_data); $this->object->merge_attributes($object_data); if(!$this->_update_object_operation()) { $request->set_status(REQUEST_STATUS_FAILURE); return; } $this->indexer->add($this->object); if(isset($data_to_import['identifier']) && $object_data['identifier'] != $data_to_import['identifier']) { $this->_handle_changed_identifier($data_to_import['identifier']); } $request->set_status(REQUEST_STATUS_FORM_SUBMITTED); flush_fetcher_cache(); }
function perform(&$request, &$response) { $request->set_status(REQUEST_STATUS_SUCCESS); if ($request->has_attribute('popup')) { $response->write(close_popup_response($request)); } if (!($object = wrap_with_site_object(fetch_requested_object()))) { return; } $status = $this->get_status($object); $object->set_attribute('status', $status); $object->update(false); $this->_apply_access_policy($object); flush_fetcher_cache(); }