From 4cada49ce18b753cb4cde06aafc087fff27a7f37 Mon Sep 17 00:00:00 2001
From: Kenji ITO
Date: Fri, 17 Mar 2017 21:28:07 +0900
Subject: [PATCH 1/3] Fixed some errors with PHP-7
---
admin/icons.php | 4 +-
admin/import_export.php | 3 +-
admin/index.php | 9 +-
admin/map_edit.php | 8 +-
admin/marker_edit.php | 16 +-
admin/overlay_edit.php | 9 +-
admin/overlay_group_edit.php | 7 +-
functions.inc | 3619 +++++++++++++++--------------
install_defaults.php | 2 +-
language/english.php | 2 +-
language/french_france_utf-8.php | 2 +-
public_html/index.php | 9 +-
public_html/js/mapiconmaker.js | 10 +-
public_html/js/markerclusterer.js | 2 +-
public_html/map_detail.php | 13 +-
public_html/maps.css | 99 +-
public_html/markers.php | 32 +-
public_html/users_map.php | 270 ++-
18 files changed, 2070 insertions(+), 2046 deletions(-)
diff --git a/admin/icons.php b/admin/icons.php
index 54ba181..36f89fb 100644
--- a/admin/icons.php
+++ b/admin/icons.php
@@ -347,7 +347,7 @@ function MAPS_deleteIconImage ($image)
$msg = $LANG_MAPS_1['deletion_fail'];
}
// delete complete, return to icon list
- echo COM_refresh($_CONF['site_url'] . "/admin/plugins/maps/icons.php?msg=$msg");
+ COM_redirect($_CONF['site_url'] . "/admin/plugins/maps/icons.php?msg=$msg");
exit();
break;;
@@ -397,7 +397,7 @@ function MAPS_deleteIconImage ($image)
MAPS_saveIconImage($_REQUEST, $_FILES, $id);
}
// save complete, return to icons list
- echo COM_refresh($_CONF['site_admin_url'] . "/plugins/maps/icons.php?msg=" . urlencode($msg));
+ COM_redirect($_CONF['site_admin_url'] . "/plugins/maps/icons.php?msg=" . urlencode($msg));
exit();
break;
diff --git a/admin/import_export.php b/admin/import_export.php
index 4f9397c..2097fe8 100644
--- a/admin/import_export.php
+++ b/admin/import_export.php
@@ -128,8 +128,7 @@ function MAPS_importCSV ($FILES = '', $map_id, $separator=';', $fields, $valid =
if($map_id == '') return MAPS_message('Map ID is missing');
if ( !in_array($separator, array(',','tab',';')) ) {
- echo COM_refresh($_CONF['site_admin_url'] . '/plugins/maps/import_export.php');
- exit();
+ COM_redirect($_CONF['site_admin_url'] . '/plugins/maps/import_export.php');
}
if ($valid == false) {
diff --git a/admin/index.php b/admin/index.php
index ae13062..e43a572 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -193,21 +193,18 @@ function plugin_getListField_maps($fieldname, $fieldvalue, $A, $icon_arr)
//Create a new marker for admin
case 'edit' :
- echo COM_refresh($_CONF['site_url'] . "/admin/plugins/maps/marker_edit.php");
- exit();
+ COM_redirect($_CONF['site_url'] . "/admin/plugins/maps/marker_edit.php");
break;
//Edit marker sumission
case 'editsubmission' :
$id = $_REQUEST['id'];
- echo COM_refresh($_CONF['site_url'] . "/admin/plugins/maps/marker_edit.php?mode=editsubmission&mkid=$id");
- exit();
+ COM_redirect($_CONF['site_url'] . "/admin/plugins/maps/marker_edit.php?mode=editsubmission&mkid=$id");
break;
case 'setgeolocation' :
MAPS_setGeoLocation();
- echo COM_refresh($_CONF['site_url'] . "/admin/plugins/maps/index.php?msg=" . urlencode($LANG_MAPS_1['set_geo_location']));
- exit();
+ COM_redirect($_CONF['site_url'] . "/admin/plugins/maps/index.php?msg=" . urlencode($LANG_MAPS_1['set_geo_location']));
break;
default :
diff --git a/admin/map_edit.php b/admin/map_edit.php
index c31bf9c..509a586 100644
--- a/admin/map_edit.php
+++ b/admin/map_edit.php
@@ -457,8 +457,7 @@ function()
$msg = $LANG_MAPS_1['deletion_fail'];
}
// delete complete, return to map list
- echo COM_refresh($_CONF['site_url'] . "/admin/plugins/maps/index.php?msg=$msg");
- exit();
+ COM_redirect($_CONF['site_url'] . "/admin/plugins/maps/index.php?msg=$msg");
break;
case 'save':
@@ -558,8 +557,7 @@ function()
$msg = $LANG_MAPS_1['save_success'];
}
// save complete, return to map list
- echo COM_refresh($_CONF['site_admin_url'] . "/plugins/maps/index.php?msg=$msg");
- exit();
+ COM_redirect($_CONF['site_admin_url'] . "/plugins/maps/index.php?msg=$msg");
break;
case 'edit':
@@ -575,7 +573,7 @@ function()
}
$display .= getMapForm($A);
} else {
- echo COM_refresh($_CONF['site_url']);
+ COM_redirect($_CONF['site_url']);
}
break;
diff --git a/admin/marker_edit.php b/admin/marker_edit.php
index 06bfd2f..da913c6 100644
--- a/admin/marker_edit.php
+++ b/admin/marker_edit.php
@@ -439,7 +439,7 @@ function getMarkerForm($marker = array()) {
$_SCRIPTS->setJavaScriptLibrary('jquery');
$_SCRIPTS->setJavaScriptFile('maps_simplecolor', '/' . $_MAPS_CONF['maps_folder'] . '/js/simple-color.js');
- $js = LB . '
+ $js = LB . '
', false, false);
-
+
+ $_SCRIPTS->setJavaScriptLibrary('jquery');
+ $_SCRIPTS->setJavaScript('', false, false);
+
//Maps for calendar plugin
+ $str = '';
$url = COM_getCurrentURL();
-
- if ( ( stripos($url, 'calendar/index.php') !== FALSE || stripos($url, 'event.php') !== FALSE && $_GET['eid'] != '') && in_array('calendar', $_PLUGINS) && $_MAPS_CONF['display_events_map'] )
- {
-
-
+
+ if ((stripos($url, 'calendar/index.php') !== false || stripos($url, 'event.php') !== false && $_GET['eid'] != '') && in_array('calendar', $_PLUGINS) && $_MAPS_CONF['display_events_map']) {
+
+
$js_events_map = MAPS_displayEventsMap(false);
$_SCRIPTS->setJavaScript($js_events_map, false, false);
-
- if (stripos($url, 'calendar/index.php') !== FALSE ) {
- $str .= ' jQuery(document).ready(function() {' . LB;
+
+ if (stripos($url, 'calendar/index.php') !== false) {
+ $str = ' jQuery(document).ready(function() {' . LB;
$str .= ' jQuery(\'.cal-header\').after(\'\');' . LB;
$str .= ' });' . LB;
}
- if (stripos($url, 'event.php') !== FALSE && $_GET['eid'] != '') {
+ if (stripos($url, 'event.php') !== false && $_GET['eid'] != '') {
// get eid
- $eid = addslashes ($_GET['eid']);
+ $eid = addslashes($_GET['eid']);
$str .= ' jQuery(document).ready(function() {' . LB;
$js_one_event = MAPS_displayEventsMap(false, $eid);
$_SCRIPTS->setJavaScript($js_one_event, false, false);
- if ($eid != '') $str .= ' jQuery(\'.location\').append(\'\');' . LB;
+ if ($eid != '') $str .= ' jQuery(\'.location\').append(\'\');' . LB;
$str .= ' });' . LB;
}
}
- $_SCRIPTS->setJavaScript($str, true, true);
+ $_SCRIPTS->setJavaScript($str, true, true);
return;
}
-function MAPS_getheadercode () {
-
+function MAPS_getheadercode()
+{
+
global $_CONF, $_MAPS_CONF, $_SCRIPTS;
-
- $_SCRIPTS->setCSSFile('maps_css', '/' . $_MAPS_CONF['maps_folder'] . '/maps.css');
- $_SCRIPTS->setCSSFile('datepicker_ui', '/layout/' . $_CONF['theme'] . '/jquery_ui/jquery.ui.datepicker.css');
+
+ $_SCRIPTS->setCSSFile('maps_css', '/' . $_MAPS_CONF['maps_folder'] . '/maps.css');
+ $_SCRIPTS->setCSSFile('datepicker_ui', '/layout/' . $_CONF['theme'] . '/jquery_ui/jquery.ui.datepicker.css');
$_SCRIPTS->setJavaScriptFile('maps_iconmaker', '/' . $_MAPS_CONF['maps_folder'] . '/js/mapiconmaker.js', false);
}
/**
-* Returns doc uri for Geeklog-1.6.0 or later
-*/
-function plugin_getdocumentationurl_maps() {
-
+ * Returns doc uri for Geeklog-1.6.0 or later
+ */
+function plugin_getdocumentationurl_maps()
+{
+
return 'http://geeklog.fr/downloads/index.php/maps';
}
/**
-* Returns the item(s) for this plugin that should appear on the main menu
-*
-* NOTE: this MUST return the url/value pairs in the following format
-* $[
');
+ if ($mapid >= 0 && is_numeric($mapid)) {
+ $presentation = '';
+ if (file_exists($_CONF['path_data'] . 'maps_data/templates/presentation_tab.thtml')) {
+ $template = COM_newTemplate($_CONF['path_data'] . 'maps_data/templates');
+ } else {
+ $template = COM_newTemplate($_CONF['path'] . 'plugins/maps/templates');
+ }
+ $template->set_file(array('presentation' => 'presentation_tab.thtml'));
+
+ //Limited marker
+ $limited = '';
+ if ($marker['validity'] == 1 && SEC_hasRights('maps.admin') && (strtotime($marker['validity_end']) > time() || strtotime($marker['validity_start']) < time())) $limited = ' Limited';
+
+ $template->set_var('name', '' . addslashes($marker['name']) . '' . $limited);
- //Map
- $mid = $marker['mid'];
- $template->set_var('map', '' . $LANG_MAPS_1['on_map'] . ' ' . stripslashes($mapname) . '
');
+ //description
+ (strlen($marker['description']) > 150) ? $dots = '...' : $dots = '';
+ ($marker['description'] != '') ? $description = '' . preg_replace("/\r|\n/", "", nl2br(mb_substr($marker['description'], 0, 150))) . $dots . '
' : '';
+ $template->set_var('description', PLG_replaceTags(stripslashes($description)));
+
+ //Ressources
+ $ressources = '';
+ $arr = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+
+ foreach ($arr as $value) {
+ //For custom presentation_tab.thtml
+ $template->set_var('item_' . $value . '_label', $_MAPS_CONF['item_' . $value]);
+ $template->set_var('item_' . $value, PLG_replaceTags(stripslashes($marker['item_' . $value])));
+ if ($_MAPS_CONF['item_' . $value] != '' && $marker['item_' . $value] != '') {
+ $ressources .= '' . $_MAPS_CONF['item_' . $value] . '
';
+ $ressources .= '' . PLG_replaceTags($marker['item_' . $value]) . '
';
+ }
+ }
+ $template->set_var('ressources', $ressources);
+
+ //Read more
+ $read_more_url = '';
+ $lang_read_more = $LANG_MAPS_1['read_more'];
+
+ if ($marker['url'] == '') {
+ $read_more_url = $_MAPS_CONF['site_url'] . '/markers.php?mode=show&mkid=' . $marker['mkid'] . '&mid=' . $marker['mid'];
+ } else {
+ $read_more_url = $_CONF['site_url'] . '/' . $marker['url'];
+ $funcname = 'MAPS_ReadMore_' . $marker['type'];
+ if (function_exists($funcname)) $lang_read_more = $funcname();
+ }
+
+ $template->set_var('read_more', '' . $lang_read_more . '');
+
+ //Map
+ $mid = $marker['mid'];
+ $template->set_var('map', '' . $LANG_MAPS_1['on_map'] . ' ' . stripslashes($mapname) . '
');
//Edit link
- if (SEC_hasRights('maps.admin') || $_USER['uid'] == $marker['owner_id']) {
- $template->set_var('edit', ' ' . $LANG_MAPS_1['edit_button'] . '');
- } else {
- $template->set_var('edit', '');
- }
+ if (SEC_hasRights('maps.admin') || $_USER['uid'] == $marker['owner_id']) {
+ $template->set_var('edit', ' ' . $LANG_MAPS_1['edit_button'] . '');
+ } else {
+ $template->set_var('edit', '');
+ }
- $presentation .= $template->parse('output', 'presentation');
-
- $markers .= LB . ' var infowindow' . $marker['mkid'] . ' = new google.maps.InfoWindow({
+ $presentation .= $template->parse('output', 'presentation');
+
+ $markers .= LB . ' var infowindow' . $marker['mkid'] . ' = new google.maps.InfoWindow({
content: \'' . addslashes($presentation) . '\'
});' . LB;
-
- // Adding a click-event to the marker
- $markers .= LB . ' google.maps.event.addListener(marker' . $marker['mkid'] . ', \'click\', function() {
- infowindow' . $marker['mkid'] . '.open(map' . $mapid . ',marker' . $marker['mkid'] .');
+
+ // Adding a click-event to the marker
+ $markers .= LB . ' google.maps.event.addListener(marker' . $marker['mkid'] . ', \'click\', function() {
+ infowindow' . $marker['mkid'] . '.open(map' . $mapid . ',marker' . $marker['mkid'] . ');
});' . LB;
- } else {
- if ( $mapid == 'events' && $infos )
- {
- //Display infoWindow for events map
- $presentation = '';
- $template = COM_newTemplate($_CONF['path'] . 'plugins/maps/templates');
- $template->set_file(array('presentation_event' => 'presentation_tab_event.thtml'));
-
- $template->set_var('name', '' . $marker['name'] . '');
-
- //description
- (strlen($marker['description'])>150) ? $dots = '...' : $dots = '' ;
- ($marker['description'] != '') ? $description = '' . preg_replace( "/\r|\n/", "", nl2br(mb_substr ( $marker['description'] ,0, 150 ))) . $dots . '
' : '';
- $template->set_var('description', $description);
-
- //Read more
- $template->set_var('read_more', '' . $LANG_MAPS_1['read_more'] . '');
+ } else {
+ if ($mapid == 'events' && $infos) {
+ //Display infoWindow for events map
+ $presentation = '';
+ $template = COM_newTemplate($_CONF['path'] . 'plugins/maps/templates');
+ $template->set_file(array('presentation_event' => 'presentation_tab_event.thtml'));
- //Map
- $template->set_var('map', '');
+ $template->set_var('name', '' . $marker['name'] . '');
- $presentation .= $template->parse('output', 'presentation_event');
-
- $markers .= LB . ' var infowindow' . $marker['mkid'] . ' = new google.maps.InfoWindow({
+ //description
+ (strlen($marker['description']) > 150) ? $dots = '...' : $dots = '';
+ ($marker['description'] != '') ? $description = '' . preg_replace("/\r|\n/", "", nl2br(mb_substr($marker['description'], 0, 150))) . $dots . '
' : '';
+ $template->set_var('description', $description);
+
+ //Read more
+ $template->set_var('read_more', '' . $LANG_MAPS_1['read_more'] . '');
+
+ //Map
+ $template->set_var('map', '');
+
+ $presentation .= $template->parse('output', 'presentation_event');
+
+ $markers .= LB . ' var infowindow' . $marker['mkid'] . ' = new google.maps.InfoWindow({
content: \'' . addslashes($presentation) . '\'
});' . LB;
-
- // Adding a click-event to the marker
- $markers .= LB . ' google.maps.event.addListener(marker' . $marker['mkid'] . ', \'click\', function() {
- infowindow' . $marker['mkid'] . '.open(map' . $mapid . ',marker' . $marker['mkid'] .');
+
+ // Adding a click-event to the marker
+ $markers .= LB . ' google.maps.event.addListener(marker' . $marker['mkid'] . ', \'click\', function() {
+ infowindow' . $marker['mkid'] . '.open(map' . $mapid . ',marker' . $marker['mkid'] . ');
});' . LB;
- }
-
- }
-
+ }
+
+ }
+
// Add marker to map
- if ( $_MAPS_CONF['use_cluster'] == 1 ) {
- $markers .= ' markers.push(marker' . $marker['mkid'] .');' . LB;
- }
+ if ($_MAPS_CONF['use_cluster'] == 1) {
+ $markers .= ' markers.push(marker' . $marker['mkid'] . ');' . LB;
+ }
return $markers;
}
function MAPS_checkMarkervalidity($marker)
{
- if ( !SEC_hasAccess2($marker) ) return false;
-
- if ( $marker['validity'] == 1 && ! SEC_hasRights('maps.admin')) {
- if ( strtotime($marker['validity_end']) > time() || strtotime($marker['validity_start']) < time() ) return false;
- }
-
- return true;
+ if (!SEC_hasAccess2($marker)) return false;
+
+ if ($marker['validity'] == 1 && !SEC_hasRights('maps.admin')) {
+ if (strtotime($marker['validity_end']) > time() || strtotime($marker['validity_start']) < time()) return false;
+ }
+
+ return true;
}
-function MAPS_selectedMarkers($width, $height, $zoom, $mkids=array()) {
-
- global $_TABLES;
-
- //Center the map in the centre of the markers
- $allmkid = rtrim(implode(', ', $mkids), ', ');
- $sql = "SELECT mk.*, ma.mmk_default, ma.mmk_icon, ma.name as mapname, ma.primary_color, ma.stroke_color, ma.label, ma.label_color FROM {$_TABLES['maps_markers']} AS mk
+function MAPS_selectedMarkers($width, $height, $zoom, $mkids = array())
+{
+
+ global $_TABLES;
+
+ //Center the map in the centre of the markers
+ $allmkid = rtrim(implode(', ', $mkids), ', ');
+ $sql = "SELECT mk.*, ma.mmk_default, ma.mmk_icon, ma.name as mapname, ma.primary_color, ma.stroke_color, ma.label, ma.label_color FROM {$_TABLES['maps_markers']} AS mk
LEFT JOIN {$_TABLES['maps_maps']} AS ma ON mk.mid = ma.mid
WHERE mkid IN ({$allmkid})";
- $res = DB_query($sql);
- if (!$res) return '';
- while ($A = DB_fetchArray($res, false)) {
- $markers[] = $A;
- $lat = $lat + $A['lat'];
- $lng = $lng + $A['lng'];
- $i++;
- }
- $lat = $lat / $i;
- $lng = $lng / $i;
-
- return MAPS_getMarkerDetail (0, $markers, 1, $width, $height, $zoom, $lat, $lng);
+ $res = DB_query($sql);
+ if (!$res) return '';
+
+ $lat = 0.0;
+ $lng = 0.0;
+ $i = 0;
+ $markers = array();
+
+ while ($A = DB_fetchArray($res, false)) {
+ $markers[] = $A;
+ $lat = $lat + $A['lat'];
+ $lng = $lng + $A['lng'];
+ $i++;
+ }
+ $lat = $lat / $i;
+ $lng = $lng / $i;
+
+ return MAPS_getMarkerDetail(0, $markers, 1, $width, $height, $zoom, $lat, $lng);
}
// $mkid unique marker id or array of markers datas
-function MAPS_getMarkerDetail ($mid=0, $mkid, $autotag=0, $mapwidth ='100%', $mapheight='300px', $mapzoom='10', $lat='0', $lng='0')
+function MAPS_getMarkerDetail($mid = 0, $mkid, $autotag = 0, $mapwidth = '100%', $mapheight = '300px', $mapzoom = '10', $lat = '0', $lng = '0')
{
global $_TABLES, $LANG_MAPS_1, $_MAPS_CONF, $_CONF;
$retval = '';
-
- //One marker
- if ($mid > 0) {
- //Map info
- $res_map = DB_query("SELECT * FROM {$_TABLES['maps_maps']} WHERE mid=$mid LIMIT 1");
-
- if (DB_numRows($res_map) < 1) {
- echo COM_refresh($_MAPS_CONF['site_url'] . '/index.php');
- exit ();
- }
-
- $A = DB_fetchArray($res_map);
-
- // Ensure user has the rights to access this map
- if (!SEC_hasAccess2($A)) return;
-
- $primaryColor = $A['primary_color'];
- $strokecolor = $A['stroke_color'];
- if ($A['label_color'] == 1) {
- $label_color = '#FFFFFF';
- } else {
- $label_color = '#000000';
- }
- $label = $A['label'];
-
- //marker info
- $markers = '' . LB;
- $sql = "SELECT * FROM {$_TABLES['maps_markers']} WHERE mkid=$mkid LIMIT 1";
- $res_markers = DB_query($sql);
- $marker = DB_fetchArray($res_markers);
-
- //check marker validity
- if( !MAPS_checkMarkervalidity($marker) ) return $LANG_MAPS_1['marker_limited'];
- if ( !defined('MAPS_PAGE_TITLE') ) define( 'MAPS_PAGE_TITLE', stripslashes($marker['name']));
-
- $markers = MAPS_renderMarker ($marker, $primaryColor, $strokecolor, $label, $label_color, $A['name'],
- $marker_fields[$mkid], '', $mkid, true, $A);
+ //One marker
+ if ($mid > 0) {
+ //Map info
+ $res_map = DB_query("SELECT * FROM {$_TABLES['maps_maps']} WHERE mid=$mid LIMIT 1");
- $T = COM_newTemplate($_CONF['path'] . 'plugins/maps/templates');
-
- if ($autotag==0) {
- $T->set_file('page', 'map.thtml');
- } else {
- $T->set_file('page', 'map_autotag.thtml');
- }
- $T->set_var('mid', $mkid);
- $T->set_var('name', '');
- $T->set_var('description', '');
- $T->set_var('header', '');
- $T->set_var('footer', '');
-
- //address from marker
- $T->set_var('address', addslashes($marker['address']));
- $lat = str_replace(",",".",$marker['lat']);
- $lng = str_replace(",",".",$marker['lng']);
- $T->set_var('lat', $lat);
- $T->set_var('lng', $lng);
- $T->set_var('zoom', $_MAPS_CONF['detail_zoom']);
-
- $T->set_var('map_type', $_MAPS_CONF['global_type']);
- $T->set_var('map_width', $_MAPS_CONF['global_width']);
-
- $T->set_var('map_height', $_MAPS_CONF['map_height_geotag']);
-
- //directions
- $gid = $marker['mkid'];
- $T->set_var('gid', $gid);
- $value = htmlentities($LANG_MAPS_1['value_directions'], ENT_QUOTES);
-
- $T->set_var('directions_input', '
+ if (DB_numRows($res_map) < 1) {
+ COM_redirect($_MAPS_CONF['site_url'] . '/index.php');
+ }
+
+ $A = DB_fetchArray($res_map);
+
+ // Ensure user has the rights to access this map
+ if (!SEC_hasAccess2($A)) return;
+
+ $primaryColor = $A['primary_color'];
+ $strokecolor = $A['stroke_color'];
+ if ($A['label_color'] == 1) {
+ $label_color = '#FFFFFF';
+ } else {
+ $label_color = '#000000';
+ }
+ $label = $A['label'];
+
+ //marker info
+ $markers = '' . LB;
+ $sql = "SELECT * FROM {$_TABLES['maps_markers']} WHERE mkid=$mkid LIMIT 1";
+ $res_markers = DB_query($sql);
+ $marker = DB_fetchArray($res_markers);
+
+ //check marker validity
+ if (!MAPS_checkMarkervalidity($marker)) return $LANG_MAPS_1['marker_limited'];
+
+ if (!defined('MAPS_PAGE_TITLE')) define('MAPS_PAGE_TITLE', stripslashes($marker['name']));
+
+ $markers = MAPS_renderMarker($marker, $primaryColor, $strokecolor, $label, $label_color, $A['name'], '', '', $mkid, true, $A);
+
+ $T = COM_newTemplate($_CONF['path'] . 'plugins/maps/templates');
+
+ if ($autotag == 0) {
+ $T->set_file('page', 'map.thtml');
+ } else {
+ $T->set_file('page', 'map_autotag.thtml');
+ }
+ $T->set_var('mid', $mkid);
+ $T->set_var('name', '');
+ $T->set_var('description', '');
+ $T->set_var('header', '');
+ $T->set_var('footer', '');
+
+ //address from marker
+ $T->set_var('address', addslashes($marker['address']));
+ $lat = str_replace(",", ".", $marker['lat']);
+ $lng = str_replace(",", ".", $marker['lng']);
+ $T->set_var('lat', $lat);
+ $T->set_var('lng', $lng);
+ $T->set_var('zoom', $_MAPS_CONF['detail_zoom']);
+
+ $T->set_var('map_type', $_MAPS_CONF['global_type']);
+ $T->set_var('map_width', $_MAPS_CONF['global_width']);
+
+ $T->set_var('map_height', $_MAPS_CONF['map_height_geotag']);
+
+ //directions
+ $gid = $marker['mkid'];
+ $T->set_var('gid', $gid);
+ $value = htmlentities($LANG_MAPS_1['value_directions'], ENT_QUOTES);
+
+ $T->set_var('directions_input', '
' . $LANG_MAPS_1['need_directions'] . '
-
+
');
-
- $T->set_var('current_address', addslashes($marker['address']));
-
- //markers
- $jsmarkers = 'var markers = [];';
- $jsmarkers .= $markers;
- if ($_MAPS_CONF['use_cluster'] == 0 ) {
- $T->set_var('markerclusterer', '');
- } else {
- $T->set_var('markerclusterer', "");
- $jsmarkers .= LB . ' var markerCluster = new MarkerClusterer(map' . $mkid . ', markers);' . LB;
+ $T->set_var('current_address', addslashes($marker['address']));
- }
-
- $T->set_var('markers', $jsmarkers);
-
- //Ads
- $ads = MAPS_getAds ($mkid);
- $T->set_var('ads', $ads);
+ //markers
+ $jsmarkers = 'var markers = [];';
+ $jsmarkers .= $markers;
+ if ($_MAPS_CONF['use_cluster'] == 0) {
+ $T->set_var('markerclusterer', '');
+ } else {
+ $T->set_var('markerclusterer', "");
- //Todo edit button
- $T->set_var('edit_button', '');
+ $jsmarkers .= LB . ' var markerCluster = new MarkerClusterer(map' . $mkid . ', markers);' . LB;
- $T->parse('output','page');
- $retval .= $T->finish($T->get_var('output'));
- } else {
- //Selected markers
+ }
+
+ $T->set_var('markers', $jsmarkers);
+
+ //Ads
+ $ads = MAPS_getAds($mkid);
+ $T->set_var('ads', $ads);
+
+ //Todo edit button
+ $T->set_var('edit_button', '');
+
+ $T->parse('output', 'page');
+ $retval .= $T->finish($T->get_var('output'));
+ } else {
+ //Selected markers
$randid = rand();
- $markers = '' . LB;
-
- foreach ($mkid as $mkinfos) {
+ $markers = '' . LB;
- //check marker validity
- if( !MAPS_checkMarkervalidity($mkinfos) ) continue;
+ foreach ($mkid as $mkinfos) {
- if ( !defined('MAPS_PAGE_TITLE') ) define( 'MAPS_PAGE_TITLE', '');
-
- $primaryColor = $mkinfos['primary_color'];
- $strokecolor = $mkinfos['stroke_color'];
- if ($mkinfos['label_color'] == 1) {
- $label_color = '#FFFFFF';
- } else {
- $label_color = '#000000';
- }
- $label = $mkinfos['label'];
-
- $markers .= MAPS_renderMarker ($mkinfos, $primaryColor, $strokecolor, $label, $label_color, $mkinfos['mapname'], '', '', $randid, true, $mkinfos);
- }
+ //check marker validity
+ if (!MAPS_checkMarkervalidity($mkinfos)) continue;
- $T = COM_newTemplate($_CONF['path'] . 'plugins/maps/templates');
-
- if ($autotag==0) {
- $T->set_file('page', 'map.thtml');
- } else {
- $T->set_file('page', 'map_autotag.thtml');
- }
- $T->set_var('mid', $randid);
- $T->set_var('name', '');
- $T->set_var('description', '');
- $T->set_var('header', '');
- $T->set_var('footer', '');
- $T->set_var('address', '');
- $T->set_var('lat', $lat);
- $T->set_var('lng', $lng);
- $T->set_var('zoom', $mapzoom);
-
- $T->set_var('map_type', $_MAPS_CONF['global_type']);
- $T->set_var('map_width', $mapwidth);
-
- $T->set_var('map_height', $mapheight);
-
- //directions
- $T->set_var('gid', '');
- $value = htmlentities($LANG_MAPS_1['value_directions'], ENT_QUOTES);
-
- $T->set_var('directions_input', '');
-
- $T->set_var('current_address', '');
-
- //markers
- $jsmarkers = 'var markers = [];';
- $jsmarkers .= $markers;
- if ($_MAPS_CONF['use_cluster'] == 0 ) {
- $T->set_var('markerclusterer', '');
- } else {
- $T->set_var('markerclusterer', "");
+ if (!defined('MAPS_PAGE_TITLE')) define('MAPS_PAGE_TITLE', '');
- $jsmarkers .= LB . ' var markerCluster = new MarkerClusterer(map' . $randid . ', markers);' . LB;
+ $primaryColor = $mkinfos['primary_color'];
+ $strokecolor = $mkinfos['stroke_color'];
+ if ($mkinfos['label_color'] == 1) {
+ $label_color = '#FFFFFF';
+ } else {
+ $label_color = '#000000';
+ }
+ $label = $mkinfos['label'];
- }
-
- $T->set_var('markers', $jsmarkers);
-
- //Ads
- $ads = MAPS_getAds ($randid);
- $T->set_var('ads', $ads);
+ $markers .= MAPS_renderMarker($mkinfos, $primaryColor, $strokecolor, $label, $label_color, $mkinfos['mapname'], '', '', $randid, true, $mkinfos);
+ }
+
+ $T = COM_newTemplate($_CONF['path'] . 'plugins/maps/templates');
+
+ if ($autotag == 0) {
+ $T->set_file('page', 'map.thtml');
+ } else {
+ $T->set_file('page', 'map_autotag.thtml');
+ }
+ $T->set_var('mid', $randid);
+ $T->set_var('name', '');
+ $T->set_var('description', '');
+ $T->set_var('header', '');
+ $T->set_var('footer', '');
+ $T->set_var('address', '');
+ $T->set_var('lat', $lat);
+ $T->set_var('lng', $lng);
+ $T->set_var('zoom', $mapzoom);
+
+ $T->set_var('map_type', $_MAPS_CONF['global_type']);
+ $T->set_var('map_width', $mapwidth);
+
+ $T->set_var('map_height', $mapheight);
+
+ //directions
+ $T->set_var('gid', '');
+ $value = htmlentities($LANG_MAPS_1['value_directions'], ENT_QUOTES);
+
+ $T->set_var('directions_input', '');
+
+ $T->set_var('current_address', '');
+
+ //markers
+ $jsmarkers = 'var markers = [];';
+ $jsmarkers .= $markers;
+ if ($_MAPS_CONF['use_cluster'] == 0) {
+ $T->set_var('markerclusterer', '');
+ } else {
+ $T->set_var('markerclusterer', "");
- //Edit button
- $T->set_var('edit_button', '');
+ $jsmarkers .= LB . ' var markerCluster = new MarkerClusterer(map' . $randid . ', markers);' . LB;
+
+ }
+
+ $T->set_var('markers', $jsmarkers);
+
+ //Ads
+ $ads = MAPS_getAds($randid);
+ $T->set_var('ads', $ads);
+
+ //Edit button
+ $T->set_var('edit_button', '');
+
+ $T->parse('output', 'page');
+ $retval .= $T->finish($T->get_var('output'));
+ }
- $T->parse('output','page');
- $retval .= $T->finish($T->get_var('output'));
- }
-
return $retval;
-
+
}
/**
-*
-* Checks that the current user has the rights to moderate the
-* plugin, returns true if this is the case, false otherwise
-*
-* @return boolean Returns true if moderator
-*
-*/
+ * Checks that the current user has the rights to moderate the
+ * plugin, returns true if this is the case, false otherwise
+ *
+ * @return boolean Returns true if moderator
+ */
function plugin_ismoderator_maps()
{
return SEC_hasRights('maps.admin');
}
/**
-*
-* Counts the items that are submitted
-*
-*/
+ * Counts the items that are submitted
+
+ */
function plugin_submissioncount_maps()
{
global $_TABLES;
@@ -2293,49 +2307,47 @@ function plugin_submissioncount_maps()
}
/**
-* Shows marker submission form or diverts to marker editor if admin calls in
-*
-*/
-function plugin_submit_maps($marker='')
+ * Shows marker submission form or diverts to marker editor if admin calls in
+
+ */
+function plugin_submit_maps($marker = '')
{
global $_CONF, $_MAPS_CONF, $LANG12, $LANG_MAPS_1, $LANG_LOGIN, $_SCRIPTS;
if (SEC_hasRights('maps.admin')) {
- echo COM_refresh ($_CONF['site_admin_url'] . '/plugins/maps/marker_edit.php');
- exit;
- }
-
- //set default for geocoder
- $marker['lat'] = '37.4217913';
- $marker['lng'] = '-122.08371390000002';
-
- COM_clearSpeedlimit ($_CONF['speedlimit'], 'submit');
+ COM_redirect($_CONF['site_admin_url'] . '/plugins/maps/marker_edit.php');
+ }
+
+ //set default for geocoder
+ $marker['lat'] = '37.4217913';
+ $marker['lng'] = '-122.08371390000002';
+
+ COM_clearSpeedlimit($_CONF['speedlimit'], 'submit');
if ($_MAPS_CONF['marker_submission'] == 0) {
return $LANG_MAPS_1['submission_disabled'];
}
-
+
// Ensure user has the rights to access this page
- // TODO use geeklog built-in login form
-
+ // TODO use geeklog built-in login form
+
if (COM_isAnonUser() && (($_CONF['loginrequired'] == 1) || ($_MAPS_CONF['maps_login_required'] == 1) || ($_MAPS_CONF['submit_login_required'] == 1))) {
- $display .= COM_siteHeader('');
- $display .= MAPS_user_menu();
- $display .= COM_startBlock ($LANG_LOGIN[1], '',
- COM_getBlockTemplate ('_msg_block', 'header'));
+ $display = MAPS_user_menu();
+ $display .= COM_startBlock($LANG_LOGIN[1], '',
+ COM_getBlockTemplate('_msg_block', 'header'));
$login = COM_newTemplate($_CONF['path'] . 'plugins/maps/templates');
- $login->set_file (array ('login'=>'submitloginrequired.thtml'));
- $login->set_var ( 'xhtml', XHTML );
- $login->set_var ('login_message', $LANG_LOGIN[2]);
- $login->set_var ('site_url', $_CONF['site_url']);
- $login->set_var ('site_admin_url', $_CONF['site_admin_url']);
- $login->set_var ('layout_url', $_CONF['layout_url']);
- $login->set_var ('lang_login', $LANG_LOGIN[3]);
- $login->set_var ('lang_newuser', $LANG_LOGIN[4]);
- $login->parse ('output', 'login');
- $display .= $login->finish ($login->get_var('output'));
- $display .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
- $display .= COM_siteFooter();
+ $login->set_file(array('login' => 'submitloginrequired.thtml'));
+ $login->set_var('xhtml', XHTML);
+ $login->set_var('login_message', $LANG_LOGIN[2]);
+ $login->set_var('site_url', $_CONF['site_url']);
+ $login->set_var('site_admin_url', $_CONF['site_admin_url']);
+ $login->set_var('layout_url', $_CONF['layout_url']);
+ $login->set_var('lang_login', $LANG_LOGIN[3]);
+ $login->set_var('lang_newuser', $LANG_LOGIN[4]);
+ $login->parse('output', 'login');
+ $display .= $login->finish($login->get_var('output'));
+ $display .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
+ $display = COM_createHTMLDocument($display);
COM_output($display);
exit;
}
@@ -2350,9 +2362,9 @@ function plugin_submit_maps($marker='')
$template->set_var('lang_preview', $LANG12[32]);
$template->set_var('lang_save', $LANG12[8]);
-
+
$template->set_var('arrow', '

');
-
+
//informations
$template->set_var('informations', $LANG_MAPS_1['informations']);
$template->set_var('name_label', $LANG_MAPS_1['marker_name_label']);
@@ -2369,10 +2381,11 @@ function plugin_submit_maps($marker='')
$template->set_var('mid', $marker['mid']);
$map_options = MAPS_recurseMaps($marker['mid']);
if ($map_options == '') {
- $display .= COM_startBlock($LANG_MAPS_1['error'],'','blockheader-message.thtml');
+ $display = COM_startBlock($LANG_MAPS_1['error'], '', 'blockheader-message.thtml');
$display .= $LANG_MAPS_1['maps_empty'];
$display .= COM_endBlock('blockfooter-message.thtml');
- return ;
+
+ return;
}
$template->set_var('map_options', $map_options);
$template->set_var('created_label', $LANG_MAPS_1['marker_created']);
@@ -2387,98 +2400,98 @@ function plugin_submit_maps($marker='')
$template->set_var('presentation_tab', $LANG_MAPS_1['presentation_tab']);
$template->set_var('description_label', $LANG_MAPS_1['description_label']);
$template->set_var('description', $marker['description']);
-
+
$template->set_var('street_label', $LANG_MAPS_1['street_label']);
if ($_MAPS_CONF['street'] == 1) {
- $template->set_var('street', '
');
+ $template->set_var('street', '
');
} else {
- $template->set_var('street', $LANG_MAPS_1['not_use_see_config']);
+ $template->set_var('street', $LANG_MAPS_1['not_use_see_config']);
}
-
+
$template->set_var('code_label', $LANG_MAPS_1['code_label']);
if ($_MAPS_CONF['code'] == 1) {
- $template->set_var('code', '
');
+ $template->set_var('code', '
');
} else {
- $template->set_var('code', $LANG_MAPS_1['not_use_see_config']);
+ $template->set_var('code', $LANG_MAPS_1['not_use_see_config']);
}
-
+
$template->set_var('city_label', $LANG_MAPS_1['city_label']);
if ($_MAPS_CONF['city'] == 1) {
- $template->set_var('city', '
');
+ $template->set_var('city', '
');
} else {
- $template->set_var('city', $LANG_MAPS_1['not_use_see_config']);
+ $template->set_var('city', $LANG_MAPS_1['not_use_see_config']);
}
-
+
$template->set_var('state_label', $LANG_MAPS_1['state_label']);
if ($_MAPS_CONF['state'] == 1) {
- $template->set_var('state', '
');
+ $template->set_var('state', '
');
} else {
- $template->set_var('state', $LANG_MAPS_1['not_use_see_config']);
+ $template->set_var('state', $LANG_MAPS_1['not_use_see_config']);
}
-
+
$template->set_var('country_label', $LANG_MAPS_1['country_label']);
if ($_MAPS_CONF['country'] == 1) {
- $template->set_var('country', '
');
+ $template->set_var('country', '
');
} else {
- $template->set_var('country', $LANG_MAPS_1['not_use_see_config']);
+ $template->set_var('country', $LANG_MAPS_1['not_use_see_config']);
}
-
+
$template->set_var('tel_label', $LANG_MAPS_1['tel_label']);
if ($_MAPS_CONF['tel'] == 1) {
- $template->set_var('tel', '
');
+ $template->set_var('tel', '
');
} else {
- $template->set_var('tel', $LANG_MAPS_1['not_use_see_config']);
+ $template->set_var('tel', $LANG_MAPS_1['not_use_see_config']);
}
-
+
$template->set_var('fax_label', $LANG_MAPS_1['fax_label']);
if ($_MAPS_CONF['fax'] == 1) {
- $template->set_var('fax', '
');
+ $template->set_var('fax', '
');
} else {
- $template->set_var('fax', $LANG_MAPS_1['not_use_see_config']);
+ $template->set_var('fax', $LANG_MAPS_1['not_use_see_config']);
}
-
+
$template->set_var('web_label', $LANG_MAPS_1['web_label']);
if ($_MAPS_CONF['web'] == 1) {
- $template->set_var('web', '
');
+ $template->set_var('web', '
');
} else {
- $template->set_var('web', $LANG_MAPS_1['not_use_see_config']);
+ $template->set_var('web', $LANG_MAPS_1['not_use_see_config']);
}
//Tab ressources
$template->set_var('ressources_tab', $LANG_MAPS_1['ressources_tab']);
$template->set_var('max_char', $LANG_MAPS_1['max_char']);
-
+
$arr = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
- $ressources ='';
+ $ressources = '';
foreach ($arr as $value) {
- if ($_MAPS_CONF['item_'. $value] == '') {
- $template->set_var('item_'. $value . '_label', '');
- $template->set_var('item_'. $value, '');
+ if ($_MAPS_CONF['item_' . $value] == '') {
+ $template->set_var('item_' . $value . '_label', '');
+ $template->set_var('item_' . $value, '');
$ressources .= '';
} else {
- $template->set_var('item_'. $value . '_label', $_MAPS_CONF['item_'. $value]);
- $template->set_var('item_'. $value, $marker['item_'. $value]);
- $ressources .= '
' . $_MAPS_CONF['item_'. $value] . '
';
+ $template->set_var('item_' . $value . '_label', $_MAPS_CONF['item_' . $value]);
+ $template->set_var('item_' . $value, $marker['item_' . $value]);
+ $ressources .= '
' . $_MAPS_CONF['item_' . $value] . '
';
}
}
if ($ressources == '') {
$ressources = $LANG_MAPS_1['empty_ressources'];
}
$template->set_var('ressources', $ressources);
-
+
//Form validation
$template->set_var('save_button', $LANG_MAPS_1['save_button']);
$template->set_var('delete_button', $LANG_MAPS_1['delete_button']);
$template->set_var('lang_save', $LANG12[8]);
if (is_numeric($marker['mkid'])) {
- $template->set_var('mkid', '
');
+ $template->set_var('mkid', '
');
} else {
$template->set_var('mkid', '');
}
-
- $_SCRIPTS->setJavaScriptLibrary('jquery');
-
- $js = LB . '
+
+ $_SCRIPTS->setJavaScriptLibrary('jquery');
+
+ $js = LB . '
' . LB. LB;
-
- $_SCRIPTS->setJavaScript($js, false);
-
+ ' . LB . LB;
+
+ $_SCRIPTS->setJavaScript($js, false);
+
return $template->parse('output', 'form');
}
/**
-* Check marker submission form for missing fields
-* and Saves a marker submission
-*
-* @param array $A Data for that submission
-* @return string HTML redirect
-*
-*/
+ * Check marker submission form for missing fields
+ * and Saves a marker submission
+ *
+ * @param array $A Data for that submission
+ * @return string HTML redirect
+ */
function plugin_savesubmission_maps($A)
{
global $_TABLES, $_USER, $LANG_MAPS_1, $_MAPS_CONF;
- $retval = '';
-
// check for missing fields
if (empty($A['name']) || empty($A['address'])) {
COM_resetSpeedlimit($type = 'submit');
- $retval = COM_siteHeader ('menu')
- . COM_startBlock($LANG_MAPS_1['error'],'','blockheader-message.thtml')
+ $retval = COM_siteHeader('menu')
+ . COM_startBlock($LANG_MAPS_1['error'], '', 'blockheader-message.thtml')
. $LANG_MAPS_1['missing_field']
. COM_endBlock('blockfooter-message.thtml')
. plugin_submit_maps($A)
- . COM_siteFooter ();
+ . COM_siteFooter();
return $retval;
}
@@ -2608,163 +2618,162 @@ function plugin_savesubmission_maps($A)
if ($_MAPS_CONF['marker_submission'] == 1) {
if ($A['from'] > $A['to']) {
- $display .= COM_startBlock($LANG_MAPS_1['error'],'','blockheader-message.thtml');
+ $display = COM_startBlock($LANG_MAPS_1['error'], '', 'blockheader-message.thtml');
$display .= $LANG_MAPS_1['date_issue'];
$display .= COM_endBlock('blockfooter-message.thtml');
$A['validity_start'] = $A['from'];
$A['validity_end'] = $A['to'];
$display .= getMarkerForm($A);
- break;
+
+ return COM_createHTMLDocument($display);
}
-
+
// prepare strings for insertion
$A['created'] = date("YmdHis");
$A['modified'] = date("YmdHis");
$A['from'] = date("Ymd");
$A['to'] = date("Ymd");
-
+
// lat, lng can only contain numbers and a decimal
if (empty($A['lat']) || empty($A['lng'])) {
$address = $A['address'];
// Updated to mysql 5.1
- // $coords = MAPS_getCoords($address, &$lat, &$lng);
- $coords = MAPS_getCoords($address, $lat, $lng);
+ // $coords = MAPS_getCoords($address, &$lat, &$lng);
+ $coords = MAPS_getCoords($address, $lat, $lng);
} else {
- $lat = addslashes ($A['lat']);
- $lng = addslashes ($A['lng']);
+ $lat = addslashes($A['lat']);
+ $lng = addslashes($A['lng']);
}
-
+
// Convert array values to numeric permission values
if (is_array($A['perm_owner']) OR is_array($A['perm_group']) OR is_array($A['perm_members']) OR is_array($A['perm_anon'])) {
- list($A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']) = SEC_getPermissionValues($A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']);
+ list($A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']) = SEC_getPermissionValues($A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']);
}
- $mkid = addslashes (COM_makeSid ());
-
- $A['name'] = addslashes ($A['name']);
- $A['description'] = addslashes ($A['description']);
- $A['address'] = addslashes ($A['address']);
- $A['mid'] = addslashes ($A['mid']);
- $A['remark'] = addslashes ($A['remark']);
- $A['street'] = addslashes ($A['street']);
- $A['city'] = addslashes ($A['city']);
- $A['code'] = addslashes ($A['code']);
- $A['state'] = addslashes ($A['state']);
- $A['country'] = addslashes ($A['country']);
- $A['tel'] = addslashes ($A['tel']);
- $A['fax'] = addslashes ($A['fax']);
- $A['web'] = addslashes ($A['web']);
- $A['item_1'] = addslashes ($A['item_1']);
- $A['item_2'] = addslashes ($A['item_2']);
- $A['item_3'] = addslashes ($A['item_3']);
- $A['item_4'] = addslashes ($A['item_4']);
- $A['item_5'] = addslashes ($A['item_5']);
- $A['item_6'] = addslashes ($A['item_6']);
- $A['item_7'] = addslashes ($A['item_7']);
- $A['item_8'] = addslashes ($A['item_8']);
- $A['item_9'] = addslashes ($A['item_9']);
- $A['item_10'] = addslashes ($A['item_10']);
-
+ $mkid = addslashes(COM_makeSid());
+
+ $A['name'] = addslashes($A['name']);
+ $A['description'] = addslashes($A['description']);
+ $A['address'] = addslashes($A['address']);
+ $A['mid'] = addslashes($A['mid']);
+ $A['remark'] = addslashes($A['remark']);
+ $A['street'] = addslashes($A['street']);
+ $A['city'] = addslashes($A['city']);
+ $A['code'] = addslashes($A['code']);
+ $A['state'] = addslashes($A['state']);
+ $A['country'] = addslashes($A['country']);
+ $A['tel'] = addslashes($A['tel']);
+ $A['fax'] = addslashes($A['fax']);
+ $A['web'] = addslashes($A['web']);
+ $A['item_1'] = addslashes($A['item_1']);
+ $A['item_2'] = addslashes($A['item_2']);
+ $A['item_3'] = addslashes($A['item_3']);
+ $A['item_4'] = addslashes($A['item_4']);
+ $A['item_5'] = addslashes($A['item_5']);
+ $A['item_6'] = addslashes($A['item_6']);
+ $A['item_7'] = addslashes($A['item_7']);
+ $A['item_8'] = addslashes($A['item_8']);
+ $A['item_9'] = addslashes($A['item_9']);
+ $A['item_10'] = addslashes($A['item_10']);
+
$sql = "'{$mkid}', '{$A['name']}', "
- . "'{$A['description']}', "
- . "'{$A['created']}', "
- . "'{$A['modified']}', "
- . "'0', "
- . "'0', "
- . "'{$A['from']}', "
- . "'{$A['to']}', "
- . "'1', "
- . "'0', "
- . "'{$A['address']}', "
- . "'{$lat}', "
- . "'{$lng}', "
- . "'{$A['mid']}', "
- . "'{$A['remark']}', "
- . "'{$A['street']}', "
- . "'{$A['city']}', "
- . "'{$A['code']}', "
- . "'{$A['state']}', "
- . "'{$A['country']}', "
- . "'{$A['tel']}', "
- . "'{$A['fax']}', "
- . "'{$A['web']}', "
- . "'{$A['item_1']}', "
- . "'{$A['item_2']}', "
- . "'{$A['item_3']}', "
- . "'{$A['item_4']}', "
- . "'{$A['item_5']}', "
- . "'{$A['item_6']}', "
- . "'{$A['item_7']}', "
- . "'{$A['item_8']}', "
- . "'{$A['item_9']}', "
- . "'{$A['item_10']}', "
- . "'{$_USER['uid']}', "
- . "'{$A['group_id']}', "
- . "'{$_MAPS_CONF['default_permissions'][0]}', "
- . "'{$_MAPS_CONF['default_permissions'][1]}', "
- . "'{$_MAPS_CONF['default_permissions'][2]}', "
- . "'{$_MAPS_CONF['default_permissions'][3]}', "
- . "'1', "
- . "'1'";
-
- DB_save ($_TABLES['maps_submission'],
- 'mkid, name, description, created, modified, payed, validity, validity_start, validity_end, active, hidden, address, lat, lng, mid, remark, street, city, code, state, country, tel, fax, web, item_1, item_2, item_3, item_4, item_5, item_6, item_7, item_8, item_9, item_10, owner_id, group_id, perm_owner, perm_group, perm_members, perm_anon, submission, mk_default',
- "{$sql}");
-
+ . "'{$A['description']}', "
+ . "'{$A['created']}', "
+ . "'{$A['modified']}', "
+ . "'0', "
+ . "'0', "
+ . "'{$A['from']}', "
+ . "'{$A['to']}', "
+ . "'1', "
+ . "'0', "
+ . "'{$A['address']}', "
+ . "'{$lat}', "
+ . "'{$lng}', "
+ . "'{$A['mid']}', "
+ . "'{$A['remark']}', "
+ . "'{$A['street']}', "
+ . "'{$A['city']}', "
+ . "'{$A['code']}', "
+ . "'{$A['state']}', "
+ . "'{$A['country']}', "
+ . "'{$A['tel']}', "
+ . "'{$A['fax']}', "
+ . "'{$A['web']}', "
+ . "'{$A['item_1']}', "
+ . "'{$A['item_2']}', "
+ . "'{$A['item_3']}', "
+ . "'{$A['item_4']}', "
+ . "'{$A['item_5']}', "
+ . "'{$A['item_6']}', "
+ . "'{$A['item_7']}', "
+ . "'{$A['item_8']}', "
+ . "'{$A['item_9']}', "
+ . "'{$A['item_10']}', "
+ . "'{$_USER['uid']}', "
+ . "'{$A['group_id']}', "
+ . "'{$_MAPS_CONF['default_permissions'][0]}', "
+ . "'{$_MAPS_CONF['default_permissions'][1]}', "
+ . "'{$_MAPS_CONF['default_permissions'][2]}', "
+ . "'{$_MAPS_CONF['default_permissions'][3]}', "
+ . "'1', "
+ . "'1'";
+
+ DB_save($_TABLES['maps_submission'],
+ 'mkid, name, description, created, modified, payed, validity, validity_start, validity_end, active, hidden, address, lat, lng, mid, remark, street, city, code, state, country, tel, fax, web, item_1, item_2, item_3, item_4, item_5, item_6, item_7, item_8, item_9, item_10, owner_id, group_id, perm_owner, perm_group, perm_members, perm_anon, submission, mk_default',
+ "{$sql}");
+
if (DB_error()) {
- return COM_refresh($_MAPS_CONF['site_url'] . '/index.php?msg=3');
+ return COM_redirect($_MAPS_CONF['site_url'] . '/index.php?msg=3');
} else {
//Send notification to admin
- MAPS_sendNotification ($A);
- return COM_refresh($_MAPS_CONF['site_url'] . '/index.php?msg=1');
+ MAPS_sendNotification($A);
+
+ return COM_redirect($_MAPS_CONF['site_url'] . '/index.php?msg=1');
}
} else {
- return COM_refresh($_MAPS_CONF['site_url'] . '/index.php?msg=2');
+ return COM_redirect($_MAPS_CONF['site_url'] . '/index.php?msg=2');
}
}
/**
-* Send an email notification for a new submission.
-*
-* @param array $A submission data
-*
-*/
-function MAPS_sendNotification ($data, $modification = false)
+ * Send an email notification for a new submission.
+ *
+ * @param array $A submission data
+ */
+function MAPS_sendNotification($data, $modification = false)
{
global $_CONF, $_MAPS_CONF, $LANG_MAPS_EMAIL, $LANG08, $_TABLES;
- $name = stripslashes ($data['name']);
+ $name = stripslashes($data['name']);
$description = stripslashes($data['description']);
$map = DB_getItem($_TABLES['maps_maps'], 'name', "mid = '{$data['mid']}'");
($modification) ? $action = $LANG_MAPS_EMAIL['marker_modification'] : $action = $LANG_MAPS_EMAIL['new_marker'];
- $mailbody = "$action\n\n"
- . "{$LANG_MAPS_EMAIL['name']} $name\n"
- . "{$LANG_MAPS_EMAIL['description']} $description\n\n"
- . "{$LANG_MAPS_EMAIL['on_map']} $map\n\n";
+ $mailbody = "$action\n\n"
+ . "{$LANG_MAPS_EMAIL['name']} $name\n"
+ . "{$LANG_MAPS_EMAIL['description']} $description\n\n"
+ . "{$LANG_MAPS_EMAIL['on_map']} $map\n\n";
- ($modification) ? $mailbody .= $_MAPS_CONF['site_url'] . '/markers.php?mode=show&mkid=' . $data['mkid'] . '&mid=' . $data['mid'] : $mailbody .= "{$LANG_MAPS_EMAIL['submissions']} >> {$_CONF['site_admin_url']}/moderation.php>\n\n";
+ ($modification) ? $mailbody .= $_MAPS_CONF['site_url'] . '/markers.php?mode=show&mkid=' . $data['mkid'] . '&mid=' . $data['mid'] : $mailbody .= "{$LANG_MAPS_EMAIL['submissions']} >> {$_CONF['site_admin_url']}/moderation.php>\n\n";
- ($modification) ? $mailsubject = $_CONF['site_name'] . ' ' . $LANG_MAPS_EMAIL['marker_modification'] : $mailsubject = $_CONF['site_name'] . ' ' . $LANG_MAPS_EMAIL['marker_submissions'];
+ ($modification) ? $mailsubject = $_CONF['site_name'] . ' ' . $LANG_MAPS_EMAIL['marker_modification'] : $mailsubject = $_CONF['site_name'] . ' ' . $LANG_MAPS_EMAIL['marker_submissions'];
$mailbody .= "\n------------------------------\n";
$mailbody .= "\n$LANG08[34]\n";
$mailbody .= "\n------------------------------\n";
- COM_mail ($_CONF['site_mail'], $mailsubject, $mailbody);
+ COM_mail($_CONF['site_mail'], $mailsubject, $mailbody);
}
/**
-* returns list of moderation values
-*
-* The array returned contains (in order): the row 'id' label, main plugin
-* table, moderation fields (comma seperated), and plugin submission table
-*
-* @return array Returns array of useful moderation values
-*
-*/
+ * returns list of moderation values
+ * The array returned contains (in order): the row 'id' label, main plugin
+ * table, moderation fields (comma seperated), and plugin submission table
+ *
+ * @return array Returns array of useful moderation values
+ */
function plugin_moderationvalues_maps()
{
global $_TABLES;
@@ -2773,8 +2782,8 @@ function plugin_moderationvalues_maps()
}
/**
-* Returns SQL & Language texts to moderation.php
-*/
+ * Returns SQL & Language texts to moderation.php
+ */
function plugin_itemlist_maps()
{
global $_TABLES, $LANG_MAPS_1;
@@ -2783,8 +2792,8 @@ function plugin_itemlist_maps()
$plugin = new Plugin();
$plugin->submissionlabel = $LANG_MAPS_1['markers_submissions'];
$plugin->submissionhelpfile = 'http://geeklog.fr/wiki/plugins:maps#moderation';
- $plugin->getsubmissionssql = "SELECT mkid AS id, name, created, address FROM "
- . $_TABLES['maps_submission'];
+ $plugin->getsubmissionssql = "SELECT mkid AS id, name, created, address FROM "
+ . $_TABLES['maps_submission'];
$plugin->addSubmissionHeading($LANG_MAPS_1['name']);
$plugin->addSubmissionHeading($LANG_MAPS_1['created']);
$plugin->addSubmissionHeading($LANG_MAPS_1['address']);
@@ -2794,52 +2803,49 @@ function plugin_itemlist_maps()
}
/**
-* Performs plugin exclusive work for items approved by moderation
-*
-* While moderation.php handles the actual move from maps_submission
-* to maps_markers tables, within the function we handle all other approval
-* relate tasks
-*
-* @param string $id Identifying string
-* @return string Any wanted HTML output
-*
-*/
+ * Performs plugin exclusive work for items approved by moderation
+ * While moderation.php handles the actual move from maps_submission
+ * to maps_markers tables, within the function we handle all other approval
+ * relate tasks
+ *
+ * @param string $id Identifying string
+ * @return string Any wanted HTML output
+ */
function plugin_moderationapprove_maps($id)
{
global $_TABLES, $_USER, $_CONF;
- $result = DB_query("SELECT * FROM " . $_TABLES['groups']
- . " WHERE grp_name = 'Maps Admin'");
- $group = DB_fetchArray($result);
-
+ $result = DB_query("SELECT * FROM " . $_TABLES['groups']
+ . " WHERE grp_name = 'Maps Admin'");
+ $group = DB_fetchArray($result);
+
$sql = "UPDATE " . $_TABLES['maps_markers'] . " SET active = 1, submission = 0, group_id = " . $group['grp_id'] . " WHERE mkid = '$id'";
$result = DB_query($sql);
if (DB_error()) {
- return 'Error';
+ return 'Error';
}
+
return '';
}
/**
-* Performs plugin exclusive work for items deleted by moderation
-*
-* While moderation.php handles the actual removal from
submission
-* table, within this function we handle all other deletion
-* relate tasks
-*
-* @param string $id Identifying string
-* @return string Any wanted HTML output
-*
-*/
+ * Performs plugin exclusive work for items deleted by moderation
+ * While moderation.php handles the actual removal from submission
+ * table, within this function we handle all other deletion
+ * relate tasks
+ *
+ * @param string $id Identifying string
+ * @return string Any wanted HTML output
+ */
function plugin_moderationdelete_maps($id)
{
global $_TABLES;
}
-function hitMap ($map)
+function hitMap($map)
{
global $_TABLES;
// increment hit counter for map
@@ -2850,16 +2856,16 @@ function hitMap ($map)
}
}
-function hitMarker ($mkid)
+function hitMarker($mkid)
{
global $_TABLES;
-
- // increment hit counter for marker
+
+ // increment hit counter for marker
DB_query("UPDATE {$_TABLES['maps_markers']} SET hits = hits + 1 WHERE mkid = '$mkid'");
}
-function updateMap ($map)
+function updateMap($map)
{
global $_TABLES;
// update modification date for a map
@@ -2868,197 +2874,195 @@ function updateMap ($map)
}
/**
-* Returns the user option for this plugin
-*
-* Adds the plugin to the user menu
-*
-* Universal Plugin: modify/uncomment use it
-*
-* @return array Array containing (plugin name, plugin user url, 0)
-*
-*/
-function plugin_getuseroption_maps()
+ * Returns the user option for this plugin
+ * Adds the plugin to the user menu
+ * Universal Plugin: modify/uncomment use it
+ *
+ * @return array Array containing (plugin name, plugin user url, 0)
+ */
+function plugin_getuseroption_maps()
{
global $_MAPS_CONF, $LANG_MAPS_1;
-
- if ($_MAPS_CONF['marker_submission']==1) return array($LANG_MAPS_1['my_markers'], $_MAPS_CONF['site_url'] . '/markers.php', 0);
+
+ if ($_MAPS_CONF['marker_submission'] == 1) return array($LANG_MAPS_1['my_markers'], $_MAPS_CONF['site_url'] . '/markers.php', 0);
}
-function MAPS_message ($message, $title='')
+function MAPS_message($message, $title = '')
{
global $LANG_MAPS_MESSAGE;
-
+
$retval = '';
if (!empty($message)) {
- $retval = COM_startBlock(($title == '')? $LANG_MAPS_MESSAGE['message'] : $title, '', 'blockheader-message.thtml');
+ $retval = COM_startBlock(($title == '') ? $LANG_MAPS_MESSAGE['message'] : $title, '', 'blockheader-message.thtml');
$retval .= stripslashes($message);
$retval .= COM_endBlock('blockfooter-message.thtml');
}
+
return $retval;
}
-function MAPS_ViewMarkerInfos ($mkid)
+function MAPS_ViewMarkerInfos($mkid)
{
global $LANG_MAPS_1, $_TABLES, $_CONF, $_MAPS_CONF, $_USER;
-
+
if ($mkid == '') return;
-
+
$sql = "SELECT * FROM {$_TABLES['maps_markers']} WHERE mkid=$mkid LIMIT 1";
$res_markers = DB_query($sql);
$marker = DB_fetchArray($res_markers);
-
- if(!MAPS_checkMarkervalidity($marker)) return;
-
+
+ if (!MAPS_checkMarkervalidity($marker)) return;
+
// Presentation tab
$presentation = '';
$template = new Template($_CONF['path'] . 'plugins/maps/templates');
$template->set_file(array('presentation' => 'marker.thtml'));
-
- //Limited marker
- $limited = '';
- if ( $marker['validity'] == 1 && SEC_hasRights('maps.admin') && ( strtotime($marker['validity_end']) > time() || strtotime($marker['validity_start']) < time() ) ) $limited = ' Limited';
-
+
+ //Limited marker
+ $limited = '';
+ if ($marker['validity'] == 1 && SEC_hasRights('maps.admin') && (strtotime($marker['validity_end']) > time() || strtotime($marker['validity_start']) < time())) $limited = ' Limited';
+
$template->set_var('name', '' . stripslashes($marker['name']) . ' ' . $limited);
-
- //ressources tab
+
+ //ressources tab
$ressources = '';
$arr = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
-
+
//payed marker
- if ( $_MAPS_CONF['monetize'] == 0 ) {
+ if ($_MAPS_CONF['monetize'] == 0) {
if ($marker['description'] != '') {
- $description = nl2br(stripslashes($marker['description']));
- $description = str_replace("\n", "", $description);
- $description = str_replace("\r", "", $description);
- $template->set_var('description', '' . $description . '
');
+ $description = nl2br(stripslashes($marker['description']));
+ $description = str_replace("\n", "", $description);
+ $description = str_replace("\r", "", $description);
+ $template->set_var('description', '' . $description . '
');
} else {
- $template->set_var('description', '');
+ $template->set_var('description', '');
}
if ($_MAPS_CONF['street'] == 1 && $marker['street'] != '') {
- $template->set_var('street', '' . $LANG_MAPS_1['street_label'] . ' ' . stripslashes($marker['street']) . '
');
+ $template->set_var('street', '' . $LANG_MAPS_1['street_label'] . ' ' . stripslashes($marker['street']) . '
');
} else {
- $template->set_var('street', '');
+ $template->set_var('street', '');
}
-
+
if ($_MAPS_CONF['code'] == 1 && $marker['code'] != '') {
- $template->set_var('code', '' . $LANG_MAPS_1['code_label'] . ' ' . $marker['code']);
+ $template->set_var('code', '' . $LANG_MAPS_1['code_label'] . ' ' . $marker['code']);
} else {
- $template->set_var('code', '');
+ $template->set_var('code', '');
}
-
+
if ($_MAPS_CONF['city'] == 1 && $marker['city'] != '') {
- $template->set_var('city', '' . $LANG_MAPS_1['city_label'] . ' ' . stripslashes($marker['city']));
+ $template->set_var('city', '' . $LANG_MAPS_1['city_label'] . ' ' . stripslashes($marker['city']));
} else {
- $template->set_var('city', '');
+ $template->set_var('city', '');
}
-
+
if ($_MAPS_CONF['state'] == 1 && $marker['state'] != '') {
- $template->set_var('state', '' . $LANG_MAPS_1['state_label'] . ' ' . $marker['state'] . '
');
+ $template->set_var('state', '' . $LANG_MAPS_1['state_label'] . ' ' . $marker['state'] . '
');
} else {
- $template->set_var('state', '');
+ $template->set_var('state', '');
}
-
+
if ($_MAPS_CONF['country'] == 1 && $marker['country'] != '') {
- $template->set_var('country', '' . $LANG_MAPS_1['country_label'] . ' ' . stripslashes($marker['country']) . '
');
+ $template->set_var('country', '' . $LANG_MAPS_1['country_label'] . ' ' . stripslashes($marker['country']) . '
');
} else {
- $template->set_var('country', '');
+ $template->set_var('country', '');
}
-
+
if ($_MAPS_CONF['tel'] == 1 && $marker['tel'] != '') {
- $template->set_var('tel', '' . $LANG_MAPS_1['tel_label'] . ' ' . $marker['tel'] . '
');
+ $template->set_var('tel', '' . $LANG_MAPS_1['tel_label'] . ' ' . $marker['tel'] . '
');
} else {
- $template->set_var('tel', '');
+ $template->set_var('tel', '');
}
-
+
if ($_MAPS_CONF['fax'] == 1 && $marker['fax'] != '') {
- $template->set_var('fax', '' . $LANG_MAPS_1['fax_label'] . ' ' . $marker['fax'] . '
');
+ $template->set_var('fax', '' . $LANG_MAPS_1['fax_label'] . ' ' . $marker['fax'] . '
');
} else {
- $template->set_var('fax', '');
+ $template->set_var('fax', '');
}
-
+
if ($_MAPS_CONF['web'] == 1 && $marker['web'] != '') {
- $template->set_var('web', '' . $LANG_MAPS_1['web_label'] . ' ' . MAPS_convertLinkToUrl($marker['web']) . '
');
+ $template->set_var('web', '' . $LANG_MAPS_1['web_label'] . ' ' . MAPS_convertLinkToUrl($marker['web']) . '
');
} else {
- $template->set_var('web', '');
+ $template->set_var('web', '');
}
-
+
//Ressources tab
foreach ($arr as &$value) {
- if ($_MAPS_CONF['item_'. $value] == '') {
+ if ($_MAPS_CONF['item_' . $value] == '') {
$ressources .= '';
} else {
- if ($marker['item_'. $value] != ''){
- $content = str_replace(array("\r\n", "\n", "\r", " "), '', addslashes($marker['item_'. $value]));
- $ressources .= '' . $_MAPS_CONF['item_'. $value] . '
' . stripslashes($content) . '
';
- }
+ if ($marker['item_' . $value] != '') {
+ $content = str_replace(array("\r\n", "\n", "\r", " "), '', addslashes($marker['item_' . $value]));
+ $ressources .= '' . $_MAPS_CONF['item_' . $value] . '
' . stripslashes($content) . '
';
+ }
}
}
- } elseif (($marker['payed'] == 1 ) && ($_MAPS_CONF['monetize'] == 1)) {
+ } elseif (($marker['payed'] == 1) && ($_MAPS_CONF['monetize'] == 1)) {
if ($marker['description'] != '') {
- $template->set_var('description', '' . stripslashes($marker['description']) . '
');
+ $template->set_var('description', '' . stripslashes($marker['description']) . '
');
} else {
- $template->set_var('description', '');
+ $template->set_var('description', '');
}
if ($_MAPS_CONF['street'] == 1 && $marker['street'] != '') {
- $template->set_var('street', stripslashes($marker['street']) . ' ');
+ $template->set_var('street', stripslashes($marker['street']) . ' ');
} else {
- $template->set_var('street', '');
+ $template->set_var('street', '');
}
if ($_MAPS_CONF['code'] == 1 && $marker['code'] != '') {
- $template->set_var('code', $marker['code'] . ' ');
+ $template->set_var('code', $marker['code'] . ' ');
} else {
- $template->set_var('code', '');
+ $template->set_var('code', '');
}
if ($_MAPS_CONF['city'] == 1 && $marker['city'] != '') {
- $template->set_var('city', stripslashes($marker['city']) . ' ');
+ $template->set_var('city', stripslashes($marker['city']) . ' ');
} else {
- $template->set_var('city', '');
+ $template->set_var('city', '');
}
if ($_MAPS_CONF['state'] == 1 && $marker['state'] != '') {
- $template->set_var('state', $marker['state'] . ' ');
+ $template->set_var('state', $marker['state'] . ' ');
} else {
- $template->set_var('state', '');
+ $template->set_var('state', '');
}
if ($_MAPS_CONF['country'] == 1 && $marker['country'] != '') {
- $template->set_var('country', stripslashes($marker['country']) . ' ');
- } else {
- $template->set_var('country', '');
- }
- if ($count == 0) {
- $template->set_var('space', '');
+ $template->set_var('country', stripslashes($marker['country']) . ' ');
} else {
- $template->set_var('space', '
' . '
');
+ $template->set_var('country', '');
}
+// if ($count == 0) {
+ $template->set_var('space', '');
+// } else {
+// $template->set_var('space', '
' . '
');
+// }
if ($_MAPS_CONF['tel'] == 1 && $marker['tel'] != '') {
- $template->set_var('tel', '' . $LANG_MAPS_1['tel_label'] . ' ' . $marker['tel'] . '
');
+ $template->set_var('tel', '' . $LANG_MAPS_1['tel_label'] . ' ' . $marker['tel'] . '
');
} else {
- $template->set_var('tel', '');
+ $template->set_var('tel', '');
}
if ($_MAPS_CONF['fax'] == 1 && $marker['fax'] != '') {
- $template->set_var('fax', '' . $LANG_MAPS_1['fax_label'] . ' ' . $marker['fax'] . '
');
+ $template->set_var('fax', '' . $LANG_MAPS_1['fax_label'] . ' ' . $marker['fax'] . '
');
} else {
- $template->set_var('fax', '');
+ $template->set_var('fax', '');
}
if ($_MAPS_CONF['web'] == 1 && $marker['web'] != '') {
- $template->set_var('web', '' . $LANG_MAPS_1['web_label'] . ' ' . $marker['web'] . '
');
+ $template->set_var('web', '' . $LANG_MAPS_1['web_label'] . ' ' . $marker['web'] . '
');
} else {
- $template->set_var('web', '');
+ $template->set_var('web', '');
}
//Ressources tab
foreach ($arr as &$value) {
- if ($_MAPS_CONF['item_'. $value] == '') {
+ if ($_MAPS_CONF['item_' . $value] == '') {
$ressources .= '';
} else {
- if ($marker['item_'. $value] != '') {
- $content = str_replace(array("\r\n", "\n", "\r", " "), '', addslashes($marker['item_'. $value]));
- $ressources .= '' . $_MAPS_CONF['item_'. $value] . '
' . stripslashes($content) . '
';
- }
+ if ($marker['item_' . $value] != '') {
+ $content = str_replace(array("\r\n", "\n", "\r", " "), '', addslashes($marker['item_' . $value]));
+ $ressources .= '' . $_MAPS_CONF['item_' . $value] . '
' . stripslashes($content) . '
';
+ }
}
}
} else {
if ($marker['description'] != '') {
- $template->set_var('description', '' . stripslashes($marker['description']) . '
');
+ $template->set_var('description', '' . stripslashes($marker['description']) . '
');
} else {
$template->set_var('description', '');
}
@@ -3074,330 +3078,371 @@ function MAPS_ViewMarkerInfos ($mkid)
//Ressources tab
$ressources = '';
}
-
+
$template->set_var('ressources', $ressources);
-
+
//Edit link
if (SEC_hasRights('maps.admin') || $_USER['uid'] == $marker['owner_id']) {
- $template->set_var('edit', ' | ' . $LANG_MAPS_1['edit_button'] . '');
+ $template->set_var('edit', ' | ' . $LANG_MAPS_1['edit_button'] . '');
} else {
$template->set_var('edit', '');
}
//Map
$mapname = DB_getItem($_TABLES['maps_maps'], 'name', "mid={$marker['mid']}");
- $template->set_var('map', ' | ' . $LANG_MAPS_1['from_map'] . ' ' . stripslashes($mapname) . '');
-
- //Owner
- $profile_url = $_CONF['site_url']
- . '/users.php?mode=profile&uid=' . $marker['owner_id'];
+ $template->set_var('map', ' | ' . $LANG_MAPS_1['from_map'] . ' ' . stripslashes($mapname) . '');
+
+ //Owner
+ $profile_url = $_CONF['site_url']
+ . '/users.php?mode=profile&uid=' . $marker['owner_id'];
$profile = COM_createLink(COM_getDisplayName($marker['owner_id']), $profile_url);
- $template->set_var('owner', $LANG_MAPS_1['from_owner'] . ' ' . $profile);
-
+ $template->set_var('owner', $LANG_MAPS_1['from_owner'] . ' ' . $profile);
+
//Update
$update = COM_getUserDateTimeFormat($marker['modified']);
$template->set_var('update', '
' . $LANG_MAPS_1['last_modification'] . ' ' . $update[0] . ' ' . ' | ' . $marker['hits'] . ' ' . $LANG_MAPS_1['hits']);
-
+
//Report
- $template->set_var('report', '' .$LANG_MAPS_1['report'] . '');
-
- //Print
- $template->set_var('print', '' .$LANG_MAPS_1['print'] . ' | ');
-
- //directions
- $gid = $marker['mkid'];
- $template->set_var('directions_table_result', '
- ');
+ $template->set_var('report', '' . $LANG_MAPS_1['report'] . '');
+
+ //Print
+ $template->set_var('print', '' . $LANG_MAPS_1['print'] . ' | ');
+
+ //directions
+ $gid = $marker['mkid'];
+ $template->set_var('directions_table_result', '
+ ');
$presentation .= $template->parse('output', 'presentation');
- $retval .= $presentation;
-
- hitMarker ($mkid);
-
- return $retval;
+ $retval = $presentation;
+
+ hitMarker($mkid);
+
+ return $retval;
}
-function MAPS_convertLinkToUrl ($url, $lenght=35) {
-
- global $_CONF;
-
- if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
- $newurl = "http://" . $url;
+function MAPS_convertLinkToUrl($url, $lenght = 35)
+{
+
+ global $_CONF;
+
+ if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
+ $newurl = "//" . $url;
} else {
- $newurl = $url;
- }
-
- //name
- $parse = parse_url($newurl);
- ($parse['host'] != '' ) ? $name = $parse['host'] : $name = $url;
-
- //Target
- (strpos($newurl,$_CONF['site_url']) !== false) ? $target = '' : $target = '_blank';
-
- // convert link to url
+ $newurl = $url;
+ }
+
+ //name
+ $parse = parse_url($newurl);
+ ($parse['host'] != '') ? $name = $parse['host'] : $name = $url;
+
+ //Target
+ (strpos($newurl, $_CONF['site_url']) !== false) ? $target = '' : $target = '_blank';
+
+ // convert link to url
$link = preg_replace("/((http:\/\/|https:\/\/)[^ |<)
- ]+)/e", "''. ((strlen(\"$name\")>=" . $lenght . " ? substr(\"$name\",0," . $lenght . ").'... ':\"$name\")).' '", $newurl );
-
- return $link ;
+ ]+)/e", "''. ((strlen(\"$name\")>=" . $lenght . " ? substr(\"$name\",0," . $lenght . ").'... ':\"$name\")).' '", $newurl);
+
+ return $link;
}
/**
-* List all markers that the user has access to
-*
-* @retun string HTML for the list
-*
-*/
+ * List all markers that the user has access to
+ *
+ * @retun string HTML for the list
+ */
function MAPS_ListMarkers($mid = '')
{
global $_CONF, $_MAPS_CONF, $_TABLES, $_IMAGE_TYPE, $LANG_ADMIN, $LANG_MAPS_1;
if ($mid == '') return;
$mid = addslashes($mid);
-
+
require_once $_CONF['path_system'] . 'lib-admin.php';
$retval = '';
-
- if (DB_count($_TABLES['maps_markers']) == 0){
- return $retval = '';
+
+ if (DB_count($_TABLES['maps_markers']) == 0) {
+ return $retval = '';
}
$header_arr = array( // display 'text' and use table field 'field'
array('text' => $LANG_MAPS_1['name'], 'field' => 'name', 'sort' => true),
array('text' => $LANG_MAPS_1['code'], 'field' => 'code', 'sort' => true),
- array('text' => $LANG_MAPS_1['city'], 'field' => 'city', 'sort' => true)
+ array('text' => $LANG_MAPS_1['city'], 'field' => 'city', 'sort' => true),
);
$defsort_arr = array('field' => 'code', 'direction' => 'asc');
$text_arr = array(
'has_extras' => true,
- 'form_url' => $_MAPS_CONF['site_url'] . '/index.php?mode=markers&mid=' . $mid
+ 'form_url' => $_MAPS_CONF['site_url'] . '/index.php?mode=markers&mid=' . $mid,
);
-
- if ($mid == 0) {
- $sql = "SELECT
+
+ if ($mid == 0) {
+ $sql = "SELECT
*
FROM {$_TABLES['maps_markers']}
WHERE active = 1 AND hidden = 0
";
- $map_name = $LANG_MAPS_1['global_map'];
- } else {
- $sql = "SELECT
+ $map_name = $LANG_MAPS_1['global_map'];
+ } else {
+ $sql = "SELECT
*
FROM {$_TABLES['maps_markers']}
WHERE mid = {$mid} AND active = 1 AND hidden = 0
";
- $map_name = DB_getItem($_TABLES['maps_maps'],'name', "mid = {$mid}");
- }
+ $map_name = DB_getItem($_TABLES['maps_maps'], 'name', "mid = {$mid}");
+ }
$query_arr = array(
'table' => 'maps_markers',
'sql' => $sql,
- 'query_fields' => array('name','code','city'),
- 'default_filter' => COM_getPermSQL ('AND', 0, 2)
+ 'query_fields' => array('name', 'code', 'city'),
+ 'default_filter' => COM_getPermSQL('AND', 0, 2),
);
$retval .= '
- ' . $LANG_MAPS_1['viewing_markers'] . ' ' . $map_name . '
';
+ ' . $LANG_MAPS_1['viewing_markers'] . ' ' . $map_name . '';
$retval .= '' . ADMIN_list('markers', 'MAPS_getListField_markersList',
- $header_arr, $text_arr, $query_arr, $defsort_arr) . '
';
+ $header_arr, $text_arr, $query_arr, $defsort_arr) . ' ';
return $retval;
}
/**
-* Get an individual field for the markers screen.
-*
-* @param string $fieldname Name of field (from the array, not the db)
-* @param mixed $fieldvalue Value of the field
-* @param array $A Array of all fields from the database
-* @param array $icon_arr System icon array
-* @param object $EntryList This entry list object
-* @return string HTML for field display in the table
-*/
+ * Get an individual field for the markers screen.
+ *
+ * @param string $fieldname Name of field (from the array, not the db)
+ * @param mixed $fieldvalue Value of the field
+ * @param array $A Array of all fields from the database
+ * @param array $icon_arr System icon array
+ * @param object $EntryList This entry list object
+ * @return string HTML for field display in the table
+ */
function MAPS_getListField_markersList($fieldname, $fieldvalue, $A, $icon_arr)
{
global $_CONF, $_MAPS_CONF, $LANG_ADMIN, $LANG_MAPS_1, $LANG_STATIC, $_TABLES;
- switch($fieldname) {
+ switch ($fieldname) {
case "name":
- $map_title = ucwords(strtolower(stripslashes ($A['name'])));
+ $map_title = ucwords(strtolower(stripslashes($A['name'])));
$url = $_MAPS_CONF['site_url'] .
- '/markers.php?mode=show&mkid=' . $A['mkid'] . '&mid=' . $A['mid'];
+ '/markers.php?mode=show&mkid=' . $A['mkid'] . '&mid=' . $A['mid'];
$retval = COM_createLink($map_title, $url);
break;
- case "city":
- $city = ucwords(strtolower(stripslashes ($A['city'])));
+ case "city":
+ $city = ucwords(strtolower(stripslashes($A['city'])));
$retval = $city;
break;
default:
$retval = stripslashes($fieldvalue);
break;
}
+
return $retval;
}
-function MAPS_setGeoLocation ()
+function MAPS_setGeoLocation()
{
global $_CONF, $_TABLES, $_MAPS_CONF;
-
- $sql = "SELECT info.location
+
+ $sql = "SELECT info.location
FROM {$_TABLES['userinfo']} AS info
WHERE info.location <> ''
";
-
- $locations = DB_query($sql);
-
- $nRows = DB_numRows($locations);
-
- for ( $i=0; $i < $nRows; $i++ ) {
+
+ $locations = DB_query($sql);
+
+ $nRows = DB_numRows($locations);
+
+ for ($i = 0; $i < $nRows; $i++) {
$geo = DB_fetchArray($locations);
- MAPS_getDBCoords($gid, $geo['location'], $lat, $lng) ;
- }
-
- return;
+ MAPS_getDBCoords($gid, $geo['location'], $lat, $lng);
+ }
+
+ return;
}
-function MAPS_displayEventsMap ($output=true, $event_id='')
+function MAPS_displayEventsMap($output = true, $event_id = '')
{
- global $_TABLES, $_CONF, $_MAPS_CONF, $LANG_MAPS_1, $LANG_CAL_1;
+ global $_TABLES, $_CONF, $_MAPS_CONF, $LANG_MAPS_1, $LANG_CAL_1;
$retval = '';
-
- //map settings
- $res = DB_query("SELECT * FROM {$_TABLES['maps_maps']} WHERE 1=1 LIMIT 1");
-
- //event map is set on mid=1.
- //TODO change this
- $A = DB_fetchArray($res);
-
- $T = COM_newTemplate($_CONF['path'] . 'plugins/maps/templates');
- if ($output) {
- $T->set_file('page', 'map_autotag.thtml');
- } else {
- $T->set_file('page', 'map_only_script.thtml');
- }
- $T->set_var('mid', 'events');
- $T->set_var('name', $LANG_MAPS_1['events_map']);
- $T->set_var('description', '' . $LANG_MAPS_1['info_events_map'] . '
');
-
- $T->set_var('header', '');
- $T->set_var('footer', '');
-
- //address from global map
- $T->set_var('address', addslashes($A['geo']));
- $lat = str_replace(",",".",$A['lat']);
- $lng = str_replace(",",".",$A['lng']);
-
- $T->set_var('map_type', $_MAPS_CONF['global_type']);
- $T->set_var('map_width', $_MAPS_CONF['global_width']);
-
-
- $jsmarkers = 'var markers = [];';
- if ($event_id == '') {
- if ($lat == '') $lat = 0;
- if ($lng == '') $lng = 0;
- $T->set_var('lat', $lat);
- $T->set_var('lng', $lng);
+ //map settings
+ $res = DB_query("SELECT * FROM {$_TABLES['maps_maps']} WHERE 1=1 LIMIT 1");
+
+ //event map is set on mid=1.
+ //TODO change this
+ $A = DB_fetchArray($res);
+
+ $T = COM_newTemplate($_CONF['path'] . 'plugins/maps/templates');
+ if ($output) {
+ $T->set_file('page', 'map_autotag.thtml');
+ } else {
+ $T->set_file('page', 'map_only_script.thtml');
+ }
+ $T->set_var('mid', 'events');
+ $T->set_var('name', $LANG_MAPS_1['events_map']);
+ $T->set_var('description', '' . $LANG_MAPS_1['info_events_map'] . '
');
+
+ $T->set_var('header', '');
+ $T->set_var('footer', '');
+
+ //address from global map
+ $T->set_var('address', addslashes($A['geo']));
+ $lat = str_replace(",", ".", $A['lat']);
+ $lng = str_replace(",", ".", $A['lng']);
+
+ $T->set_var('map_type', $_MAPS_CONF['global_type']);
+ $T->set_var('map_width', $_MAPS_CONF['global_width']);
+
+
+ $jsmarkers = 'var markers = [];';
+
+ if ($event_id == '') {
+ if ($lat == '') $lat = 0;
+ if ($lng == '') $lng = 0;
+ $T->set_var('lat', $lat);
+ $T->set_var('lng', $lng);
$T->set_var('zoom', $_MAPS_CONF['global_zoom']);
- $T->set_var('map_height', $_MAPS_CONF['global_height']);
-
- //select all coming events
- $result = DB_query("SELECT * FROM {$_TABLES['events']} WHERE TO_DAYS(dateend) >= TO_DAYS(NOW()) ");
- } else {
- //TODO make this configurable
+ $T->set_var('map_height', $_MAPS_CONF['global_height']);
+
+ //select all coming events
+ $result = DB_query("SELECT * FROM {$_TABLES['events']} WHERE TO_DAYS(dateend) >= TO_DAYS(NOW()) ");
+ } else {
+ //TODO make this configurable
$T->set_var('zoom', 8);
- $T->set_var('map_height', '300px');
-
- $result = DB_query("SELECT * FROM {$_TABLES['events']} WHERE eid='$event_id'");
- }
+ $T->set_var('map_height', '300px');
- $nrows = DB_numRows($result);
-
- if ($nrows > 0) {
-
- for ($i = 0;$i < $nrows; $i++) {
-
- $B = DB_fetchArray($result);
-
- $access = SEC_hasAccess($B['owner_id'],$B['group_id'],$B['perm_owner'],$B['perm_group'],$B['perm_members'],$B['perm_anon']);
-
- if ($access > 0 && $B['location']!='') {
-
- //markers
- $marker['mkid'] = $B['eid'];
- $marker['hidden'] = 0;
- $marker['active'] = 1;
- $marker['name'] = $B['title'];
-
- //start and end time
- $thestart = COM_getUserDateTimeFormat($B['datestart'] . ' ' . $B['timestart']);
+ $result = DB_query("SELECT * FROM {$_TABLES['events']} WHERE eid='$event_id'");
+ }
+
+ $nrows = DB_numRows($result);
+
+ if ($nrows > 0) {
+
+ for ($i = 0; $i < $nrows; $i++) {
+
+ $B = DB_fetchArray($result);
+
+ $access = SEC_hasAccess($B['owner_id'], $B['group_id'], $B['perm_owner'], $B['perm_group'], $B['perm_members'], $B['perm_anon']);
+
+ if ($access > 0 && $B['location'] != '') {
+
+ //markers
+ $marker['mkid'] = $B['eid'];
+ $marker['hidden'] = 0;
+ $marker['active'] = 1;
+ $marker['name'] = $B['title'];
+
+ //start and end time
+ $thestart = COM_getUserDateTimeFormat($B['datestart'] . ' ' . $B['timestart']);
$theend = COM_getUserDateTimeFormat($B['dateend'] . ' ' . $B['timeend']);
- if ($B['allday'] == 0) {
- $event_start = $LANG_MAPS_1['from_cal'] . ' ' . $thestart[0];
- $event_end = ' ' . $LANG_MAPS_1['to_cal'] . ' ' . $theend[0];
- if ($thestart[0] == $theend[0]) $event_end = '';
- } else {
- $event_start = $LANG_MAPS_1['from_cal'] . ' ' . strftime($_CONF['shortdate'], $thestart[1]);
- $event_end = ' ' . $LANG_MAPS_1['to_cal'] . ' ' . strftime($_CONF['shortdate'], $theend[1]);
- if ($thestart[1] == $theend[1]) {
- $event_start = $LANG_MAPS_1['from_cal'] . ' ' . strftime($_CONF['shortdate'], $thestart[1]);
- $event_end = '';
- }
- }
-
- if ($event_id == '') $marker['description'] = '' . $event_start . $event_end . '
' . $B['description'];
-
- $marker['payed'] = 0;
- $marker['mk_default'] = 1;
- $marker['validity'] = 0;
- $marker['perm_owner'] = 2;
- $marker['perm_group'] = 2;
- $marker['perm_members'] = 2;
- $marker['perm_anon'] = 2;
-
- MAPS_getDBCoords($gid, $B['location'], $lat, $lng) ;
- $marker['lat'] = str_replace(",",".",$lat);
- $marker['lng'] = str_replace(",",".",$lng);
-
- $primary_color = '';
- $stroke_color = '';
- $marker_label = '';
- $label_color = '';
-
- if ($event_id == '') {
- $jsmarkers .= MAPS_renderMarker($marker,$primary_color,$stroke_color,$marker_label, $label_color, $LANG_MAPS_1['events_map'],'','','events', true, array());
- } else {
- $T->set_var('lat', $marker['lat']);
- $T->set_var('lng', $marker['lng']);
- $jsmarkers .= MAPS_renderMarker($marker,$primary_color,$stroke_color,$marker_label, $label_color, $LANG_MAPS_1['events_map'],'','','events', false, array());
- }
-
- }
- }
- }
-
- if ($_MAPS_CONF['use_cluster'] == 0 ) {
- $T->set_var('markerclusterer', '');
- } else {
- $T->set_var('markerclusterer', "");
- $jsmarkers .= LB . ' var markerCluster_events = new MarkerClusterer(mapevents, markers);' . LB;
- }
-
- $T->set_var('markers', $jsmarkers);
-
- //Ads
- $ads = MAPS_getAds ('events');
- $T->set_var('ads', $ads);
-
- $T->set_var('edit_button', '');
-
- $T->parse('output','page');
- $retval .= $T->finish($T->get_var('output'));
-
+ if ($B['allday'] == 0) {
+ $event_start = $LANG_MAPS_1['from_cal'] . ' ' . $thestart[0];
+ $event_end = ' ' . $LANG_MAPS_1['to_cal'] . ' ' . $theend[0];
+ if ($thestart[0] == $theend[0]) $event_end = '';
+ } else {
+ $event_start = $LANG_MAPS_1['from_cal'] . ' ' . strftime($_CONF['shortdate'], $thestart[1]);
+ $event_end = ' ' . $LANG_MAPS_1['to_cal'] . ' ' . strftime($_CONF['shortdate'], $theend[1]);
+ if ($thestart[1] == $theend[1]) {
+ $event_start = $LANG_MAPS_1['from_cal'] . ' ' . strftime($_CONF['shortdate'], $thestart[1]);
+ $event_end = '';
+ }
+ }
+
+ if ($event_id == '') $marker['description'] = '' . $event_start . $event_end . '
' . $B['description'];
+
+ $marker['payed'] = 0;
+ $marker['mk_default'] = 1;
+ $marker['validity'] = 0;
+ $marker['perm_owner'] = 2;
+ $marker['perm_group'] = 2;
+ $marker['perm_members'] = 2;
+ $marker['perm_anon'] = 2;
+
+ MAPS_getDBCoords($gid, $B['location'], $lat, $lng);
+ $marker['lat'] = str_replace(",", ".", $lat);
+ $marker['lng'] = str_replace(",", ".", $lng);
+
+ $primary_color = '';
+ $stroke_color = '';
+ $marker_label = '';
+ $label_color = '';
+
+ if ($event_id == '') {
+ $jsmarkers .= MAPS_renderMarker($marker, $primary_color, $stroke_color, $marker_label, $label_color, $LANG_MAPS_1['events_map'], '', '', 'events', true, array());
+ } else {
+ $T->set_var('lat', $marker['lat']);
+ $T->set_var('lng', $marker['lng']);
+ $jsmarkers .= MAPS_renderMarker($marker, $primary_color, $stroke_color, $marker_label, $label_color, $LANG_MAPS_1['events_map'], '', '', 'events', false, array());
+ }
+
+ }
+ }
+ }
+
+ if ($_MAPS_CONF['use_cluster'] == 0) {
+ $T->set_var('markerclusterer', '');
+ } else {
+ $T->set_var('markerclusterer', "");
+ $jsmarkers .= LB . ' var markerCluster_events = new MarkerClusterer(mapevents, markers);' . LB;
+ }
+
+ $T->set_var('markers', $jsmarkers);
+
+ //Ads
+ $ads = MAPS_getAds('events');
+ $T->set_var('ads', $ads);
+
+ $T->set_var('edit_button', '');
+
+ $T->parse('output', 'page');
+ $retval .= $T->finish($T->get_var('output'));
+
return $retval;
}
-?>
\ No newline at end of file
+if (!is_callable('COM_createHTMLDocument')) {
+ function COM_createHTMLDocument(&$content, array $information = array())
+ {
+ // Retrieve required variables from information array
+ $what = isset($information['what']) ? $information['what'] : 'menu';
+ $pageTitle = isset($information['pagetitle']) ? $information['pagetitle'] : '';
+ $headerCode = isset($information['headercode']) ? $information['headercode'] : '';
+ $rightBlock = isset($information['rightblock']) ? $information['rightblock'] : -1;
+ $custom = isset($information['custom']) ? $information['custom'] : '';
+
+ return COM_siteHeader($what, $pageTitle, $headerCode) . $content
+ . COM_siteFooter($rightBlock, $custom);
+ }
+}
+
+if (!is_callable('COM_redirect')) {
+ function COM_redirect($url)
+ {
+ global $_CONF;
+
+ if (!headers_sent($file, $line)) {
+ $url = str_ireplace('&', '&', $url);
+ header('Location: ' . $url);
+ }
+
+ if (isset($_CONF['rootdebug']) && $_CONF['rootdebug']) {
+ // for debugging
+ COM_errorLog(
+ sprintf(
+ '%1$s failed to redirect to "%2$s". Headers were already sent at line %3$d of "%4$s".',
+ __FUNCTION__, $url, $line, $file
+ )
+ );
+ }
+
+ // Send out HTML meta tags in case header('Location: some_url') fails
+ @header('Content-Type: text/html; charset=' . COM_getCharset());
+ echo "" . PHP_EOL;
+ die(1);
+ }
+}
diff --git a/install_defaults.php b/install_defaults.php
index 5c3228f..ab1f188 100644
--- a/install_defaults.php
+++ b/install_defaults.php
@@ -75,7 +75,7 @@
//Google maps API
$_MAPS_DEFAULT['google_api_key'] = ''; // User must supply their own
-$_MAPS_DEFAULT['url_MAPScode'] = 'http://maps.googleapis.com/maps/api/geocode/json?address=%address%&sensor=false';
+$_MAPS_DEFAULT['url_MAPScode'] = '//maps.googleapis.com/maps/api/geocode/json?address=%address%&sensor=false';
// Set the default permissions
$_MAPS_DEFAULT['default_permissions'] = array (3, 3, 2, 2);
diff --git a/language/english.php b/language/english.php
index a351df8..1049a24 100644
--- a/language/english.php
+++ b/language/english.php
@@ -55,7 +55,7 @@
'map' => 'map',
'online' => 'online',
'google_maps_API' => 'Google Maps API',
- 'need_google_api' => 'You need a Google Maps API to start.',
+ 'need_google_api' => 'You need a Google Maps API to start.',
'profile_title' => 'Geolocalisation',
'buy_marker' => 'Buy a marker',
'menu_label' => 'Maps administration',
diff --git a/language/french_france_utf-8.php b/language/french_france_utf-8.php
index e1961eb..10110e3 100644
--- a/language/french_france_utf-8.php
+++ b/language/french_france_utf-8.php
@@ -55,7 +55,7 @@
'map' => 'carte',
'online' => 'en ligne',
'google_maps_API' => 'Google Maps API',
- 'need_google_api' => 'Attention, vous avez besoin d\'une API Google Maps pour commencer.',
+ 'need_google_api' => 'Attention, vous avez besoin d\'une API Google Maps pour commencer.',
'profile_title' => 'Géolocalisation',
'buy_marker' => 'Acheter un marqueur',
'menu_label' => 'Administration du plugin Maps',
diff --git a/public_html/index.php b/public_html/index.php
index 7edc625..6337fce 100644
--- a/public_html/index.php
+++ b/public_html/index.php
@@ -39,8 +39,7 @@
// take user back to the homepage if the plugin is not active
if (!in_array('maps', $_PLUGINS)) {
- echo COM_refresh($_CONF['site_url'] . '/index.php');
- exit;
+ COM_redirect($_CONF['site_url'] . '/index.php');
}
MAPS_getheadercode();
@@ -272,21 +271,21 @@ function MAPS_displayFrontPage ()
$display .= MAPS_getGlobalMap();
} else {
- echo COM_refresh($_MAPS_CONF['site_url'] . '/index.php');
+ COM_redirect($_MAPS_CONF['site_url'] . '/index.php');
}
break;
case 'markers':
if ( ($_REQUEST['mid'] >= 0) ) {
$display .= MAPS_ListMarkers($_REQUEST['mid']);
} else {
- echo COM_refresh($_MAPS_CONF['site_url'] . '/index.php');
+ COM_redirect($_MAPS_CONF['site_url'] . '/index.php');
}
break;
case 'marker':
if ( isset($_REQUEST['mkid']) && $_REQUEST['mkid'] != '' && function_exists('MAPS_proViewMarker') ) {
$display .= MAPS_proViewMarker($_REQUEST['mkid']);
} else {
- echo COM_refresh($_MAPS_CONF['site_url'] . '/index.php');
+ COM_redirect($_MAPS_CONF['site_url'] . '/index.php');
}
break;
diff --git a/public_html/js/mapiconmaker.js b/public_html/js/mapiconmaker.js
index 3d3fdca..3bf65d4 100644
--- a/public_html/js/mapiconmaker.js
+++ b/public_html/js/mapiconmaker.js
@@ -79,7 +79,7 @@ MapIconMaker.createMarkerIcon = function (opts) {
var strokeColor = opts.strokeColor || "#000000";
var cornerColor = opts.cornerColor || "#ffffff";
- var baseUrl = "http://chart.apis.google.com/chart?cht=mm";
+ var baseUrl = "//chart.apis.google.com/chart?cht=mm";
var iconUrl = baseUrl + "&chs=" + width + "x" + height +
"&chco=" + cornerColor.replace("#", "") + "," +
primaryColor.replace("#", "") + "," +
@@ -92,7 +92,7 @@ MapIconMaker.createMarkerIcon = function (opts) {
icon.anchor = new google.maps.Point(width / 2, height);
icon.size = new google.maps.Size(width, height);
- shadow.url = 'http://maps.gstatic.com/mapfiles/shadow50.png';
+ shadow.url = '//maps.gstatic.com/mapfiles/shadow50.png';
shadow.anchor = new google.maps.Point(width / 2, height);
shadow.size = new google.maps.Size(Math.floor(width * 1.6), height);
shadow.scaledSize = new google.maps.Size(Math.floor(width * 1.6), height);
@@ -143,7 +143,7 @@ MapIconMaker.createFlatIcon = function (opts) {
var shape = opts.shape || "circle";
var shapeCode = (shape === "circle") ? "it" : "itr";
- var baseUrl = "http://chart.apis.google.com/chart?cht=" + shapeCode;
+ var baseUrl = "//chart.apis.google.com/chart?cht=" + shapeCode;
var iconUrl = baseUrl + "&chs=" + width + "x" + height +
"&chco=" + primaryColor.replace("#", "") + "," +
shadowColor.replace("#", "") + "ff,ffffff01" +
@@ -200,7 +200,7 @@ MapIconMaker.createLabeledMarkerIcon = function (opts) {
var addStar = opts.addStar || false;
var pinProgram = (addStar) ? "pin_star" : "pin";
- var baseUrl = "http://chart.apis.google.com/chart?cht=d&chdp=mapsapi&chl=";
+ var baseUrl = "//chart.apis.google.com/chart?cht=d&chdp=mapsapi&chl=";
var iconUrl = baseUrl + pinProgram + "'i\\" + "'[" + label +
"'-2'f\\" + "hv'a\\]" + "h\\]o\\" +
primaryColor.replace("#", "") + "'fC\\" +
@@ -221,7 +221,7 @@ MapIconMaker.createLabeledMarkerIcon = function (opts) {
icon.url = iconUrl + "&ext=.png";
icon.size = new google.maps.Size(width, height);
- shadow.url = 'http://maps.gstatic.com/mapfiles/shadow50.png';
+ shadow.url = '//maps.gstatic.com/mapfiles/shadow50.png';
shadow.anchor = new google.maps.Point(width / 2, height);
shadow.size = new google.maps.Size(Math.floor(width * 1.6), height);
shadow.scaledSize = new google.maps.Size(Math.floor(width * 1.6), height);
diff --git a/public_html/js/markerclusterer.js b/public_html/js/markerclusterer.js
index d6c4dce..1c7d092 100644
--- a/public_html/js/markerclusterer.js
+++ b/public_html/js/markerclusterer.js
@@ -192,7 +192,7 @@ function MarkerClusterer(map, opt_markers, opt_options) {
* @private
*/
MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_ =
- 'http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/' +
+ '//google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/' +
'images/m';
diff --git a/public_html/map_detail.php b/public_html/map_detail.php
index efbc795..5967484 100644
--- a/public_html/map_detail.php
+++ b/public_html/map_detail.php
@@ -39,8 +39,7 @@
// take user back to the homepage if the plugin is not active
if (!in_array('maps', $_PLUGINS)) {
- echo COM_refresh($_CONF['site_url'] . '/index.php');
- exit;
+ COM_redirect($_CONF['site_url'] . '/index.php');
}
MAPS_getheadercode();
@@ -51,10 +50,8 @@
// Ensure user has the rights to access this page
if (COM_isAnonUser() && (($_CONF['loginrequired'] == 1) || ($_MAPS_CONF['maps_login_required'] == 1))) {
- $display .= COM_siteHeader('');
$display .= MAPS_user_menu();
- $display .= COM_startBlock ($LANG_LOGIN[1], '',
- COM_getBlockTemplate ('_msg_block', 'header'));
+ $display .= COM_startBlock ($LANG_LOGIN[1], '', COM_getBlockTemplate ('_msg_block', 'header'));
$login = new Template($_CONF['path'] . 'plugins/maps/templates');
$login->set_file (array ('login'=>'submitloginrequired.thtml'));
$login->set_var ( 'xhtml', XHTML );
@@ -67,7 +64,7 @@
$login->parse ('output', 'login');
$display .= $login->finish ($login->get_var('output'));
$display .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
- $display .= COM_siteFooter();
+ $display = COM_createHTMLDocument($display);
COM_output($display);
exit;
}
@@ -86,11 +83,9 @@
//Display the Global Map
$display .= MAPS_getGlobalMap();
} else {
- echo COM_refresh($_MAPS_CONF['site_url'] . '/index.php');
+ COM_redirect($_MAPS_CONF['site_url'] . '/index.php');
}
$display .= COM_siteFooter();
echo $display;
-
-?>
diff --git a/public_html/maps.css b/public_html/maps.css
index 084a836..b8161b0 100644
--- a/public_html/maps.css
+++ b/public_html/maps.css
@@ -1,94 +1,101 @@
/*CSS for Maps plugin*/
.colorSwatch {
- border: 1px solid #000000;
- font-family: Verdana;
- font-size: 10px;
+ border: 1px solid #000000;
+ font-family: Verdana;
+ font-size: 10px;
text-decoration: none;
- }
+}
/*Marker Submission */
#map_contener_submission {
- padding:5px;
- border: 1px solid #333;
- background: #FFFFFF;
+ padding: 5px;
+ border: 1px solid #333;
+ background: #FFFFFF;
}
+
/* Map form */
form#map-form legend {
- display: block!important;
- color:#00f;
- background-color:#ddd
+ display: block !important;
+ color: #00f;
+ background-color: #ddd
}
+
fieldset {
- margin-bottom:1em;
+ margin-bottom: 1em;
}
+
fieldset p {
- padding:5px;
- margin:0px;
- margin-top:5px;
- margin-bottom:0px;
+ padding: 5px;
+ margin: 5px 0 0;
}
+
fieldset legend {
- font-size:0.9em;
+ font-size: 0.9em;
}
/*Tabs*/
ul.tabNavigation {
- list-style: none;
- margin: 0;
- padding: 0;
+ list-style: none;
+ margin: 0;
+ padding: 0;
}
ul.tabNavigation li {
- display: inline;
- font-weight:bold;
+ display: inline;
+ font-weight: bold;
}
ul.tabNavigation li a {
- padding: 3px 10px;
- background-color: #ddd;
- color: #333;
- text-decoration: none;
- border-top: 1px solid #ccc;
- border-left: 1px solid #ccc;
- border-right: 1px solid #ccc;
+ padding: 3px 10px;
+ background-color: #ddd;
+ color: #333;
+ text-decoration: none;
+ border-top: 1px solid #ccc;
+ border-left: 1px solid #ccc;
+ border-right: 1px solid #ccc;
}
+
ul.tabNavigation li a.selected {
- padding: 3px 10px;
- background-color: #999;
- color: #FFF;
- text-decoration: none;
+ padding: 3px 10px;
+ background-color: #999;
+ color: #FFF;
+ text-decoration: none;
}
+
ul.tabNavigation li a:hover {
- background-color: #999;
- color: #FFF;
+ background-color: #999;
+ color: #FFF;
}
ul.tabNavigation li a:focus {
- outline: 0;
+ outline: 0;
}
div.tabs > div {
- padding: 0px 10px 10px 10px;
- margin-top: 3px;
- border: 1px solid #bbb;
+ padding: 0 10px 10px 10px;
+ margin-top: 3px;
+ border: 1px solid #bbb;
}
div.tabs > div h2 {
- margin-top: 0;
+ margin-top: 0;
}
#overlays_checkboxes {
- padding-top:10px;
- font-size:x-small;
+ padding-top: 10px;
+ font-size: x-small;
}
+
#maps_list {
- padding:5px;
+ padding: 5px;
}
+
#ui-datepicker-div {
- background:white;
- border:1px solid #DDD;
- padding:15px;
+ background: white;
+ border: 1px solid #DDD;
+ padding: 15px;
}
+
.user_menu {
- padding-top:10px;
+ padding-top: 10px;
}
\ No newline at end of file
diff --git a/public_html/markers.php b/public_html/markers.php
index 023fca4..9446eee 100644
--- a/public_html/markers.php
+++ b/public_html/markers.php
@@ -39,7 +39,7 @@
// take user back to the homepage if the plugin is not active
if (!in_array('maps', $_PLUGINS)) {
- echo COM_refresh($_CONF['site_url'] . '/index.php');
+ COM_redirect($_CONF['site_url'] . '/index.php');
exit;
}
@@ -48,9 +48,7 @@
// Ensure user has the rights to access this page
if (COM_isAnonUser() && $_MAPS_CONF['maps_login_required'] == 1) {
- $display .= COM_siteHeader('');
- $display .= MAPS_user_menu();
-
+ $display = MAPS_user_menu();
$display .= COM_startBlock ($LANG_LOGIN[1], '',
COM_getBlockTemplate ('_msg_block', 'header'));
$login = new Template($_CONF['path'] . 'plugins/maps/templates');
@@ -65,8 +63,7 @@
$login->parse ('output', 'login');
$display .= $login->finish ($login->get_var('output'));
$display .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
-
- $display .= COM_siteFooter();
+ $display = COM_createHTMLDocument($display);
COM_output($display);
exit;
}
@@ -205,7 +202,7 @@ function MAPS_listUserMarkers()
*/
function plugin_getListField_userMarkers($fieldname, $fieldvalue, $A, $icon_arr)
{
- global $_CONF, $_MAPS_CONF, $LANG_ADMIN, $LANG_STATIC, $_TABLES;
+ global $_CONF, $_MAPS_CONF, $LANG_MAPS_1, $LANG_ADMIN, $LANG_STATIC, $_TABLES;
switch($fieldname) {
case "edit":
@@ -550,7 +547,7 @@ function getUserMarkerForm($marker = array()) {
$_SCRIPTS->setJavaScriptLibrary('jquery');
$_SCRIPTS->setJavaScriptFile('maps_simplecolor', '/' . $_MAPS_CONF['maps_folder'] . '/js/simple-color.js');
- $js = LB . '
+ $js = LB . '
");
- } else {
- $T->set_var('markerclusterer', '');
- }
-
- for ( $i=0; $i < $nRows; $i++ ) {
-
- $marker = DB_fetchArray($user_marker);
-
- $marker['mkid'] = $marker['uid'];
-
- //icon
- $markers .= LB . '';
-
- if ( $marker['photo'] != '' && file_exists($_CONF['path_images'] . 'userphotos/' . $marker['photo']) ) {
-
- $markers .= LB . 'var image' . $marker['mkid'] . ' = {
+ $nRows = DB_numRows($user_marker);
+
+ $markers = 'var markers = [];';
+
+ if ($_MAPS_CONF['use_cluster'] == 0) {
+ $T->set_var('markerclusterer', "");
+ } else {
+ $T->set_var('markerclusterer', '');
+ }
+
+ for ($i = 0; $i < $nRows; $i++) {
+
+ $marker = DB_fetchArray($user_marker);
+
+ $marker['mkid'] = $marker['uid'];
+
+ //icon
+ $markers .= LB . '';
+
+ if ($marker['photo'] != '' && file_exists($_CONF['path_images'] . 'userphotos/' . $marker['photo'])) {
+
+ $markers .= LB . 'var image' . $marker['mkid'] . ' = {
url: "' . $_MAPS_CONF['site_url'] . '/timthumb.php?src='
- . $_CONF['site_url'] . '/' . substr($_CONF['path_images'], strlen($_CONF['path_html']), -1) . '/userphotos/' . $marker['photo'] . '&w=30&h=30&q=90",
+ . $_CONF['site_url'] . '/' . substr($_CONF['path_images'], strlen($_CONF['path_html']), -1) . '/userphotos/' . $marker['photo'] . '&w=30&h=30&q=90",
size: new google.maps.Size(30,30),
// The origin for this image
origin: new google.maps.Point(0,0),
// The anchor for this image
anchor: new google.maps.Point(15, 30)
};';
- } else {
- $markers .= LB . 'var image' . $marker['mkid'] . ' = {
+ } else {
+ $markers .= LB . 'var image' . $marker['mkid'] . ' = {
url: "' . $_MAPS_CONF['site_url'] . '/images/usermarker.png",
size: new google.maps.Size(37, 37),
// The origin for this image
@@ -158,71 +157,70 @@ function getUsersMap () {
// The anchor for this image
anchor: new google.maps.Point(17,37)
};';
- }
-
- $markers .= LB . ' var marker' . $marker['mkid'] .' = new google.maps.Marker({
- position: new google.maps.LatLng('. $marker['lat']. ', '. $marker['lng'] .'),
+ }
+
+ $markers .= LB . ' var marker' . $marker['mkid'] . ' = new google.maps.Marker({
+ position: new google.maps.LatLng(' . $marker['lat'] . ', ' . $marker['lng'] . '),
map:map0,
- title: "' . $marker['username'] . '",
+ title: "' . $marker['username'] . '",
animation: google.maps.Animation.DROP,
icon: image' . $marker['mkid'] . '
- });' . LB ;
-
- //Infowindow link to user profile
- $bio = '';
- if ($marker['about'] != '') $bio = preg_replace( "/\r|\n/", "", nl2br(substr ( $marker['about'] ,0, 150 ))) . '...
';
- $presentation = '';
-
- $markers .= ' var infowindow' . $marker['mkid'] . ' = new google.maps.InfoWindow({
+ });' . LB;
+
+ //Infowindow link to user profile
+ $bio = '';
+ if ($marker['about'] != '') $bio = preg_replace("/\r|\n/", "", nl2br(substr($marker['about'], 0, 150))) . '...
';
+ $presentation = '';
+
+ $markers .= ' var infowindow' . $marker['mkid'] . ' = new google.maps.InfoWindow({
content: \'' . addslashes($presentation) . '\'
});' . LB;
-
- // Adding a click-event to the marker
- $markers .= ' google.maps.event.addListener(marker' . $marker['mkid'] . ', \'click\', function() {
- infowindow' . $marker['mkid'] . '.open(map0,marker' . $marker['mkid'] .');
+
+ // Adding a click-event to the marker
+ $markers .= ' google.maps.event.addListener(marker' . $marker['mkid'] . ', \'click\', function() {
+ infowindow' . $marker['mkid'] . '.open(map0,marker' . $marker['mkid'] . ');
});' . LB;
- // Add marker to map
- if ( $_MAPS_CONF['use_cluster'] == 1 ) {
- $markers .= ' markers.push(marker' . $marker['mkid'] .');' . LB;
- }
-
- }
-
- $markers .= LB . ' var markerCluster = new MarkerClusterer(map0, markers);' . LB;
-
- //Ads
- $ads = MAPS_getAds (0);
- $T->set_var('ads', $ads);
-
- $T->set_var('markers', $markers);
-
- $T->set_var('edit_button', '');
-
- $T->parse('output','page');
- $retval .= $T->finish($T->get_var('output'));
-
- return $retval;
-}
+ // Add marker to map
+ if ($_MAPS_CONF['use_cluster'] == 1) {
+ $markers .= ' markers.push(marker' . $marker['mkid'] . ');' . LB;
+ }
-// MAIN
+ }
+
+ $markers .= LB . ' var markerCluster = new MarkerClusterer(map0, markers);' . LB;
+
+ //Ads
+ $ads = MAPS_getAds(0);
+ $T->set_var('ads', $ads);
+
+ $T->set_var('markers', $markers);
-$display = '';
+ $T->set_var('edit_button', '');
-$display .= COM_siteHeader('menu', $LANG_MAPS_1['users_map']);
-$display .= MAPS_user_menu();
+ $T->parse('output', 'page');
+ $retval = $T->finish($T->get_var('output'));
+
+ return $retval;
+}
+
+// MAIN
+$display = MAPS_user_menu();
if ($_MAPS_CONF['users_map'] == 1) {
//Display the Users Map
- $display .= getUsersMap();
+ $display .= getUsersMap();
} else {
- echo COM_refresh($_MAPS_CONF['site_url'] . '/index.php');
+ COM_redirect($_MAPS_CONF['site_url'] . '/index.php');
}
-$display .= COM_siteFooter();
-
-echo $display;
-
-?>
+$display = COM_createHTMLDocument(
+ $display,
+ array(
+ 'what' => 'menu',
+ 'pagetitle' => $LANG_MAPS_1['users_map'],
+ )
+);
+COM_output($display);
From 3671980b17b0d03d8c1f574142d1e06307f57f57 Mon Sep 17 00:00:00 2001
From: Ivy
Date: Sat, 18 Mar 2017 16:27:11 +0900
Subject: [PATCH 2/3] add Japanese language file
---
language/japanese_utf-8.php | 476 ++++++++++++++++++++++++++++++++++++
1 file changed, 476 insertions(+)
create mode 100644 language/japanese_utf-8.php
diff --git a/language/japanese_utf-8.php b/language/japanese_utf-8.php
new file mode 100644
index 0000000..5acc464
--- /dev/null
+++ b/language/japanese_utf-8.php
@@ -0,0 +1,476 @@
+ 'Maps',
+ 'plugin_doc' => 'インストール、アップグレードと利用方法のドキュメントは',
+ 'map' => 'マップ',
+ 'online' => 'こちら',
+ 'google_maps_API' => 'Google Maps API',
+ 'need_google_api' => 'まずはじめに、Google Maps APIをコンフィギュレーションにセットしてください。',
+ 'profile_title' => '位置情報',
+ 'buy_marker' => 'マーカーを購入',
+ 'menu_label' => 'マップ管理',
+ 'admin_home' => 'ホーム',
+ 'user_home' => 'すべてのマップ',
+ 'maps' => 'マップ',
+ 'markers' => 'マーカー',
+ 'maps_label' => 'マップ',
+ 'create_map' => 'マップを作成する',
+ 'create_marker' => 'マーカーを作成する',
+ 'map_edit' => 'マップ編集:',
+ 'marker_edit' => 'マーカー編集:',
+ 'deletion_succes' => '削除成功',
+ 'deletion_fail' => '削除失敗',
+ 'error' => 'エラー',
+ 'save_fail' => '保存エラー',
+ 'save_success' => '保存完了',
+ 'missing_field' => '未入力フィールドがあります...',
+ 'geocoder' => 'Geoコーダー',
+ 'geocoder_text' => '住所を入力してください。そしてマーカーをロケーションにドラッグしてください。緯度・軽度が表示されます。',
+ 'go' => '実行!',
+ 'name_label' => 'マップ名: ',
+ 'marker_name_label' => 'マーカー名: ',
+ 'description_label' => '詳細:',
+ 'ok_button' => 'Ok',
+ 'edit_button' => '編集',
+ 'save_button' => '保存',
+ 'delete_button' => '削除',
+ 'yes' => 'はい',
+ 'no' => 'いいえ',
+ 'required_field' => '入力必須',
+ 'address_label' => '住所: ',
+ 'message' => 'メッセージ',
+ 'general_settings' => '一般設定',
+ 'map_width' => 'マップの横幅 (% または px, 最小 550px): ',
+ 'map_height' => 'マップの高さ (px のみ, 最小 350px): ',
+ 'map_zoom' => 'マップズーム (0-21): ',
+ 'map_type' => 'マップタイプ: ',
+ 'active' => 'マップ有効: ',
+ 'hidden' => 'マップ非表示: ',
+ 'marker_active' => 'マーカー有効: ',
+ 'marker_hidden' => 'マーカー非表示: ',
+ 'free_marker' => 'フリーマーカー許可: ',
+ 'paid_marker' => 'ペイドマーカー許可: ',
+ 'error_address_empty' => '住所を先に入力してください。',
+ 'error_invalid_address' => 'この住所をただしく認識できません。市区町村名と番地はただしいでしょうか?',
+ 'error_google_error' => '処理できませんでした。もう一度処理してください。',
+ 'error_no_map_info' => '残念ながらマップ情報を表示できません。',
+ 'need_directions' => '方向が必要ですか? あなたの住所を入力してください:',
+ 'get_directions' => '方向をGET ',
+ 'maps_list' => 'マップリスト',
+ 'you_can' => '',
+ 'user_maps_list' => 'データベースにマップリストがあります。',
+ 'markers_list' => 'マーカーリスト',
+ 'no_map' => 'マップがありません。マップを作成した後マーカーを登録してください。',
+ 'no_map_user' => '残念ながら有効なマップがデータベースに登録されていません。',
+ 'value_directions' => '例) 国名 市区町村名 番地', // No quote here please
+ 'id' => 'ID',
+ 'name' => '名称',
+ 'description' => '詳細',
+ 'active_field' => '有効',
+ 'hidden_field' => '非表示',
+ 'title_display' => 'マップページを表示',
+ 'map_header_label' => '任意のマップヘッダ',
+ 'map_footer_label' => '任意のマップフッタ',
+ 'header_footer' => 'ヘッダとフッタ',
+ 'informations' => 'インフォメーション',
+ 'must_belong_to' => 'マップへのアクセスに必要なグループ登録:',
+ 'private_access' => 'プライベートアクセス',
+ 'marker_label' => 'マーカー',
+ 'primary_color_label' => 'プライマリーカラー',
+ 'stroke_color_label' => 'ストロークカラー',
+ 'label' => 'ラベル',
+ 'label_color' => 'ラベルカラー',
+ 'black' => 'ブラック',
+ 'white' => 'ホワイト',
+ 'payed' => 'ペイドマーカー:',
+ 'lat' => '緯度:',
+ 'lng' => '経度:',
+ 'ressources_tab' => 'リソースタブ',
+ 'presentation' => 'プレゼンテーション',
+ 'ressources' => 'リソース',
+ 'presentation_tab' => 'プレゼンテーションタブ',
+ 'empty_ressources' => 'リソースラベルが空です。少なくともひとつ、登録してください。コンフィギュレーションを参照してください。',
+ 'empty_for_geo' => '住所からの自動計測をするなら、緯度経度は空白にしてください。',
+ 'select_marker_map' => 'マーカーを表示するマップを選んでください。',
+ 'remark' => '注意',
+ 'marker_created' => 'マーカー作成:',
+ 'map_created' => 'マップ作成:',
+ 'modified' => '最終編集日:',
+ 'marker_validity' => '有効期限を利用:',
+ 'maps_empty' => '先にマップを作成してください。',
+ 'from' => 'From:',
+ 'to' => 'To:',
+ 'date_issue' => '終了タグが開始タグの前にあります。すぐチェックしてください!',
+ 'max_char' => '最大文字数。',
+ 'street_label' => '番地:',
+ 'code_label' => '〒:',
+ 'city_label' => '市:',
+ 'state_label' => '都道府県:',
+ 'country_label' => '国:',
+ 'tel_label' => 'Tel:',
+ 'fax_label' => 'Fax:',
+ 'web_label' => 'Web:',
+ 'not_use_see_config' => '利用していません。コンフィギュレーションを参照してください。',
+ //global maps
+ 'global_map' => 'グローバルマップ',
+ 'info_global_map' => 'これはひとつのマップにすべてのマーカーを表示したものです。',
+ 'users_map' => 'サイトユーザのマップ',
+ 'info_users_map' => 'これはサイトユーザのマップです。あなたのプロフィールの位置情報を追加することで表示されます。',
+ //Submission
+ 'address' => '住所',
+ 'created' => '日時',
+ 'submit_marker' => 'マーカーを投稿する',
+ 'submit_marker_text' => '- ロケーションマーカーを登録してください。
- すべてのフィールドを入力してください。
- 投稿が承認されるまでお待ちください。
',
+ 'markers_submissions' => 'マーカーを登録',
+ 'submission_disabled' => 'マーカーの登録申請ができませんでした。',
+ 'go' => '入力した住所の位置情報を取得する',
+ //date and hits
+ 'last_modification' => '最終編集日時:',
+ 'hits' => 'ヒット',
+ //user marker
+ 'member' => 'メンバー',
+ 'location' => '位置: ',
+ 'regdate' => 'メンバー登録日: ',
+ 'about' => 'アバウト',
+ 'my_markers' => 'マイマーカー',
+ 'payed_label' => 'ペイド',
+ 'from_label' => 'バリディティ from',
+ 'to_label' => 'バリディティ to',
+ 'no_marker' => 'マーカーが未登録のようです。サイトのミスだと思われる場合にはサイトの管理者にお問い合わせください。',
+ 'marker_detail' => 'マーカー詳細',
+ 'admin_can' => 'マップ管理者としてあなたは',
+ 'create_map' => 'マップ新規作成',
+ 'set_user_geo' => 'ユーザーのGeoをセット',
+ 'set_geo_location' => 'システムチェックとすべてのGeoロケーションのセット OK',
+ 'records' => 'レコード',
+ 'report' => 'マーカーレポート',
+ 'report_subject' => 'マーカーのレポート',
+ 'edit_marker_text' => '- ロケーションマーカーをセット
- 入力フィールドに入力
- それでOKです。
',
+ 'admin' => '管理画面',
+ 'category_label' => 'カテゴリ:',
+ 'choose_category' => '-- カテゴリを選択 --',
+ 'categories' => 'カテゴリ',
+ 'categories_list' => 'カテゴリリスト',
+ 'cat_edit' => 'カテゴリ編集:',
+ 'cat_name_label' => 'カテゴリ名:',
+ 'create_cat' => 'カテゴリ新規作成',
+ 'field_list' => 'フィールドリスト',
+ 'addfield' => 'フィールドを追加',
+ 'field_name' => 'フィールド名',
+ 'field_order' => '順番',
+ 'field_autotag' => '自動タグ',
+ 'field_rights' => 'パーミッション',
+ 'field_edit' => '編集',
+ 'valid' => '有効',
+ 'editing_field' => 'フィールド編集',
+ 'category' => 'カテゴリ',
+ 'map_label' => 'マップ',
+ 'colon' => ':', //Add space before and after if needed
+ 'view_map' => 'マップを見る',
+ 'view_markers' => 'マーカーを見る',
+ 'code' => '郵便番号',
+ 'city' => '市',
+ 'viewing_markers' => 'ここはマップのマーカー',
+ 'details' => '詳細',
+ 'view_details' => '詳細をみる',
+ 'print' => 'プリント',
+ 'to_complete' => '完了する',
+ 'autotag_desc_maps' => '[maps: xx] - id=XX を指定して マップを表示する。',
+ 'autotag_desc_geo' => '[geo: map width:XX height:YY zoom:ZZ location] - 位置情報 (street, city, country)を中心としたマップを表示する。オプションは、幅と高さをピクセル指定 (例 400px) とズーム (0 から 21)。',
+ 'autotag_desc_marker' => '[marker: xx] - マーカーを id=XX で指定して表示する。',
+ //v1.1
+ 'marker_customisation' => 'マーカーカスタマイズ',
+ 'mk_default' => 'デフォルトのマーカーを使う',
+ 'overlays' => 'オーバーレイ',
+ 'overlays_list' => 'オーバーレイ一覧',
+ 'create_overlay' => 'オーバーレイ新規作成',
+ 'edit_overlay_text' => 'オーバーレイ編集:',
+ 'overlay_name_label' => 'オーバーレイ名:',
+ 'overlay_presentation' => 'オーバーレイ画像は緯度・経度を指定して張り付けられます。ドラッグ、ズームに応じてオーバーレイが切り替わります。',
+ 'overlay_active' => 'オーバーレイアクティブ:',
+ 'zoom_min_label' => 'ズーム 最小:',
+ 'zoom_max_label' => 'ズーム 最大:',
+ 'image_message' => '画像ファイルを選んでください。',
+ 'image_replace' => '画像ファイルをアップロードして置き換え:',
+ 'image' => '画像',
+ 'sw_lat' => '南西 緯度:',
+ 'sw_lng' => '南西 経度:',
+ 'ne_lat' => '北東 緯度:',
+ 'ne_lng' => '北東 経度:',
+ 'overlay_not_writable' => 'オーバーレイフォルダ書き込み化: オーバーレイ用のフォルダを作成して書き込み可能に設定してください。',
+ 'map_tab' => 'マップ',
+ 'overlays_tab' => 'オーバーレイ',
+ 'add_overlay' => 'オーバーレイ追加',
+ 'remove_overlay' => 'オーバーレイ削除',
+ 'overlay_label' => 'オーバーレイ',
+ 'import_export' => 'インポート/エクスポート',
+ 'import' => 'インポート',
+ 'export' => 'エクスポート',
+ 'select_file' => '.csvファイルを選んでください。',
+ 'import_message' => 'マーカーを追加したいマップを選んで, マーカーファイルを選び, データのセパレータとインポートしたいフィールドをチェックしてください。',
+ 'markers_added' => 'マーカーをマップに追加:',
+ 'export_message' => 'マーカーをエクスポートしたいマップを選んで, マーカーファイルを選び, データのセパレータとインポートしたいフィールドをチェックしてください。',
+ 'no_marker_to_export' => 'このマップにはエクスポートするマーカーがありませんでした。',
+ 'icons' => 'アイコン',
+ 'icons_not_writable' => 'アイコンフォルダ書き込み不可: アイコンフォルダを作成して書き込み可能にしてください。',
+ 'icons_list' => 'アイコン一覧',
+ 'create_icon' => 'アイコン新規作成',
+ 'icon_edit' => 'アイコン編集',
+ 'icon_presentation' => 'マーカーで表示するアイコンをアップロードできます。',
+ 'icon_name_label' => 'アイコン名',
+ 'xmarkers' => 'マーカー',
+ '1marker' => 'マーカー',
+ 'choose_icon' => 'このマーカーのアイコンを選べます。優先アイコンはカラーアイコンです。',
+ 'no_icon' => 'アイコン無し',
+ 'separator' => 'セパレータ',
+ 'markers_to_add' => 'すべてのフィールドの値をチェックして、マーカーを追加するマップを選んでください。:',
+ 'choose_fields_import' => 'フィールドを選んでインポート',
+ 'choose_fields_export' => 'フィールドを選んでエクスポート',
+ 'checkall' => 'すべてチェック',
+ 'order' => '順番',
+ 'move' => '移動',
+ 'name_missing' => '少なくともCSVファイル名がありません。',
+ 'need_address' => 'マーカー作成のためには少なくとも住所または緯度・経度が必要です。CSVファイルをチェックしてください。',
+ 'manage_groups' => 'オーバーレイ管理',
+ 'create_group' => 'オーバーレイグループを作成する',
+ 'group_edit' => 'グループ編集:',
+ 'group_overlay_presentation' => 'オーバーレイグループの名前を編集できます。',
+ 'group_overlay_name_label' => 'オーバーレイグループ名',
+ 'group_label' => 'グループ (オプション)',
+ 'choose_group' => 'グループ選択',
+ 'group' => 'グループ',
+ //v1.3
+ 'geo_fail' => '住所の入力エラーです。',
+ 'on_map' => '地図上',
+ 'read_more' => '詳しくはこちら',
+ 'from_map' => '地図から',
+ 'show_hide_overlays' => 'オーバーレイ 表示 / 非表示',
+ 'fields_presentation' => 'カテゴリの編集またはフィールドを追加する。',
+ 'overlays_added' => '地図にオーバーレイを追加する',
+ 'overlays_to_add' => '地図にオーバーレイを追加',
+ 'marker_modification' => 'マーカーの編集',
+ 'from_owner' => 'から',
+ 'marker_limited' => 'マーカー制限です',
+ 'events_map' => 'イベントマップ',
+ 'info_events_map' => '',
+ 'from_cal' => 'From',
+ 'to_cal' => 'to',
+ 'on_cal' => 'On',
+ //v1.4
+ 'configuration' => 'コンフィギュレーション',
+
+);
+
+$LANG_MAPS_MESSAGE = array(
+ 'message' => 'システムからのメッセージ',
+ 'add_new_field' => 'フィールドが新たに作成されました。',
+ 'save_field' => 'フィールドが新たに保存されました。',
+ 'delete_field' => 'フィールドが削除されました。',
+);
+
+$LANG_MAPS_EMAIL = array(
+ 'hello_admin' => 'ようこそ、管理者さん,',
+ 'new_marker' => '承認待ちのマーカーが作成されました。',
+ 'name' => '名称:',
+ 'on_map' => 'マップ上:',
+ 'submissions' => '投稿: ',
+ 'marker_submissions' => 'マーカーの投稿',
+ 'description' => '説明:',
+);
+
+// Messages for the plugin upgrade
+$PLG_maps_MESSAGE3002 = $LANG32[9]; // "requires a newer version of Geeklog"
+
+$PLG_maps_MESSAGE1 = "マーカー登録ありがとう! {$_CONF['site_name']}. 投稿はスタッフに通知されました。";
+$PLG_maps_MESSAGE2 = "マーカーの投稿は終了しました。";
+$PLG_maps_MESSAGE3 = "エラーです。マーカーを保存できません。";
+
+/**
+* Localization of the Admin Configuration UI
+* @global array $LANG_configsections['maps']
+*/
+$LANG_configsections['maps'] = array(
+ 'label' => 'Maps',
+ 'title' => 'Maps'
+);
+
+/**
+* Configuration system prompt strings
+* @global array $LANG_confignames['maps']
+*/
+$LANG_confignames['maps'] = array(
+ 'maps_folder' => 'マップの公開フォルダ',
+ 'hide_maps_menu' => 'マップメニューを非表示',
+ 'maps_login_required' => 'マップ ログイン要求',
+ 'autofill_coord' => '自動的に未入力緯度経度をセットする',
+ 'display_geo_profile' => 'プロフィール geo ロケーリゼーション',
+ 'map_type_profile' => 'プロフィールマップタイプ',
+ 'map_type_geotag' => 'geo マップ自動タグ タイプ',
+ 'show_directions_geo' => 'geo 自動タグに方向を表示する',
+ 'show_directions_profile' => 'プロフィールに方向を表示する',
+ 'map_width_geotag' => 'geo マップ自動タグ 幅 (単位指定: % または px)',
+ 'map_height_geotag' => 'geo マップ自動タグ 高さ (単位指定: px のみ)',
+ 'map_zoom_geotag' => 'geo マップ自動タグ ズーム (0-21)',
+ 'map_width_profile' => 'プロフィールマップの幅 (単位指定: % または px)',
+ 'map_height_profile' => 'プロフィールマップの高さ (単位指定: px のみ)',
+ 'AdsOnMap' => 'マップにgoogle adsを表示',
+ 'publisher_id' => '公開 id',
+ 'channel_id' => 'あなたのチャンネル',
+ 'maxAdsOnMap' => 'マップ上の最大ads数',
+ 'show_map' => 'Google Mapを見る',
+ 'google_api_key' => 'Google Maps API Key',
+ 'url_geocode' => 'Google GeoコーディングサービスのURL',
+ 'map_width' => 'マップの横幅のデフォルト(with % or px)',
+ 'map_height' => 'マップの高さのデフォルト(with px only)',
+ 'map_zoom' => 'マップズームのデフォルト(0-21)',
+ 'map_type' => 'マップタイプのデフォルト',
+ 'default_permissions' => 'パーミッションのデフォルト',
+ 'map_main_header' => 'メインページヘッダ, autotag welcome',
+ 'map_main_footer' => 'メインページフッタ, autotag welcome',
+ 'map_geo' => 'すべてのプロフィールでマップを作成する',
+ 'map_markers' => 'すべてのマーカーでマップを作成する',
+ 'map_active' => 'マップは有効',
+ 'map_hidden' => 'マップは非表示',
+ 'free_markers' => 'マップはフリーマーカーを許可',
+ 'paid_markers' => 'マップはペイドマーカーを許可 (Paypalプラグイン要)',
+ 'street' => '番地情報を使用',
+ 'code' => '郵便番号情報を使用',
+ 'city' => '市区町村情報を使用',
+ 'state' => '都道府県情報を使用',
+ 'country' => '国情報を使用',
+ 'tel' => 'TEL情報を使用',
+ 'fax' => 'FAX情報を使用',
+ 'web' => 'Web情報を使用',
+ 'item_1' => 'リソース #1 label',
+ 'item_2' => 'リソース #2 label',
+ 'item_3' => 'リソース #3 label',
+ 'item_4' => 'リソース #4 label',
+ 'item_5' => 'リソース #5 label',
+ 'item_6' => 'リソース #6 label',
+ 'item_7' => 'リソース #7 label',
+ 'item_8' => 'リソース #8 label',
+ 'item_9' => 'リソース #9 label',
+ 'item_10' => 'リソース #10 label',
+ 'label_color' => 'ラベルカラー',
+ 'star_primary_color' => 'スタープライマリーカラー',
+ 'star_stroke_color' => 'スターストロークカラー',
+ 'marker_active' => 'マーカー有効をデフォルト',
+ 'marker_hidden' => 'マーカー非表示をデフォルト',
+ 'marker_payed' => 'マーカーペイドをデフォルト',
+ 'marker_validity' => 'マーカーバリディティをデフォルト',
+ 'monetize' => 'マーカー収益化',
+ 'marker_submission' => 'マーカー投稿を許可',
+ 'users_map' => 'サイトユーザのアクティブマップ',
+ 'global_map' => 'アクティブグローバルマップ',
+ 'global_type' => 'グローバルマップ タイプ',
+ 'global_width' => 'グローバルマップ 横幅',
+ 'global_height' => 'グローバルマップ 高さ',
+ 'global_zoom' => 'グローバルマップ ズーム (0-21)',
+ 'detail_zoom' => 'マーカー詳細 ズームm (0-21)',
+ 'submit_login_required' => 'マーカー投稿にログインが必要',
+ 'marker_edition' => 'マーカー編集',
+ 'infos_label' => 'インフォラベル (プロバージョン)',
+ 'use_cluster' => 'マーカークラスターを利用する',
+ 'zoom_profile' => 'ユーザープロファイルのマップのズーム (0-21)',
+ 'display_events_map' => 'イベントマップを表示する',
+);
+
+/**
+* Configuration system subgroup strings
+* @global array $LANG_configsubgroups['maps']
+*/
+$LANG_configsubgroups['maps'] = array(
+ 'sg_main' => 'メイン設定',
+ 'sg_display' => '表示設定'
+);
+
+/**
+* Configuration system fieldset names
+* @global array $LANG_fs['maps']
+*/
+$LANG_fs['maps'] = array(
+ 'fs_main' => '一般設定',
+ 'fs_ads' => 'Google Ads設定',
+ 'fs_google' => 'Google API設定',
+ 'fs_permissions' => 'デフォルトパーミッション',
+ 'fs_display' => 'マップ',
+ 'fs_global_map' => 'グローバルマップ',
+ 'fs_display_profile' => 'プロフィール',
+ 'fs_display_geo' => 'geo自動タグ',
+ 'fs_map_default' => 'マップデフォルト設定',
+ 'fs_marker_default' => 'マーカーデフォルト設定',
+ );
+
+/**
+* Configuration system selection strings
+* Note: entries 0, 1, and 12 are the same as in
+* $LANG_configselects['Core']
+*
+* @global array $LANG_configselects['maps']
+*/
+$LANG_configselects['maps'] = array(
+ 0 => array('はい' => 1, 'いいえ' => 0),
+ 1 => array('はい' => TRUE, 'いいえ' => FALSE),
+ 3 => array('はい' => 1, 'いいえ' => 0),
+ 4 => array('オン' => 1, 'オフ' => 0),
+ 5 => array('ページトップ' => 1, '注目記事の下' => 2, 'ページの下' => 3),
+ 10 => array('5' => 5, '10' => 10, '25' => 25, '50' => 50),
+ 11 => array('マイル' => 'miles', 'キロメータ' => 'km'),
+ 12 => array('アクセス不可' => 0, '表示' => 2, '表示・編集' => 3),
+ 20 => array('ノーマル' => 'G_NORMAL_MAP', 'サテライトマップ' => 'G_SATELLITE_MAP', '航空写真' => 'G_PHYSICAL_MAP ', '地図+写真' => 'G_HYBRID_MAP', '地形' => 'G_AERIAL_HYBRID_MAP'),
+ 30 => array('白' => 1, '黒' => 0),
+ 31 => array('一時的' => 1, 'パーマネント' => 0),
+);
+
+?>
From d2534f364b45f8e37284caf31064897529589d9a Mon Sep 17 00:00:00 2001
From: Ivy
Date: Sat, 18 Mar 2017 16:29:20 +0900
Subject: [PATCH 3/3] add {templatelocation} to templates
---
templates/admin_menu.thtml | 4 ++++
templates/edit_map_end.thtml | 3 +++
templates/edit_map_item.thtml | 4 ++++
templates/edit_map_start.thtml | 4 ++++
templates/geo.thtml | 6 +++++-
templates/geo_profile.thtml | 6 +++++-
templates/geocoder.thtml | 3 +++
templates/group_overlay_form.thtml | 8 ++++++--
templates/icon_form.thtml | 6 +++++-
templates/import_export_form.thtml | 6 +++++-
templates/list_map_end.thtml | 3 +++
templates/list_map_item.thtml | 6 +++++-
templates/list_map_start.thtml | 4 ++++
templates/map.thtml | 6 +++++-
templates/map_autotag.thtml | 6 +++++-
templates/map_form.thtml | 6 +++++-
templates/map_only_script.thtml | 4 ++++
templates/marker.thtml | 3 +++
templates/marker_detail.thtml | 4 ++++
templates/marker_form.thtml | 6 +++++-
templates/marker_submit_form.thtml | 5 ++++-
templates/marker_user_form.thtml | 6 +++++-
templates/overlay_form.thtml | 6 +++++-
templates/submitloginrequired.thtml | 4 ++++
templates/user_menu.thtml | 5 +++++
25 files changed, 110 insertions(+), 14 deletions(-)
diff --git a/templates/admin_menu.thtml b/templates/admin_menu.thtml
index b5c049a..edc73c4 100644
--- a/templates/admin_menu.thtml
+++ b/templates/admin_menu.thtml
@@ -1,3 +1,5 @@
+{# begin {templatelocation} #}
+
+
+{# end {templatelocation} #}
diff --git a/templates/edit_map_end.thtml b/templates/edit_map_end.thtml
index 3e5645e..b7b8bd5 100644
--- a/templates/edit_map_end.thtml
+++ b/templates/edit_map_end.thtml
@@ -1,2 +1,5 @@
+{# begin {templatelocation} #}
+
+{# end {templatelocation} #}
diff --git a/templates/edit_map_item.thtml b/templates/edit_map_item.thtml
index 48fb541..5e4c4b4 100644
--- a/templates/edit_map_item.thtml
+++ b/templates/edit_map_item.thtml
@@ -1,3 +1,5 @@
+{# begin {templatelocation} #}
+
|
{name}
@@ -8,3 +10,5 @@
| {edit_button}
|
+
+{# end {templatelocation} #}
diff --git a/templates/edit_map_start.thtml b/templates/edit_map_start.thtml
index 43acbe5..1f356f5 100644
--- a/templates/edit_map_start.thtml
+++ b/templates/edit_map_start.thtml
@@ -1 +1,5 @@
+{# begin {templatelocation} #}
+
+
+{# end {templatelocation} #}
diff --git a/templates/geo.thtml b/templates/geo.thtml
index 19b9b24..e98137c 100644
--- a/templates/geo.thtml
+++ b/templates/geo.thtml
@@ -1,3 +1,5 @@
+{# begin {templatelocation} #}
+