From aee6832374978cb65bcce7b08809ebcf71cf721a Mon Sep 17 00:00:00 2001 From: abijah Date: Fri, 28 Aug 2009 21:22:50 +0000 Subject: [PATCH] Fixed the sandbox/unsandbox URLs. I'd like to make this a route... I'll look into it. git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@814 97e9348a-65ac-dc4b-aefc-98561f571b83 --- site/app_controller.php | 9 +++++++-- site/views/layouts/default.ctp | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/site/app_controller.php b/site/app_controller.php index f4cbf70..f5428ab 100644 --- a/site/app_controller.php +++ b/site/app_controller.php @@ -196,13 +196,18 @@ class AppController extends Controller { $this->addSideMenuLink('Deposits', array('controller' => 'transactions', 'action' => 'deposit'), null, 'SITE'); + if (sandbox()) $this->addSideMenuLink('Leave Sandbox', - preg_replace("%^/([^/]+)\.sand%", "/$1", $_SERVER['REQUEST_URI']), null, + ('http://' . $_SERVER['SERVER_NAME'] . + preg_replace("%^/([^/]+)\.sand%", "/$1", $_SERVER['REQUEST_URI'])), + null, 'SITE'); else $this->addSideMenuLink('Sandbox', - preg_replace("%^/([^/]+)%", "/$1.sand", $_SERVER['REQUEST_URI']), null, + ('http://' . $_SERVER['SERVER_NAME'] . + preg_replace("%^/([^/]+)%", "/$1.sand", $_SERVER['REQUEST_URI'])), + null, 'SITE'); diff --git a/site/views/layouts/default.ctp b/site/views/layouts/default.ctp index e89827b..c123318 100644 --- a/site/views/layouts/default.ctp +++ b/site/views/layouts/default.ctp @@ -34,7 +34,9 @@ charset(); ?> + <?php if (sandbox()) echo "*SANDBOX* "; ?> Property Manager: <?php echo $title_for_layout; ?> + <?php if (sandbox()) echo " *SANDBOX*"; ?>