summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFranco Nogarin2013-07-09 06:10:08 (GMT)
committer Franco Nogarin2013-07-09 06:10:08 (GMT)
commita8f961f10333b63d1d79e6bb758ad96310e320e1 (patch)
tree6c06e180202d3c9c88fe4270ffcea699e02a55be
parente97f1e093c7cfb2fee5c3d178835bc82838cba5f (diff)
add drupal bootstrap
-rw-r--r--sparcsmap/js/evolution.js.php26
-rw-r--r--sparcsmap/sparcsmap.demo.inc3
2 files changed, 27 insertions, 2 deletions
diff --git a/sparcsmap/js/evolution.js.php b/sparcsmap/js/evolution.js.php
index 8a911a2..8af5915 100644
--- a/sparcsmap/js/evolution.js.php
+++ b/sparcsmap/js/evolution.js.php
@@ -1,4 +1,28 @@
-<?php
+<?PHP
+ // to read this document, colorize as PHP to read PHP scope and as javascript to read javascript scope.
+ // make the var layer or return none if user should have no access to vars
+
+ // we are in the PHP scope
+ // ok we check if we have a valid userid from sparcs passed on the URL line
+ if($_GET["uid"] === "") {
+ // uid is empty
+ }
+ else {
+
+ $sparcsid = $_GET["uid"];
+ $sparcsname = $_GET["un"];
+ $path = $_GET["p"];
+ }
+
+ // Get the base path
+ define('DRUPAL_ROOT', $path);
+
+ //Include the bootstrap file for using the DRUPLA function in our file
+ require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
+ drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+
+ chdir('../');
+ global $user;
$geoserver_url = variable_get('sparcsmap_geoserver_url', 'error');
$output = '
diff --git a/sparcsmap/sparcsmap.demo.inc b/sparcsmap/sparcsmap.demo.inc
index fc8d401..41cdf03 100644
--- a/sparcsmap/sparcsmap.demo.inc
+++ b/sparcsmap/sparcsmap.demo.inc
@@ -1,6 +1,7 @@
<?php
$geoext_path = libraries_get_path("GeoExt");
$logo_path = drupal_get_path('module', 'sparcsmap') ."/images/sparcs-logo-overlay.png";
+
$output = '
<html>
<head>
@@ -15,7 +16,7 @@
<script src="' . $geoext_path. '/lib/GeoExt.js" type="text/javascript"></script>
<script type="text/javascript" src="' . drupal_get_path('module', 'sparcsmap') . '/js/evolution.js.php"></script>
-
+ <script type="application/x-javascript" src="' . drupal_get_path('module', 'sparcsmap') . '/js/sparcsmap.js.php?uid='.$user->uid.'&un='.$user->name.'&p=' . getcwd(). ' "></script>
</head>
<body>
<h1>Tree using a GeoExt.tree.WMSCapabilitiesLoader</h1>