Commit 51f65079 authored by lphuberdeau's avatar lphuberdeau

[KIL] No longer used

parent a7df7ba2
......@@ -6002,7 +6002,6 @@ templates/tiki-forums_reported.tpl -text
templates/tiki-freetag-translate.tpl -text
templates/tiki-friends.tpl -text
templates/tiki-galleries.tpl -text
templates/tiki-gmap_locator.tpl -text
templates/tiki-gmap_usermap.tpl -text
templates/tiki-graph-sheets.tpl -text
templates/tiki-history_sheets.tpl -text
......@@ -6527,7 +6526,6 @@ tests/testfile.txt -text
/tiki-friends.php -text
/tiki-galleries.php -text
/tiki-galleries_rankings.php -text
/tiki-gmap_locator.php -text
/tiki-gmap_usermap.php -text
/tiki-graph_formula.php -text
/tiki-graph_sheet.php -text
......
{if $prefs.feature_gmap eq 'y'}
{if 0 and $prefs.feature_ajax eq 'y'}{* AJAX_TODO *}
{* Ajax version using new plugin *}
{title help="gmap"}{tr}Google Map Locator{/tr} - {$userwatch}{/title}
<p>{button _script="tiki-user_preferences.php" view_user=$smarty.request.view_user|escape _text="{tr}Back to preferences{/tr}"}</p>
{wikiplugin _name="googlemap" type="locator" setdefaultxyz="y" locateitemtype="user" locateitemid="$userwatch"}{/wikiplugin}
{else}
{* Old non-ajax version which can be removed once Ajax becomes always on (and this has been converted to not use xajax - jb dec 2010 *}
{title help="gmap"}{tr}Google Map Locator{/tr}{/title}
{if $watch}({$watch}){/if}
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key={$prefs.gmap_key}"></script>
<div class="navbar">
{button href="$backurl" _text="$backlink"}
</div>
<form action="tiki-gmap_locator.php{$extraquery}" method="post">
<input type="text" size="60" name="address" value="{tr}enter address{/tr}" />
<input type="button" value="{tr}Find address{/tr}" onclick="showAddress(this.form.address.value)"/><br />
<input type="text" name="point[x]" value="{$pointx}" id="pointx" size="16" />
<input type="text" name="point[y]" value="{$pointy}" id="pointy" size="16" />
<input type="text" name="point[z]" value="{$pointz}" id="pointz" size="2" />
{if $input eq 'y'}
{if $watch}<input type="hidden" name="view_user" value="{$watch|escape}" />{/if}
{if $itemId}<input type="hidden" name="itemId" value="{$itemId}" />{/if}
{if $fieldId}<input type="hidden" name="fieldId" value="{$fieldId}" />{/if}
{if $fromPage}<input type="hidden" name="fromPage" value="{$fromPage}" />{/if}
<input type="submit" name="act" value="{tr}Save clicked point{/tr}" /><br /><br />
<input type="submit" name="reset_default" value="{tr}Reset view to default{/tr}" />
<input type="submit" name="set_default" value="{tr}Save current view as default{/tr}" />
<input type="submit" name="recenter" value="{tr}Center map to saved point{/tr}" />
{/if}
<input type="hidden" name="default[x]" value="{$pointx}" id="defx" />
<input type="hidden" name="default[y]" value="{$pointy}" id="defy" />
<input type="hidden" name="default[z]" value="{$pointz}" id="defz" />
<input type="submit" name="reset_site_default" value="{tr}Reset view to site default{/tr}" />
<input type="hidden" name="for" value="{$for|escape}" />
</form>
{if $pointx eq ''}
{assign var=pointx value=$prefs.gmap_defaultx}
{assign var=pointy value=$prefs.gmap_defaulty}
{assign var=pointz value=$prefs.gmap_defaultz}
{/if}
<div id="map" style="width: 500px; height: 400px;border: 1px solid #000;"></div>
{jq notonready=true}
var map = null;
var geocoder = null;
function load() {literal}{{/literal}
map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.addControl(new GScaleControl());
map.setCenter(new GLatLng({$pointy}, {$pointx}), {$pointz});
geocoder = new GClientGeocoder();
{if $input eq 'y'}
{if $pointx and $pointy}
map.addOverlay(new GMarker(new GLatLng({$pointy},{$pointx})));
{/if}
GEvent.addListener(map, "click", function(marker, point) {literal}{{/literal}
if (marker) {literal}{{/literal}
map.removeOverlay(marker);
{literal}} else {{/literal}
document.getElementById('pointx').value = point.x;
document.getElementById('pointy').value = point.y;
map.clearOverlays();
map.addOverlay(new GMarker(point));
{literal}}{/literal}
{literal}});{/literal}
{/if}
GEvent.addListener(map, "zoomend", function(gold, gnew) {literal}{{/literal}
document.getElementById('defz').value = gnew;
document.getElementById('pointz').value = gnew;
{literal}});{/literal}
GEvent.addListener(map, "moveend", function() {literal}{{/literal}
document.getElementById('defx').value = map.getCenter().x;
document.getElementById('defy').value = map.getCenter().y;
{literal}});{/literal}
{literal}}{/literal}
//load();
function showAddress(address) {literal}{{/literal}
if (geocoder) {literal}{{/literal}
geocoder.getLatLng(
address,
function(point) {literal}{{/literal}
if (!point) {literal}{{/literal}
alert(address + " not found!");
{literal}} else {{/literal}
map.setCenter(point,14);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(address);
{literal}}{/literal}
{literal}}{/literal}
);
{literal}}{/literal}
{literal}}{/literal}
{literal}$("input[name=address]").focus(function () { if ($(this).val() == "{/literal}{tr}enter address{/tr}{literal}") {$(this).val("");}}){/literal}
window.onload=load;
{/jq}
{/if} {*end if ajax *}
{else}
Google Maps is not enabled.
{/if}
\ No newline at end of file
<?php
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
include 'tiki-setup.php';
include_once ('lib/trackers/trackerlib.php');
$access->check_feature('feature_gmap');
$auto_query_args = array('for', 'itemId', 'fieldId', 'trackerId', 'view_user', 'fromPage');
if ($tiki_p_admin == 'y' and isset($_REQUEST['view_user']) and $userlib->user_exists($_REQUEST['view_user'])) {
$userwatch = $_REQUEST['view_user'];
$smarty->assign('watch', $userwatch);
} else {
$userwatch = $user;
}
if ($prefs["feature_ajax"] == 'y') {
// Ajax version using new plugin
$smarty->assign('userwatch', $userwatch);
} else {
// Old non-ajax version which can be removed once Ajax becomes always on
if (!isset($_REQUEST['for']))
$_REQUEST['for'] = '';
if (isset($_REQUEST['set_default']) && ($user == $userwatch || $tiki_p_admin =='y')) {
$pointx = $_REQUEST['point']['x'];
$pointy = $_REQUEST['point']['y'];
$pointz = $_REQUEST['point']['z'];
$tikilib->set_user_preference($userwatch, 'gmap_defx', $pointx);
$tikilib->set_user_preference($userwatch, 'gmap_defy', $pointy);
$tikilib->set_user_preference($userwatch, 'gmap_defz', $pointz);
$smarty->assign('extraquery', '?for=user');
$smarty->assign('backurl', 'tiki-user_preferences.php?view_user=' . $userwatch);
$smarty->assign('backlink', tra('Back to preferences'));
} elseif (isset($_REQUEST['reset_default'])) {
$pointx = $tikilib->get_user_preference($userwatch, 'gmap_defx', $prefs['gmap_defaultx']);
$pointy = $tikilib->get_user_preference($userwatch, 'gmap_defy', $prefs['gmap_defaulty']);
$pointz = $tikilib->get_user_preference($userwatch, 'gmap_defz', $prefs['gmap_defaultz']);
} elseif (isset($_REQUEST['reset_site_default'])) {
$pointx = $prefs['gmap_defaultx'];
$pointy = $prefs['gmap_defaulty'];
$pointz = $prefs['gmap_defaultz'];
} elseif (isset($_REQUEST['center'])) {
$pointx = $_REQUEST['point']['x'];
$pointy = $_REQUEST['point']['y'];
$pointz = $_REQUEST['point']['z'];
} elseif (isset($_REQUEST['for']) && $_REQUEST['for'] == 'user') {
if (isset($_REQUEST['point']) and is_array($_REQUEST['point']) && ($user == $userwatch || $tiki_p_admin =='y')) {
$p = $_REQUEST['point'];
if ($p['x'] > -180 and $p['x'] < 180) {
$tikilib->set_user_preference($userwatch, 'lon', $p['x']);
}
if ($p['y'] > -180 and $p['y'] < 180) {
$tikilib->set_user_preference($userwatch, 'lat', $p['y']);
}
if ($p['z'] >= 0 and $p['z'] < 20) {
$tikilib->set_user_preference($userwatch, 'zoom', $p['z']);
}
}
$pointx = $tikilib->get_user_preference($userwatch, 'lon', '');
$pointy = $tikilib->get_user_preference($userwatch, 'lat', '');
$pointz = $tikilib->get_user_preference($userwatch, 'zoom', $prefs['gmap_defaultz']);
$smarty->assign('extraquery', '?for=user');
$smarty->assign('backurl', 'tiki-user_preferences.php?view_user=' . $userwatch);
$smarty->assign('backlink', tra('Back to preferences'));
} elseif (isset($_REQUEST['for']) && $_REQUEST['for'] == 'item' && !empty($_REQUEST['itemId'])) {
if (!empty($_REQUEST['fieldId']) && !empty($_REQUEST['trackerId'])) {
if (isset($_REQUEST['point']) and is_array($_REQUEST['point'])) {
$tikilib->get_perm_object($_REQUEST['trackerId'], 'tracker');
if ($tiki_p_modify_tracker_items == 'y') {
$p = $_REQUEST['point'];
if ( ($p['x'] > -180 and $p['x'] < 180) && ($p['y'] > -180 and $p['y'] < 180) && ($p['z'] >= 0 and $p['z'] < 20)) {
$G_query="UPDATE `tiki_tracker_item_fields` SET `value`=? WHERE `itemId`=? AND `fieldId`=?";
$trklib->query($G_query, array($p['x'].','.$p['y'].','.$p['z'], (int)$_REQUEST['itemId'], (int)$_REQUEST['fieldId']));
}
}
}
$xyz = explode(',', $trklib->get_item_value($_REQUEST['trackerId'], $_REQUEST['itemId'], $_REQUEST['fieldId']));
$pointx = $xyz['0'];
$pointy = $xyz['1'];
$pointz = $xyz['2'];
$smarty->assign('extraquery', '?for=item&amp;itemId='.$_REQUEST['itemId'].'&amp;trackerId='.$_REQUEST['trackerId'].'&amp;fieldId='.$_REQUEST['fieldId']);
global $wikilib; include_once( 'lib/wiki/wikilib.php');
if (!empty($_REQUEST['fromPage'])) {
$smarty->assign('backurl', $wikilib->sefurl($_REQUEST['fromPage'], true) . 'itemId='.$_REQUEST['itemId'].'&amp;trackerId='.$_REQUEST['trackerId']);
$smarty->assign('fromPage', $_REQUEST['fromPage']);
} else {
$smarty->assign('backurl', 'tiki-view_tracker_item.php?itemId='.$_REQUEST['itemId'].'&amp;trackerId='.$_REQUEST['trackerId']);
}
$smarty->assign('backlink', tra('Back to item'));
}
} elseif (isset($_REQUEST['for']) && $_REQUEST['for'] == 'item' && empty($_REQUEST['itemId']) && !empty($_REQUEST['fieldId']) && !empty($_REQUEST['trackerId'])) {
$smarty->assign('extraquery', '?for=item&amp;itemId='.$_REQUEST['itemId'].'&amp;trackerId='.$_REQUEST['trackerId'].'&amp;fieldId='.$_REQUEST['fieldId']);
$smarty->assign('backurl', 'tiki-view_tracker_item.php?itemId='.$_REQUEST['itemId'].'&amp;trackerId='.$_REQUEST['trackerId']);
$smarty->assign('backlink', tra('Back to item'));
}
if (!isset($pointx)) {
$pointx = isset($prefs['gmap_defx'])? $prefs['gmap_defx']: $prefs['gmap_defaultx'];
$pointy = isset($prefs['gmap_defy'])? $prefs['gmap_defy']: $prefs['gmap_defaulty'];
$pointz = isset($prefs['gmap_defz'])? $prefs['gmap_defz']: $prefs['gmap_defaultz'];
}
if (!isset($pointz)) {
$pointz = 11;
} // trackers cope with only x & y
$smarty->assign_by_ref('pointx', $pointx);
$smarty->assign_by_ref('pointy', $pointy);
$smarty->assign_by_ref('pointz', $pointz);
if (($_REQUEST['for'] == 'user' && ($user == $userwatch || $tiki_p_admin == 'y')) || ($_REQUEST['for'] == 'item' && ($tiki_p_admin_trackers == 'y' || ($tiki_modify_tracker_items == 'y') && !empty($_REQUEST['itemId'])))) {
$smarty->assign('input', 'y');
}
$smarty->assign('for', $_REQUEST['for']);
} //end if feature_ajax
$smarty->assign('mid', 'tiki-gmap_locator.tpl');
$smarty->display('tiki.tpl');
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment