/** * Copy a slot from a template page to another. * @param sfWebRequest $request */ public function executeCopySlot(sfWebRequest $request) { $this->page_ref = $this->getRoute()->getObject(); $this->page_ref->setCulture($this->culture); $this->slot_ref = sfPlopSlotPeer::retrieveByPK($request->getParameter('slot_id')); $this->forward404Unless($this->slot_ref); $this->form = new sfPlopSlotCopyForm(null, array('page_ref' => $this->page_ref, 'slot_ref' => $this->slot_ref)); if ($this->getRequest()->getMethod() == sfRequest::POST) { $values = $request->getParameter('sf_plop_slot'); $this->form->bind($values); if ($this->form->isValid()) { $this->slot = $this->form->save(); return $this->redirect('@sf_plop_page_show?slug=' . $this->slot->getPage()->getSlug()); } } $this->params = array('form' => $this->form, 'page_ref' => $this->page_ref, 'slot_ref' => $this->slot_ref); $this->partial = 'copy_slot'; $this->decorate(sfPlopCMSActions::T_DEFAULT); }