$theme =& atkinstance("atk.ui.atktheme"); $output =& atkinstance("atk.ui.atkoutput"); $page->register_style($theme->stylePath("style.css")); $page->register_script(atkconfig("atkroot") . "atk/javascript/launcher.js"); $content = '<script language="javascript">atkLaunchApp(); </script>'; $content .= '<br><br><a href="#" onClick="atkLaunchApp()">' . atktext('app_reopen', "atk") . '</a> ' . '<a href="#" onClick="window.close()">' . atktext('app_close', "atk") . '</a><br><br>'; $box = $ui->renderBox(array("title" => atktext("app_launcher"), "content" => $content)); $page->addContent($box); $output->output($page->render(atktext('app_launcher'), true)); $output->outputFlush(); } else { if ($theme->getAttribute('useframes', true)) { // Regular mode. app.php can be included directly. include "app.php"; } else { $user =& atkGetUser(); $indexpage =& atknew('atk.ui.atkindexpage'); $indexpage->setUsername(getFullUsername()); $indexpage->setTitle(getAchievoTitle()); $indexpage->setTopSearchPiece(getSearchPiece()); $centerpiece = ""; $centerpiecelinks = array(); getCenterPiece($centerpiece, $centerpiecelinks); $indexpage->setTopCenterPieceLinks($centerpiecelinks); if ($user["name"] == "administrator") { $destination = array("atknodetype" => "pim.pim", "atkaction" => "adminpim"); } else { $destination = array("atknodetype" => "pim.pim", "atkaction" => "pim"); } $indexpage->setDefaultDestination($destination); $indexpage->generate();
* @author Ivo Jansch <*****@*****.**> * * @copyright (c)2000-2004 Ibuildings.nl BV * @license http://www.achievo.org/atk/licensing ATK Open Source License * * @version $Revision: 5036 $ * $Id: top.php 6354 2009-04-15 02:41:21Z mvdam $ */ /** * @internal includes. */ $config_atkroot = "./"; include_once "atk.inc"; atksession(); atksecure(); $page =& atkNew("atk.ui.atkpage"); $ui =& atkInstance("atk.ui.atkui"); $theme =& atkInstance("atk.ui.atktheme"); $output =& atkInstance("atk.ui.atkoutput"); $page->register_style($theme->stylePath("style.css")); $page->register_style($theme->stylePath("top.css")); $vars = array("logintext" => atkText("logged_in_as", "atk"), "logouttext" => ucfirst(atkText("logout", "atk")), "logoutlink" => "app.php?atklogout=1", "logouttarget" => "_top", "centerpiece" => "", "searchpiece" => "", "title" => atkText("app_title"), "user" => atkArrayNvl(atkGetUser(), "name")); // Backwards compatible $vars[content], that is what will render when the // box.tpl is used instead of a top.tpl. This happens in old themes. $contenttpl = '<br />[logintext]: <b>[user]</b> <a href="[logoutlink]" target="[logouttarget]">[logouttext] </a> <br /><br />'; $stringparser =& atkNew("atk.utils.atkstringparser", $contenttpl); $vars["content"] = $stringparser->parse($vars); $top = $ui->renderBox($vars, "top"); $page->addContent($top); $output->output($page->render($vars["title"], true)); $output->outputFlush();
$content .= '<br><br><center>IP: ' . $_SERVER[REMOTE_ADDR] . '</center>'; show_error_window($content, false); die; } } // check if user is suspended if ($db_is_suspended == 1) { $content = atktext('account_suspended_ml'); $content .= '<br><br>'; $content .= '<a href="index.php?atklogout=1">' . atktext('login_here_ml') . '</a>'; show_error_window($content, false); die; } } /* * run... */ $indexpage =& atknew('atk.ui.atkindexpage'); $indexpage->setUsername(getFullUsername()); $indexpage->setTitle(getTitle()); $indexpage->setTopSearchPiece(getSearchPiece()); $centerpiece = ""; $centerpiecelinks = array(); getCenterPiece($centerpiece, $centerpiecelinks); $indexpage->setTopCenterPieceLinks($centerpiecelinks); $destination = array("atknodetype" => "dashboard.mainboard", "atkaction" => "start"); if (atkGetUser('name') == 'administrator') { $destination = array("atknodetype" => "loginmanager.users", "atkaction" => "admin"); } $indexpage->setDefaultDestination($destination); $indexpage->generate();
atkimport("atk.menu.atkmenu"); atkimport("atk.utils.atkframeset"); $menu =& atkMenu::getMenu(); $theme =& atkinstance('atk.ui.atktheme'); $position = $menu->getPosition(); $scrolling = $menu->getScrollable() == MENU_SCROLLABLE ? FRAME_SCROLL_AUTO : FRAME_SCROLL_NO; if (isset($ATK_VARS["atknodetype"]) && isset($ATK_VARS["atkaction"])) { $destination = "dispatch.php?atknodetype=" . $ATK_VARS["atknodetype"] . "&atkaction=" . $ATK_VARS["atkaction"]; if (isset($ATK_VARS["atkselector"])) { $destination .= "&atkselector=" . $ATK_VARS["atkselector"]; } if (isset($ATK_VARS["searchstring"])) { $destination .= "&searchstring=" . $ATK_VARS["searchstring"]; } } else { if (atkArrayNvl(atkGetUser(), "name") == "administrator") { $destination = session_url(dispatch_url("pim.pim", "adminpim"), SESSION_NEW); } else { $destination = session_url(dispatch_url("pim.pim", "pim"), SESSION_NEW); } } $frame_top_height = $theme->getAttribute('frame_top_height'); $frame_menu_width = $theme->getAttribute('frame_menu_width'); $topframe =& new atkFrame($frame_top_height ? $frame_top_height : "75", "top", "top.php", FRAME_SCROLL_NO, true); $mainframe =& new atkFrame("*", "main", $destination, FRAME_SCROLL_AUTO, true); $menuframe =& new atkFrame($position == MENU_LEFT || $position == MENU_RIGHT ? $frame_menu_width ? $frame_menu_width : 190 : $menu->getHeight(), "menu", "menu.php", $scrolling); $noframes = '<p>Your browser doesnt support frames, but this is required to run ' . atktext('app_title') . "</p>\n"; $root =& new atkRootFrameset(); if (atkconfig("top_frame")) { $outer =& new atkFrameSet("*", FRAMESET_VERTICAL, 0, $noframes); $outer->addChild($topframe);
function getFirmData($id) { $sql = "SELECT * FROM ia32_config"; $conn = atkGetUser(atkconfig('auth_dbconfigfield')); $db =& atkGetDb($conn); $user_prefix = atkGetUser(atkconfig('auth_tblprefixfield')); $sql = str_replace('ia32_', $user_prefix, $sql); $ret = $db->getrows($sql); return $ret[0]; }