$GLOBALS['topScripts'][] = JQUERY_CDN_JS;
}
+ /**
+ * Returns the Seasons Object Reference for the current season
+ *
+ * @return Toolkit_Seasonator_Seasons
+ */
+ private function _getSeasonImages()
+ {
+ $cache = new Cache_Lite($GLOBALS['cacheOptions']);
+ if ($seasons = $cache->get('Images', 'Season')) {
+ return unserialize($seasons);
+ } else {
+ $dbh = Toolkit_Database::getInstance();
+ // get the current season
+ $seasonMapper = new Toolkit_Seasonator_Season();
+ $season = $seasonMapper->fetchById($dbh, 1);
+ $seasonsMapper = new Toolkit_Seasonator_Seasons();
+ $seasons = $seasonsMapper->fetchBySeason($dbh, $season->getName());
+ $cache->save(serialize($seasons), 'Images', 'Season');
+ return $seasons;
+ }
+ }
+
private function _video()
{
//$GLOBALS['styleSheets'][]
}
$this->pageTitle = $this->_getPageTitle($this->_catid);
+// if (defined('MAIN_LEVEL_NAV_ARRAY') && MAIN_LEVEL_NAV_ARRAY) {
+// $mainNavArray = unserialize(MAIN_LEVEL_NAV_ARRAY);
+// }
$bodyFactory = new Toolkit_Template_Page_BodyFactory(
$this->_breadCrumbs,
$this->_pageGateway,
private function _getMainNavigation()
{
+ static $seasonImages;
if (defined('MAIN_LEVEL_NAV_ARRAY') && MAIN_LEVEL_NAV_ARRAY) {
$mainNavArray = unserialize(MAIN_LEVEL_NAV_ARRAY);
}
+ if (!$seasonImages) {
+ $seasonImages = $this->_getSeasonImages();
+ }
$sideNav = new Toolkit_Template_Navigation_AllInOneSideNav(
$this->_pageGateway
);
if ($key !== false) {
$item['class'] = $key;
}
+ switch ($key) {
+ case 'activities':
+ $newStyle = $seasonImages->getImage1();
+ break;
+ case 'attractions':
+ $newStyle = $seasonImages->getImage2();
+ break;
+ case 'lodging':
+ $newStyle =$seasonImages->getImage3();
+ break;
+ case 'restaurants':
+ $newStyle =$seasonImages->getImage4();
+ break;
+ case 'shopping':
+ $newStyle =$seasonImages->getImage5();
+ break;
+ }
+ if ($newStyle) {
+ $item['background-image'] = MAIN_NAV_IMAGE . $newStyle;
+ }
$newNav[] = $item;
}
}
return ($html) ? $html : '';
}
- private function _arrayToListHTML($array, $level = 0, $className = null, $mobile = false)
- {
+ /**
+ * Generate html code from a nav array.
+ *
+ * @staticvar string $tab Tab character
+ * @staticvar string $format Format of the anchor tag
+ *
+ * @param array $array Array used for html
+ * @param int $level What level in nav
+ * @param string $className Class name
+ * @param bool $mobile Is mobile nav?
+ *
+ * @return string
+ */
+ private function _arrayToListHTML(
+ $array,
+ $level = 0,
+ $className = null,
+ $mobile = false,
+ $backgroundImage = null
+ ) {
static $tab = "\t", $format = '<a href="%s"%s>%s</a>';
if (empty($array)) {
? ' class="'.$className.'"'
: ' class="dropdown"';
}
-
- $result = "{$tabs}<ul{$mainClass}>\n";
+ $styleCode = ($backgroundImage)
+ ? 'style="background-image: url('.$backgroundImage.');"'
+ : '';
+ $result = "{$tabs}<ul{$mainClass}{$styleCode}>\n";
foreach ($array as $i => $node) {
$classes = array();
if ($mobile && $node['class']) {
}
}
-
if (!empty($node['pages'])) {
$classes[] = 'has-dropdown';
}
if (!empty($node['pages'])) {
$result .= '<a class="toggle"></a>';
}
-
- $result .= $this->_arrayToListHTML($node['pages'], $level + 1, '', true);
+ $result .= $this->_arrayToListHTML(
+ $node['pages'], $level + 1, '', true
+ );
} else {
- $result .= $this->_arrayToListHTML($node['pages'], $level + 1);
+ $result .= $this->_arrayToListHTML(
+ $node['pages'],
+ $level + 1,
+ null,
+ false,
+ $node['background-image']
+ );
}
= $blocks->getPageBlocksAsArray((int)$parentId);
$cache->save(serialize($this->headlines), $parentId, 'Block');
}
+// echo '<pre>'.print_r($this->headlines, true).'</pre>';exit;
$this->hasHeadlines = !empty($this->headlines);
}