www.mapsmarker.com"); } class Class_leaflet_options { private $panes; private $sections; private $checkboxes; private $_settings = array(); public function __get( $name ) { if ( 'settings' === $name ) { $this->get_settings(); return $this->_settings; } return null; } public function __isset( $name ) { if ( 'settings' === $name ) { $this->get_settings(); return ! empty( $this->_settings ); } return false; } /** * * Construct * */ public function __construct() { //info: This will keep track of the checkbox options for the validate_settings function. $this->checkboxes = array(); $this->panes['mapdefaults'] = esc_attr__('Map Defaults','lmm'); $this->panes['geocoding'] = esc_attr__('Geocoding','lmm'); $this->panes['basemaps'] = esc_attr__('Basemaps','lmm'); $this->panes['overlays'] = esc_attr__('Overlays','lmm'); $this->panes['wms'] = esc_attr__('WMS','lmm'); $this->panes['directions'] = esc_attr__('Directions','lmm'); $this->panes['misc'] = esc_attr__('Misc','lmm'); $this->panes['reset'] = esc_attr__('Reset','lmm'); $this->sections['mapdefaults-marker_map_defaults'] = esc_attr__('Default values for new marker maps','lmm'); $this->sections['mapdefaults-marker_icons'] = esc_attr__('Default values for marker icons','lmm'); $this->sections['mapdefaults-marker_popups'] = esc_attr__('Default values for marker popups','lmm') . '
  •  '; $this->sections['mapdefaults-layer_map_defaults'] = esc_attr__('Default values for new layer maps','lmm'); $this->sections['mapdefaults-list_of_markers'] = esc_attr__('List of markers settings','lmm'); $this->sections['mapdefaults-filtering'] = esc_attr__('Filter settings for multi-layer-maps','lmm'); $this->sections['mapdefaults-clustering'] = esc_attr__('Marker clustering settings','lmm') . '
  •  '; $this->sections['mapdefaults-interaction'] = esc_attr__('Interaction options','lmm'); $this->sections['mapdefaults-control'] = esc_attr__('Control options','lmm'); $this->sections['mapdefaults-minimap'] = esc_attr__('Minimap settings','lmm'); $this->sections['mapdefaults-gpx'] = esc_attr__('GPX tracks settings','lmm'); $this->sections['mapdefaults-geolocate'] = esc_attr__('Geolocate settings','lmm'); $this->sections['mapdefaults-qr_code'] = esc_attr__('QR code settings','lmm'); $this->sections['mapdefaults-marker_tooltip'] = esc_attr__('Marker tooltip settings','lmm'); $this->sections['geocoding-general_settings'] = esc_attr__('Geocoding provider','lmm') . '
  •  '; $this->sections['geocoding-algolia'] = esc_attr__('Algolia Places settings','lmm'); $this->sections['geocoding-photon'] = esc_attr__('Photon@MapsMarker settings','lmm') . '
  •  '; $this->sections['geocoding-mapzen'] = '' . esc_attr__('Mapzen Search settings','lmm'); $this->sections['geocoding-mapquest'] = esc_attr__('MapQuest Geocoding settings','lmm'); $this->sections['geocoding-google'] = esc_attr__('Google Geocoding settings','lmm'); $this->sections['basemaps-default_basemap'] = esc_attr__('Default basemap for new markers/layers','lmm'); $this->sections['basemaps-available_basemaps_controlbox'] = esc_attr__('Available basemaps in control box','lmm'); $this->sections['basemaps-basemap_names'] = esc_attr__('Names for basemaps in control box','lmm'); $this->sections['basemaps-basemap_global_settings'] = esc_attr__('Global basemap settings','lmm') . '
  •  '; $this->sections['basemaps-openstreetmap'] = 'OpenStreetMap'; $this->sections['basemaps-stamen_maps'] = esc_attr__( 'Stamen Maps', 'lmm' ) . '
  •  '; $this->sections['basemaps-google_js_api'] = esc_attr__('Google Maps JavaScript API','lmm'); $this->sections['basemaps-google_localization'] = esc_attr__('Google language localization','lmm'); $this->sections['basemaps-google_base_domain'] = esc_attr__('Google Maps base domain','lmm'); $this->sections['basemaps-google_styling'] = esc_attr__('Google Maps styling','lmm') . '
  •  '; $this->sections['basemaps-bing'] = esc_attr__('Bing Maps','lmm'); $this->sections['basemaps-basemap_at'] = 'basemap.at'; $this->sections['basemaps-mapbox1'] = 'MapBox 1'; $this->sections['basemaps-mapbox2'] = 'MapBox 2'; $this->sections['basemaps-mapbox3'] = 'MapBox 3' . '
  •  '; $this->sections['basemaps-custom_basemap1'] = sprintf(esc_attr__('Custom basemap %1$s','lmm'), '1'); $this->sections['basemaps-custom_basemap2'] = sprintf(esc_attr__('Custom basemap %1$s','lmm'), '2'); $this->sections['basemaps-custom_basemap3'] = sprintf(esc_attr__('Custom basemap %1$s','lmm'), '3'); $this->sections['basemaps-empty_basemap'] = esc_attr__('Empty basemap','lmm'); $this->sections['overlays-available_overlays'] = esc_attr__('Available overlays for new markers/layers','lmm') . '
  •  '; $this->sections['overlays-custom_overlay1'] = esc_attr__('Custom overlay settings','lmm'); $this->sections['overlays-custom_overlay2'] = esc_attr__('Custom overlay 2 settings','lmm'); $this->sections['overlays-custom_overlay3'] = esc_attr__('Custom overlay 3 settings','lmm'); $this->sections['overlays-custom_overlay4'] = esc_attr__('Custom overlay 4 settings','lmm'); $this->sections['wms-available_wms'] = esc_attr__('Available WMS layers for new markers/layers','lmm') . '
  •  '; $this->sections['wms-wms1'] = esc_attr__('WMS layer 1 settings','lmm'); $this->sections['wms-wms2'] = esc_attr__('WMS layer 2 settings','lmm'); $this->sections['wms-wms3'] = esc_attr__('WMS layer 3 settings','lmm'); $this->sections['wms-wms4'] = esc_attr__('WMS layer 4 settings','lmm'); $this->sections['wms-wms5'] = esc_attr__('WMS layer 5 settings','lmm'); $this->sections['wms-wms6'] = esc_attr__('WMS layer 6 settings','lmm'); $this->sections['wms-wms7'] = esc_attr__('WMS layer 7 settings','lmm'); $this->sections['wms-wms8'] = esc_attr__('WMS layer 8 settings','lmm'); $this->sections['wms-wms9'] = esc_attr__('WMS layer 9 settings','lmm'); $this->sections['wms-wms10'] = esc_attr__('WMS layer 10 settings','lmm'); $this->sections['directions-general_settings'] = esc_attr__('General directions settings','lmm') . '
  •  '; $this->sections['directions-google_maps'] = esc_attr__('Google Maps directions','lmm'); $this->sections['directions-yournavigation'] = 'yournavigation.org'; $this->sections['directions-openrouteservice'] = 'openrouteservice.org'; $this->sections['ar-layar'] = esc_attr__('Layar settings','lmm'); $this->sections['misc-general_settings'] = esc_attr__('General settings','lmm'); $this->sections['misc-interface_language'] = esc_attr__('Interface language settings','lmm'); $this->sections['misc-list_all_markers'] = esc_attr__('"List all markers" page settings','lmm'); $this->sections['misc-list_all_layers'] = esc_attr__('"List all layers" page settings','lmm'); $this->sections['misc-web_api'] = esc_attr__('Web API settings','lmm'); $this->sections['misc-permissions'] = esc_attr__('Permission settings','lmm'); $this->sections['misc-xml_sitemap'] = esc_attr__('XML sitemaps integration','lmm'); $this->sections['misc-compatibility'] = esc_attr__('Compatibility settings','lmm'); $this->sections['misc-wordpress_integration'] = esc_attr__('WordPress integration settings','lmm'); $this->sections['reset-reset_settings'] = esc_attr__('Reset Settings','lmm'); add_action( 'admin_init', array( &$this, 'register_settings' ) ); if ( ! get_option( 'leafletmapsmarker_options' ) ) $this->initialize_settings(); } /** * Create settings field * * @since 1.0 */ public function create_setting( $args = array() ) { $defaults = array( 'id' => 'default_field', 'version' => '', 'pane' => 'mapdefaults', 'section' => 'mapdefaults-section1', 'title' => __( 'Default Field','lmm' ), 'desc' => __( 'This is a default description.','lmm' ), 'std' => '', 'type' => 'text', 'choices' => array(), 'class' => '' ); extract( wp_parse_args( $args, $defaults ) ); $field_args = array( 'type' => $type, 'id' => $id, 'desc' => $desc, 'std' => $std, 'choices' => $choices, 'label_for' => $id, 'class' => $class ); if ( $type == 'checkbox' ) $this->checkboxes[] = $id; add_settings_field( $id, $title, array( $this, 'display_setting' ), 'leafletmapsmarker_settings', $section, $field_args ); } /** * Display options page * * @since 1.0 */ public function display_page() { include(LEAFLET_PLUGIN_DIR . 'inc' . DIRECTORY_SEPARATOR . 'admin-header.php'); if ( isset( $_GET['settings-updated'] ) ) echo '

    ' . __( 'Settings have been successfully updated!','lmm' ) . '

    '; echo '

    '.__('Settings','lmm').'

    '; echo '
    '; settings_fields( 'leafletmapsmarker_options' ); echo '
      '; $section_index = 0; foreach ( $this->panes as $pane_slug => $pane ) { $li_class = 0 === $section_index ? ' class="active"' : ''; $section_index++; echo '' . $pane . ''; } echo '
    '; echo '
    '; $panel_index = 0; foreach($this->panes as $pane_slug => $pane){ $li_class = 0 === $panel_index ? ' in active' : ''; $panel_index++; echo '
    '; echo '
    '; echo '
      '; $sections = array(); $sub_panel_index = 0; foreach ( $this->sections as $key => $row ){ $k = explode("-",$key); if ( $k[0] == $pane_slug ) { $li_class = 0 === $sub_panel_index ? ' class="active"' : ''; $sub_panel_index ++; echo '' . $row . ''; $sections[] = $key; } } echo '
    '; echo '
    '; $sub_panel_index = 0; foreach($sections as $slug => $section){ $li_class = 0 === $sub_panel_index ? ' in active' : ''; $sub_panel_index++; echo '
    '; echo "

    ".strip_tags($this->sections[$section])."

    "; //info: strip_tags for removing
    dividers if (function_exists('display_'.$pane_slug.'_section')) { //info: Phalanger fix @call_user_func(array(&$this, 'display_'.$pane_slug.'_section'), array()); } echo ''; do_settings_fields( $_GET['page'], $section ); echo '
    '; echo '
    '; } echo '
    '; // tab-content echo '
    '; // tabs-left echo '
    '; // tab-pane } echo '
    '; // tab-content echo '
    '; // tabs-top echo '

    '; include(LEAFLET_PLUGIN_DIR . 'inc' . DIRECTORY_SEPARATOR . 'admin-footer.php'); echo '
    '; ?>

    ' . $desc . '

    '; break; case 'helptext': echo '' . $desc . ''; break; case 'helptext-twocolumn': echo $desc; break; case 'checkbox': echo ' '; break; case 'checkbox-pro': echo ' '; break; case 'checkbox-readonly': echo ' '; break; case 'select': echo ''; if ( $desc != '' ) echo '
    ' . $desc . ''; break; case 'select-pro': echo ''; if ( $desc != '' ) echo '
    ' . $desc . ''; break; case 'radio': $i = 0; echo '