/** * {@inheritdoc} */ public function optionsFormSubmit($form, &$form_state) { if ($form_state['values']['options']['url'] == '') { unset($form_state['item']->options['url']); } if ($form_state['values']['options']['crossOrigin'] == '') { unset($form_state['item']->options['crossOrigin']); } parent::optionsFormSubmit($form, $form_state); }
/** * {@inheritdoc} */ public function optionsFormSubmit($form, &$form_state) { if (!empty($form_state['values']['options']['zoomDistance'])) { $zoom_distance = array(); foreach (explode("\n", $form_state['values']['options']['zoomDistance']) as $data) { $data = array_map('trim', explode(':', trim($data), 2)); if (!empty($data)) { $zoom_distance[(int) $data[0]] = (int) (isset($data[1]) ? $data[1] : $data[0]); } } $form_state['values']['options']['zoomDistance'] = $zoom_distance; } parent::optionsFormSubmit($form, $form_state); }
/** * {@inheritdoc} */ public function optionsFormSubmit($form, &$form_state) { parent::optionsFormSubmit($form, $form_state); $options = $this->getOptions(); foreach ($options as $geometry_type => $data) { if ($data['setRandomStyle'] != 1) { unset($options[$geometry_type]['styles']); unset($options[$geometry_type]['setRandomStyle']); } if ($data['count'] == 0) { unset($options[$geometry_type]); } } $this->setOptions($options); $form_state['values']['options'] = $options; parent::optionsFormSubmit($form, $form_state); }