Exemplo n.º 1
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;
  }
 public function getWidgetValues()
 {
     $values = parent::getWidgetValues();
     if ($values['file']) {
         $this->createMediaFromUploadedFile($values);
     }
     unset($values['mediaName'], $values['file']);
     return $values;
 }
Exemplo n.º 3
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;
 }