You are here

class openlayers_simple in Openlayers 7.2

OpenLayers Box

Hierarchy

Expanded class hierarchy of openlayers_simple

1 string reference to 'openlayers_simple'
openlayers_boxes_plugins in ./openlayers.module
Implements hook_boxes_plugins().

File

plugins/boxes/openlayers_simple.inc, line 6

View source
class openlayers_simple extends boxes_box {

  /**
   * Implementation of boxes_content::options_defaults().
   */
  public function options_defaults() {
    return array(
      'map' => '',
    );
  }

  /**
   * Implementation of boxes_content::options_form().
   */
  public function options_form(&$form_state) {
    $form = array();

    // Map objects
    $form['map'] = array(
      '#type' => 'select',
      '#title' => t('Map'),
      '#description' => t('This is map that will be used to render the view.'),
      '#options' => openlayers_map_options(),
      '#default_value' => $this->options['map'] ? $this->options['map'] : variable_get('openlayers_default_map', 'default'),
    );
    return $form;
  }

  /**
   * Implementation of boxes_content::options_form().
   */
  public function render() {
    $title = isset($this->title) ? check_plain($this->title) : NULL;
    $map = openlayers_map_load($this->options['map']);
    return array(
      'delta' => $this->delta,
      // Crucial.
      'title' => $title,
      'subject' => $title,
      'content' => openlayers_render_map($map, $map->name),
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
boxes_box::$boxes static property
boxes_box::$delta public property
boxes_box::$description public property
boxes_box::$export_type public property
boxes_box::$new public property
boxes_box::$options public property
boxes_box::$plugin_key public property
boxes_box::$title public property
boxes_box::cache_setting public function Returns the block cache settings for this box. Subclasses can override this to perform more intricate operations around deciding the cache settings of the specific box instance.
boxes_box::delete public function Delete a box.
boxes_box::factory public static function Instantiate, populate and return a box object.
boxes_box::load public static function Load existing box by its unique identifier $delta.
boxes_box::reset public static function Reset the boxes cache.
boxes_box::save public function Save a box.
boxes_box::use_multistep_create public function Declare if the box should use a multistep form for the create form.
boxes_box::__construct protected function Create a new box.
openlayers_simple::options_defaults public function Implementation of boxes_content::options_defaults(). Overrides boxes_box::options_defaults
openlayers_simple::options_form public function Implementation of boxes_content::options_form(). Overrides boxes_box::options_form
openlayers_simple::render public function Implementation of boxes_content::options_form(). Overrides boxes_box::render