/** * Return the template pages without the current page * @return Array Object collection */ protected function getTemplatePages() { $pages = sfPlopPagePeer::getPagesWithLevel(); if (!$this->isNew()) { unset($pages[$this->getObject()->getId()]); } return $pages; }
public function configure() { parent::configure(); unset($this['layout'], $this['template'], $this['is_editable'], $this['sortable_rank'], $this['created_at'], $this['updated_at']); $this->widgetSchema->getFormFormatter()->setTranslationCatalogue('plopAdmin'); $this->widgetSchema['page_id'] = new sfWidgetFormChoice(array('choices' => sfPlopPagePeer::getPagesWithLevel(true))); $this->validatorSchema['page_id'] = new sfValidatorChoice(array('choices' => array_keys(sfPlopPagePeer::getPagesWithLevel(true)), 'required' => false)); if ($this->getOption('page_id')) { $this->widgetSchema['page_id']->setDefault($this->getOption('page_id')); } $this->widgetSchema['is_published']->setLabel('Is published ?'); }