mon/inc/setup.php');
$objTpl->define(array('main' => $custom_files['main.tpl']));
$objTpl->assign('PHPUSRSID',SID);
$objTpl->assign('SESSION_NAME', session_name());
$objTpl->assign('SESSION_ID', session_id());
$objTpl->assign('CurURL', urlencode($db->Request));
$section = (isset($_GET['sect']))?$_GET['sect']:'home';
$objTpl->define(array('homehref' => $custom_files['home_href.tpl']));
$objTpl->parse('MENU_HOME','homehref');
$objTpl->define(array('aboutushref' => $custom_files['aboutus_href.tpl']));
$objTpl->parse('MENU_ABOUTUS','aboutushref');
$objTpl->define(array('contactushref' => $custom_files['contactus_href.tpl']));
$objTpl->parse('MENU_CONTACTUS','contactushref');
$objTpl->define(array('browsehref' => $custom_files['browse_href.tpl']));
$objTpl->parse('MENU_BROWSE','browsehref');
// category common processing
$category_id = isset($_GET['category'])?$_GET['category']:0;
$cat = new Category($category_id);
if ($cat->CACAID>0){
$CAMTPT = $cat->CAMTPT;
$CAMTDC = $cat->CAMTDC;
$CAMTKW = $cat->CAMTKW;
} else {
$CAMTPT = '';
$CAMTDC = '';
$CAMTKW = '';
}
if ($CAMTPT==''){
$objTpl->define(array('_def_title' => $custom_files['_def_title.tpl']));
$objTpl->parse('CAMTPT','_def_title');
} else {
$objTpl->assign('CAMTPT', $cat->CAMTPT);
}
if ($CAMTDC==''){
$objTpl->define(array('_def_description' => $custom_files['_def_description.tpl']));
$objTpl->parse('CAMTDC','_def_description');
} else {
$objTpl->assign('CAMTDC', $cat->CAMTDC);
}
if ($CAMTKW==''){
$objTpl->define(array('_def_keywords' => $custom_files['_def_keywords.tpl']));
$objTpl->parse('CAMTKW','_def_keywords');
} else {
$objTpl->assign('CAMTKW', $cat->CAMTKW);
}
switch ($section){
case 'home': {
$objTpl->define(array('homediv' => $custom_files['home_div.tpl']));
$objTpl->parse('MENU_HOME','homediv');
$objTpl->define(array('home' => $custom_files['home.tpl']));
$objTpl->parse('CONTEXT','home');
break;
}
case 'aboutus': {
$objTpl->define(array('aboutusdiv' => $custom_files['aboutus_div.tpl']));
$objTpl->parse('MENU_ABOUTUS','aboutusdiv');
$objTpl->define(array('aboutus' => $custom_files['aboutus.tpl']));
$objTpl->parse('CONTEXT','aboutus');
break;
}
case 'contactus': {
$objTpl->define(array('contactusdiv' => $custom_files['contactus_div.tpl']));
$objTpl->parse('MENU_CONTACTUS','contactusdiv');
$objTpl->define(array('contactus' => $custom_files['contactus.tpl']));
$objTpl->parse('CONTEXT','contactus');
break;
}
case 'browse': {
$objTpl->define(array('browsediv' => $custom_files['browse_div.tpl']));
$objTpl->parse('MENU_BROWSE','browsediv');
$objTpl->define(array('browse' => $custom_files['browse.tpl']));
$objTpl->define_dynamic('backsec','browse');
$objTpl->assign('PARRENTID', $cat->getParrentCategoryID());
if ($cat->CACAID>0){
$objTpl->assign('CATEGORYPATH', $cat->GetFullName());
} else {
$objTpl->assign('CATEGORYPATH', "Catalog");
$objTpl->clear_dynamic('backsec');
}
$objTpl->assign('NAVLINKSHTML', $cat->GetNavLinksHTML());
if (isset($_GET['item'])&&($cat->CACAID!=0)){
include_once ($custom_files['mod_view_item.php']);
$objTpl->assign('SUBCATEGORIESSECTION', "");
$objTpl->assign('CATEGORYDETAILSSECTION', "");
$objTpl->assign('ITEMSLISTSECTION', "");
$objTpl->assign('VARIATIONSLISTSECTION', "");
} else {
include_once ($custom_files['mod_browse_category_details.php']);
include_once ($custom_files['mod_browse_category_sublist.php']);
if (isset($_GET['catview'])&&($_GET['catview']=='variations')){
include_once ($custom_files['mod_browse_category_variations.php']);
$objTpl->assign('ITEMSLISTSECTION', "");
} else {
include_once ($custom_files['mod_browse_category_items.php']);
$objTpl->assign('VARIATIONSLISTSECTION', "");
}
$objTpl->assign('ITEMSDETAILSSECTION', "");
}
$objTpl->parse('CONTEXT','browse');
$_SESSION['SelectedCategoryID'] = $cat->CACAID;
break;
}
default: {
/*
include_once ('navigation/inc/mod_home.php');
$objTpl->assign('HEADER','"'.$db->DB_CATALOG.'" Database Administration');
$objTpl->define(array('mainselector' => 'Admin/tpl/mainselector.tpl'));
$objTpl->parse('CONTEXT','mainselector');*/
die (header('location:./?'.$SessionSIDSuffix));
break;
}
}
$_SESSION['FirstSessionRun'] = true;
$objTpl->parse('out','main');
if (!$CustomItemView){
$objTpl->FastPrint('out');
} else {
include_once ($Itm->IMPURL);
}
?>