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 -* $[