Get("Site_Path");
$admin = $objConfig->Get("AdminDirectory");
if(!strlen($admin))
$admin = "admin";
$localURL=$rootURL."kernel/";
$adminURL = $rootURL.$admin;
$imagesURL = $adminURL."/images";
//$pathtolocal = $pathtoroot."in-news/";
require_once ($pathtoroot.$admin."/include/elements.php");
require_once ($pathtoroot."kernel/admin/include/navmenu.php");
//require_once ($pathtolocal."admin/include/navmenu.php");
require_once($pathtoroot.$admin."/toolbar.php");
require_once($pathtoroot.$admin."/listview/listview.php");
$section = "in-portal:configure_themes";
$m = GetModuleArray();
foreach($m as $key=>$value)
{
$path = $pathtoroot. $value."admin/include/parser.php";
if(file_exists($path))
{
include_once($path);
}
}
unset($objEditItems);
$envar = "env=".BuildEnv();
$formaction = $_SERVER["PHP_SELF"]."?".$envar;
$sec = $objSections->GetSection($section);
$objListToolBar = new clsToolBar();
$objListToolBar->Set("section",$section);
$objListToolBar->Set("load_menu_func","");
$objListToolBar->Set("CheckClass","ThemeChecks");
$objListToolBar->Set("CheckForm","theme");
$listImages = array();
//$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick
$objListToolBar->Add("new_theme", "la_ToolTip_New_Theme",$adminURL."/config/addtheme.php?$envar&new=1","swap('new_theme','toolbar/tool_new_theme_f2.gif');",
"swap('new_theme', 'toolbar/tool_new_theme.gif');","",$imagesURL."/toolbar/tool_new_theme.gif");
$objListToolBar->Add("theme_edit","la_ToolTip_Edit","#", "if (ThemeChecks.itemChecked()) swap('theme_edit','toolbar/tool_edit_f2.gif');",
"if (ThemeChecks.itemChecked()) swap('theme_edit', 'toolbar/tool_edit.gif');","if (ThemeChecks.itemChecked()) ThemeChecks.check_submit('addtheme', '');",
"tool_edit.gif",TRUE,TRUE);
$listImages[] = "ThemeChecks.addImage('theme_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); ";
$objListToolBar->Add("theme_del","la_ToolTip_Delete","#", "if (ThemeChecks.itemChecked()) swap('theme_del','toolbar/tool_delete_f2.gif');",
"if (ThemeChecks.itemChecked()) swap('theme_del', 'toolbar/tool_delete.gif');","if (ThemeChecks.itemChecked()) ThemeChecks.check_submit('config_theme', 'm_theme_delete');",
"tool_delete.gif",FALSE,TRUE);
$listImages[] = "ThemeChecks.addImage('theme_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); ";
$objListToolBar->Add("theme_primary","la_ToolTip_Primary","#", "if (ThemeChecks.itemChecked()) swap('theme_primary','toolbar/tool_primary_theme_f2.gif');",
"if (ThemeChecks.itemChecked()) swap('theme_primary', 'toolbar/tool_primary_theme.gif');","if (ThemeChecks.itemChecked()) ThemeChecks.check_submit('config_theme', 'm_theme_primary');",
"tool_primary_theme.gif");
$listImages[] = "ThemeChecks.addImage('theme_primary','$imagesURL/toolbar/tool_primary_theme.gif','$imagesURL/toolbar/tool_primary_theme_f3.gif',1); ";
$objListToolBar->AddToInitScript($listImages);
$objListToolBar->AddToInitScript("fwLoadMenus(); \n");
$objThemes->CreateMissingThemes();
$SearchWords = $objSession->GetVariable("ThemeSearchWord");
if(strlen($SearchWords))
{
$where = $objThemes->AdminSearchWhereClause($SearchWords);
}
else
$where = "";
$order = trim($objConfig->Get("Theme_LV_Sortfield")." ".$objConfig->Get("Theme_LV_Sortorder"));
$sql = "SELECT t.*,ELT(t.enabled+1,'".admin_language("la_Text_Disabled")."','".admin_language("la_Text_Enabled")."') as Status ";
$sql .= "FROM ".GetTablePrefix()."Theme as t ";
if(strlen($where))
$sql .= "WHERE ".$where." ";
if(strlen($order))
$sql .= " ORDER BY ".$order;
$objListView = new clsListView($objListToolBar);
$objListView->CurrentPageVar = "Page_LV_Themes";
$objListView->PerPageVar = "Perpage_LV_Themes";
$sql .= ' '.$objListView->GetLimitSQL();
$objThemes->Query_Item($sql);
$itemcount = TableCount(GetTablePrefix()."Theme", $where,0);
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo htmlentities($sql,ENT_NOQUOTES)."
\n";
$objListView->SetListItems($objThemes);
$objListView->IdField = "ThemeId";
$order = $objConfig->Get("Theme_LV_Sortfield");
$objListView->ColumnHeaders->Add("Name",admin_language("la_prompt_Name"),1,0,$order,"width=\"30%\"","Theme_LV_Sortfield","Theme_LV_Sortorder","Name");
$objListView->ColumnHeaders->Add("Description",admin_language("la_prompt_Description"),1,0,$order,"width=\"30%\"","Theme_LV_Sortfield","Theme_LV_Sortorder","Description");
$objListView->ColumnHeaders->Add("Status",admin_language("la_ColHeader_Status"),1,0,$order,"width=\"30%\"","Theme_LV_Sortfield","Theme_LV_Sortorder","Status");
$objListView->ColumnHeaders->SetSort($objConfig->Get("Theme_LV_Sortfield"), $objConfig->Get("Theme_LV_Sortorder"));
$objListView->PrintToolBar = FALSE;
$objListView->checkboxes = TRUE;
$objListView->CheckboxName = "itemlist[]";
$objListView->SearchBar = TRUE;
$objListView->SearchKeywords = $SearchWords;
$objListView->SearchAction="m_theme_search";
$objListView->TotalItemCount = $itemcount;
for($i=0;$iItems);$i++)
{
$objListView->RowIcons[] = $objThemes->Items[$i]->AdminIcon();
}
$objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField,"","",0);
$objSession->SetVariable("HasChanges", 0);
$filter = false;
if ($SearchWords != '') {
$filter = true;
}
$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Theme");
$h = "\n\n\n";
int_header($objListToolBar,NULL,$title, NULL, $h);
if ($filter) { ?>