views_plugin_argument_default_bboxquery.inc in Views GeoJSON 6
Same filename and directory in other branches
Contains the BBOX query string argument default plugin.
File
views/views_plugin_argument_default_bboxquery.incView source
<?php
/**
* @file
* Contains the BBOX query string argument default plugin.
*/
/**
* The BBOX query string argument default handler.
*/
class views_plugin_argument_default_bboxquery extends views_plugin_argument_default {
function option_definition() {
$options = parent::option_definition();
$options['argument'] = array(
'default' => '',
);
return $options;
}
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$form['info'] = array(
'#markup' => '<p class="description">Attempt to pull bounding box info
directly from the query string, bypassing Drupal\'s normal argument
handling. If the argument does not exist, all values will be shown.</p>',
);
$form['arg_id'] = array(
'#type' => 'textfield',
'#title' => t('Query argument ID'),
'#size' => 60,
'#maxlength' => 64,
'#default_value' => $this->options['arg_id'] ? $this->options['arg_id'] : t('BBOX'),
'#description' => t('The ID of the query argument.<br />For OpenLayers use <em>BBOX</em>, (as in "<em>?BBOX=left,bottom,right,top</em>".)'),
);
}
/**
* Return the default argument.
*/
function get_argument() {
if (isset($_GET[$this->options['arg_id']])) {
return $_GET[$this->options['arg_id']];
}
else {
return TRUE;
// Return all values if arg not present
}
}
}
/**
* @}
*/
Classes
Name![]() |
Description |
---|---|
views_plugin_argument_default_bboxquery | The BBOX query string argument default handler. |