m_sCurrentTabContainer = ''; $this->m_sCurrentTab = ''; $this->m_aTabs = array(); $this->m_sMenu = ""; $oAppContext = new ApplicationContext(); $sExtraParams = $oAppContext->GetForLink(); $this->add_header("Content-type: text/html; charset=utf-8"); $this->add_header("Cache-control: no-cache"); $this->m_currentOrganization = $currentOrganization; $this->add_linked_script("../js/jquery.dimensions.js"); $this->add_linked_script("../js/splitter.js"); $this->add_linked_script("../js/jquery.tablehover.js"); $this->add_linked_script("../js/jquery.treeview.js"); $this->add_linked_script("../js/jquery.autocomplete.js"); $this->add_linked_script("../js/jquery.bgiframe.js"); $this->add_linked_script("../js/jquery.jdMenu.js"); $this->add_linked_script("../js/date.js"); $this->add_linked_script("../js/jquery.date.picker.js"); $this->add_linked_script("../js/jquery.tablesorter.min.js"); //$this->add_linked_script("../js/jquery-ui-personalized-1.5.3.js"); $this->add_linked_script("../js/swfobject.js"); $this->add_linked_stylesheet("../css/jquery.treeview.css"); $this->add_linked_stylesheet("../css/jquery.autocomplete.css"); $this->add_linked_stylesheet("../css/date.picker.css"); $this->add_ready_script( << 0) { $("#RightPane").splitter({ type: "h" //, //minA: 100, initA: 150, maxA: 500, //accessKey: "_" }); } // Manually set the outer splitter's height to fill the browser window. // This must be re-done any time the browser window is resized. $(window).bind("resize", function(){ var ms = $("#MySplitter"); var top = ms.offset().top; // from dimensions.js var wh = $(window).height(); // Account for margin or border on the splitter container var mrg = parseInt(ms.css("marginBottom")) || 0; var brd = parseInt(ms.css("borderBottomWidth")) || 0; ms.css("height", (wh-top-mrg-brd)+"px"); // IE fires resize for splitter; others don't so do it here if ( !jQuery.browser.msie ) ms.trigger("resize"); }).trigger("resize"); var ms = $("#MySplitter"); ms.trigger("resize"); if ( $("#TopPane").length > 0) { $("#RightPane").trigger("resize"); } $("#tabbedContent > ul").tabs( 1, { fxFade: true, fxSpeed: 'fast' } ); // tabs $("table.listResults").tableHover(); // hover tables $(".listResults").tablesorter( { headers: { 0:{sorter: false }}, widgets: ['zebra']} ); // sortable and zebra tables $(".date-pick").datePicker( {clickInput: false, createButton: true, startDate: '2000-01-01'} ); // Date picker $('#ModalDlg').jqm({ajax: '@href', trigger: 'a.jqmTrigger', overlay:70, modal:true, toTop:true}); // jqModal Window //$('.display_block').draggable(); // make the blocks draggable EOF ); $this->add_script(" // For automplete function findValue(li) { if( li == null ) return alert(\"No match!\"); // if coming from an AJAX call, let's use the CityId as the value if( !!li.extra ) var sValue = li.extra[0]; // otherwise, let's just display the value in the text box else var sValue = li.selectValue; //alert(\"The value you selected was: \" + sValue); } function selectItem(li) { findValue(li); } function formatItem(row) { return row[0]; } function goBack() { window.history.back(); } "); $this->DisplayMenu(); } public function AddToMenu($sHtml) { $this->m_sMenu .= $sHtml; } public function DisplayMenu() { // Combo box to select the organization $this->AddToMenu("
\n"); $this->AddToMenu("
\n"); $this->AddToMenu("\n"); } /** * Outputs (via some echo) the complete HTML page by assembling all its elements */ public function output() { foreach($this->a_headers as $s_header) { header($s_header); } $s_captured_output = ob_get_contents(); ob_end_clean(); echo "\n"; echo "\n"; echo "\n"; echo "{$this->s_title}\n"; // Stylesheets MUST be loaded before any scripts otherwise // jQuery scripts may face some spurious problems (like failing on a 'reload') foreach($this->a_linked_stylesheets as $a_stylesheet) { if ($a_stylesheet['condition'] != "") { echo "\n"; } } foreach($this->a_linked_scripts as $s_script) { echo "\n"; } if (count($this->m_aReadyScripts)>0) { $this->add_script("\$(document).ready(function() {\n".implode("\n", $this->m_aReadyScripts)."\n});"); } if (count($this->a_scripts)>0) { echo "\n"; } if (count($this->a_styles)>0) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; // Display the header echo "
\n"; echo "
iTop
\n"; //echo "
\n"; $sText = Utils::ReadParam('text', ''); $sOnClick = ""; if (empty($sText)) { // if no search text is supplied then // 1) the search text is filled with "your search" // 2) clicking on it will erase it $sText = "Your search"; $sOnClick = " onclick=\"this.value='';this.onclick=null;\""; } $sUserName = UserRights::GetUser(); $sIsAdmin = UserRights::IsAdministrator() ? '(Administrator)' : ''; echo "
Logged in as '$sUserName' $sIsAdmin  "; echo "
\n"; echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; // Display the menu echo "
\n"; echo "
\n"; echo $this->m_sMenu; echo "
\n"; echo "
\n"; // Render the tabs in the page (if any) foreach($this->m_aTabs as $sTabContainerName => $m_aTabs) { $sTabs = ''; if (count($m_aTabs) > 0) { $sTabs = "\n
\n"; $sTabs .= "
    \n"; // Display the unordered list that will be rendered as the tabs $i = 0; foreach($m_aTabs as $sTabName => $sTabContent) { $sTabs .= "
  • ".htmlentities($sTabName)."
  • \n"; $i++; } $sTabs .= "
