67 lines
1.6 KiB
PHP
Executable File
67 lines
1.6 KiB
PHP
Executable File
<?php
|
|
|
|
/* Requests Handler */
|
|
|
|
//Start buffering
|
|
ob_start();
|
|
require_once '../objects/class_management.php';
|
|
$oClassManagement = new ClassManagement('spot');
|
|
ToolBox::cleanPost($_POST);
|
|
ToolBox::cleanPost($_GET);
|
|
ToolBox::cleanPost($_REQUEST);
|
|
ToolBox::fixGlobalVars(isset($argv)?$argv:array());
|
|
|
|
//Available variables
|
|
$sAction = isset($_REQUEST['a'])?$_REQUEST['a']:'';
|
|
$sPage = isset($_GET['p'])?$_GET['p']:'index';
|
|
$sName = isset($_GET['name'])?$_GET['name']:'';
|
|
$sContent = isset($_GET['content'])?$_GET['content']:'';
|
|
$iChunk = isset($_GET['chunk'])?$_GET['chunk']:0;
|
|
$sId = isset($_REQUEST['id'])?$_REQUEST['id']:'';
|
|
$iProjectId = isset($_REQUEST['project_id'])?$_REQUEST['project_id']:'';
|
|
$iX = isset($_GET['x'])?$_GET['x']:0;
|
|
$iY = isset($_GET['y'])?$_GET['y']:0;
|
|
$iZ = isset($_GET['z'])?$_GET['z']:0;
|
|
|
|
//Initiate class
|
|
$oSpot = new Spot($oClassManagement, __FILE__);
|
|
$oSpot->setProjectId($iProjectId);
|
|
|
|
$sResult = '';
|
|
if($sAction!='')
|
|
{
|
|
switch($sAction)
|
|
{
|
|
case 'markers':
|
|
$sResult = $oSpot->getMarkers();
|
|
break;
|
|
case 'feed':
|
|
$sResult = $oSpot->getNewsFeed($iChunk);
|
|
break;
|
|
case 'upload':
|
|
$sResult = $oSpot->upload();
|
|
break;
|
|
case 'add_post':
|
|
$sResult = $oSpot->addPost($sName, $sContent);
|
|
break;
|
|
case 'tile':
|
|
$sResult = $oSpot->getTile($sId, $iX, $iY, $iZ);
|
|
break;
|
|
/*case 'sql':
|
|
$sResult = $oSpot->getDbBuildScript();
|
|
break;*/
|
|
case 'sync_pics':
|
|
$sResult = $oSpot->syncPics();
|
|
break;
|
|
default:
|
|
$sResult = Spot::getJsonResult(false, Spot::NOT_FOUND);
|
|
}
|
|
}
|
|
else $sResult = $oSpot->getMainPage();
|
|
|
|
$sDebug = ob_get_clean();
|
|
if(Settings::DEBUG && $sDebug!='') $oSpot->addUncaughtError($sDebug);
|
|
|
|
echo $sResult;
|
|
|
|
?>
|