Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function optionsToObjects()
 {
     $import = parent::optionsToObjects();
     if ($style = $this->getOption('style')) {
         $import = array_merge($import, Openlayers::load('style', $style)->getCollection()->getFlatList());
     }
     if ($source = $this->getOption('source')) {
         $import = array_merge($import, Openlayers::load('source', $source)->getCollection()->getFlatList());
     }
     return $import;
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function optionsToObjects()
 {
     $import = parent::optionsToObjects();
     foreach (array('style', 'source') as $option) {
         if ($option_value = $this->getOption($option, FALSE)) {
             if ($object = $this->getCollection()->getObjectById($option, $option_value)) {
                 $import = array_merge($import, $object->getCollection()->getFlatList());
             } else {
                 $import = array_merge($import, Openlayers::load($option, $option_value)->getCollection()->getFlatList());
             }
         }
     }
     return $import;
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 public function defaultProperties()
 {
     $properties = parent::defaultProperties();
     $properties['errorMessage'] = 'Error while loading @type @machine_name having service @service.';
     return $properties;
 }
 /**
  * Save an object in the database.
  *
  * @param ObjectInterface $object
  */
 public static function save(Object $object)
 {
     ctools_include('export');
     $configuration = $object->getConfiguration();
     $export = $object->getExport();
     ctools_export_crud_save($configuration['table'], $export);
 }
Esempio n. 5
0
 /**
  * {@inheritdoc}
  */
 public function getJS()
 {
     $js = parent::getJS();
     $js['opt']['target'] = $this->getId();
     unset($js['opt']['capabilities']);
     return $js;
 }
Esempio n. 6
0
 /**
  * {@inheritdoc}
  */
 public function getJS()
 {
     $js = parent::getJS();
     unset($js['opt']['capabilities']);
     return $js;
 }
Esempio n. 7
0
 /**
  * {@inheritdoc}
  */
 public function init()
 {
     parent::init();
     $this->loggerChannel->error($this->getMessage(), array('channel' => 'openlayers'));
     $this->messenger->addMessage($this->getMessage(), 'error', FALSE);
 }