public function configure()
 {
     $this->widgetSchema['content'] = new sfWidgetFormDmRichEditor();
     $this->widgetSchema['content']->setAttribute('rows', 20);
     $this->validatorSchema['content'] = new sfValidatorString(array('required' => true));
     parent::configure();
 }
Ejemplo n.º 2
0
  public function getWidgetValues()
  {
    $values = parent::getWidgetValues();

    $values['items'] = array();

    foreach(dmArray::get($values, 'link', array()) as $index => $link)
    {
      $values['items'][] = array(
        'link'     => $values['link'][$index],
        'text'     => $values['text'][$index],
        'secure'   => (int) !empty($values['secure'][$index]),
        'nofollow' => (int) !empty($values['nofollow'][$index]),
        'depth'    => $values['depth'][$index]
      );
    }

    unset(
      $values['link'],
      $values['text'],
      $values['secure'],
      $values['nofollow'],
      $values['depth']
    );

    return $values;
  }
Ejemplo n.º 3
0
 public function getWidgetValues()
 {
     $values = parent::getWidgetValues();
     if ($values['file']) {
         $this->createMediaFromUploadedFile($values);
     }
     unset($values['mediaName'], $values['file']);
     return $values;
 }
Ejemplo n.º 4
0
 public function configure()
 {
     $this->widgetSchema['href'] = new sfWidgetFormInputText(array(), array('class' => 'dm_link_droppable', 'title' => $this->__('Accepts pages, medias and urls')));
     $this->validatorSchema['href'] = new dmValidatorLinkUrl(array('required' => true));
     $this->widgetSchema['text'] = new sfWidgetFormTextarea(array(), array('rows' => 2));
     $this->validatorSchema['text'] = new sfValidatorString(array('required' => false));
     $this->widgetSchema['title'] = new sfWidgetFormInputText();
     $this->validatorSchema['title'] = new sfValidatorString(array('required' => false));
     parent::configure();
 }
Ejemplo n.º 5
0
 public function configure()
 {
     $this->widgetSchema['text'] = new sfWidgetFormTextarea(array(), array('rows' => 2));
     $this->widgetSchema['tag'] = new sfWidgetFormChoice(array('choices' => $this->getTagNames()));
     $this->widgetSchema['href'] = new sfWidgetFormInputText(array(), array('class' => 'dm_link_droppable', 'title' => $this->__('Accepts pages, medias and urls')));
     $this->widgetSchema->setHelp('href', 'If you set a href, a link will be inserted into the title');
     $this->validatorSchema['text'] = new sfValidatorString(array('required' => true));
     $this->validatorSchema['tag'] = new sfValidatorChoice(array('choices' => $this->getTagNames(), 'required' => true));
     $this->validatorSchema['href'] = new dmValidatorLinkUrl(array('required' => false));
     parent::configure();
 }
 public function configure()
 {
     $this->widgetSchema['href'] = new sfWidgetFormInputText(array(), array('class' => 'dm_link_droppable', 'title' => $this->__('Accepts pages, medias and urls')));
     $this->validatorSchema['href'] = new dmValidatorLinkUrl(array('required' => true));
     $this->widgetSchema['target'] = new sfWidgetFormSelect(array('choices' => $this->getI18n()->translateArray($this->target)));
     $this->validatorSchema['target'] = new sfValidatorChoice(array('choices' => array_keys($this->target), 'required' => false));
     if (is_null($this->getDefault('target'))) {
         $this->setDefault('target', '_self');
     }
     $this->widgetSchema['text'] = new sfWidgetFormTextarea(array(), array('rows' => 2));
     $this->validatorSchema['text'] = new sfValidatorString(array('required' => false));
     $this->widgetSchema['title'] = new sfWidgetFormInputText();
     $this->validatorSchema['title'] = new sfValidatorString(array('required' => false));
     parent::configure();
 }
Ejemplo n.º 7
0
 public function configure()
 {
     $this->widgetSchema['url'] = new sfWidgetFormInputText();
     $this->validatorSchema['url'] = new dmValidatorLinkUrl(array('required' => true));
     $this->widgetSchema['nb_items'] = new sfWidgetFormInputText();
     $this->validatorSchema['nb_items'] = new sfValidatorInteger(array('min' => 0, 'max' => 100));
     $this->widgetSchema['life_time'] = new sfWidgetFormInputText();
     $this->validatorSchema['life_time'] = new sfValidatorInteger(array('min' => 0));
     $this->widgetSchema->setHelp('life_time', 'Cache life time in seconds');
     if (!$this->getDefault('nb_items')) {
         $this->setDefault('nb_items', 10);
     }
     if (!$this->getDefault('life_time')) {
         $this->setDefault('life_time', 86400);
     }
     parent::configure();
 }
Ejemplo n.º 8
0
 public function getWidgetValues()
 {
     $values = parent::getWidgetValues();
     $values['medias'] = array();
     foreach ($values['media_id'] as $index => $mediaId) {
         $values['medias'][] = array('id' => $mediaId, 'link' => $values['media_link'][$index], 'alt' => $values['media_alt'][$index]);
     }
     if (empty($values['width'])) {
         if ($values['widget_width']) {
             $values['width'] = $values['widget_width'];
         } else {
             $values['width'] = 300;
         }
         $values['height'] = dmArray::get($values, 'height', (int) ($values['width'] * 2 / 3));
     } elseif (empty($values['height'])) {
         $values['height'] = (int) ($values['width'] * 2 / 3);
     }
     unset($values['widget_width'], $values['media_position'], $values['media_id'], $values['media_link']);
     return $values;
 }
Ejemplo n.º 9
0
 protected function getFirstDefaults()
 {
     return array_merge(parent::getFirstDefaults(), array('maxPerPage' => 10));
 }
 public function getJavascripts()
 {
     $javascripts = parent::getJavascripts();
     array_unshift($javascripts, 'dmCkEditorPlugin.widgetForm');
     return $javascripts;
 }
Ejemplo n.º 11
0
 public function configure()
 {
     parent::configure();
     dmDb::table('DmPage')->checkSearchPage();
 }
 protected function getFirstDefaults()
 {
     return array_merge(parent::getFirstDefaults(), array('separator' => '>', 'includeCurrent' => true, 'includeInactivePages' => true));
 }