* @license http://www.opensource.org/licenses/gpl-license.php GNU Public License */ // Load config file require_once dirname(__FILE__) . "/../config/config.inc.php"; // Load SolidWorks require_once dirname(__FILE__) . "/../solidworks/solidworks.php"; // Load settings from database require_once dirname(__FILE__) . "/../util/settings.php"; load_settings($conf); require_once dirname(__FILE__) . "/../include/SolidStateMenu.class.php"; // Set the current theme $theme = isset($_SESSION['client']['userdbo']) ? $_SESSION['client']['userdbo']->getTheme() : $conf['themes']['manager']; $conf['themes']['current'] = $theme; // Load the user's language preference session_start(); $language = isset($_SESSION['client']['userdbo']) ? $_SESSION['client']['userdbo']->getLanguage() : null; if ($language != null) { TranslationParser::load("language/" . $language); Translator::getTranslator()->setActiveLanguage($language); } // Change the charset to UTF-8 header("Content-type: text/html; charset=utf-8"); // Build the core menu $menu = SolidStateMenu::getSolidStateMenu(); $username = isset($_SESSION['client']['userdbo']) ? $_SESSION['client']['userdbo']->getUsername() : null; $menu->addItem(new SolidStateMenuItem("myinfo", "[MY_INFO]", "vcard_edit.png", "manager_content.php?page=config_edit_user&user="******"administration"); $menuItems = $menu->getItemArray(); $smarty->assign("menuItems", $menuItems); // Display menu $smarty->display(Page::selectTemplateFile("manager_menu.tpl"));
function display_page($page) { $conf = $page->conf; $smarty = $page->smarty; // Update page variables - they may need to be filled in with run-time info generate_location_stack($conf); $page->setLocationStack($conf['pages'][$page->getClassName()]['location_stack']); $page->setTitle($conf['pages'][$page->getClassName()]['title']); $page->setUrl($conf['pages'][$page->getClassName()]['url']); // Set template variables $smarty->assign("location", $page->getTitle()); $smarty->assign("location_stack", $page->getLocationStack()); $smarty->assign("company_name", $conf['company']['name']); $smarty->assign("client_ip", $_SERVER['REMOTE_ADDR']); $smarty->assign("content_template", $page->getTemplateFile()); $smarty->assign("url", $page->getUrl()); $smarty->assign("version", $conf['application_name']); $smarty->assign("machine", $_SERVER['SERVER_NAME']); if (isset($_SESSION['client']['userdbo'])) { $smarty->assign("username", $_SESSION['client']['userdbo']->getUsername()); } // Invoke any javascript if (isset($_SESSION['jsFunction'])) { $smarty->assign("jsFunction", $_SESSION['jsFunction']); unset($_SESSION['jsFunction']); } if (intval($_GET['no_headers']) == 1) { // Display without headers $smarty->display($page->getTemplateFile()); } else { // Display with headers $smarty->display(Page::selectTemplateFile($conf['main_template'])); } // Remove messages and errors from session $session = $page->getPageSession(); unset($session['errors']); unset($session['messages']); }
/** * Return the current template's filename * * @return string Template filename */ function getTemplateFile() { return Page::selectTemplateFile($this->template_file, $this->getTemplateDir()); }