本文整理汇总了PHP中iform_map_get_map_options函数的典型用法代码示例。如果您正苦于以下问题:PHP iform_map_get_map_options函数的具体用法?PHP iform_map_get_map_options怎么用?PHP iform_map_get_map_options使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了iform_map_get_map_options函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_form
/**
* Return the Indicia form code
* @param array $args Input parameters.
* @param array $node Drupal node object
* @param array $response Response from Indicia services after posting.
* @return HTML string
*/
public static function get_form($args, $node, $response)
{
iform_load_helpers(array('report_helper', 'map_helper'));
$auth = report_helper::get_read_auth($args['website_id'], $args['password']);
$reportOptions = iform_report_get_report_options($args, $auth);
$r = '<div class="ui-helper-clearfix">';
$reportOptions['geoserverLayer'] = $args['geoserver_layer'];
$reportOptions['geoserverLayerStyle'] = $args['geoserver_layer_style'];
$reportOptions['cqlTemplate'] = $args['cql_template'];
$reportOptions['clickable'] = $args['click_on_map_mode'] != 'none';
$reportOptions['clickableLayersOutputDiv'] = $args['click_on_map_div'];
if (!empty($args['click_on_map_columns'])) {
$reportOptions['clickableLayersOutputColumns'] = helper_base::explode_lines_key_value_pairs($args['click_on_map_columns']);
}
if ($args['click_on_map_mode'] != 'none') {
$reportOptions['clickableLayersOutputMode'] = $args['click_on_map_mode'];
}
// Use the proxy module if enabled, to get round limitations in URL length for
// filtered WMS requests.
if (defined('DRUPAL_BOOTSTRAP_CONFIGURATION') && module_exists('iform_proxy')) {
global $base_url;
$reportOptions['proxy'] = $base_url . '/?q=' . variable_get('iform_proxy_path', 'proxy') . '&url=';
}
$r .= '<br/>' . report_helper::report_map($reportOptions);
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
// This is used for drawing, so need an editlayer, but not used for input
$options['editLayer'] = true;
$options['editLayerInSwitcher'] = true;
$options['clickForSpatialRef'] = false;
if ($args['layer_picker'] != 'none') {
$picker = array('id' => 'map-layer-picker', 'includeIcons' => false, 'includeSwitchers' => true, 'includeHiddenLayers' => true);
if ($args['layer_picker'] == 'before') {
$r .= map_helper::layer_list($picker);
}
// as we have a layer picker, we can drop the layerSwitcher from the OL map.
if (array_search('layerSwitcher', $options['standardControls']) !== false) {
unset($options['standardControls'][array_search('layerSwitcher', $options['standardControls'])]);
}
}
if ($args['legend'] != 'none') {
$legend = array('id' => 'map-legend', 'includeIcons' => true, 'includeSwitchers' => false, 'includeHiddenLayers' => false);
if ($args['legend'] == 'before') {
$r .= map_helper::layer_list($legend);
}
}
if (isset($args['map_toolbar_pos'])) {
$options['toolbarDiv'] = $args['map_toolbar_pos'];
}
$r .= map_helper::map_panel($options, $olOptions);
if ($args['layer_picker'] == 'after') {
$r .= map_helper::layer_list($picker);
}
if ($args['legend'] == 'after') {
$r .= map_helper::layer_list($legend);
}
$r .= '</div>';
return $r;
}
示例2: get_form
/**
* Return the generated form output.
* @return Form HTML.
* @todo: Implement this method
*/
public static function get_form($args)
{
global $user;
$lang = isset($user) ? iform_lang_iso_639_2($user->lang) : 'eng';
if (function_exists('iform_load_helpers')) {
iform_load_helpers(array('map_helper'));
} else {
require_once dirname(dirname(__FILE__)) . '/map_helper.php';
}
$readAuth = data_entry_helper::get_read_auth($args['website_id'], $args['password']);
$r = '';
// setup the map options
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
if (array_key_exists('table', $_GET) && $_GET['table'] == 'sample') {
// Use a cUrl request to get the data from Indicia which contains the value we need to filter against
// Read the record that was just posted.
$fetchOpts = array('dataSource' => 'reports_for_prebuilt_forms/my_dot_map/occurrences_list', 'mode' => 'report', 'readAuth' => $readAuth, 'extraParams' => array('sample_id' => $_GET['id'], 'language' => $lang));
// @todo Error handling on the response
$occurrence = data_entry_helper::get_report_data($fetchOpts);
self::prepare_layer_titles($args, $occurrence);
// Add the 3 distribution layers if present. Reverse the order so 1st layer is topmost
$layerName = self::build_distribution_layer(3, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
}
$layerName = self::build_distribution_layer(2, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
}
$layerName = self::build_distribution_layer(1, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
}
if ($layerName) {
$options['layers'][] = $layerName;
}
// This is not a map used for input
$options['editLayer'] = false;
if ($args['hide_grid'] == false) {
// Now output a grid of the occurrences that were just saved.
$r .= "<table class=\"submission\"><thead><tr><th>" . lang::get('Species') . "</th><th>" . lang::get('Latin Name') . "</th><th>" . lang::get('Date') . "</th><th>" . lang::get('Spatial Ref') . "</th></tr></thead>\n";
$r .= "<tbody>\n";
foreach ($occurrence as $record) {
$r .= '<tr class="biota"><td>' . $record['lt4_taxon'] . '</td><td class="binomial"><em>' . $record['lt7_taxon'] . '</em></td><td>' . $record['lt0_date_start'] . '</td><td>' . $record['lt0_entered_sref'] . "</td></tr>\n";
}
$r .= "</tbody></table>\n";
}
}
$r .= '<div id="mapandlegend">';
$r .= map_helper::layer_list(array('id' => 'legend', 'includeSwitchers' => false, 'includeHiddenLayers' => false, 'includeIcons' => true, 'layerTypes' => array('overlay')));
$r .= map_helper::map_panel($options, $olOptions);
$r .= '</div>';
return $r;
}
示例3: get_form
/**
* Return the generated form output.
* @return Form HTML.
*/
public static function get_form($args)
{
iform_load_helpers(array('map_helper'));
$readAuth = map_helper::get_read_auth($args['website_id'], $args['password']);
// setup the map options
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
for ($layer = 1; $layer <= 3; $layer++) {
$argTitle = $args["layer_title_{$layer}"];
if (isset($argTitle) && !empty($argTitle)) {
//if there is no title then ignore the layer
$meaningId = self::get_meaning_id($layer, $args, $readAuth);
$taxon = self::get_taxon($meaningId, $readAuth);
$layerTitle = str_replace('{species}', $taxon, $argTitle);
$layerTitle = str_replace("'", "\\'", $layerTitle);
$url = map_helper::$geoserver_url . 'wms';
$argFeature = $args["wms_feature_type_{$layer}"];
$layers = "layers: '{$argFeature}'";
$argStyle = $args["wms_style_{$layer}"];
$style = $argStyle ? ", styles: '{$argStyle}'" : '';
$argWebsite = $args["website_id"];
$filter = ", CQL_FILTER: 'website_id={$argWebsite} AND taxon_meaning_id={$meaningId}";
$argCql = $args["cql_filter_{$layer}"];
if ($argCql) {
$arg = str_replace("'", "\\'", $argCql);
$filter .= " AND({$argCql})'";
} else {
$filter .= "'";
}
$script = " var distLayer{$layer} = new OpenLayers.Layer.WMS(";
$script .= "'{$layerTitle}', '{$url}',";
$script .= "{" . "{$layers}, transparent: true {$filter} {$style}},";
$script .= "{isBaseLayer: false, sphericalMercator: true, singleTile: true}";
$script .= ");\n";
map_helper::$onload_javascript .= $script;
$options['layers'][] = "distLayer{$layer}";
}
}
// This is not a map used for input
$options['editLayer'] = false;
// output a legend
$r .= map_helper::layer_list(array('includeSwitchers' => true, 'includeHiddenLayers' => true));
// output a map
$r .= map_helper::map_panel($options, $olOptions);
// Set up a page refresh for dynamic update of the map at set intervals
if ($args['refresh_timer'] !== 0 && is_numeric($args['refresh_timer'])) {
// is_int prevents injection
if (isset($args['load_on_refresh']) && !empty($args['load_on_refresh'])) {
map_helper::$javascript .= "setTimeout('window.location=\"" . $args['load_on_refresh'] . "\";', " . $args['refresh_timer'] . "*1000 );\n";
} else {
map_helper::$javascript .= "setTimeout('window.location.reload( false );', " . $args['refresh_timer'] . "*1000 );\n";
}
}
return $r;
}
示例4: get_form
/**
* Return the generated form output.
* @return Form HTML.
* @todo: Implement this method
*/
public static function get_form($args)
{
global $user;
$readAuth = data_entry_helper::get_read_auth($args['website_id'], $args['password']);
// setup the map options
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
if (array_key_exists('table', $_GET) && $_GET['table'] == 'sample') {
// Use a cUrl request to get the data from Indicia which contains the value we need to filter against
// Read the record that was just posted.
$fetchOpts = array('dataSource' => 'reports_for_prebuilt_forms/my_dot_map/occurrences_list', 'mode' => 'report', 'readAuth' => $readAuth, 'extraParams' => array('sample_id' => $_GET['id'], 'language' => iform_lang_iso_639_2($user->lang)));
// @todo Error handling on the response
$occurrence = data_entry_helper::get_report_data($fetchOpts);
$legend = '';
self::prepare_layer_titles($args, $occurrence);
// Add the 3 distribution layers if present. Reverse the order so 1st layer is topmost
$layerName = self::build_distribution_layer(3, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
$legend = '<div><img src="' . data_entry_helper::$geoserver_url . 'wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&LAYER=detail_occurrences&Format=image/jpeg' . '&STYLE=' . $args["wms_dist_3_style"] . '" alt=""/>' . $args["wms_dist_3_title"] . '</div>' . $legend;
}
$layerName = self::build_distribution_layer(2, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
$legend = '<div><img src="' . data_entry_helper::$geoserver_url . 'wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&LAYER=detail_occurrences&Format=image/jpeg' . '&STYLE=' . $args["wms_dist_2_style"] . '" alt=""/>' . $args["wms_dist_2_title"] . '</div>' . $legend;
}
$layerName = self::build_distribution_layer(1, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
$legend = '<div><img src="' . data_entry_helper::$geoserver_url . 'wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&LAYER=detail_occurrences&Format=image/png' . '&STYLE=' . $args["wms_dist_1_style"] . '" alt=""/>' . $args["wms_dist_1_title"] . '</div>' . $legend;
}
if ($layerName) {
$options['layers'][] = $layerName;
}
// This is not a map used for input
$options['editLayer'] = false;
// Now output a grid of the occurrences that were just saved.
$r .= "<table class=\"submission\"><thead><tr><th>" . lang::get('Species') . "</th><th>" . lang::get('Latin Name') . "</th><th>" . lang::get('Date') . "</th><th>" . lang::get('Spatial Ref') . "</th></tr></thead>\n";
$r .= "<tbody>\n";
foreach ($occurrence as $record) {
$r .= '<tr class="biota"><td>' . $record['lt4_taxon'] . '</td><td class="binomial"><em>' . $record['lt7_taxon'] . '</em></td><td>' . $record['lt0_date_start'] . '</td><td>' . $record['lt0_entered_sref'] . "</td></tr>\n";
}
$r .= "</tbody></table>\n";
$r .= '<div id="legend" class="ui-widget ui-widget-content ui-corner-all">' . $legend . '</div>';
}
$r .= data_entry_helper::map_panel($options, $olOptions);
return $r;
}
示例5: count_by_location_map
/**
* Outputs a map with an overlay of regions, showing a count for each. Default is to count records, but can
* be configured to count taxa.
*
* @param array $auth Authorisation tokens.
* @param array $args Form arguments (the settings on the form edit tab).
* @param string $tabalias The alias of the tab this is being loaded onto.
* @param array $options The options passed to this control using @option=value settings in the form structure.
* Options supported are those which can be passed to the report_helper::report_map method. In addition
* set @output=species to configure the report to show a species counts map.
* @param string $path The page reload path, in case it is required for the building of links.
* @return string HTML to insert into the page for the location map. JavaScript is added to the variables in helper_base.
*
* @link http://www.biodiverseit.co.uk/indicia/dev/docs/classes/report_helper.html#method_report_map API docs for report_helper::report_map
*/
public static function count_by_location_map($auth, $args, $tabalias, $options, $path)
{
iform_load_helpers(array('map_helper', 'report_helper'));
require_once iform_client_helpers_path() . 'prebuilt_forms/includes/map.php';
$mapOptions = iform_map_get_map_options($args, $auth['read']);
$olOptions = iform_map_get_ol_options($args);
$mapOptions['clickForSpatialRef'] = false;
$r = map_helper::map_panel($mapOptions, $olOptions);
if (!empty($options['output']) && $options['output'] === 'species') {
$type = 'species';
} else {
$type = 'occurrence';
}
$reportOptions = array_merge(iform_report_get_report_options($args, $auth['read']), array('dataSource' => "library/locations/{$type}_counts_mappable_for_event", 'featureDoubleOutlineColour' => '#f7f7f7', 'rowId' => 'id'), $options);
$r .= report_helper::report_map($reportOptions);
return $r;
}
示例6: count_by_location_map
/**
* Outputs a map with an overlay of regions, showing a count for each. Default is to count records, but can
* be configured to count taxa.
*
* @param array $auth Authorisation tokens.
* @param array $args Form arguments (the settings on the form edit tab).
* @param string $tabalias The alias of the tab this is being loaded onto.
* @param array $options The options passed to this control using @option=value settings in the form structure.
* Options supported are those which can be passed to the report_helper::report_map method. In addition
* set @output=species to configure the report to show a species counts map and set @title=... to
* include a heading in the output.
* @param string $path The page reload path, in case it is required for the building of links.
* @return string HTML to insert into the page for the location map. JavaScript is added to the variables in helper_base.
*
* @link http://www.biodiverseit.co.uk/indicia/dev/docs/classes/report_helper.html#method_report_map API docs for report_helper::report_map
*/
public static function count_by_location_map($auth, $args, $tabalias, $options, $path)
{
iform_load_helpers(array('map_helper', 'report_helper'));
require_once iform_client_helpers_path() . 'prebuilt_forms/includes/map.php';
$mapOptions = iform_map_get_map_options($args, $auth['read']);
$olOptions = iform_map_get_ol_options($args);
$mapOptions['clickForSpatialRef'] = false;
if ($args['interface'] !== 'one_page') {
$mapOptions['tabDiv'] = $tabalias;
}
$r = self::output_title($options);
$r .= map_helper::map_panel($mapOptions, $olOptions);
if (!empty($options['output']) && $options['output'] === 'species') {
$type = 'species';
} else {
$type = 'occurrence';
}
$subtype = empty($options['linked']) || $options['linked'] === false ? '' : '_linked';
$reportOptions = array_merge(iform_report_get_report_options($args, $auth['read']), array('dataSource' => "library/locations/filterable_{$type}_counts_mappable{$subtype}", 'featureDoubleOutlineColour' => '#f7f7f7', 'rowId' => 'id', 'caching' => true, 'cachePerUser' => false), $options);
$r .= report_helper::report_map($reportOptions);
return $r;
}
示例7: get_form
/**
* Return the generated form output.
* @return Form HTML.
* @todo: Implement this method
*/
public static function get_form($args)
{
$readAuth = data_entry_helper::get_read_auth($args['website_id'], $args['password']);
// setup the map options
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
if (array_key_exists('table', $_GET) && $_GET['table'] == 'sample') {
// Use a cUrl request to get the data from Indicia which contains the value we need to filter against
// Read the record that was just posted.
$fetchOpts = array('table' => 'occurrence', 'extraParams' => $readAuth + array('sample_id' => $_GET['id'], 'view' => 'detail'));
// @todo Error handling on the response
$occurrence = data_entry_helper::get_population_data($fetchOpts);
}
// Add the 3 distribution layers if present. Reverse the order so 1st layer is topmost
$layerName = self::build_distribution_layer(3, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
}
$layerName = self::build_distribution_layer(2, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
}
$layerName = self::build_distribution_layer(1, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
}
// Now output a grid of the occurrences that were just saved.
if (isset($occurrence)) {
$r .= "<table class=\"submission\"><thead><tr><th>Species</th><th>Date</th><th>Spatial Reference</th></tr></thead>\n";
$r .= "<tbody>\n";
foreach ($occurrence as $record) {
$r .= "<tr><td>" . $record['taxon'] . "</td><td>" . $record['date_start'] . "</td><td>" . $record['entered_sref'] . "</td></tr>\n";
}
$r .= "</tbody></table>\n";
}
$r .= data_entry_helper::map_panel($options, $olOptions);
return $r;
}
示例8: get_control_map
/**
* Get the map control.
*/
protected static function get_control_map($auth, $args, $tabalias, $options)
{
$options = array_merge(iform_map_get_map_options($args, $auth['read']), $options);
if (isset(data_entry_helper::$entity_to_load['sample:geom'])) {
$options['initialFeatureWkt'] = data_entry_helper::$entity_to_load['sample:wkt'];
}
if ($args['interface'] !== 'one_page') {
$options['tabDiv'] = $tabalias;
}
$olOptions = iform_map_get_ol_options($args);
if (!isset($options['standardControls'])) {
$options['standardControls'] = array('layerSwitcher', 'panZoom');
}
return data_entry_helper::map_panel($options, $olOptions);
}
示例9: get_template_with_map
private static function get_template_with_map($args, $readAuth, $extraParams, $paramDefaults)
{
$r = '<div id="outer-with-map" class="ui-helper-clearfix">';
$r .= '<div id="grid" class="left" style="width:65%">{paramsForm}{grid}';
// Insert a button to verify all visible, only available if viewing the clean records.
if (isset($_POST['verification-rule']) && $_POST['verification-rule'] === 'none' && empty($_POST['verification-id'])) {
$r .= '<button type="button" id="btn-verify-all">' . lang::get('Verify all visible') . '</button>';
}
$r .= '</div>';
$r .= '<div id="map-and-record" class="right" style="width: 34%"><div id="summary-map">';
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
// This is used for drawing, so need an editlayer, but not used for input
$options['editLayer'] = true;
$options['editLayerInSwitcher'] = true;
$options['clickForSpatialRef'] = false;
$options['featureIdField'] = 'occurrence_id';
$r .= map_helper::map_panel($options, $olOptions);
$reportMapOpts = array('dataSource' => !empty($args['mapping_report_name']) ? $args['mapping_report_name'] : $args['report_name'], 'mode' => 'report', 'readAuth' => $readAuth, 'autoParamsForm' => false, 'extraParams' => $extraParams, 'paramDefaults' => $paramDefaults, 'reportGroup' => 'verification', 'clickableLayersOutputMode' => 'report', 'rowId' => 'occurrence_id', 'sharing' => 'verification', 'ajax' => TRUE);
if (!empty($args['mapping_report_name_lores'])) {
$reportMapOpts['dataSourceLoRes'] = $args['mapping_report_name_lores'];
}
$r .= report_helper::report_map($reportMapOpts);
$r .= '</div>';
global $user;
if (function_exists('hostsite_get_user_field') && ($locationId = hostsite_get_user_field('location_expertise', false))) {
iform_map_zoom_to_location($locationId, $readAuth);
}
$r .= '<div id="record-details-wrap" class="ui-widget ui-widget-content">';
$r .= self::instructions('grid on the left');
$r .= '<div id="record-details-content" style="display: none">';
$r .= '<div id="record-details-toolbar">';
$r .= '<label>Set status:</label>';
$r .= '<button type="button" id="btn-verify">' . lang::get('Verify') . '</button>';
$r .= '<button type="button" id="btn-reject">' . lang::get('Reject') . '</button>';
$r .= '<button type="button" id="btn-query">' . lang::get('Query') . '</button>';
$r .= '<button type="button" id="btn-multiple" title="' . lang::get('Select this tool to tick off a list of records and action all of the ticked records in one go') . '">' . lang::get('Select records') . '</button>';
$r .= '<br/><label>Contact:</label>';
$r .= '<button type="button" id="btn-email-expert" class="default-button">' . lang::get('Another expert') . '</button>';
$r .= '<button type="button" id="btn-email-recorder" class="default-button">' . lang::get('Recorder') . '</button>';
$r .= '</div>';
$r .= '<div id="record-details-tabs">';
// note - there is a dependency in the JS that comments is the last tab and images the 2nd to last.
$r .= data_entry_helper::tab_header(array('tabs' => array('#details-tab' => lang::get('Details'), '#experience-tab' => lang::get('Experience'), '#phenology-tab' => lang::get('Phenology'), '#images-tab' => lang::get('Images'), '#comments-tab' => lang::get('Comments'))));
data_entry_helper::$javascript .= "indiciaData.detailsTabs = ['details','experience','phenology','images','comments'];\n";
data_entry_helper::enable_tabs(array('divId' => 'record-details-tabs'));
$r .= '<div id="details-tab"></div>';
$r .= self::other_tab_html();
$r .= '</div></div></div></div></div>';
return $r;
}
示例10: get_form
/**
* Return the generated form output.
* @return Form HTML.
*/
public static function get_form($args, $node)
{
global $user;
// There is a language entry in the args parameter list: this is derived from the $language DRUPAL global.
// It holds the 2 letter code, used to pick the language file from the lang subdirectory of prebuilt_forms.
// There should be no explicitly output text in this file.
// We must translate any field names and ensure that the termlists and taxonlists use the correct language.
// For attributes, the caption is automatically translated by data_entry_helper.
$logged_in = $user->uid > 0;
$uid = $user->uid;
$email = $user->mail;
$username = $user->name;
if (!user_access('IForm n' . $node->nid . ' access')) {
return "<p>" . lang::get('LANG_Insufficient_Privileges') . "</p>";
}
$r = '';
// Get authorisation tokens to update and read from the Warehouse.
$readAuth = data_entry_helper::get_read_auth($args['website_id'], $args['password']);
$svcUrl = data_entry_helper::$base_url . '/index.php/services';
$language = iform_lang_iso_639_2($args['language']);
drupal_add_js(drupal_get_path('module', 'iform') . '/media/js/jquery.form.js', 'module');
data_entry_helper::link_default_stylesheet();
data_entry_helper::add_resource('jquery_ui');
if ($args['language'] != 'en') {
data_entry_helper::add_resource('jquery_ui_' . $args['language']);
}
data_entry_helper::enable_validation('new-comments-form');
// don't care about ID itself, just want resources
$occID = '';
$smpID = '';
$userID = '';
$mode = 'FILTER';
if (array_key_exists('insect_id', $_GET)) {
$occID = $_GET['insect_id'];
$mode = 'INSECT';
} else {
if (array_key_exists('insect', $_GET)) {
$occID = $_GET['insect'];
$mode = 'INSECT';
} else {
if (array_key_exists('flower_id', $_GET)) {
$occID = $_GET['flower_id'];
$mode = 'FLOWER';
} else {
if (array_key_exists('flower', $_GET)) {
$occID = $_GET['flower'];
$mode = 'FLOWER';
} else {
if (array_key_exists('collection_id', $_GET)) {
$smpID = $_GET['collection_id'];
$mode = 'COLLECTION';
} else {
if (array_key_exists('collection', $_GET)) {
$smpID = $_GET['collection'];
$mode = 'COLLECTION';
} else {
if (array_key_exists('user_id', $_GET)) {
$userID = $_GET['user_id'];
} else {
if (array_key_exists('user', $_GET)) {
$userID = $_GET['user'];
}
}
}
}
}
}
}
}
// data_entry_helper::enable_validation('cc-1-collection-details'); // don't care about ID itself, just want resources
// The only things that will be editable after the collection is saved will be the identifiaction of the flower/insects.
// no id - just getting the attributes, rest will be filled in using AJAX
$sample_attributes = data_entry_helper::getAttributes(array('valuetable' => 'sample_attribute_value', 'attrtable' => 'sample_attribute', 'key' => 'sample_id', 'fieldprefix' => 'smpAttr', 'extraParams' => $readAuth, 'survey_id' => $args['survey_id']));
$occurrence_attributes = data_entry_helper::getAttributes(array('valuetable' => 'occurrence_attribute_value', 'attrtable' => 'occurrence_attribute', 'key' => 'occurrence_id', 'fieldprefix' => 'occAttr', 'extraParams' => $readAuth, 'survey_id' => $args['survey_id']));
$location_attributes = data_entry_helper::getAttributes(array('valuetable' => 'location_attribute_value', 'attrtable' => 'location_attribute', 'key' => 'location_id', 'fieldprefix' => 'locAttr', 'extraParams' => $readAuth, 'survey_id' => $args['survey_id']));
$defAttrOptions = array('extraParams' => $readAuth + array('orderby' => 'id'), 'lookUpListCtrl' => 'checkbox_group', 'lookUpKey' => 'meaning_id', 'booleanCtrl' => 'checkbox_group', 'sep' => ' ', 'language' => $language, 'suffixTemplate' => 'nosuffix', 'default' => '-1');
// note we have to proxy the post. Every time a write transaction is carried out, the write nonce is trashed.
// For security reasons we don't want to give the user the ability to generate their own nonce, so we use
// the fact that the user is logged in to drupal as the main authentication/authorisation/identification
// process for the user. The proxy also packages the post into the correct format
// the controls for the filter include all taxa, not just the ones allowed for data entry, as does the one for checking the tool, just to be on the safe side.
$flower_ctrl_args = array('label' => lang::get('LANG_Flower_Species'), 'fieldname' => 'flower:taxa_taxon_list_id', 'table' => 'taxa_taxon_list', 'captionField' => 'taxon', 'valueField' => 'id', 'columns' => 2, 'blankText' => lang::get('LANG_Choose_Taxon'), 'extraParams' => $readAuth + array('taxon_list_id' => $args['flower_list_id'], 'view' => 'detail', 'orderby' => 'taxonomic_sort_order'), 'suffixTemplate' => 'nosuffix');
$focus_flower_ctrl_args = $flower_ctrl_args;
$focus_flower_ctrl_args['fieldname'] = 'determination:taxa_taxon_list_id';
$focus_flower_ctrl_args['extraParams'] = $readAuth + array('taxon_list_id' => $args['flower_list_id'], 'view' => 'detail', 'orderby' => 'taxonomic_sort_order', 'allow_data_entry' => 't');
$insect_ctrl_args = array('label' => lang::get('LANG_Insect_Species'), 'fieldname' => 'insect:taxa_taxon_list_id', 'table' => 'taxa_taxon_list', 'captionField' => 'taxon', 'valueField' => 'id', 'columns' => 2, 'blankText' => lang::get('LANG_Choose_Taxon'), 'extraParams' => $readAuth + array('taxon_list_id' => $args['insect_list_id'], 'view' => 'detail', 'orderby' => 'taxonomic_sort_order'), 'suffixTemplate' => 'nosuffix');
$focus_insect_ctrl_args = $insect_ctrl_args;
$focus_insect_ctrl_args['fieldname'] = 'determination:taxa_taxon_list_id';
$focus_insect_ctrl_args['extraParams'] = $readAuth + array('taxon_list_id' => $args['insect_list_id'], 'view' => 'detail', 'orderby' => 'taxonomic_sort_order', 'allow_data_entry' => 't');
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
// The maps internal projection will be left at its default of 900913.
$options['initialFeatureWkt'] = null;
$options['proxy'] = '';
$options['suffixTemplate'] = 'nosuffix';
if (lang::get('msgGeorefSelectPlace') != 'msgGeorefSelectPlace') {
//.........这里部分代码省略.........
示例11: get_site_tab
private static function get_site_tab($auth, $args, $settings)
{
$r = '<div id="site-details" class="ui-helper-clearfix">';
$r .= '<form method="post" id="input-form">';
$r .= $auth['write'];
$r .= '<div id="cols" class="ui-helper-clearfix"><div class="left" style="width: 54%">';
$r .= '<fieldset><legend>' . lang::get('Site Details') . '</legend>';
$r .= "<input type=\"hidden\" name=\"website_id\" value=\"" . $args['website_id'] . "\" />\n";
$typeTerms = array();
if (!empty($args['main_type_term_1'])) {
$typeTerms[] = $args['main_type_term_1'];
}
if (!empty($args['main_type_term_2'])) {
$typeTerms[] = $args['main_type_term_2'];
}
if (!empty($args['main_type_term_3'])) {
$typeTerms[] = $args['main_type_term_3'];
}
$typeTermIDs = helper_base::get_termlist_terms($auth, 'indicia:location_types', $typeTerms);
$lookUpValues = array('' => '<' . lang::get('please select') . '>');
foreach ($typeTermIDs as $termDetails) {
$lookUpValues[$termDetails['id']] = $termDetails['term'];
}
// if location is predefined, can not change unless a 'managerPermission'
$canEditType = !$settings['locationId'] || isset($args['managerPermission']) && $args['managerPermission'] != '' && function_exists('user_access') && user_access($args['managerPermission']);
if ($canEditType) {
$r .= data_entry_helper::select(array('label' => lang::get('Site Type'), 'id' => 'location_type_id', 'fieldname' => 'location:location_type_id', 'lookupValues' => $lookUpValues));
data_entry_helper::$javascript .= "\$('#location_type_id').change(function(){\r\n switch(\$(this).val()){\n";
for ($i = 1; $i < 4; $i++) {
if (!empty($args['main_type_term_' . $i])) {
$type = helper_base::get_termlist_terms($auth, 'indicia:location_types', array($args['main_type_term_' . $i]));
data_entry_helper::$javascript .= " case \"" . $type[0]['id'] . "\":\n";
if (!isset($args['can_change_section_number_' . $i]) || !$args['can_change_section_number_' . $i]) {
if ($settings['locationId']) {
// not saved yet, so no sections yet created, hence no need to worry about existing value. make number attribute readonly. set value. min value will be 1.
data_entry_helper::$javascript .= " var minValue = \$('[name=" . str_replace(':', '\\\\:', $settings['numSectionsAttr']) . "]').attr('min');\r\n if(minValue > " . $args['section_number_' . $i] . ") { // existing value is greater than one we want to set\r\n alert('You are reducing the number of sections below that already existing. Please use the Remove Section button on the Your Route tab to reduce the number of sections to " . $args['section_number_' . $i] . " before changing the Site type');\r\n return false;\r\n }\r\n \$('[name=" . str_replace(':', '\\\\:', $settings['numSectionsAttr']) . "]').val(" . $args['section_number_' . $i] . ").attr('readonly','readonly').css('color','graytext');\n";
} else {
// not saved yet, so no sections yet created, hence no need to worry about existing value. make number attribute readonly. set value. min value will be 1.
data_entry_helper::$javascript .= " \$('[name=" . str_replace(':', '\\\\:', $settings['numSectionsAttr']) . "]').val(" . $args['section_number_' . $i] . ").attr('readonly','readonly').css('color','graytext');\n";
}
} else {
// user modifiable number of sections. value of attribute is left alone: don't have to worry att his point whether existing data.
data_entry_helper::$javascript .= " \$('[name=" . str_replace(':', '\\\\:', $settings['numSectionsAttr']) . "]').removeAttr('readonly').css('color','');\n";
}
data_entry_helper::$javascript .= " break;\n";
}
}
data_entry_helper::$javascript .= " default: break;\r\n };\r\n return true;\r\n});\n";
}
if ($settings['locationId']) {
$r .= '<input type="hidden" name="location:id" id="location:id" value="' . $settings['locationId'] . "\" />\n";
}
$r .= data_entry_helper::text_input(array('fieldname' => 'location:name', 'label' => lang::get('Site Name'), 'class' => 'control-width-4 required', 'disabled' => $settings['canEditBody'] ? '' : ' disabled="disabled" '));
if (!$settings['canEditBody']) {
$r .= '<p>' . lang::get('This site cannot be edited because there are walks recorded on it. Please contact the site administrator if you think there are details which need changing.') . '</p>';
} else {
if (count($settings['walks']) > 0) {
// can edit it
$r .= '<p>' . lang::get('This site has walks recorded on it. Please do not change the site details without considering the impact on the existing data.') . '</p>';
}
}
$list = explode(',', str_replace(' ', '', $args['spatial_systems']));
foreach ($list as $system) {
$systems[$system] = lang::get($system);
}
if (isset(data_entry_helper::$entity_to_load['location:centroid_sref_system']) && in_array(data_entry_helper::$entity_to_load['location:centroid_sref_system'], array('osgb', 'osie'))) {
data_entry_helper::$entity_to_load['location:centroid_sref_system'] = strtoupper(data_entry_helper::$entity_to_load['location:centroid_sref_system']);
}
$r .= data_entry_helper::sref_and_system(array('fieldname' => 'location:centroid_sref', 'geomFieldname' => 'location:centroid_geom', 'label' => 'Grid Ref.', 'systems' => $systems, 'class' => 'required', 'helpText' => lang::get('Click on the map to set the central grid reference.'), 'disabled' => $settings['canEditBody'] ? '' : ' disabled="disabled" '));
if ($settings['locationId'] && data_entry_helper::$entity_to_load['location:code'] != '' && data_entry_helper::$entity_to_load['location:code'] != null) {
$r .= data_entry_helper::text_input(array('fieldname' => 'location:code', 'label' => lang::get('Site Code'), 'class' => 'control-width-4', 'disabled' => ' readonly="readonly" '));
} else {
$r .= "<p>" . lang::get('The Site Code will be allocated by the Administrator.') . "</p>";
}
// setup the map options
$options = iform_map_get_map_options($args, $auth['read']);
// find the form blocks that need to go below the map.
$bottom = '';
$bottomBlocks = explode("\n", isset($args['bottom_blocks']) ? $args['bottom_blocks'] : '');
foreach ($bottomBlocks as $block) {
$bottom .= get_attribute_html($settings['attributes'], $args, array('extraParams' => $auth['read'], 'disabled' => $settings['canEditBody'] ? '' : ' disabled="disabled" '), $block);
}
// other blocks to go at the top, next to the map
if (isset($args['site_help']) && $args['site_help'] != '') {
$r .= '<p class="ui-state-highlight page-notice ui-corner-all">' . t($args['site_help']) . '</p>';
}
$r .= get_attribute_html($settings['attributes'], $args, array('extraParams' => $auth['read']));
$r .= '</fieldset>';
$r .= "</div>";
// left
$r .= '<div class="right" style="width: 44%">';
if (!$settings['locationId']) {
$help = t('Use the search box to find a nearby town or village, then drag the map to pan and click on the map to set the centre grid reference of the transect. ' . 'Alternatively if you know the grid reference you can enter it in the Grid Ref box on the left.');
$r .= '<p class="ui-state-highlight page-notice ui-corner-all">' . $help . '</p>';
$r .= data_entry_helper::georeference_lookup(array('label' => lang::get('Search for place'), 'driver' => $args['georefDriver'], 'georefPreferredArea' => $args['georefPreferredArea'], 'georefCountry' => $args['georefCountry'], 'georefLang' => $args['language'], 'readAuth' => $auth['read']));
}
if (isset($args['maxPrecision']) && $args['maxPrecision'] != '') {
$options['clickedSrefPrecisionMax'] = $args['maxPrecision'];
}
if (isset($args['minPrecision']) && $args['minPrecision'] != '') {
//.........这里部分代码省略.........
示例12: get_control_map
/**
* Get the map control.
*/
private static function get_control_map($auth, $args, $tabalias, $options)
{
$options = array_merge(iform_map_get_map_options($args, $auth['read']), $options);
if ($args['interface'] !== 'one_page') {
$options['tabDiv'] = $tabalias;
}
if (self::$want_location_layer) {
$options['layers'][] = 'locationLayer';
// Create vector layers to display a selected location onto
$options['setupJs'] = "\n locStyleMap = new OpenLayers.StyleMap({\n \"default\": new OpenLayers.Style({\n fillColor: \"Green\",\n strokeColor: \"Black\",\n fillOpacity: 0.3,\n strokeWidth: 1\n })\n });\n locationLayer = new OpenLayers.Layer.Vector(\"" . lang::get("LANG_Location_Layer") . "\",\n {styleMap: locStyleMap});\n";
}
$olOptions = iform_map_get_ol_options($args);
return data_entry_helper::map_panel($options, $olOptions);
}
示例13: get_control_map
/**
* Get the map control.
*/
private static function get_control_map($auth, $args, $tabalias, $options)
{
$options = array_merge(iform_map_get_map_options($args, $auth['read']), $options);
$options['layers'][] = 'locationLayer';
$options['tabDiv'] = $tabalias;
$olOptions = iform_map_get_ol_options($args);
return data_entry_helper::map_panel($options, $olOptions);
}
示例14: get_form
//.........这里部分代码省略.........
<form method="post" action="' . data_entry_helper::$base_url . '/index.php/services/report/requestReport?report=reports_for_prebuilt_forms/MNHNL/mnhnl_btw_transect_direction_report.xml&reportSource=local&auth_token=' . $readAuth['auth_token'] . '&nonce=' . $readAuth['nonce'] . '&mode=csv">
<p>' . lang::get('LANG_Direction_Report') . '</p>
<input type="hidden" name="params" value=\'{"survey_id":' . $args['survey_id'] . ', "direction_attr_id":' . $sample_walk_direction_id . ', "closed_attr_id":' . $sample_closure_id . '}\' />
<input type="submit" class="ui-state-default ui-corner-all" value="' . lang::get('LANG_Direction_Report_Button') . '">
</form>
<form method="post" action="' . data_entry_helper::$base_url . '/index.php/services/report/requestReport?report=reports_for_prebuilt_forms/MNHNL/mnhnl_btw_verified_data_report.xml&reportSource=local&auth_token=' . $readAuth['auth_token'] . '&nonce=' . $readAuth['nonce'] . '&mode=csv">
<p>' . lang::get('LANG_Verified_Data_Report') . '</p>
<input type="hidden" name="params" value=\'{"survey_id":' . $args['survey_id'] . '}\' />
<input type="submit" class="ui-state-default ui-corner-all" value="' . lang::get('LANG_Verified_Data_Report_Button') . '">
</form>
<form method="post" action="' . data_entry_helper::$base_url . '/index.php/services/report/requestReport?report=reports_for_prebuilt_forms/MNHNL/mnhnl_btw_download_report_2.xml&reportSource=local&auth_token=' . $readAuth['auth_token'] . '&nonce=' . $readAuth['nonce'] . '&mode=csv">
<p>' . lang::get('LANG_Initial_Download') . '</p>
<input type="hidden" name="params" value=\'{"survey_id":' . $args['survey_id'] . ', "closed_attr_id":' . $sample_closure_id . ', "download": "INITIAL", "quality": "!R", "occattrs": "' . $occurrence_confidence_id . ',' . $occurrence_count_id . ',' . $occurrence_approximation_id . ',' . $occurrence_territorial_id . ',' . $occurrence_atlas_code_id . ',' . $occurrence_overflying_id . '", "smpattrs" : "' . $sample_walk_direction_id . ',' . $sample_reliability_id . ',' . $sample_visit_number_id . ',' . $sample_wind_id . ',' . $sample_precipitation_id . ',' . $sample_temperature_id . ',' . $sample_cloud_id . ',' . $sample_start_time_id . ',' . $sample_end_time_id . ',' . $sample_closure_id . ',' . $uid_attr_id . ',' . $email_attr_id . ',' . $username_attr_id . '"}\' />
<input type="submit" class="ui-state-default ui-corner-all" value="' . lang::get('LANG_Initial_Download_Button') . '">
</form>
<form method="post" action="' . data_entry_helper::$base_url . '/index.php/services/report/requestReport?report=reports_for_prebuilt_forms/MNHNL/mnhnl_btw_download_report_2.xml&reportSource=local&auth_token=' . $readAuth['auth_token'] . '&nonce=' . $readAuth['nonce'] . '&mode=csv">
<p>' . lang::get('LANG_Confirm_Download') . '</p>
<input type="hidden" name="params" value=\'{"survey_id":' . $args['survey_id'] . ', "closed_attr_id":' . $sample_closure_id . ', "download": "CONFIRM", "quality": "V", "occattrs": "' . $occurrence_confidence_id . ',' . $occurrence_count_id . ',' . $occurrence_approximation_id . ',' . $occurrence_territorial_id . ',' . $occurrence_atlas_code_id . ',' . $occurrence_overflying_id . '", "smpattrs" : "' . $sample_walk_direction_id . ',' . $sample_reliability_id . ',' . $sample_visit_number_id . ',' . $sample_wind_id . ',' . $sample_precipitation_id . ',' . $sample_temperature_id . ',' . $sample_cloud_id . ',' . $sample_start_time_id . ',' . $sample_end_time_id . ',' . $sample_closure_id . ',' . $uid_attr_id . ',' . $email_attr_id . ',' . $username_attr_id . '"}\' />
<input type="submit" class="ui-state-default ui-corner-all" value="' . lang::get('LANG_Confirm_Download_Button') . '">
</form>
<form method="post" action="' . data_entry_helper::$base_url . '/index.php/services/report/requestReport?report=reports_for_prebuilt_forms/MNHNL/mnhnl_btw_download_report_2.xml&reportSource=local&auth_token=' . $readAuth['auth_token'] . '&nonce=' . $readAuth['nonce'] . '&mode=csv">
<p>' . lang::get('LANG_Final_Download') . '</p>
<input type="hidden" name="params" value=\'{"survey_id":' . $args['survey_id'] . ', "closed_attr_id":' . $sample_closure_id . ', "download": "FINAL", "quality": "V", "occattrs": "' . $occurrence_confidence_id . ',' . $occurrence_count_id . ',' . $occurrence_approximation_id . ',' . $occurrence_territorial_id . ',' . $occurrence_atlas_code_id . ',' . $occurrence_overflying_id . '", "smpattrs" : "' . $sample_walk_direction_id . ',' . $sample_reliability_id . ',' . $sample_visit_number_id . ',' . $sample_wind_id . ',' . $sample_precipitation_id . ',' . $sample_temperature_id . ',' . $sample_cloud_id . ',' . $sample_start_time_id . ',' . $sample_end_time_id . ',' . $sample_closure_id . ',' . $uid_attr_id . ',' . $email_attr_id . ',' . $username_attr_id . '"}\' />
<input type="submit" class="ui-state-default ui-corner-all" value="' . lang::get('LANG_Final_Download_Button') . '">
</form>
<form method="post" action="' . data_entry_helper::$base_url . '/index.php/services/report/requestReport?report=reports_for_prebuilt_forms/MNHNL/mnhnl_btw_download_report_2.xml&reportSource=local&auth_token=' . $readAuth['auth_token'] . '&nonce=' . $readAuth['nonce'] . '&mode=csv">
<p>' . lang::get('LANG_Complete_Final_Download') . '</p>
<input type="hidden" name="params" value=\'{"survey_id":' . $args['survey_id'] . ', "closed_attr_id":' . $sample_closure_id . ', "download": "OFF", "quality": "NA", "occattrs": "' . $occurrence_confidence_id . ',' . $occurrence_count_id . ',' . $occurrence_approximation_id . ',' . $occurrence_territorial_id . ',' . $occurrence_atlas_code_id . ',' . $occurrence_overflying_id . '", "smpattrs" : "' . $sample_walk_direction_id . ',' . $sample_reliability_id . ',' . $sample_visit_number_id . ',' . $sample_wind_id . ',' . $sample_precipitation_id . ',' . $sample_temperature_id . ',' . $sample_cloud_id . ',' . $sample_start_time_id . ',' . $sample_end_time_id . ',' . $sample_closure_id . ',' . $uid_attr_id . ',' . $email_attr_id . ',' . $username_attr_id . '"}\' />
<input type="submit" class="ui-state-default ui-corner-all" value="' . lang::get('LANG_Complete_Final_Download_Button') . '">
</form>
</div>';
}
// Create Map
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
// if($locations == 'all' || $loclist != '-1')
// $options['layers'] = array('locationListLayer');
$options['searchLayer'] = 'false';
$options['editLayer'] = 'false';
$options['initialFeatureWkt'] = null;
$options['proxy'] = '';
$options['scroll_wheel_zoom'] = false;
$options['width'] = 'auto';
// TBD remove from arglist
$r .= "<div class=\"mnhnl-btw-mappanel\">\n" . data_entry_helper::map_panel($options, $olOptions) . "</div>\n";
data_entry_helper::$javascript .= "\n\$('#controls').bind('tabsshow', function(event, ui) {\n var y = \$('.mnhnl-btw-datapanel:visible').outerHeight(true) + \$('.mnhnl-btw-datapanel:visible').position().top;\n if(y < \$('.mnhnl-btw-mappanel').outerHeight(true)+ \$('.mnhnl-btw-mappanel').position().top){\n y = \$('.mnhnl-btw-mappanel').outerHeight(true)+ \$('.mnhnl-btw-mappanel').position().top;\n }\n \$('#controls').height(y - \$('#controls').position().top);\n});\n";
if (count($tabs) > 1) {
// close tabs div if present
$r .= "</div>";
}
if (method_exists(get_called_class(), 'getTrailerHTML')) {
$r .= call_user_func(array(get_called_class(), 'getTrailerHTML'), $args);
}
return $r;
}
///////////////////////////////////////////////////////////////////
// At this point there are 3 modes:
// Adding a new survey
// editing/showing an existing survey
// editing/showing an existing occurrence
// First load the occurrence (and its position sample) if provided
// Then load the parent sample if provided, or derived from occurrence.
// $occReadOnly is set if the occurrence has been downloaded. Not even an admin user can modify it in this case.
data_entry_helper::$javascript .= "\n// Create Layers.\nvar locationLayer, occListLayer, control;\nmapInitialisationHooks.push(function (div) {\n \"use strict\";\n // Create vector layers: one to display the location onto, and another for the occurrence list\n // the default edit layer is used for the occurrences themselves\n var locStyleMap = new OpenLayers.StyleMap({\n 'default': new OpenLayers.Style({\n fillColor: 'Green',\n strokeColor: 'Black',\n fillOpacity: 0.2,\n strokeWidth: 1\n })});\n locationLayer = new OpenLayers.Layer.Vector('" . lang::get("LANG_Location_Layer") . "', {styleMap: locStyleMap});\n var occStyleMap = new OpenLayers.StyleMap({\n 'default': new OpenLayers.Style({\n pointRadius: 3,\n fillColor: 'Red',\n fillOpacity: 0.3,\n strokeColor: 'Red',\n strokeWidth: 1\n })});\n occListLayer = new OpenLayers.Layer.Vector(\"" . lang::get("LANG_Occurrence_List_Layer") . "\", {styleMap: occStyleMap});\n div.map.addLayer(locationLayer);\n div.map.addLayer(occListLayer);\n var control = new OpenLayers.Control.SelectFeature(occListLayer);\n occListLayer.map.addControl(control);\n function onPopupClose(evt) {\n // 'this' is the popup.\n control.unselect(this.feature);\n }\n function onFeatureSelect(evt) {\n feature = evt.feature;\n popup = new OpenLayers.Popup.FramedCloud(\"featurePopup\",\n feature.geometry.getBounds().getCenterLonLat(),\n new OpenLayers.Size(100,100),\n feature.attributes.taxon + \" (\" + feature.attributes.count + \")\",\n null, true, onPopupClose);\n feature.popup = popup;\n popup.feature = feature;\n feature.layer.map.addPopup(popup);\n }\n function onFeatureUnselect(evt) {\n feature = evt.feature;\n if (feature.popup) {\n popup.feature = null;\n feature.layer.map.removePopup(feature.popup);\n feature.popup.destroy();\n feature.popup = null;\n }\n }\n occListLayer.events.on({\n 'featureselected': onFeatureSelect,\n 'featureunselected': onFeatureUnselect\n });\n control.activate();\n});\n";
$occReadOnly = false;
$childSample = array();
示例15: get_control_map
/**
* Draw Map section of the page.
* @return string The output map panel.
*
* @package Client
* @subpackage PrebuiltForms
*/
protected static function get_control_map($auth, $args, $tabalias, $options)
{
iform_load_helpers(array('data_entry_helper'));
self::load_record($auth);
$options = array_merge(iform_map_get_map_options($args, $auth['read']), array('maxZoom' => 14), $options);
if (isset(self::$record['geom'])) {
$options['initialFeatureWkt'] = self::$record['geom'];
}
if ($args['interface'] !== 'one_page') {
$options['tabDiv'] = $tabalias;
}
$olOptions = iform_map_get_ol_options($args);
if (!isset($options['standardControls'])) {
$options['standardControls'] = array('layerSwitcher', 'panZoom');
}
return '<div class="detail-panel" id="detail-panel-map"><h3>Map</h3>' . data_entry_helper::map_panel($options, $olOptions) . '</div>';
}