/** * Create the results settings panel * */ function results_settings() { // Add Results Section // $section_name = __('Results', 'csa-slplus'); $this->settings->add_section(array('name' => $section_name, 'div_id' => 'results')); // Add Results Features Group // $slpDescription = $this->plugin->helper->create_SubheadingLabel(__('Search Results', 'csa-slplus')) . $this->CreateInputDiv('max_results_returned', __('Max Search Results', 'csa-slplus'), __('How many locations does a search return? Default is 25.', 'csa-slplus'), '', $this->plugin->options_nojs['max_results_returned']) . $this->plugin->helper->CreateCheckboxDiv('immediately_show_locations', __('Immediately Show Locations', 'csa-slplus'), __('Display locations as soon as map loads, based on map center and default radius. Enhanced Search provides [slplus immediately_show_locations="true|false"] attribute option.', 'csa-slplus'), '', false, $this->plugin->options['immediately_show_locations']) . $this->CreateInputDiv('initial_results_returned', __('Number To Show Initially', 'csa-slplus'), __('How many locations should be shown when Immediately Show Locations is checked. Recommended maximum is 50.', 'csa-slplus'), '', $this->plugin->options['initial_results_returned']) . $this->CreateInputDiv('initial_radius', __('Radius To Search Initially', 'csa-slplus'), __('What should immediately show locations use as the default search radius? Leave empty to use map radius default or set to a large number like 25000 to search everywhere.', 'csa-slplus') . sprintf(__('Can be set with <a href="%s" target="csa">shortcode attribute initial_radius</a> if Force Load JavaScript is turned off.', 'csa-slplus'), $this->plugin->url . 'support/documentation/store-locator-plus/shortcodes/'), '', $this->plugin->options['initial_radius']); // FILTER: slp_settings_results_locationinfo - add input fields to results locaiton info // $resultSettings['features'] = apply_filters('slp_settings_results_locationinfo', $slpDescription); $this->settings->add_ItemToGroup(array('section' => $section_name, 'group' => __('Results Features', 'csa-slplus'), 'label' => '', 'type' => 'custom', 'show_label' => false, 'custom' => $resultSettings['features'])); // ===== Labels // $slpDescription = $this->plugin->helper->create_SubheadingLabel(__('Results Labels', 'csa-slplus')) . $this->CreateInputDiv('sl_website_label', __('Website URL', 'csa-slplus'), __('Search results text for the website link.', 'csa-slplus'), '', __('Website', 'csa-slplus')) . $this->CreateInputDiv('_label_hours', __('Hours', 'csa-slplus'), __('Hours label.', 'csa-slplus'), SLPLUS_PREFIX, __('Hours', 'csa-slplus') . ': ') . $this->CreateInputDiv('_label_phone', __('Phone', 'csa-slplus'), __('Phone label.', 'csa-slplus'), SLPLUS_PREFIX, __('Phone', 'csa-slplus') . ': ') . $this->CreateInputDiv('_label_fax', __('Fax', 'csa-slplus'), __('Fax label.', 'csa-slplus'), SLPLUS_PREFIX, __('Fax', 'csa-slplus') . ': ') . $this->CreateInputDiv('_label_directions', __('Directions', 'csa-slplus'), __('Directions label.', 'csa-slplus'), SLPLUS_PREFIX, __('Directions', 'csa-slplus')) . $this->CreateInputDiv('sl_instruction_message', __('Instructions', 'csa-slplus'), __('Search results instructions shown if immediately show locations is not selected.', 'csa-slplus'), '', __('Enter an address or zip code and click the find locations button.', 'csa-slplus')); // FILTER: slp_settings_results_labels - add input fields to results labels // $resultSettings['labels'] = apply_filters('slp_settings_results_labels', $slpDescription); $this->settings->add_ItemToGroup(array('section' => $section_name, 'group' => __('Results Labels', 'csa-slplus'), 'label' => '', 'type' => 'subheader', 'show_label' => false, 'description' => $resultSettings['labels'])); // ACTION: slp_ux_modify_adminpanel_results // params: settings object, section name // do_action('slp_ux_modify_adminpanel_results', $this->settings, $section_name); }
/** * Returns the string that is the Location Info Form guts. * * @param boolean $addform - true if rendering add locations form * @return string */ public function create_settings_section_Add() { // Edit Mode // if ($this->current_action === 'edit') { $panel_name = __('Edit', 'store-locator-le'); $this->slplus->currentLocation->set_PropertiesViaDB($_REQUEST['id']); $panel_div_id = 'edit_location'; $this->addingLocation = false; // Add Mode // } else { $panel_name = __('Add', 'store-locator-le'); $panel_div_id = 'add_location'; $this->addingLocation = true; } // Add form // if ($this->addingLocation) { $this->slplus->currentLocation->reset(); $address_description = __('Adding a new location.', 'store-locator-le'); // Setup current location based in incoming request data // } else { $linked_post_message = ''; if (!empty($this->slplus->currentLocation->linked_postid)) { $linked_post_message = sprintf(__('Linked to %s page # %d', 'store-locator-le'), $this->slplus->add_ons->get_product_url('slp-pages'), $this->slplus->currentLocation->linked_postid); } $lat_long_message = ''; if (is_numeric($this->slplus->currentLocation->latitude) && is_numeric($this->slplus->currentLocation->longitude)) { $lat_long_message = sprintf(__('Original latitude %f , longitude %f.', 'store-locator-le'), $this->slplus->currentLocation->latitude, $this->slplus->currentLocation->longitude); } $address_description = sprintf(__('Editing location #%d %s %s', 'store-locator-le'), $this->slplus->currentLocation->id, $linked_post_message, $lat_long_message); } $address_description .= '<br/>' . sprintf('<a href="%s" target="csa" alt="%s" title="%s">%s</a>', 'http://www.latlong.net', __('Latitude/Longitude lookup.', 'store-locator-le'), __('Latitude/Longitude lookup.', 'store-locator-le'), __('The LatLong.net website can help you locate an exact latitude/longitude.', 'store-locator-le')); // Add Location Section // $this->settings->add_section(array('name' => $panel_name, 'div_id' => $panel_div_id, 'opening_html' => "<form id='manualAddForm' name='manualAddForm' method='post'>" . ($this->addingLocation ? '<input type="hidden" id="act" name="act" value="add" />' : '<input type="hidden" id="act" name="act" value="edit" />') . "<input type='hidden' name='id' " . "id='id' value='{$this->slplus->currentLocation->id}' />" . "<input type='hidden' name='locationID' " . "id='locationID' value='{$this->slplus->currentLocation->id}' />" . "<input type='hidden' name='linked_postid-{$this->slplus->currentLocation->id}' " . "id='linked_postid-{$this->slplus->currentLocation->id}' value='" . $this->slplus->currentLocation->linked_postid . "' />" . (isset($_REQUEST['start']) ? "<input type='hidden' name='start' id='start' value='{$_REQUEST['start']}' />" : '') . "<a name='a{$this->slplus->currentLocation->id}'></a>", 'closing_html' => '</form>')); // Locations / Add / Address $this->add_edit_address_group($panel_name); // Location / Add / Details // add_filter('slp_edit_location_right_column', array($this, 'filter_EditLocationRight_Address'), 5); add_filter('slp_edit_location_right_column', array($this, 'filter_EditLocationLeft_Submit'), 99); /** * Filter to add HTML to the top of the add/edit location form. * * @filter slp_edit_location_right_column * * @params string current HTML */ $group_name = __('Details', 'store-locator-le'); $this->settings->add_ItemToGroup(array('type' => 'details', 'custom' => apply_filters('slp_edit_location_right_column', ''), 'show_label' => false, 'section' => $panel_name, 'group' => $group_name)); // Location / Add / Extended // $this->add_extended_data_to_location_edit($panel_name); }
/** * Build the User Settings Panel */ function build_UserSettingsPanel() { $sectName = __('User Interface', 'csa-slplus'); $this->settings->add_section(array('name' => $sectName)); $groupName = __('JavaScript', 'csa-slplus'); $this->settings->add_ItemToGroup(array('section' => $sectName, 'group' => $groupName, 'label' => __('Force Load JavaScript', 'csa-slplus'), 'setting' => 'force_load_js', 'type' => 'checkbox', 'default' => 1, 'description' => __('Force the JavaScript for Store Locator Plus to load on every page with early loading. ', 'csa-slplus') . __('This can slow down your site, but is compatible with more themes and plugins.', 'csa-slplus'))); // ACTION: slp_generalsettings_modify_userpanel // params: settings object, section name do_action('slp_generalsettings_modify_userpanel', $this->settings, $sectName); }
/** * Add web app settings. */ function build_WebAppSettings() { $section = __('Server', 'csa-slplus'); $groupName = __('Web App Settings', 'csa-slplus'); $this->settings->add_ItemToGroup(array('section' => $section, 'group' => $groupName, 'label' => __('PHP Time Limit', 'csa-slplus'), 'setting' => 'php_max_execution_time', 'use_prefix' => false, 'value' => $this->slplus->options_nojs['php_max_execution_time'], 'description' => __('Maximum execution time, in seconds, for PHP processing. ', 'csa-slplus') . __('Affects all CSV imports for add-ons and Janitor delete all locations. ', 'csa-slplus') . __('SLP Default 600. ', 'csa-slplus') . __('On most servers you will need to edit this setting in the php.ini file. ', 'csa-slplus') . sprintf(__('Your server default %s. ', 'csa-slplus'), ini_get('max_execution_time')))); }