\n"; // Now add the content of the tabs themselves $i = 0; foreach($m_aTabs as $sTabName => $sTabContent) { $sTabs .= "
".$sTabContent."
\n"; $i++; } $sTabs .= "
\n\n"; } $this->s_content = str_replace("\$Tabs:$sTabContainerName\$", $sTabs, $this->s_content); } // Display the page's content echo $this->s_content; // Add the captured output if (trim($s_captured_output) != "") { echo "
$s_captured_output
\n"; } echo "
Please wait...
\n"; // jqModal Window echo "
\n"; echo "
\n"; echo "
"; echo "\n"; echo "\n"; } public function AddTabContainer($sTabContainer) { $this->m_aTabs[$sTabContainer] = array(); $this->add("\$Tabs:$sTabContainer\$"); } public function AddToTab($sTabContainer, $sTabLabel, $sHtml) { if (!isset($this->m_aTabs[$sTabContainer][$sTabLabel])) { // Set the content of the tab $this->m_aTabs[$sTabContainer][$sTabLabel] = $sHtml; } else { // Append to the content of the tab $this->m_aTabs[$sTabContainer][$sTabLabel] .= $sHtml; } } public function SetCurrentTabContainer($sTabContainer = '') { $sPreviousTabContainer = $this->m_sCurrentTabContainer; $this->m_sCurrentTabContainer = $sTabContainer; return $sPreviousTabContainer; } public function SetCurrentTab($sTabLabel = '') { $sPreviousTab = $this->m_sCurrentTab; $this->m_sCurrentTab = $sTabLabel; return $sPreviousTab; } public function StartCollapsibleSection($sSectionLabel, $bOpen = false) { $this->add($this->GetStartCollapsibleSection($sSectionLabel, $bOpen)); } public function GetStartCollapsibleSection($sSectionLabel, $bOpen = false) { $sHtml = ''; static $iSectionId = 0; $sHtml .= "$sSectionLabel
\n"; $sStyle = $bOpen ? '' : 'style="display:none" '; $sHtml .= "
"; $this->add_ready_script("\$(\"#LnkCollapse_$iSectionId\").click(function() {\$(\"#Collapse_$iSectionId\").slideToggle('normal'); $(\"#LnkCollapse_$iSectionId\").toggleClass('open');});"); //$this->add_ready_script("$('#LnkCollapse_$iSectionId').hide();"); $iSectionId++; return $sHtml; } public function EndCollapsibleSection() { $this->add($this->GetEndCollapsibleSection()); } public function GetEndCollapsibleSection() { return "
"; } public function add($sHtml) { if (!empty($this->m_sCurrentTabContainer) && !empty($this->m_sCurrentTab)) { $this->AddToTab($this->m_sCurrentTabContainer, $this->m_sCurrentTab, $sHtml); } else { parent::add($sHtml); } } /* public function AddSearchForm($sClassName, $bOpen = false) { $iSearchSectionId = 0; $sStyle = $bOpen ? 'SearchDrawer' : 'SearchDrawer DrawerClosed'; $this->add("
\n"); $this->add("

Search form for ".Metamodel::GetName($sClassName)."

\n"); $this->add_ready_script("\$(\"#LnkSearch_$iSearchSectionId\").click(function() {\$(\"#Search_$iSearchSectionId\").slideToggle('normal'); $(\"#LnkSearch_$iSearchSectionId\").toggleClass('open');});"); $oFilter = new DBObjectSearch($sClassName); $sFilter = $oFilter->serialize(); $oSet = new CMDBObjectSet($oFilter); cmdbAbstractObject::DisplaySearchForm($this, $oSet, array('operation' => 'search', 'filter' => $sFilter, 'search_form' => true)); $this->add("
\n"); $this->add("
\n"); $this->add("
Search
\n"); $iSearchSectionId++; } */ } ?>