/** * Setup and render the info tab. */ function display() { $this->cache_expired = $this->is_cache_expired(); $this->settings->add_section(array('name' => __('Navigation', 'store-locator-le'), 'div_id' => 'navbar_wrapper', 'description' => $this->adminui->create_Navbar(), 'innerdiv' => false, 'is_topmenu' => true, 'auto' => false, 'headerbar' => false)); $this->settings->add_section(array('name' => __('How to Use', 'store-locator-le'), 'div_id' => 'how_to_use', 'description' => $this->createstring_HowToUse())); $this->settings->add_section(array('name' => __('Plugin News', 'store-locator-le'), 'div_id' => 'plugin_news', 'description' => $this->get_broadcast())); $this->settings->add_section(array('name' => __('Plugin Environment', 'store-locator-le'), 'div_id' => 'plugin_environment', 'description' => $this->create_EnvironmentPanel())); $this->settings->render_settings_page(); $this->adminui->render_rate_box(); if ($this->cache_expired) { $this->update_cache_timestamp(); } }
/** * Add the search form panel to the map settings page on the admin UI. * TODO : Convert this to wpCSL add_ItemToGroup model. */ function search_form_settings() { $slpDescription = "<div id='search_settings' class='section'>" . "<div class='section_column'>" . "<h2>" . __('Search Features', 'csa-slplus') . "</h2>" . $this->CreateInputDiv('sl_map_radii', __('Radii Options', 'csa-slplus'), __('Separate each number with a comma ",". Put parenthesis "( )" around the default.', 'csa-slplus'), '', '10,25,50,100,(200),500') . "<div class='form_entry'>" . "<label for='distance_unit'>" . __('Distance Unit', 'csa-slplus') . ':</label>' . "<select name='distance_unit'>"; foreach (array(__('Kilometers', 'csa-slplus') => __('km', 'csa-slplus'), __('Miles', 'csa-slplus') => __('miles', 'csa-slplus')) as $key => $sl_value) { $selected = $this->plugin->options['distance_unit'] == $sl_value ? " selected " : ""; $slpDescription .= "<option value='{$sl_value}' {$selected}>{$key}</option>\n"; } $slpDescription .= '</select>' . '</div>' . $this->plugin->helper->CreateCheckboxDiv('_disable_find_image', __('Use Find Location Text Button', 'csa-slplus'), __('Use a standard text button for "Find Locations" instead of the provided button images.', 'csa-slplus'), SLPLUS_PREFIX, false, 1); // FILTER: slp_settings_search_features $slpDescription = apply_filters('slp_settings_search_features', $slpDescription) . '</div>'; // Search Form Labels // $settingsHTML = $this->CreateInputDiv('sl_search_label', __('Address', 'csa-slplus'), __('Search form address label.', 'csa-slplus'), '', __('Address / Zip', 'csa-slplus')) . $this->CreateInputDiv('sl_radius_label', __('Radius', 'csa-slplus'), __('Search form radius label.', 'csa-slplus'), '', __('Within', 'csa-slplus')); // FILTER: slp_settings_search_labels $settingsHTML = apply_filters('slp_settings_search_labels', $settingsHTML) . '</div>'; $slpDescription .= $this->plugin->settings->create_SettingsGroup('search_labels', __('Search Labels', 'csa-slplus'), '', $settingsHTML); $this->settings->add_section(array('name' => __('Search Form', 'csa-slplus'), 'div_id' => 'search', 'description' => apply_filters('slp_map_settings_searchform', $slpDescription), 'auto' => true, 'innerdiv' => true)); }
/** * Render the manage locations admin page. * */ function render_adminpage() { $this->slplus->debugMP('slp.managelocs', 'msg', __FUNCTION__); $this->slplus->helper->loadPluginData(); $this->slplus->AdminUI->initialize_variables(); $this->process_Actions(); //------------------------------------------------------------------------ // CHANGE UPDATER // Changing Updater //------------------------------------------------------------------------ if (isset($_GET['changeUpdater']) && $_GET['changeUpdater'] == 1) { if (get_option('sl_location_updater_type') == "Tagging") { update_option('sl_location_updater_type', 'Multiple Fields'); $updaterTypeText = "Multiple Fields"; } else { update_option('sl_location_updater_type', 'Tagging'); $updaterTypeText = "Tagging"; } $_SERVER['REQUEST_URI'] = preg_replace('/&changeUpdater=1/', '', $_SERVER['REQUEST_URI']); print "<script>location.replace('" . $_SERVER['REQUEST_URI'] . "');</script>"; } //------------------------------------------------------------------------ // Reload Variables - anything that my have changed //------------------------------------------------------------------------ $this->slplus->helper->getData('sl_admin_locations_per_page', 'get_option', null, '10', true, true); //-------------------------------------- // Setup the Location panel navigation //-------------------------------------- $subtabs = apply_filters('slp_locations_subtabs', array(__('Manage', 'csa-slplus'), __('Add', 'csa-slplus'))); //------------------------------------ // Create Location Panels // add_action('slp_build_locations_panels', array($this, 'create_settings_section_Manage'), 10); add_action('slp_build_locations_panels', array($this, 'create_settings_section_Add'), 20); //------------------------- // Setup Navigation Bar // $this->settings->add_section(array('name' => 'Navigation', 'div_id' => 'navbar_wrapper', 'description' => $this->slplus->AdminUI->create_Navbar(), 'innerdiv' => false, 'is_topmenu' => true, 'auto' => false, 'headerbar' => false)); //------------------------------------ // Render It // do_action('slp_build_locations_panels'); $this->settings->render_settings_page(); }
/** * Render the map settings admin page. */ function render_adminpage() { // If we are updating settings... // if (isset($_REQUEST['action']) && $_REQUEST['action'] === 'update' && isset($_REQUEST['_wpnonce']) && !empty($_REQUEST['_wpnonce'])) { $this->save_Settings(); } // Setup and render settings page // $this->settings = new wpCSL_settings__slplus(array('prefix' => $this->plugin->prefix, 'css_prefix' => $this->plugin->prefix, 'url' => $this->plugin->url, 'name' => $this->plugin->name . ' - ' . __('General Settings', 'csa-slplus'), 'plugin_url' => $this->plugin->plugin_url, 'render_csl_blocks' => false, 'form_action' => admin_url() . 'admin.php?page=' . $this->slug)); $this->settings->add_section(array('name' => 'Navigation', 'div_id' => 'navbar_wrapper', 'description' => $this->plugin->AdminUI->create_Navbar(), 'innerdiv' => false, 'is_topmenu' => true, 'auto' => false, 'headerbar' => false)); // Panel building actions // add_action('slp_build_general_settings_panels', array($this, 'build_UserSettingsPanel'), 10); add_action('slp_build_general_settings_panels', array($this, 'build_GoogleSettingsPanel'), 20); add_action('slp_build_general_settings_panels', array($this, 'build_AdminSettingsPanel'), 30); //------------------------------------ // Render It // do_action('slp_build_general_settings_panels'); $this->settings->render_settings_page(); }
/** * Render the manage locations admin page. * */ function render_adminpage() { $this->process_Actions(); //------------------------------------------------------------------------ // CHANGE UPDATER // Changing Updater //------------------------------------------------------------------------ if (isset($_GET['changeUpdater']) && $_GET['changeUpdater'] == 1) { if (get_option('sl_location_updater_type') == "Tagging") { update_option('sl_location_updater_type', 'Multiple Fields'); $updaterTypeText = "Multiple Fields"; } else { update_option('sl_location_updater_type', 'Tagging'); $updaterTypeText = "Tagging"; } $_SERVER['REQUEST_URI'] = preg_replace('/&changeUpdater=1/', '', $_SERVER['REQUEST_URI']); print "<script>location.replace('" . $_SERVER['REQUEST_URI'] . "');</script>"; } //------------------------------------ // Create Location Panels // add_action('slp_build_locations_panels', array($this, 'create_settings_section_Manage'), 10); add_action('slp_build_locations_panels', array($this, 'create_settings_section_Add'), 20); //------------------------- // Setup Navigation Bar // $this->settings->add_section(array('name' => 'Navigation', 'div_id' => 'navbar_wrapper', 'description' => $this->slplus->AdminUI->create_Navbar(), 'innerdiv' => false, 'is_topmenu' => true, 'auto' => false, 'headerbar' => false)); /** * Hook executes when building the locations panels, before rendering. * * @action slp_build_locations_panels */ do_action('slp_build_locations_panels'); $this->enqueue_scripts(); $this->settings->render_settings_page(); }
/** * Instantiate a section panel. * * @param mixed[] $params */ function __construct($params) { foreach ($params as $name => $value) { $this->{$name} = $value; } $this->parent->debugMP('wpcsl.settings', 'msg', "Created section {$params['name']}", '', NULL, NULL, true); }
if (!(strpos($slplus_plugin->data['endicon'], 'http') === 0)) { $slplus_plugin->data['endicon'] = $slplus_plugin->data['siteURL'] . $slplus_plugin->data['endicon']; } if (!$slplus_plugin->helper->webItemExists($slplus_plugin->data['homeicon'])) { $slplus_plugin->data['iconNotice'] .= sprintf(__('Your home icon %s cannot be located, please select a new one.', 'csl-slplus'), $slplus_plugin->data['homeicon']) . '<br/>'; } if (!$slplus_plugin->helper->webItemExists($slplus_plugin->data['endicon'])) { $slplus_plugin->data['iconNotice'] .= sprintf(__('Your destination icon %s cannot be located, please select a new one.', 'csl-slplus'), $slplus_plugin->data['endicon']) . '<br/>'; } if ($slplus_plugin->data['iconNotice'] != '') { $slplus_plugin->data['iconNotice'] = "<div class='highlight' style='background-color:LightYellow;color:red'><span style='color:red'>" . $slplus_plugin->data['iconNotice'] . "</span></div>"; } // Instantiate the form rendering object // global $slpMapSettings; $slpMapSettings = new wpCSL_settings__slplus(array('no_license' => true, 'prefix' => $slplus_plugin->prefix, 'url' => $slplus_plugin->url, 'name' => $slplus_plugin->name . ' - Map Settings', 'plugin_url' => $slplus_plugin->plugin_url, 'render_csl_blocks' => false, 'form_action' => SLPLUS_ADMINPAGE . 'map-designer.php', 'save_text' => 'Save Settings')); //------------------------- // Navbar Section //------------------------- $slpMapSettings->add_section(array('name' => 'Navigation', 'div_id' => 'slplus_navbar', 'description' => get_string_from_phpexec(SLPLUS_COREDIR . '/templates/navbar.php'), 'is_topmenu' => true, 'auto' => false, 'headerbar' => false)); //------------------------------------ // Create The Search Form Settings Panel // add_action('slp_build_map_settings_panels', array('SLPlus_AdminUI', 'slp_add_search_form_settings_panel'), 10); add_action('slp_build_map_settings_panels', array('SLPlus_AdminUI', 'slp_add_map_settings_panel'), 20); add_action('slp_build_map_settings_panels', array('SLPlus_AdminUI', 'slp_add_results_settings_panel'), 30); //------------------------------------ // Render It // print $update_msg; do_action('slp_build_map_settings_panels');
$thisSectionDesc .= '</tr>'; } $thisSectionDesc .= '</tbody>' . '</table>' . '</div>' . '</div>'; return $thisSectionDesc; } //=========================================================================== // Main Processing //=========================================================================== // Data Settings // $slpQueryTable = $wpdb->prefix . 'slp_rep_query'; $slpResultsTable = $wpdb->prefix . 'slp_rep_query_results'; $slpLocationsTable = $wpdb->prefix . 'store_locator'; // Instantiate the form rendering object // $slpReportSettings = new wpCSL_settings__slplus(array('no_license' => true, 'prefix' => $slplus_plugin->prefix, 'url' => $slplus_plugin->url, 'name' => $slplus_plugin->name . ' - Reporting', 'plugin_url' => $slplus_plugin->plugin_url, 'render_csl_blocks' => false, 'form_action' => admin_url() . 'admin.php?page=' . SLPLUS_PLUGINDIR . 'reporting.php', 'save_text' => 'Run Report')); //------------------------- // Navbar Section //------------------------- global $slplus_plugin; $slpReportSettings->add_section(array('name' => 'Navigation', 'div_id' => 'slplus_navbar', 'description' => $slplus_plugin->helper->get_string_from_phpexec(SLPLUS_COREDIR . '/templates/navbar.php'), 'is_topmenu' => true, 'auto' => false, 'headerbar' => false)); //------------------------------------ // Create The Report Parameters Panel // $slpReportSettings->add_section(array('name' => __('Report Parameters', SLPLUS_PREFIX), 'description' => __('Use these settings to select which data to report on.', SLPLUS_PREFIX), 'auto' => true)); // Start of date range to report on // default: 30 days ago // $slpReportStartDate = isset($_POST[SLPLUS_PREFIX . '-start_date']) ? $_POST[SLPLUS_PREFIX . '-start_date'] : date('Y-m-d', time() - 30 * 24 * 60 * 60); $slpReportSettings->add_item('Report Parameters', __('Start Date: ', SLPLUS_PREFIX), 'start_date', 'text', null, null, null, $slpReportStartDate);
/** * WordPress admin_init hook (runs after admin_menu has run) */ function admin_init() { $this->settings->register(); }