From 20b3d9662ea1e2807cc3f68e213bdcc7e54d497d Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 25 Sep 2014 14:53:02 -0400 Subject: [PATCH] Change the page 81 to be page 16 --- Toolkit/Template/Page.php | 80 ++++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 38 deletions(-) diff --git a/Toolkit/Template/Page.php b/Toolkit/Template/Page.php index 4f1870d..fded2a7 100644 --- a/Toolkit/Template/Page.php +++ b/Toolkit/Template/Page.php @@ -28,7 +28,7 @@ */ class Toolkit_Template_Page { - // {{{ __construct() + // {{{ __construct() /** * Class constructor @@ -40,9 +40,9 @@ class Toolkit_Template_Page } - // }}} + // }}} - // {{{ getSeoUrl() + // {{{ getSeoUrl() /** * Description for getSeoUrl @@ -54,48 +54,52 @@ class Toolkit_Template_Page * @access public */ - + public static function getSeoUrl( - Toolkit_Toolbox_GatewayAbstract $gateway, - $id - ) { - if (!ctype_digit((string)$id)) { - return false; - } - - if ($id == HOME_ID) { - return ($_ENV['GLM_HOST_ID'] != 'PRODUCTION') + Toolkit_Toolbox_GatewayAbstract $gateway, + $id + ) { + if (!ctype_digit((string)$id)) { + return false; + } + + if ($id == 81) { + $id = 16; + } + + if ($id == HOME_ID) { + return ($_ENV['GLM_HOST_ID'] != 'PRODUCTION') ? BASE_URL . 'index.php' : BASE_URL; - } + } - $page = $gateway->findNavItem($id); + $page = $gateway->findNavItem($id); $shortUrlsOn = (SHORT_URLS) ? true : false; - if (empty($page['short_url']) || !$shortUrlsOn) { - $name = str_replace(' ', '-', $page['navigation_name']); - $pattern = '/[\/#&?\'"]|amp;/'; - $name = preg_replace( - $pattern, - '', - strip_tags(strtolower(trim($name))) - ); - $baseUrl + if (empty($page['short_url']) || !$shortUrlsOn) { + $name = str_replace(' ', '-', $page['navigation_name']); + $pattern = '/[\/#&?\'"]|amp;/'; + $name = preg_replace( + $pattern, + '', + strip_tags(strtolower(trim($name))) + ); + $baseUrl = in_array($id, unserialize(SECURE_PAGES)) ? BASE_SECURE_URL : BASE_URL; - return $baseUrl . htmlspecialchars($name) . "-$id/"; - } else { - return BASE_URL . "{$page['short_url']}/"; - } - } + return $baseUrl . htmlspecialchars($name) . "-$id/"; + } else { + return BASE_URL . "{$page['short_url']}/"; + } + } - // }}} + // }}} - // {{{ getBody() + // {{{ getBody() /** * Get body @@ -107,14 +111,14 @@ class Toolkit_Template_Page * @access public */ public function getBody( - $id, - Toolkit_Template_Page_BodyFactory $bodyFactory - ) { - $body = $bodyFactory->getPageBodyBuilder($id); - return $body->getContent($id); + $id, + Toolkit_Template_Page_BodyFactory $bodyFactory + ) { + $body = $bodyFactory->getPageBodyBuilder($id); + return $body->getContent($id); } - // }}} + // }}} /** * is member only @@ -126,7 +130,7 @@ class Toolkit_Template_Page * @access public */ public static function isMemberOnly(/*{{{*/ - Toolkit_Toolbox_GatewayAbstract $gateway, + Toolkit_Toolbox_GatewayAbstract $gateway, $id ) { $page = $gateway->find($id); -- 2.17.1