/** * 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; }
public static function add_template_locations_to_map($auth, $args, $tabalias, $options, $path) { if (empty($options['location_type_id']) || !preg_match('/^\\d+$/', $options['location_type_id'])) { throw new exception('Please supply a valid location_type_id option.'); } iform_load_helpers(array('report_helper')); $r = report_helper::report_map(array('readAuth' => $auth['read'], 'dataSource' => 'library/locations/locations_list_mapping', 'dataSourceLoRes' => 'library/locations/locations_list_mapping', 'extraParams' => array('location_type_id' => $options['location_type_id']), 'ajax' => TRUE, 'clickable' => FALSE)); // output a hidden grid, since the AJAX code for a report_map is in the grid. $r .= report_helper::report_grid(array('readAuth' => $auth['read'], 'dataSource' => 'library/locations/locations_list_mapping', 'extraParams' => array('location_type_id' => $options['location_type_id']), 'ajax' => TRUE, 'class' => 'report-grid hidden')); report_helper::$javascript .= "indiciaData.wantPathEditor = true;\n"; return $r; }
/** * 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; }
/** * 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; }
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}</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 .= '<div id="verify-buttons">'; $r .= '<div id="verify-buttons-inner">'; $r .= '<label>' . lang::get('Actions:') . '</label>'; $imgPath = empty(data_entry_helper::$images_path) ? data_entry_helper::relative_client_helper_path() . "../media/images/" : data_entry_helper::$images_path; $r .= '<button type="button" id="btn-verify" title="' . lang::get('Verify') . '"><img width="18" height="18" src="' . $imgPath . 'nuvola/ok-16px.png"/></button>'; $r .= '<button type="button" id="btn-edit-verify" title="' . lang::get('Edit determination then verify') . '"><img width="18" height="18" src="' . $imgPath . 'nuvola/package_editors-16px.png"/>' . '<img width="18" height="18" src="' . $imgPath . 'nuvola/ok-16px.png"/></button>'; $r .= '<button type="button" id="btn-reject" title="' . lang::get('Reject') . '"><img width="18" height="18" src="' . $imgPath . 'nuvola/cancel-16px.png"/></button>'; $r .= '<button type="button" id="btn-query" title="' . lang::get('Query') . '"><img width="18" height="18" src="' . $imgPath . 'nuvola/dubious-16px.png"/></button>'; $r .= '<div id="redet-dropdown-ctnr" style="display: none"><div id="redet-dropdown">'; $r .= data_entry_helper::species_autocomplete(array('fieldname' => 'redet', 'label' => lang::get('New determination'), 'labelClass' => 'auto', 'helpText' => lang::get('Enter a new determination for this record before verifying it. The previous determination will be stored with the record.'), 'cacheLookup' => true, 'extraParams' => $readAuth + array('taxon_list_id' => 1), 'speciesIncludeBothNames' => true, 'speciesIncludeTaxonGroup' => true)); $r .= '</div></div>'; $r .= '</div></div>'; $r .= '<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 media 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'), '#media-tab' => lang::get('Media'), '#comments-tab' => lang::get('Comments')))); data_entry_helper::$javascript .= "indiciaData.detailsTabs = ['details','experience','phenology','media','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; }
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; }
protected static function get_control_map($auth, $args, $tabalias, $options) { iform_load_helpers(array('map_helper', 'report_helper')); // $_GET data for standard params can override displayed location if (isset($_GET['filter-location_id']) || isset($_GET['filter-indexed_location_id'])) { $args['display_user_profile_location'] = false; if (!empty($_GET['filter-indexed_location_id'])) { $args['location_boundary_id'] = $_GET['filter-indexed_location_id']; } elseif (!empty($_GET['filter-location_id'])) { $args['location_boundary_id'] = $_GET['filter-location_id']; } } // allow us to call iform_report_get_report_options to get a default report setup, then override report_name $args['report_name'] = ''; $sharing = empty($args['sharing']) ? 'reporting' : $args['sharing']; $reportOptions = array_merge(iform_report_get_report_options($args, $auth['read']), array('reportGroup' => 'dynamic', 'autoParamsForm' => false, 'sharing' => $sharing, 'readAuth' => $auth['read'], 'dataSource' => $options['dataSource'], 'reportGroup' => 'dynamic', 'rememberParamsReportGroup' => 'dynamic', 'clickableLayersOutputMode' => 'report', 'rowId' => 'occurrence_id', 'ajax' => TRUE), $options); if (self::$applyUserPrefs) { iform_report_apply_explore_user_own_preferences($reportOptions); } $r = report_helper::report_map($reportOptions); $options = array_merge(iform_map_get_map_options($args, $auth['read']), array('featureIdField' => 'occurrence_id', 'clickForSpatialRef' => false, 'reportGroup' => 'explore', 'toolbarDiv' => 'top'), $options); $olOptions = iform_map_get_ol_options($args); $r .= map_helper::map_panel($options, $olOptions); return $r; }
/** * Return the generated output. * @param array $args List of parameter values passed through to the form depending on how the form has been configured. * This array always contains a value for language. * @param object $node The Drupal node object. * @param array $response When this form is reloading after saving a submission, contains the response from the service call. * Note this does not apply when redirecting (in this case the details of the saved object are in the $_GET data). * @return Form HTML. */ public static function get_form($args, $node, $response = null) { iform_load_helpers(array('report_helper', 'map_helper')); $readAuth = report_helper::get_read_auth($args['website_id'], $args['password']); $sharing = 'reporting'; $reportOptions = array_merge(iform_report_get_report_options($args, $readAuth), array('reportGroup' => 'explore', 'rememberParamsReportGroup' => 'explore', 'paramsOnly' => true, 'paramsInMapToolbar' => true, 'sharing' => $sharing, 'paramsFormButtonCaption' => lang::get('Filter'), 'rowId' => 'occurrence_id')); iform_report_apply_explore_user_own_preferences($reportOptions); $reportOptions['extraParams']['limit'] = 3000; $r = report_helper::report_grid($reportOptions); $r .= report_helper::report_map(array('readAuth' => $readAuth, 'dataSource' => $args['report_name'], 'extraParams' => $reportOptions['extraParams'], 'paramDefaults' => $reportOptions['paramDefaults'], 'autoParamsForm' => false, 'reportGroup' => 'explore', 'rememberParamsReportGroup' => 'explore', 'clickableLayersOutputMode' => 'report', 'sharing' => $sharing, 'rowId' => 'occurrence_id', 'ajax' => TRUE)); $options = array_merge(iform_map_get_map_options($args, $readAuth), array('featureIdField' => 'occurrence_id', 'clickForSpatialRef' => false, 'reportGroup' => 'explore', 'toolbarDiv' => 'top')); $olOptions = iform_map_get_ol_options($args); $r .= map_helper::map_panel($options, $olOptions); $allowDownload = !isset($args['downloadOwnDataOnly']) || !$args['downloadOwnDataOnly'] || isset($reportOptions['extraParams']['ownData']) && $reportOptions['extraParams']['ownData'] === 1 || isset($_POST['explore-ownData']) && $_POST['explore-ownData'] === '1' || !(isset($_POST['explore-ownData']) || $_POST['explore-ownData'] === '0') && isset($reportOptions['paramDefaults']['ownData']) && $reportOptions['paramDefaults']['ownData'] === 1; $reportOptions = array_merge($reportOptions, array('id' => 'explore-records', 'paramsOnly' => false, 'autoParamsForm' => false, 'downloadLink' => $allowDownload, 'rowClass' => 'certainty{certainty}')); if (isset($args['includeEditLink']) && $args['includeEditLink'] && !empty($args['includeEditLinkPath'])) { $reportOptions['columns'][] = array('display' => 'Actions', 'actions' => array(array('caption' => 'edit', 'url' => url($args['includeEditLinkPath']), 'urlParams' => array('occurrence_id' => '{occurrence_id}'), 'visibility_field' => 'belongs_to_user'))); } $r .= report_helper::report_grid($reportOptions); return $r; }
private static function _build_sites_report($args, $readAuth, $output, $type, $mySites) { $r = self::filter_toolbar(array('my_records', 'year', 'taxon_group_list'), $readAuth); $reportNameSuffix = $mySites ? '_my_sites' : '_indexed_sites'; $extraParams = $mySites ? array('person_site_attr_id' => $args['my_sites_psn_attr_id']) : array('location_type_ids' => $args['main_location_layer_type_id']); if (!empty($args['min_rank_sort_order_for_species'])) { $extraParams['min_taxon_rank_sort_order'] = $args['min_rank_sort_order_for_species']; } $reportPerUser = $mySites || !empty($_GET['my_records']); $reportOptions = array('readAuth' => $readAuth, 'dataSource' => "library/locations/filterable_{$type}_counts_mappable{$reportNameSuffix}", 'extraParams' => $extraParams, 'caching' => true, 'cachePerUser' => $reportPerUser, 'cachetimeout' => $reportPerUser ? self::FAST_CACHE_REFRESH : self::SLOW_CACHE_REFRESH); self::check_filters($reportOptions); if ($output === 'map') { require_once iform_client_helpers_path() . 'prebuilt_forms/includes/map.php'; $reportOptions += array('valueOutput' => array('fillColor' => array('from' => '#0000ff', 'to' => '#ff0000', 'valueField' => 'value', 'minValue' => '{minvalue}', 'maxValue' => '{maxvalue}'), 'fillOpacity' => array('from' => 0.25, 'to' => 0.6, 'valueField' => 'value', 'minValue' => '{minvalue}', 'maxValue' => '{maxvalue}'))); // This looks better when the sites are not contiguous (unlike the full indexed sites layer) if ($mySites) { $reportOptions['featureDoubleOutlineColour'] = '#f7f7f7'; } $mapOptions = iform_map_get_map_options($args, $readAuth); $olOptions = iform_map_get_ol_options($args); $mapOptions['clickForSpatialRef'] = false; $r .= map_helper::map_panel($mapOptions, $olOptions); $r .= report_helper::report_map($reportOptions); } else { $reportOptions += array('downloadLink' => true, 'columns' => array(array('fieldname' => 'site_label', 'visible' => false))); $r .= report_helper::report_grid($reportOptions); } return $r; }
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}</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'] = 'sample_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' => 'sample_id', 'sharing' => 'verification', 'ajax' => TRUE); $r .= report_helper::report_map($reportMapOpts); $r .= '</div>'; 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 .= '<div id="action-buttons">'; $r .= '<div id="action-buttons-status" class="action-buttons-row">'; $r .= '<div class="col-1"><label>' . lang::get('Set status:') . '</label></div>'; $imgPath = empty(data_entry_helper::$images_path) ? data_entry_helper::relative_client_helper_path() . "../media/images/" : data_entry_helper::$images_path; $r .= self::status_buttons($imgPath); $r .= '</div>'; $r .= '<div id="action-buttons-other" class="action-buttons-row"><div class="col-1"><label>Other actions:</label></div>'; $r .= self::other_action_buttons($imgPath); $r .= '</div></div>'; $r .= '<div id="record-details-tabs">'; // note - there is a dependency in the JS that comments is the last tab and media the 2nd to last. $r .= data_entry_helper::tab_header(array('tabs' => array('#details-tab' => lang::get('Details'), '#media-tab' => lang::get('Media'), '#comments-tab' => lang::get('Comments')))); data_entry_helper::$javascript .= "indiciaData.detailsTabs = ['details','media','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; }