init
This commit is contained in:
30
module/googlemaps/collection_googlemaps_cardform.inc.php
Normal file
30
module/googlemaps/collection_googlemaps_cardform.inc.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
?>
|
||||
<h2><?php echo $translation->get("googlemaps_options"); ?></h2>
|
||||
<?php
|
||||
if (!is_array($sitepart_options)) {
|
||||
$width = 450;
|
||||
$height = 450;
|
||||
} else {
|
||||
$width = $sitepart_options["collection_setup_google_maps_width"];
|
||||
$height = $sitepart_options["collection_setup_google_maps_height"];
|
||||
}
|
||||
?>
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<?php input($translation->get("maps_width"), "collection_setup_google_maps_width", "code", $width); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php input($translation->get("icon_path"), "collection_setup_icon_location", "code", $sitepart_options['collection_setup_icon_location']); ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php input($translation->get("maps_height"), "collection_setup_google_maps_height", "code", $height); ?> </td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_line_googlemaps_list_" . $fieldSetup['id'];
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_collection_id = (isset($_REQUEST["input_collection_id"]) ? $_REQUEST["input_collection_id"] : "");
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_line_id" value="" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_collection_id" value="<?php echo $input_collection_id; ?>" />
|
||||
<input type="hidden" name="collection_setup_content_id" value="<?php echo $fieldSetup['id']; ?>" />
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_line_googlemaps', true)", "", FALSE); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_line_googlemaps')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_googlemaps', false, '{$translation->get('delete_line_confirm')}')", "", FALSE); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?
|
||||
|
||||
$query = "SELECT * FROM main_collection_link WHERE main_collection_id = " . $collectionData['id'] . " AND main_collection_setup_content_id = " . $fieldSetup['id'];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$num_rows = @mysqli_num_rows($result);
|
||||
if ($num_rows == 0) {
|
||||
echo "<div class=\"infobox\">" . $translation->get("no_rows_found") . "</div></form>";
|
||||
return;
|
||||
}
|
||||
|
||||
$row = @mysqli_fetch_array($result, 1);
|
||||
|
||||
$query = "SELECT id, title AS '" . $translation->get("title") . "', address as '" . $translation->get("address") . "' FROM google_maps_line WHERE header_id = " . $row['main_sitepart_header_id'] . " ORDER BY sorting ASC";
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_line_id", "edit_line_googlemaps", TRUE, "update_sortorder_googlemaps");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
46
module/googlemaps/component_googlemaps_listform.inc.php
Normal file
46
module/googlemaps/component_googlemaps_listform.inc.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_google_maps_list";
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php echo $translation->get("assign_google_maps"); ?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("left", $translation->get("back"), $formname, "loadCard('edit_component', true)"); ?>
|
||||
<?= button("link", $translation->get("assoc_with_component"), $formname, "loadCard('assoc_line_component')"); ?>
|
||||
</ul>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input name="data-sitepartid" type="hidden" value="8">
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT google_maps_header.id, description AS '" . $translation->get("description") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from google_maps_header left join main_admin_user ON google_maps_header.modified_user = main_admin_user.id where (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1) and collection_header = 0 order by id asc";
|
||||
//echo $query;
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "assoc_line_component");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
378
module/googlemaps/edit_googlemaps.inc.php
Normal file
378
module/googlemaps/edit_googlemaps.inc.php
Normal file
@@ -0,0 +1,378 @@
|
||||
<?
|
||||
date_default_timezone_set('Europe/Berlin');
|
||||
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
|
||||
if (isset($custom_action)) {
|
||||
$action = $custom_action;
|
||||
} else {
|
||||
$action = $_REQUEST["action"];
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'new_googlemaps':
|
||||
require_once("edit_googlemaps_cardform.inc.php");
|
||||
break;
|
||||
case 'save_googlemaps':
|
||||
save_google_maps();
|
||||
break;
|
||||
case 'edit_googlemaps':
|
||||
edit_google_maps();
|
||||
break;
|
||||
case 'delete_googlemaps' :
|
||||
delete_google_maps();
|
||||
break;
|
||||
|
||||
case 'new_line_googlemaps':
|
||||
new_line_googlemaps();
|
||||
break;
|
||||
case 'edit_line_googlemaps':
|
||||
edit_line_google_maps();
|
||||
break;
|
||||
case 'delete_line_googlemaps':
|
||||
delete_line_google_maps();
|
||||
break;
|
||||
case 'save_line_googlemaps':
|
||||
save_googlemaps_entry();
|
||||
break;
|
||||
|
||||
case 'update_sortorder_googlemaps':
|
||||
update_sortorder_googlemaps();
|
||||
break;
|
||||
|
||||
default:
|
||||
require_once("edit_googlemaps_listform.inc.php");
|
||||
break;
|
||||
}
|
||||
|
||||
function update_sortorder_googlemaps() {
|
||||
$sorting = 1;
|
||||
foreach ($_POST['linklistid'] as $itemId) {
|
||||
$query = "UPDATE google_maps_line SET sorting = " . $sorting . " WHERE id = '" . $itemId."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$sorting++;
|
||||
}
|
||||
}
|
||||
|
||||
function new_line_googlemaps() {
|
||||
$input_line = array();
|
||||
|
||||
if (is_collection_edit()) {
|
||||
$collection_link = get_collection_link($_REQUEST['input_collection_id'], $_REQUEST['collection_setup_content_id']);
|
||||
if (isset($collection_link['main_sitepart_header_id'])) {
|
||||
$input_line['header_id'] = $collection_link['main_sitepart_header_id'];
|
||||
}
|
||||
} else {
|
||||
$input_line['header_id'] = $_REQUEST['input_id'];
|
||||
}
|
||||
|
||||
require_once("edit_googlemaps_line_cardform.inc.php");
|
||||
}
|
||||
|
||||
function edit_google_maps( $_id = "", $messages = array() ) {
|
||||
|
||||
if (is_collection_edit()) {
|
||||
edit_collection();
|
||||
return;
|
||||
}
|
||||
|
||||
if ((int)$_id > 0) {
|
||||
$input_id = $_id;
|
||||
} else {
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
}
|
||||
|
||||
if ($input_id <> '') {
|
||||
|
||||
$query = "SELECT * FROM google_maps_header WHERE id = '" . $input_id . "' LIMIT 1";
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
|
||||
$input_google_maps = @mysqli_fetch_array($result);
|
||||
|
||||
require_once("edit_googlemaps_cardform.inc.php");
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
require_once("edit_googlemaps_cardform.inc.php");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function edit_line_google_maps( $_id = "", $messages = array() ) {
|
||||
if ((int)$_id > 0) {
|
||||
$line_id = $_id;
|
||||
} else {
|
||||
$line_id = $_REQUEST["input_line_id"];
|
||||
}
|
||||
|
||||
if ($line_id <> '') {
|
||||
$query = "SELECT * FROM google_maps_line WHERE id = '" . $line_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_line = @mysqli_fetch_array($result);
|
||||
require_once("edit_googlemaps_line_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
require_once("edit_googlemaps_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function save_google_maps() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$input_id = "";
|
||||
$input_all_languages = ($_POST["input_all_languages"] == "on") ? 1 : 0;
|
||||
|
||||
$width = $_POST['google_maps_width'];
|
||||
$height = $_POST['google_maps_height'];
|
||||
$icon_location = $_POST['google_maps_icon_location'];
|
||||
|
||||
//pruefen ob Bild ausgewaehlt
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$insertquery = "UPDATE google_maps_header SET
|
||||
description = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_description"]) . "',
|
||||
modified_date = " . time() . ",
|
||||
modified_user = " . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
width = '" . $width . "',
|
||||
height = '" . $height . "',
|
||||
icon_location = '" . $icon_location . "',
|
||||
all_languages = " . $input_all_languages . "
|
||||
WHERE id = '" . $_REQUEST["input_id"] . "'
|
||||
LIMIT 1";
|
||||
$inserted = FALSE;
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
} else {
|
||||
$insertquery = "INSERT INTO google_maps_header
|
||||
(main_language_id, description, modified_date, modified_user, width, height, icon_location, all_languages)
|
||||
VALUES (
|
||||
'" . $GLOBALS["language"]['id'] . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['input_description']) . "',
|
||||
" . time() . ",
|
||||
" . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
'" . $width . "',
|
||||
'" . $height . "',
|
||||
'" . $icon_location . "',
|
||||
" . $input_all_languages . "
|
||||
)";
|
||||
$inserted = TRUE;
|
||||
}
|
||||
|
||||
if (($_REQUEST["input_description"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_description") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'], $insertquery);
|
||||
|
||||
if ($inserted == TRUE) {
|
||||
$input_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$messages[] = '<div class="successbox">' . $translation->get("google_maps_msg_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("google_maps_msg_success2") . '</div>';
|
||||
}
|
||||
|
||||
update_sitepart_changes(8, $input_id);
|
||||
|
||||
if (is_page_edit()) {
|
||||
header('EDIT_ERROR: 1'); // verhindern, dass overlay geschlossen wird
|
||||
if (line_already_exists($_REQUEST["input_page_id"], 8, $input_id) === FALSE) {
|
||||
assoc_sitepart(8, $input_id, FALSE);
|
||||
}
|
||||
|
||||
if ($_REQUEST['force_close'] == 1) {
|
||||
edit_content_page();
|
||||
return;
|
||||
}
|
||||
|
||||
edit_google_maps($input_id, $messages);
|
||||
|
||||
} elseif (is_component_edit()) {
|
||||
header('EDIT_ERROR: 1'); // verhindern, dass overlay geschlossen wird
|
||||
if (line_already_exists($_REQUEST["input_component_id"], 8, $input_id) === FALSE) {
|
||||
assoc_sitepart(8, $input_id, FALSE);
|
||||
}
|
||||
|
||||
if ($_REQUEST['force_close'] == 1) {
|
||||
edit_component("", $messages);
|
||||
return;
|
||||
}
|
||||
|
||||
edit_google_maps($input_id, $messages);
|
||||
} else {
|
||||
edit_google_maps($input_id, $messages);
|
||||
}
|
||||
|
||||
} else {
|
||||
header('EDIT_ERROR: 1');
|
||||
$input_google_maps = array();
|
||||
$input_google_maps["id"] = $_REQUEST["input_id"];
|
||||
$input_google_maps["description"] = $_REQUEST["input_description"];
|
||||
$input_google_maps["width"] = $width;
|
||||
$input_google_maps["height"] = $height;
|
||||
$input_google_maps["icon_location"] = $icon_location;
|
||||
$input_google_maps["all_languages"] = $input_all_languages;
|
||||
|
||||
require_once("edit_googlemaps_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function delete_google_maps() {
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "DELETE FROM google_maps_header WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
$query = "DELETE FROM google_maps_line WHERE header_id = '" . $_REQUEST["input_id"]."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
// zuordnung von Seiten loeschen
|
||||
$query = "DELETE FROM main_page_link WHERE main_sitepart_id = 8 AND main_sitepart_header_id = '" . $_REQUEST["input_id"]."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
update_sitepart_changes(8, $_REQUEST["input_id"], TRUE);
|
||||
}
|
||||
require_once("edit_googlemaps_listform.inc.php");
|
||||
}
|
||||
|
||||
|
||||
function delete_line_google_maps() {
|
||||
if ($_REQUEST["input_line_id"] <> '') {
|
||||
$query = "SELECT * FROM google_maps_line WHERE id='" . $_REQUEST["input_line_id"]."'";
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
//Loeschen der Dateien und des DB-Eintrags wenn Eintrag vorhanden
|
||||
if (mysqli_num_rows($result) > 0) {
|
||||
$row = mysqli_fetch_array($result);
|
||||
$query = "DELETE FROM google_maps_line WHERE id = '" . $_REQUEST["input_line_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
edit_google_maps();
|
||||
}
|
||||
|
||||
/**
|
||||
* save_googlemaps_entry() Speichern einzelner Bilder
|
||||
*
|
||||
*/
|
||||
|
||||
function save_googlemaps_entry() {
|
||||
$latlng = geoencode($_POST["input_address"]);
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$messages = array();
|
||||
$id = $_REQUEST["input_line_id"];
|
||||
|
||||
// wenn in kollektion, dann die dummy header id auslesen bzw erstmal anlegen
|
||||
if (is_collection_edit() && (!isset($_REQUEST['input_id']) || (int)$_REQUEST['input_id'] == 0)) {
|
||||
// neue dummy gallery anlegen
|
||||
// optionen auslesen
|
||||
$query = "SELECT options FROM main_collection_setup_content WHERE id = '" . $_POST['collection_setup_content_id']."'";
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$row = mysqli_fetch_array($result);
|
||||
|
||||
$options = unserialize($row['options']);
|
||||
// hinzufuegen zur datenbank
|
||||
$insertquery = "INSERT INTO google_maps_header
|
||||
(main_language_id, description, modified_date, modified_user, width, height, icon_location, collection_header)
|
||||
VALUES (
|
||||
'" . $GLOBALS["language"]['id'] . "',
|
||||
'',
|
||||
" . time() . ",
|
||||
" . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
" . (int)$options['collection_setup_google_maps_width'] . ",
|
||||
" . (int)$options['collection_setup_google_maps_height'] . ",
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options['collection_setup_icon_location']) . "',
|
||||
1
|
||||
)";
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'], $insertquery);
|
||||
$header_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
$query = "INSERT INTO main_collection_link (main_collection_id, main_collection_setup_content_id, main_sitepart_header_id, main_sitepart_id)
|
||||
VALUES (
|
||||
'" . $_REQUEST['input_collection_id'] . "',
|
||||
'" . $_REQUEST['collection_setup_content_id'] . "',
|
||||
" . $header_id . ",
|
||||
8
|
||||
)";
|
||||
mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
} else {
|
||||
$header_id = (int)$_REQUEST['input_id'];
|
||||
}
|
||||
|
||||
if ($_REQUEST["input_line_id"] <> '') {
|
||||
$query = "UPDATE google_maps_line
|
||||
SET
|
||||
modified_date = " . time() . ",
|
||||
modified_user = " . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
title = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_title"]) . "',
|
||||
address = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_address"]) . "',
|
||||
description = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["textcontent"]) . "',
|
||||
lat = '" . $latlng['lat'] . "',
|
||||
lng = '" . $latlng['lng'] . "'
|
||||
WHERE id = '" . $_REQUEST["input_line_id"] . "' LIMIT 1";
|
||||
$inserted = FALSE;
|
||||
} else {
|
||||
$sorting = @mysqli_fetch_array(@mysqli_query($GLOBALS['mysql_con'], "SELECT MAX(sorting)+1 AS 'newsorting' FROM google_maps_line WHERE header_id = '" . $header_id."'"));
|
||||
$sorting = ($sorting["newsorting"] <> "") ? $sorting = $sorting["newsorting"] : $sorting = 1;
|
||||
$query = "INSERT INTO google_maps_line (header_id, title, address, description,sorting, lat, lng, modified_date, modified_user)
|
||||
VALUES (" . $header_id . ",
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_title"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_address"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["textcontent"]) . "',
|
||||
" . $sorting . ",
|
||||
'" . $latlng['lat'] . "',
|
||||
'" . $latlng['lng'] . "',
|
||||
" . time() . ",
|
||||
" . (int)$GLOBALS["admin_user"]['id'] . "
|
||||
)";
|
||||
$inserted = TRUE;
|
||||
}
|
||||
|
||||
if (empty($latlng['lat']) || empty($latlng['lng'])) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_address") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
if (($_REQUEST["input_title"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_title") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
|
||||
// benoetigt fuer ajax calls
|
||||
if ($error === TRUE) {
|
||||
header('EDIT_ERROR: 1');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if ($_REQUEST['save_and_close'] == 1) {
|
||||
|
||||
edit_google_maps();
|
||||
} else {
|
||||
if ($inserted === TRUE) {
|
||||
$id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$messages[] = '<div class="successbox">' . $translation->get("google_maps_line_msg_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("google_maps_line_msg_success2") . '</div>';
|
||||
}
|
||||
edit_line_google_maps($id, $messages);
|
||||
}
|
||||
|
||||
} else {
|
||||
$input_line["id"] = $_REQUEST["input_line_id"];
|
||||
$input_line["header_id"] = $header_id;
|
||||
$input_line["title"] = $_REQUEST["input_title"];
|
||||
$input_line["address"] = $_REQUEST["input_address"];
|
||||
$input_line["description"] = $_REQUEST["textcontent"];
|
||||
require_once("edit_googlemaps_line_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
102
module/googlemaps/edit_googlemaps_cardform.inc.php
Normal file
102
module/googlemaps/edit_googlemaps_cardform.inc.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?
|
||||
$formname = "form_google_maps_cardform";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_google_maps["id"] == "") {
|
||||
echo $translation->get("new_google_maps");
|
||||
} else {
|
||||
echo $translation->get("edit_google_maps");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
// Zurueck zur uebersicht
|
||||
if (is_page_edit() || is_component_edit()) {
|
||||
button("left", $translation->get("back"), $formname, "loadCard('edit_content_page', true)");
|
||||
}
|
||||
|
||||
// Speichern button
|
||||
button("save", $translation->get("save"), $formname, "loadCard('save_googlemaps', true)");
|
||||
|
||||
// Speichern und schliessen
|
||||
button("save", $translation->get("save_and_close"), $formname, "loadCard('save_googlemaps', true, '', true)");
|
||||
?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
// Loeschen button
|
||||
if ($input_google_maps["id"] != "" && is_page_edit() === FALSE && is_component_edit() === FALSE) {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_googlemaps', true, '{$translation->get('delete_google_maps_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
|
||||
// Zuruecksetzen
|
||||
button("reset", $translation->get("restore"), $formname, "?action=edit", "", FALSE);
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_google_maps["id"] ?>">
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input name="data-sitepartid" type="hidden" value="8">
|
||||
|
||||
<?php
|
||||
if (!is_array($input_google_maps)) {
|
||||
$width = 450;
|
||||
$height = 450;
|
||||
} else {
|
||||
$width = $input_google_maps["width"];
|
||||
$height = $input_google_maps["height"];
|
||||
}
|
||||
?>
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "input_description", "text", $input_google_maps["description"], 255) ?>
|
||||
<?php input($translation->get("icon_path"), "google_maps_icon_location", "code", $input_google_maps['icon_location']); ?>
|
||||
<? input($translation->get("show_in_all_languages"), "input_all_languages", "checkbox", $input_google_maps["all_languages"]) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php input($translation->get("maps_width"), "google_maps_width", "code", $width); ?>
|
||||
<?php input($translation->get("maps_height"), "google_maps_height", "code", $height); ?>
|
||||
<?php
|
||||
if ($input_google_maps["id"] != "") {
|
||||
show_changed_on($input_google_maps["id"], "google_maps_header");
|
||||
show_changed_by($input_google_maps["id"], "google_maps_header");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<br />
|
||||
<?
|
||||
if ($input_google_maps['id'] != "") {
|
||||
require_once("edit_googlemaps_line_listform.inc.php");
|
||||
}
|
||||
?>
|
||||
87
module/googlemaps/edit_googlemaps_line_cardform.inc.php
Normal file
87
module/googlemaps/edit_googlemaps_line_cardform.inc.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?
|
||||
$formname = "form_line_card";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_collection_id = (isset($_REQUEST["input_collection_id"]) ? $_REQUEST["input_collection_id"] : "");
|
||||
$collection_setup_content_id = (isset($_REQUEST["collection_setup_content_id"]) ? $_REQUEST["collection_setup_content_id"] : "");
|
||||
$header_id = (isset($input_line["header_id"]) ? $input_line["header_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_line["id"] == "") {
|
||||
echo $translation->get("new_google_maps_line");
|
||||
} else {
|
||||
echo $translation->get("edit_google_maps_line");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?
|
||||
if (is_collection_edit()) {
|
||||
button("left", $translation->get("overview"), $formname, "loadCard('edit_collection', true)");
|
||||
} else {
|
||||
button("left", $translation->get("overview"), $formname, "loadCard('edit_googlemaps', true)");
|
||||
}
|
||||
?>
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_line_googlemaps', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "jQuery('#save_and_close', jQuery('#" . $formname . "')).val(1);loadCard('save_line_googlemaps', true)"); ?>
|
||||
<?php
|
||||
if ($input_line["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_googlemaps', true, '{$translation->get('delete_line_confirm')}')");
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit"); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post" enctype="multipart/form-data">
|
||||
<input name="input_line_id" type="hidden" value="<?= $input_line["id"] ?>" />
|
||||
<input name="input_id" type="hidden" value="<?= $header_id; ?>" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_collection_id" value="<?php echo $input_collection_id; ?>" />
|
||||
<input type="hidden" name="collection_setup_content_id" value="<?php echo $collection_setup_content_id; ?>" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input type="hidden" name="linklist_form" value="form_line_googlemaps_list" />
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("title"), "input_title", "text", $input_line["title"], 255) ?>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("address_free_format"), "input_address", "textarea", $input_line["address"]) ?>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<h2><?php echo $translation->get("content_info_box"); ?></h2>
|
||||
<?php
|
||||
show_ck_editor($input_line['description'], "dc", 'layout/frontend/' . $GLOBALS["layout"]["code"] . '/dist/css/fck.css', 'layout/frontend/' . $GLOBALS["layout"]["code"] . '/fckstyles.xml');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
30
module/googlemaps/edit_googlemaps_line_listform.inc.php
Normal file
30
module/googlemaps/edit_googlemaps_line_listform.inc.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_line_list";
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_id ?>">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_line_id" value="" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
|
||||
<h2><?php echo $translation->get("google_maps_field_headline"); ?></h2>
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_line_googlemaps', true)", "", FALSE); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_line_googlemaps')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_googlemaps', false, '{$translation->get('delete_line_confirm')}')", "", FALSE); ?>
|
||||
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?
|
||||
$query = "SELECT id, title AS '" . $translation->get("title") . "', address as '" . $translation->get("address") . "' FROM google_maps_line WHERE header_id = '" . $input_id . "' ORDER BY sorting ASC";
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_line_id", "edit_line_googlemaps", TRUE, "update_sortorder_googlemaps");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
32
module/googlemaps/edit_googlemaps_listform.inc.php
Normal file
32
module/googlemaps/edit_googlemaps_listform.inc.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_google_maps_list";
|
||||
$inputname = "input_id";
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_googlemaps', true)"); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_googlemaps')"); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "sendRequest('delete_googlemaps', false, '{$translation->get('delete_google_maps_confirm')}')"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('left_googlemaps'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT google_maps_header.id, description AS '" . $translation->get("description") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from google_maps_header left join main_admin_user ON google_maps_header.modified_user = main_admin_user.id where (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1) and collection_header = 0 ORDER BY id asc";
|
||||
//echo $query;
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "edit_googlemaps");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
9
module/googlemaps/googlemaps.php
Normal file
9
module/googlemaps/googlemaps.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?
|
||||
function googlemaps_show( $sitepart_id ) {
|
||||
require_once("googlemaps_config.inc.php");
|
||||
require("show_google_maps.inc.php");
|
||||
}
|
||||
|
||||
function googlemaps_edit() {
|
||||
require_once('edit_googlemaps.inc.php');
|
||||
}
|
||||
63
module/googlemaps/googlemaps_config.inc.php
Normal file
63
module/googlemaps/googlemaps_config.inc.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
//Generiert ein Array mit Code für Kartenmarkierungen
|
||||
function marker_list( $array, $sitepart_id ) {
|
||||
$marker_instances = array();
|
||||
FOR ($i = 0; $i < count($array); $i++) {
|
||||
$marker_instances[$i] = "
|
||||
var marker_" . $i . " = new google.maps.Marker({\t
|
||||
position: myLatlng_" . $i . ",\t
|
||||
icon: image,
|
||||
title: \"" . $array[$i]['title'] . "\",
|
||||
map: map_" . $sitepart_id . "\t
|
||||
});\n
|
||||
";
|
||||
}
|
||||
RETURN $marker_instances;
|
||||
}
|
||||
|
||||
//Generiert ein Array mit Code für Info-Boxen und deren Inhalt aus Nutzereingaben im ck-editor
|
||||
function info_list( $array ) {
|
||||
$infos = array();
|
||||
FOR ($i = 0; $i < count($array); $i++) {
|
||||
$description = str_replace("\r\n", '', $array[$i]['description']);
|
||||
$infos[$i] = "
|
||||
var contentString_" . $i . " = '" . $description . "';
|
||||
var infowindow_" . $i . " = new google.maps.InfoWindow({
|
||||
maxWidth: 350,
|
||||
content: contentString_" . $i . ",
|
||||
position: marker_" . $i . "
|
||||
});
|
||||
";
|
||||
}
|
||||
RETURN $infos;
|
||||
}
|
||||
|
||||
//Generiert ein Array mit Koordinaten für die Markierungen
|
||||
function coordinate_list( $array ) {
|
||||
$coordinates = array();
|
||||
IF (count($array) == 1) {
|
||||
$coordinates[0] = "
|
||||
var myLatlng_0 = new google.maps.LatLng(" . $array[0]['lat'] . ", " . $array[0]['lng'] . ");
|
||||
";
|
||||
} ELSE {
|
||||
FOR ($i = 0; $i < count($array); $i++) {
|
||||
$coordinates[$i] = "
|
||||
var myLatlng_" . $i . " = new google.maps.LatLng(" . $array[$i]['lat'] . ", " . $array[$i]['lng'] . ");
|
||||
bounds.extend(myLatlng_" . $i . ");
|
||||
";
|
||||
}
|
||||
}
|
||||
RETURN $coordinates;
|
||||
}
|
||||
|
||||
//Generiert ein Array mit Event-Listenern und -Triggern für das Öffnen der Infoboxen bei Klick auf die Markierung
|
||||
function info_open_list( $array, $sitepart_id ) {
|
||||
$opener = array();
|
||||
FOR ($i = 0; $i < count($array); $i++) {
|
||||
$opener[$i] = "
|
||||
google.maps.event.addListener(marker_" . $i . ", 'click', function(){
|
||||
infowindow_" . $i . ".open(map_" . $sitepart_id . ",marker_" . $i . ");
|
||||
});";
|
||||
}
|
||||
RETURN $opener;
|
||||
}
|
||||
44
module/googlemaps/page_googlemaps_listform.inc.php
Normal file
44
module/googlemaps/page_googlemaps_listform.inc.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_google_maps_list";
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php echo $translation->get("assign_google_maps"); ?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("left", $translation->get("back"), $formname, "loadCard('edit_content_page', true)"); ?>
|
||||
<?= button("link", $translation->get("assoc_with_page"), $formname, "loadCard('assoc_line_page')"); ?>
|
||||
</ul>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input name="data-sitepartid" type="hidden" value="8">
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT google_maps_header.id, description AS '" . $translation->get("description") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from google_maps_header left join main_admin_user ON google_maps_header.modified_user = main_admin_user.id where (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1) and collection_header = 0 order by id asc";
|
||||
//echo $query;
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "assoc_line_page");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
88
module/googlemaps/show_google_maps.inc.php
Normal file
88
module/googlemaps/show_google_maps.inc.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
//Holt hinterlegte Orte als assoziatives Array
|
||||
$sql_places = "SELECT address, description, lat, lng, title FROM google_maps_line WHERE header_id = '" . $sitepart_id."'";
|
||||
$qry_places = mysqli_query($GLOBALS['mysql_con'], $sql_places);
|
||||
IF (mysqli_num_rows($qry_places) == 1) {
|
||||
$places = array();
|
||||
$places[0] = mysqli_fetch_assoc($qry_places);
|
||||
} ELSE {
|
||||
$places = array();
|
||||
$i = 0;
|
||||
WHILE ($row = mysqli_fetch_assoc($qry_places)) {
|
||||
$places[$i] = $row;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
//Funktionsaufrufe zur Generierung der benötigten Listen
|
||||
$markers = marker_list($places, $sitepart_id);
|
||||
$coordinates = coordinate_list($places);
|
||||
$infos = info_list($places);
|
||||
$openers = info_open_list($places, $sitepart_id);
|
||||
|
||||
|
||||
//Holt Höhe und Breite der Karte als width & height variablen
|
||||
$sql_map = "SELECT width, height, icon_location FROM google_maps_header WHERE id = '" . $sitepart_id."'";
|
||||
$qry_map = mysqli_query($GLOBALS['mysql_con'], $sql_map);
|
||||
$map_size = mysqli_fetch_assoc($qry_map);
|
||||
extract($map_size);
|
||||
|
||||
|
||||
//Generiert Script-Tags, JQuery-Funktion zum Setzen eines neuen meta-tags im Seiten-Header,
|
||||
//Deklariert Optionsvariable und beginnt die Definition der Initialisierungsfunktion
|
||||
$mapcode = "
|
||||
<script type=\"text/javascript\" src=\"//maps.google.com/maps/api/js?sensor=false&key=AIzaSyCaWSVx10NGOpzPoZfIfD197E1RNzMLgcU\"></script>
|
||||
<script type=\"text/javascript\">\n
|
||||
\$('head').append('<meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=yes\" />');\n
|
||||
var image = '" . $icon_location . "';
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
var myOptions_" . $sitepart_id . ";\n
|
||||
function initialize_map_" . $sitepart_id . "() {
|
||||
";
|
||||
|
||||
//Generiert Objekte für Koordinaten
|
||||
FOR ($i = 0; $i < count($coordinates); $i++) {
|
||||
$mapcode .= $coordinates[$i];
|
||||
}
|
||||
|
||||
//Definiert Optionen
|
||||
$mapcode .= "\n\t\t" . "myOptions_" . $sitepart_id . " = {
|
||||
\t\t zoom: 8,
|
||||
\t\t center: myLatlng_0,
|
||||
\t\t mapTypeId: google.maps.MapTypeId.ROADMAP,
|
||||
\t\t scrollwheel: false
|
||||
\t}
|
||||
\n\t\t" . "var map_" . $sitepart_id . " = new google.maps.Map(document.getElementById(\"map_canvas_" . $sitepart_id . "\"), myOptions_" . $sitepart_id . ");\n";
|
||||
|
||||
//Generiert Objekte für Info-Boxen
|
||||
FOR ($i = 0; $i < count($infos); $i++) {
|
||||
$mapcode .= $infos[$i];
|
||||
}
|
||||
|
||||
//Generiert Objekte für Marker
|
||||
FOR ($i = 0; $i < count($markers); $i++) {
|
||||
$mapcode .= $markers[$i];
|
||||
}
|
||||
|
||||
//Generiert Event-Listener/Trigger zum Öffnen der Info-Boxen
|
||||
FOR ($i = 0; $i < count($openers); $i++) {
|
||||
$mapcode .= $openers[$i];
|
||||
}
|
||||
|
||||
IF (count($places) > 1) {
|
||||
$mapcode .= "\n\t\t" . "map_" . $sitepart_id . ".fitBounds(bounds);\n";
|
||||
}
|
||||
|
||||
//Schließt Funktionsdefinition. Generiert Listener zum Aufrufen der Initialisierungsfunktion
|
||||
$mapcode .= "} \n google.maps.event.addDomListener(window, 'load', initialize_map_" . $sitepart_id . ");";
|
||||
|
||||
$mapcode .= "</script>";
|
||||
|
||||
echo $mapcode;
|
||||
?>
|
||||
|
||||
<!--<div class="google_maps" class="sitepart_<?= $sitepart_id ?>">-->
|
||||
<div class="googlemaps_content" id="map_canvas_<?= $sitepart_id ?>"
|
||||
style="width: <?= $width ?>px; height: <?= $height ?>px; color: #000000;"></div>
|
||||
<!--</div>-->
|
||||
|
||||
Reference in New Issue
Block a user