public function output() { $sApplicationBanner = ''; if (!MetaModel::DBHasAccess(ACCESS_USER_WRITE)) { $sReadOnly = Dict::S('UI:AccessRO-Users'); $sAdminMessage = trim(MetaModel::GetConfig()->Get('access_message')); $sApplicationBanner .= '<div id="admin-banner">'; $sApplicationBanner .= '<img src="../images/locked.png" style="vertical-align:middle;">'; $sApplicationBanner .= ' <b>' . $sReadOnly . '</b>'; if (strlen($sAdminMessage) > 0) { $sApplicationBanner .= ' : ' . $sAdminMessage . ''; } $sApplicationBanner .= '</div>'; } $sMenu = ''; if ($this->m_bEnableDisconnectButton) { $this->AddMenuButton('logoff', 'Portal:Disconnect', utils::GetAbsoluteUrlAppRoot() . 'pages/logoff.php?operation=do_logoff'); // This menu is always present and is the last one } foreach ($this->m_aMenuButtons as $aMenuItem) { $sMenu .= "<a class=\"button\" id=\"{$aMenuItem['id']}\" href=\"{$aMenuItem['hyperlink']}\"><span>" . Dict::S($aMenuItem['label']) . "</span></a>"; } $this->s_content = '<div id="portal"><div id="welcome">' . $this->m_sWelcomeMsg . '</div><div id="banner"><div id="logo"></div><div id="menu">' . $sMenu . '</div></div>' . $sApplicationBanner . '<div id="content">' . $this->s_content . '</div></div>'; parent::output(); }
// Check user rights and prompt if needed ApplicationContext::SetUrlMakerClass('iTopStandardURLMaker'); // Main parameters $sExpression = utils::ReadParam('expression', null, true, 'raw_data'); $sQueryId = utils::ReadParam('query', null, true, 'raw_data'); $sFormat = utils::ReadParam('format', null, true); $sFileName = utils::ReadParam('filename', '', true, 'string'); $bInteractive = utils::ReadParam('interactive', false); $sMode = utils::ReadParam('mode', ''); if ($bInteractive) { InteractiveShell($sExpression, $sQueryId, $sFormat, $sFileName, $sMode); } else { $oExporter = CheckParameters($sExpression, $sQueryId, $sFormat); $sMimeType = $oExporter->GetMimeType(); if ($sMimeType == 'text/html') { $oP = new NiceWebPage('iTop export'); $oP->add_style("body { overflow: auto; }"); $oP->add_ready_script("\$('table.listResults').tablesorter({widgets: ['MyZebra']});"); } else { $oP = new ajax_page('iTop export'); $oP->SetContentType($oExporter->GetMimeType()); } DoExport($oP, $oExporter, false); $oP->output(); } } catch (BulkExportMissingParameterException $e) { $oP = new ajax_page('iTop Export'); $oP->add($e->getMessage()); Usage($oP); $oP->output(); } catch (Exception $e) {
public function __construct($sTitle = 'iTop Login') { parent::__construct($sTitle); $this->SetStyleSheet(); $this->add_header("Cache-control: no-cache"); }
/** * Returns the part of the html output that occurred since the call to start_capture * and removes this part from the current html output * @param $offset mixed The value returned by start_capture * @return string The part of the html output that was added since the call to start_capture */ public function end_capture($offset) { if (is_array($offset)) { if ($this->m_oTabs->TabExists($offset['tc'], $offset['tab'])) { $sCaptured = $this->m_oTabs->TruncateTab($offset['tc'], $offset['tab'], $offset['offset']); } else { $sCaptured = ''; } } else { $sCaptured = parent::end_capture($offset); } return $sCaptured; }
// iTop 1.0.2 include '../approot.inc.php'; } else { define('APPROOT', '../'); } require_once APPROOT . "/application/applicationcontext.class.inc.php"; require_once APPROOT . 'application/nicewebpage.class.inc.php'; require_once APPROOT . 'application/utils.inc.php'; require_once APPROOT . "setup/runtimeenv.class.inc.php"; if (!file_exists(ITOP_DEFAULT_CONFIG_FILE)) { echo "<h1>Toolkit</h1>\n"; echo "<p>Please install iTop prior to running the toolkit</p>\n"; exit; } require_once APPROOT . '/application/startup.inc.php'; $oP = new NiceWebPage('Data Model Toolkit'); $oP->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot() . 'toolkit/toolkit.css'); try { //$sAppRoot = utils::GetAbsoluteUrlAppRoot(); $oP->add_script(<<<EOF \tfunction GetAbsoluteUrlAppRoot() \t{ \t\treturn '../'; \t} \t \tfunction doApply(bFull) \t{ \t\tif (bFull) \t\t{ \t\t\tvar oMap = { operation: 'update_code_db' }; \t\t\tvar bOk = confirm('Are you sure you want to compile the code and patch the database ?');
// Read query parameters // $aArgs = array(); foreach ($oFilter->GetQueryParams() as $sParam => $foo) { $value = utils::ReadParam('arg_' . $sParam, null, true, 'raw_data'); if (!is_null($value)) { $aArgs[$sParam] = $value; } } $oFilter->SetInternalParams($aArgs); if ($oFilter) { $oSet = new CMDBObjectSet($oFilter, array(), $aArgs); $oSet->OptimizeColumnLoad($aAliasToFields); switch ($sFormat) { case 'html': $oP = new NiceWebPage("iTop - Export"); $oP->add_style('body { overflow: auto; }'); // Show scroll bars if needed // Integration within MS-Excel web queries + HTTPS + IIS: // MS-IIS set these header values with no-cache... while Excel fails to do the job if using HTTPS // Then the fix is to force the reset of header values Pragma and Cache-control header("Pragma:", true); header("Cache-control:", true); // The HTML output is made for pages located in the /pages/ folder // since this page is in a different folder, let's adjust the HTML 'base' attribute // to make the relative hyperlinks in the page work $sUrl = utils::GetAbsoluteUrlAppRoot(); $oP->set_base($sUrl . 'pages/'); if (count($aFields) > 0) { $iSearch = array_search('id', $aFields); if ($iSearch !== false) {
public function output() { $this->s_content = "<div id=\"header\"><h1><a href=\"http://www.combodo.com/itop\" target=\"_blank\"><img title=\"iTop by Combodo\" src=\"../images/itop-logo.png\"></a> " . htmlentities($this->s_title, ENT_QUOTES, 'UTF-8') . "</h1>\n</div><div id=\"setup\">{$this->s_content}\n</div>\n"; return parent::output(); }
// Read query parameters // $aArgs = array(); foreach ($oFilter->GetQueryParams() as $sParam => $foo) { $value = utils::ReadParam('arg_' . $sParam, null, true, 'raw_data'); if (!is_null($value)) { $aArgs[$sParam] = $value; } } $oFilter->SetInternalParams($aArgs); if ($oFilter) { $oSet = new CMDBObjectSet($oFilter, array(), $aArgs); $oSet->OptimizeColumnLoad($aAliasToFields); switch ($sFormat) { case 'html': $oP = new NiceWebPage("iTop - Export"); // Integration within MS-Excel web queries + HTTPS + IIS: // MS-IIS set these header values with no-cache... while Excel fails to do the job if using HTTPS // Then the fix is to force the reset of header values Pragma and Cache-control header("Pragma:", true); header("Cache-control:", true); // The HTML output is made for pages located in the /pages/ folder // since this page is in a different folder, let's adjust the HTML 'base' attribute // to make the relative hyperlinks in the page work $sUrl = utils::GetAbsoluteUrlAppRoot(); $oP->set_base($sUrl . 'pages/'); if (count($aFields) > 0) { $iSearch = array_search('id', $aFields); if ($iSearch !== false) { $bViewLink = true; unset($aFields[$iSearch]);