Author: Lars Michelsen <[email protected]>
Date: Wed Jan 18 20:23:11 2012 +0100
Committer: Lars Michelsen <[email protected]>
Commit-Date: Wed Jan 18 20:23:11 2012 +0100
Made default gadgets aware of OMD default and local path handling
---
ChangeLog | 1 +
share/userfiles/gadgets/std_bar.php | 12 ++++++++++--
share/userfiles/gadgets/std_html_bar.php | 12 ++++++++++--
share/userfiles/gadgets/std_speedometer.php | 12 ++++++++++--
share/userfiles/gadgets/std_speedometer2.php | 12 ++++++++++--
5 files changed, 41 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6772805..8f9e636 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@ Core
* Undefined backend in single objects does not prevent whole map loading
anymore
* Overview page: Better handling of invalid map configuration files
* Multisite auth: Redirecting to login page when auth.secret does not exist
+ * Made default gadgets aware of OMD default and local path handling
Frontend
* Showing dummy shape image when configured shape does not exist
diff --git a/share/userfiles/gadgets/std_bar.php
b/share/userfiles/gadgets/std_bar.php
index fd59e18..9f75b50 100644
--- a/share/userfiles/gadgets/std_bar.php
+++ b/share/userfiles/gadgets/std_bar.php
@@ -76,8 +76,16 @@ $sDummyPerfdata = 'config=20%;80;90;0;100';
*/
$_MODE = 'html';
-// Load gadget core functions
-require('./gadgets_core.php');
+// Include the gadgets core. Also handle OMD default and local paths
+if(substr($_SERVER["SCRIPT_FILENAME"], 0, 4) == '/omd') {
+ $core = dirname($_SERVER["SCRIPT_FILENAME"]) . '/gadgets_core.php';
+ if(file_exists($core))
+ require($core);
+ else
+ require(str_replace('local/share/', 'share/', $core));
+} else {
+ require('./gadgets_core.php');
+}
/*******************************************************************************
* Start gadget main code
diff --git a/share/userfiles/gadgets/std_html_bar.php
b/share/userfiles/gadgets/std_html_bar.php
index 9c6baf1..ba485e1 100644
--- a/share/userfiles/gadgets/std_html_bar.php
+++ b/share/userfiles/gadgets/std_html_bar.php
@@ -53,8 +53,16 @@ $sDummyPerfdata = 'config=20%;80;90;0;100';
*/
$_MODE = 'html';
-// Load gadget core functions
-require('./gadgets_core.php');
+// Include the gadgets core. Also handle OMD default and local paths
+if(substr($_SERVER["SCRIPT_FILENAME"], 0, 4) == '/omd') {
+ $core = dirname($_SERVER["SCRIPT_FILENAME"]) . '/gadgets_core.php';
+ if(file_exists($core))
+ require($core);
+ else
+ require(str_replace('local/share/', 'share/', $core));
+} else {
+ require('./gadgets_core.php');
+}
/*******************************************************************************
* Start gadget main code
diff --git a/share/userfiles/gadgets/std_speedometer.php
b/share/userfiles/gadgets/std_speedometer.php
index 2a6908b..0c42717 100644
--- a/share/userfiles/gadgets/std_speedometer.php
+++ b/share/userfiles/gadgets/std_speedometer.php
@@ -49,8 +49,16 @@ $sDummyPerfdata = 'config=20%;80;90;0;100';
*/
$_MODE = 'img';
-// Load gadget core functions
-require('./gadgets_core.php');
+// Include the gadgets core. Also handle OMD default and local paths
+if(substr($_SERVER["SCRIPT_FILENAME"], 0, 4) == '/omd') {
+ $core = dirname($_SERVER["SCRIPT_FILENAME"]) . '/gadgets_core.php';
+ if(file_exists($core))
+ require($core);
+ else
+ require(str_replace('local/share/', 'share/', $core));
+} else {
+ require('./gadgets_core.php');
+}
/*******************************************************************************
* Start gadget main code
diff --git a/share/userfiles/gadgets/std_speedometer2.php
b/share/userfiles/gadgets/std_speedometer2.php
index 45f20df..0c5dfc9 100644
--- a/share/userfiles/gadgets/std_speedometer2.php
+++ b/share/userfiles/gadgets/std_speedometer2.php
@@ -71,8 +71,16 @@ $sDummyPerfdata = 'config=20%;80;90;0;100';
*/
$_MODE = 'img';
-// Load gadget core functions
-require('./gadgets_core.php');
+// Include the gadgets core. Also handle OMD default and local paths
+if(substr($_SERVER["SCRIPT_FILENAME"], 0, 4) == '/omd') {
+ $core = dirname($_SERVER["SCRIPT_FILENAME"]) . '/gadgets_core.php';
+ if(file_exists($core))
+ require($core);
+ else
+ require(str_replace('local/share/', 'share/', $core));
+} else {
+ require('./gadgets_core.php');
+}
/*******************************************************************************
* Start gadget main code
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins