Changeset:
        3b3f5a78b68b
        
https://sourceforge.net/p/mrbs/hg-code/ci/3b3f5a78b68b1f315146e42ac8707d4a6d594e9d
Author:
        Campbell Morrison <[email protected]>
Date:
        Wed Oct 05 08:11:25 2016 +0100
Log message:

Fixed problem with page specific JavaScript not being loaded

diffstat:

 web/functions.inc |  7 ++++---
 web/js.inc        |  4 +++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r aa0a86b1b546 -r 3b3f5a78b68b web/functions.inc
--- a/web/functions.inc Tue Oct 04 23:32:09 2016 +0100
+++ b/web/functions.inc Wed Oct 05 08:11:25 2016 +0100
@@ -78,14 +78,15 @@
 }
 
 
-// Returns the current page.    Separated out into a function to make it easier
+// Returns the current page.   If the page ends in suffix this will be cut off.
+// Separated out into a function to make it easier
 // to change for different situations.   We use basename() because the full 
name
 // causes problems when reverse proxies are being used.
-function this_page()
+function this_page($suffix=null)
 {
   global $PHP_SELF;
   
-  return basename($PHP_SELF);
+  return basename($PHP_SELF, $suffix);
 }
 
 
diff -r aa0a86b1b546 -r 3b3f5a78b68b web/js.inc
--- a/web/js.inc        Tue Oct 04 23:32:09 2016 +0100
+++ b/web/js.inc        Wed Oct 05 08:11:25 2016 +0100
@@ -1,7 +1,9 @@
 <?php 
 namespace MRBS;
 
-global $day, $month, $year, $room, $area, $page;
+global $day, $month, $year, $room, $area;
+
+$page = this_page('.php');
 
 // $Id$
 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to