getNewGadgetStatus($gadgetName);
if (!$gadgetStatus) {
return false;
}
if(DISABLE_HOME_AFTER_LOGIN == "YES"){
if (iplat_session_management::isLoggedIn()){
header("Location: /bookshelf"); /* Redirect bookshelf */
exit();
}
}
$objHeaderManagement->addJS(GENERIC_SCRIPTS_PATH . '../spark/js/jquery.form.js');
$objHeaderManagement->addCSS(SITE_STYLES_PATH . '../spark/css/common.css');
$objHeaderManagement->addJS(GENERIC_SCRIPTS_PATH . '../spark/js/spark_home.js');
$objHeaderManagement->addCSS(SITE_STYLES_PATH . '../spark/css/spark_video-js.min.css');
$objHeaderManagement->addCSS(SITE_STYLES_PATH . '../spark/css/spark_custom-video.css');
$objHeaderManagement->addJS(GENERIC_SCRIPTS_PATH . '../spark/js/spark_jquery.blockUI.js');
$objHeaderManagement->addJS(GENERIC_SCRIPTS_PATH . '../spark/js/spark_video.js');
$objHeaderManagement->addJS(GENERIC_SCRIPTS_PATH . '../spark/js/spark_videojs-playlist.js');
$objHeaderManagement->addJS(GENERIC_SCRIPTS_PATH . '../spark/js/spark_videojs-playlist-ui.js');
$objHeaderManagement->addJS(GENERIC_SCRIPTS_PATH . '../spark/js/spark_videojs-contrib-hls.js');
$objHeaderManagement->addJS(GENERIC_SCRIPTS_PATH . '../spark/js/spark_video_bookshelf_custom.js');
$objHeaderManagement->addJS(GENERIC_SCRIPTS_PATH . '../spark/js/elib-functions.js');
//start home showcase
$class = "";
if (HIDE_EMPTY_TABS == "YES") {
$class = "";
}
$isAlphabeticDisplay = "";
if ( strlen(HOME_SORT_FIELD) ) {
$logStatus = iplat_session_management::isLoggedIn();
$homeSortFieldArray = explode(",", HOME_SORT_FIELD);
if ($homeSortFieldArray) {
foreach ($homeSortFieldArray as $sortKey) {
if ('title' == trim($sortKey) && strstr( HOME_SORT_FIELD , 'title' ) ) {
$isAlphabeticDisplay = 1;
}}}}
$tabs = array(
"0" => array(
"tabName" => $translator->_("all") . " ",
"tabId" => "all",
"customClass" => "$class ",
"productType" => 'all'
),
//IPI-664 Journal tab name Updated in Home page
/*"1" => array(
"tabName" => $translator->_("journals") . " ",
"tabId" => "allJournals",
"customClass" => "$class ",
"productType" => 'JOURNAL'
),*/
"1" => array(
"tabName" => $translator->_("Journal / Bare Acts") . " ",
"tabId" => "allJournals",
"customClass" => "$class ",
"productType" => 'JOURNAL'
),
"2" => array(
"tabName" => $translator->_("ebooks"),
"tabId" => "allBooks",
"customClass" => "$class ",
"productType" => 'EBO'
),
/*"3" => array(
"tabName" => $translator->_("videos") . " ",
"tabId" => "videos",
"customClass" => " videosHidden $class ",
"productType" => 'VBO'
),
"4" => array(
"tabName" => $translator->_("documents") . " ",
"tabId" => "documents",
"customClass" => " documentsHidden $class ",
"productType" => 'DOC'
),*/
"3" => array(
"tabName" => $translator->_("scorm") . " ",
"tabId" => "scorm",
"customClass" => "$class ",
"productType" => 'SCORM'
),
"4" => array(
"tabName" => $translator->_("Video") . " ",
"tabId" => "video",
"customClass" => "$class ",
"productType" => 'VBO'
),
"5" => array(
"tabName" => $translator->_("Audio") . " ",
"tabId" => "audio",
"customClass" => "$class ",
"productType" => 'ABO'
),
"6" => array(
"tabName" => $translator->_("Print") . " ",
"tabId" => "printBooks",
"customClass" => "$class ",
"productType" => 'PRINTBOOK'
)
);
require_once 'homeModel.php' ;
$homeModel = new homeModel();
$publishers = $homeModel->getPublishers();
$placeHolderArr['loop']['TABS'] = ' foreach($tabs as $tab)';
$placeHolderArr['echo_token']['CUSTOM_CLASS'] = ' $tab[\'customClass\']';
$placeHolderArr['echo_token']['tabId'] = ' $tab[\'tabId\']';
$placeHolderArr['echo_token']['tabName'] = ' $tab[\'tabName\']';
$placeHolderArr['if']['Active'] = '($tab[\'tabId\'] == \'all\') ' ;
$placeHolderArr['echo_token']['TitleView'] = ' $translator->_(\'TitleView\') ' ;
$placeHolderArr['echo_token']['ListView'] = ' $translator->_(\'ListView\') ' ;
$placeHolderArr['echo_token']['StackView'] = ' $translator->_(\'StackView\') ' ;
$placeHolderArr['echo_token']['Category'] = ' $translator->_( \'Category\' ) ';
$placeHolderArr['echo_token']['By'] = ' $translator->_( \'By\' ) ';
$placeHolderArr['echo_token']['Sort'] = ' $translator->_( \'Sort\' ) ';
$placeHolderArr['echo_token']['Filter_By'] = ' $translator->_( \'FilterBy\' ) ';
$placeHolderArr['echo_token']['Categories'] = ' $translator->_( \'Categories\' ) ';
$placeHolderArr['echo_token']['Published_Date'] = ' $translator->_( \'Published Date\' ) ';
$placeHolderArr['echo_token']['TitleAtoZ'] = ' $translator->_(\'TitleAtoZ\') ';
$placeHolderArr['echo_token']['TitleZtoA'] = ' $translator->_(\'TitleZtoA\') ';
$placeHolderArr['echo_token']['PublishedAtoZ'] = ' $translator->_(\'pubdate_low_high\') ';
$placeHolderArr['echo_token']['PublishedZtoA'] = ' $translator->_(\'pubdate_high_low\') ';
$placeHolderArr['loop']['PUBLISHERS'] = ' foreach($publishers as $publisher)';
$placeHolderArr['echo_token']['publisherName'] = ' $publisher[\'publisher\']';
$placeHolderArr['echo_token']['BuyNow'] = ' $translator->_(\'BuyNow\') ' ;
$placeHolderArr['echo_token']['Cancel'] = ' $translator->_(\'Cancel\') ' ;
$allowedFilters = @explode("," , BOOKSHELF_FILTER_FIELDS);
$placeHolderArr['if']['ALLOW_PUBLISHER'] = '( in_array(\'publisher\',$allowedFilters) )' ;
$placeHolderArr['if']['ALLOW_CATEGORY'] = '( in_array(\'category\',$allowedFilters) )' ;
$placeHolderArr['echo_token']['NoBooksFound'] = ' $translator->_( \'NoBooksFound\' ) ';
$placeHolderArr['echo_token']['VIDEO_PLAYLIST_AUTOPLAY'] = 'VIDEO_AUTOPLAY';
$placeHolderArr['echo_token']['VIDEO_PLAYLIST_AUTOPLAY_DURATION'] = 'VIDEO_AUTOPLAY_DURATION';
//end home showcase
$placeHolderArr['echo_token']['VIEWINSIDE_LABEL'] = ' $translator->_(\'view_inside\') ';
$placeHolderArr['if']['TITLE_VIEW'] = '( HOME_DEFAULT_VIEW=="title")' ;
$placeHolderArr['if']['STACK_VIEW'] = '( HOME_DEFAULT_VIEW=="stack" )' ;
$placeHolderArr['if']['LIST_VIEW'] = '( HOME_DEFAULT_VIEW=="list" )' ;
$placeHolderArr['echo_token']['defaultview'] = ' HOME_DEFAULT_VIEW ';
$placeHolderArr['echo_token']['isAlphabeticDisplay'] = ' $isAlphabeticDisplay ' ;
//Reduce the white space between the titles on the homepage, catalog page and bookshelf page LNI-219
$RemoveWhtSpceBfrLgn = defined('REMOVE_WHITESPACE_BEFORE_LOGIN')?REMOVE_WHITESPACE_BEFORE_LOGIN :OFF;
$placeHolderArr['echo_token']['RemoveWhtSpceBfrLgn'] = '$RemoveWhtSpceBfrLgn';
$compiledTplPath = 'compiledtpl/' . $gadgetName . '_' . $zoneCode . '.tpl.php';
$templatePath = $gadgetName . '/' . $gadgetName . '_' . $zoneCode . '.tpl';
$genericPath = ABSOLUTE_PATH . DEFAULT_THEME_PATH . 'gadgets/';
$customizedPath = ABSOLUTE_PATH . SITE_THEME_PATH . 'gadgets/';
if ($templateStatus == 'GENERIC') {
$templateFile = $genericPath . $templatePath;
$compiledTplFile = $genericPath . $compiledTplPath;
} else {
if (file_exists($customizedPath . $templatePath)) {
$templateFile = $customizedPath . $templatePath;
$compiledTplFile = $customizedPath . $compiledTplPath;
} else {
$templateFile = $genericPath . $templatePath;
$compiledTplFile = $genericPath . $compiledTplPath;
}
}
if (!file_exists($compiledTplFile)) {
ipc_gadget_render::render($compiledTplFile, $templateFile, $placeHolderArr);
} else if (filemtime($templateFile) > filemtime($compiledTplFile) || filemtime(__FILE__) > filemtime($compiledTplFile)) {
ipc_gadget_render::render($compiledTplFile, $templateFile, $placeHolderArr);
}
require_once($compiledTplFile);
}
}