Example #1
0
 /**
  * @param  array  $variables
  */
 public function actionEditRedirect(array $variables = array())
 {
     /* -- Give us something to edit */
     $redirectModel = new Retour_RedirectsModel();
     $redirectModel->redirectSrcUrl = craft()->request->getParam('defaultRedirectSrcUrl');
     $redirectId = 0;
     if (!empty($variables['redirectId'])) {
         $redirectId = $variables['redirectId'];
         $record = craft()->retour->getRedirectById($redirectId);
         if ($record) {
             $redirectModel->setAttributes($record->getAttributes(), false);
         }
     }
     /* -- Get the list of matches */
     $matchList = craft()->retour->getMatchesList();
     /* -- Display the edit template */
     $this->renderTemplate('retour/_edit', array('values' => $redirectModel, 'matchList' => $matchList, 'redirectId' => $redirectId));
 }
 /**
  * Defines this model's attributes.
  *
  * @return array
  */
 protected function defineAttributes()
 {
     return array_merge(parent::defineAttributes(), array('redirectChangeable' => array(AttributeType::Bool, 'default' => 1)));
 }