/** * {@inheritdoc} */ public function load() { $request = Rsc_Http_Request::create(); if (false !== strpos($request->query->get('page'), 'supsystic-slider')) { $this->register('admin_print_scripts'); } }
/** * Constructor * @param Rsc_Http_Request $request * @param string|null $method * @param Rsc_Common_Collection|array $rules * @param Rsc_Common_Collection|array $filters */ public function __construct(Rsc_Http_Request $request = null, $method = null, array $rules = array(), array $filters = array()) { $this->request = $request === null ? Rsc_Http_Request::create() : $request; $this->method = $method === null ? self::METHOD_POST : $this->prepareMethod($method); $this->rules = $rules; $this->filters = $filters; }
/** * @return bool */ public function handle() { $request = Rsc_Http_Request::create(); if ($this->isPostRequest($request)) { return $this->handleRequest($request->post); } elseif ($this->isGetRequest($request)) { return $this->handleRequest($request->query); } }
public function cloneAction(Rsc_Http_Request $request) { $id = $request->post->get('id', $request->query->get('id')); try { $cloneId = $this->modelsFactory->get('projects')->makeClone($id); $prototype = $this->modelsFactory->get('projects')->get($id); $this->modelsFactory->get('projectNetworks', 'Networks')->cloneNetworks($cloneId, $prototype); $redirectUri = $this->generateUrl('projects', 'view', array('id' => $cloneId)); if ($request->isXmlHttpRequest()) { return $this->response(Rsc_Http_Response::AJAX, array('location' => $redirectUri)); } return $this->redirect($redirectUri); } catch (InvalidArgumentException $e) { throw $this->error(sprintf($this->translate('Unable to clone project: %s'), $e->getMessage())); } catch (RuntimeException $e) { throw $this->error(sprintf($this->translate('Unable to clone project due database error: %s'), $e->getMessage())); } }