From bacc48a2eff3675a988623d01fc8b4a4c97f1371 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 12 Feb 2015 12:16:46 -0500 Subject: [PATCH] Update for sitemap styles set width and center --- Toolkit/Template/Page/BodyFactory.php | 228 +++++++++++++------------- css/siteMap.css | 80 ++++----- templates/siteMap.html | 3 - 3 files changed, 157 insertions(+), 154 deletions(-) diff --git a/Toolkit/Template/Page/BodyFactory.php b/Toolkit/Template/Page/BodyFactory.php index f08ccc1..d654167 100644 --- a/Toolkit/Template/Page/BodyFactory.php +++ b/Toolkit/Template/Page/BodyFactory.php @@ -28,7 +28,7 @@ */ class Toolkit_Template_Page_BodyFactory { - // {{{ properties + // {{{ properties /** * description of $_breadCrumbsFactory @@ -36,7 +36,7 @@ class Toolkit_Template_Page_BodyFactory * @var string * @access private */ - private $_breadCrumbsFactory; + private $_breadCrumbsFactory; /** * description of $_pageGateway @@ -44,7 +44,7 @@ class Toolkit_Template_Page_BodyFactory * @var string * @access private */ - private $_pageGateway; + private $_pageGateway; /** * description of $_paragraphGateway @@ -52,7 +52,7 @@ class Toolkit_Template_Page_BodyFactory * @var string * @access private */ - private $_paragraphGateway; + private $_paragraphGateway; /** * description of $_cache @@ -60,7 +60,7 @@ class Toolkit_Template_Page_BodyFactory * @var string * @access private */ - private $_cache; + private $_cache; /** * description of $_keywordReplacement @@ -68,10 +68,10 @@ class Toolkit_Template_Page_BodyFactory * @var string * @access private */ - private $_keywordReplacement; + private $_keywordReplacement; - // }}} - // {{{ __construct() + // }}} + // {{{ __construct() /** * Class constructor @@ -84,23 +84,23 @@ class Toolkit_Template_Page_BodyFactory * * @access public */ - public function __construct( - Toolkit_BreadCrumbsFactory $breadCrumbsFactory, - Toolkit_Toolbox_PageGatewayAbstract $pageGateway, - Toolkit_Toolbox_ParagraphGatewayAbstract $paragraphGateway, - Toolkit_Template_KeywordReplacement $keywordReplacement, + public function __construct( + Toolkit_BreadCrumbsFactory $breadCrumbsFactory, + Toolkit_Toolbox_PageGatewayAbstract $pageGateway, + Toolkit_Toolbox_ParagraphGatewayAbstract $paragraphGateway, + Toolkit_Template_KeywordReplacement $keywordReplacement, Cache_Lite $cache - ) { - $this->_breadCrumbsFactory = $breadCrumbsFactory; - $this->_pageGateway = $pageGateway; - $this->_paragraphGateway = $paragraphGateway; - $this->_keywordReplacement = $keywordReplacement; - $this->_cache = $cache; + ) { + $this->_breadCrumbsFactory = $breadCrumbsFactory; + $this->_pageGateway = $pageGateway; + $this->_paragraphGateway = $paragraphGateway; + $this->_keywordReplacement = $keywordReplacement; + $this->_cache = $cache; - } + } - // }}} - // {{{ getPageBodyBuilder() + // }}} + // {{{ getPageBodyBuilder() /** * description of getPageBodyBuilder @@ -112,101 +112,101 @@ class Toolkit_Template_Page_BodyFactory * |\Toolkit_Template_Page_Member|\Toolkit_Template_Page_Toolbox * @access public */ - public function getPageBodyBuilder($id) - { - $page = $this->_pageGateway->find($id); - - $forgotPassword = (isset($_GET['forgot']) && $_GET['forgot'] == 1); - $siteMap = (isset($_GET['sitemap']) && $_GET['sitemap'] == 1); - $memberDbSiteMap = ( isset($_GET['memberDbSiteMap']) - && $_GET['memberDbSiteMap'] == 1); - $pageDoesNotExist = ($page === false); - $pageIsTurnedOff = ( is_array($page) - && !$page['active'] - && !strstr($_SERVER['HTTP_REFERER'], 'admin/') + public function getPageBodyBuilder($id) + { + $page = $this->_pageGateway->find($id); + + $forgotPassword = (isset($_GET['forgot']) && $_GET['forgot'] == 1); + $siteMap = (isset($_GET['sitemap']) && $_GET['sitemap'] == 1); + $memberDbSiteMap = ( isset($_GET['memberDbSiteMap']) + && $_GET['memberDbSiteMap'] == 1); + $pageDoesNotExist = ($page === false); + $pageIsTurnedOff = ( is_array($page) + && !$page['active'] + && !strstr($_SERVER['HTTP_REFERER'], 'admin/') && !$_REQUEST['preview']); - $googleSearch = ( defined('GOOGLE_SEARCH') - && GOOGLE_SEARCH - && isset($_GET['query']) - && !empty($_GET['query'])); - $glmSearch = ( defined('GLM_SEARCH') - && GLM_SEARCH - && isset($_REQUEST['GLMSearch']) - && $_REQUEST['GLMSearch'] == 'true'); - $memberPage = ( defined('MEMBERS_DB') - && MEMBERS_DB + $googleSearch = ( defined('GOOGLE_SEARCH') + && GOOGLE_SEARCH + && isset($_GET['query']) + && !empty($_GET['query'])); + $glmSearch = ( defined('GLM_SEARCH') + && GLM_SEARCH + && isset($_REQUEST['GLMSearch']) + && $_REQUEST['GLMSearch'] == 'true'); + $memberPage = ( defined('MEMBERS_DB') + && MEMBERS_DB && $page['include_members']); - if ($forgotPassword) { - die('Toolkit_Template_Page_BodyFactory::getPageBodyBuilder'); - } elseif ($memberDbSiteMap) { - return new Toolkit_Members_SiteMapPage( - Toolkit_Database::getInstance(), + if ($forgotPassword) { + die('Toolkit_Template_Page_BodyFactory::getPageBodyBuilder'); + } elseif ($memberDbSiteMap) { + return new Toolkit_Members_SiteMapPage( + Toolkit_Database::getInstance(), $this->_pageGateway - ); - } elseif ($siteMap) { - return new Toolkit_Template_Page_SiteMap( - Toolkit_Database::getInstance(), + ); + } elseif ($siteMap) { + return new Toolkit_Template_Page_SiteMap( + Toolkit_Database::getInstance(), $this->_pageGateway - ); - } elseif ($pageDoesNotExist) { - // page does not exist - // give 301 redirect and go back to index page - header($_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently'); - header('Location: ' . BASE_URL . 'index.php'); - exit(); - } elseif ($pageIsTurnedOff) { - // page exists, but is turned off - // give 404 redirect and go back to index page - header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); - return new Toolkit_Template_Page_Bad(); - } elseif ($googleSearch) { - return new Toolkit_Template_Page_GoogleSearch(); - } elseif ($glmSearch) { - return new Toolkit_Template_Page_GLMSearch(); - } elseif ($memberPage) { - $conf = new Config; - $root =& $conf->parseConfig( - BASE . 'Toolkit/Members/config.ini', - 'IniFile' - ); - - $imageAdapter = new Toolkit_FileServer_ImageAdapter(); - - return new Toolkit_Template_Page_Member( - $id, - new Toolkit_Template_Image_Factory($imageAdapter), - $this->_breadCrumbsFactory, - $this->_pageGateway, - $this->_paragraphGateway, - $this->_keywordReplacement, - $this->_cache, - $root - ); - } else { // regular toolbox page - $imageAdapter = new Toolkit_FileServer_ImageAdapter(); - - $photoGallery = null; - if (defined('PHOTO_GALLERY') && PHOTO_GALLERY) { - $dbh = Toolkit_Database::getInstance(); - $photoGallery = new Toolkit_Photos_Gallery( - $dbh, - new Toolkit_Photos_Display($dbh) - ); - } - - return new Toolkit_Template_Page_Toolbox( - $id, - new Toolkit_Template_Image_Factory($imageAdapter), - $this->_breadCrumbsFactory, - $this->_pageGateway, - $this->_paragraphGateway, - $this->_keywordReplacement, - $this->_cache, - $photoGallery - ); - } - } - - // }}} + ); + } elseif ($pageDoesNotExist) { + // page does not exist + // give 301 redirect and go back to index page + header($_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently'); + header('Location: ' . BASE_URL . 'index.php'); + exit(); + } elseif ($pageIsTurnedOff) { + // page exists, but is turned off + // give 404 redirect and go back to index page + header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); + return new Toolkit_Template_Page_Bad(); + } elseif ($googleSearch) { + return new Toolkit_Template_Page_GoogleSearch(); + } elseif ($glmSearch) { + return new Toolkit_Template_Page_GLMSearch(); + } elseif ($memberPage) { + $conf = new Config; + $root =& $conf->parseConfig( + BASE . 'Toolkit/Members/config.ini', + 'IniFile' + ); + + $imageAdapter = new Toolkit_FileServer_ImageAdapter(); + + return new Toolkit_Template_Page_Member( + $id, + new Toolkit_Template_Image_Factory($imageAdapter), + $this->_breadCrumbsFactory, + $this->_pageGateway, + $this->_paragraphGateway, + $this->_keywordReplacement, + $this->_cache, + $root + ); + } else { // regular toolbox page + $imageAdapter = new Toolkit_FileServer_ImageAdapter(); + + $photoGallery = null; + if (defined('PHOTO_GALLERY') && PHOTO_GALLERY) { + $dbh = Toolkit_Database::getInstance(); + $photoGallery = new Toolkit_Photos_Gallery( + $dbh, + new Toolkit_Photos_Display($dbh) + ); + } + + return new Toolkit_Template_Page_Toolbox( + $id, + new Toolkit_Template_Image_Factory($imageAdapter), + $this->_breadCrumbsFactory, + $this->_pageGateway, + $this->_paragraphGateway, + $this->_keywordReplacement, + $this->_cache, + $photoGallery + ); + } + } + + // }}} } diff --git a/css/siteMap.css b/css/siteMap.css index 2300043..6cb45c9 100644 --- a/css/siteMap.css +++ b/css/siteMap.css @@ -1,49 +1,55 @@ #sitemap h2 { - font-size: 14px; - font-weight: bold; - margin: 20px 0 5px 0; - padding: 5px; - border-bottom: 1px solid #000; - } + font-size: 14px; + font-weight: bold; + margin: 20px 0 5px 0; + padding: 5px; + border-bottom: 1px solid #000; + } #sitemap h2 a { - color: #000; - } + color: #000; + } #sitemap .row { - clear: both; - overflow: hidden; - } + clear: both; + overflow: hidden; + } .row ol, .row li { - list-style-image: none; - list-style-type: none; - text-transform: capitalize; - font-size: 12px; - font-weight: normal; - margin: 0; - padding: 0; + list-style-image: none; + list-style-type: none; + text-transform: capitalize; + font-size: 12px; + font-weight: normal; + margin: 0; + padding: 0; } #sitemap a { - border-bottom: none; - text-decoration: none; - color: #666; - } + border-bottom: none; + text-decoration: none; + color: #666; + } #sitemap a:hover { - text-decoration: underline; - color: #00F; - } + text-decoration: underline; + color: #00F; + } #sitemap a:active { - text-decoration: underline; - color: #00F; - } + text-decoration: underline; + color: #00F; + } .row > ol { - float: left; - margin-right: 3%; - /* width: 30% */ - } + float: left; + margin-right: 3%; + /* width: 30% */ + } .row > ol > li { - margin: 5px; - font-weight: bold; - } + margin: 5px; + font-weight: bold; + } .row > ol > li > ol > li { - margin: 5px 0 5px 20px; - } \ No newline at end of file + margin: 5px 0 5px 20px; + } +#slideshow_wrapper {display:none;} +#sitemap { + width: 75%; + margin-left: auto; + margin-right: auto; +} diff --git a/templates/siteMap.html b/templates/siteMap.html index f558a73..9e47f14 100644 --- a/templates/siteMap.html +++ b/templates/siteMap.html @@ -1,6 +1,3 @@ -
  1. -- 2.17.1