$oPage->add("<h2>" . MetaModel::GetClassIcon($sClass) . " <span class=\"hilite\">" . Dict::Format('UI:Search:Count_ObjectsOf_Class_Found', $oSet->Count(), Metamodel::GetName($sClass)) . "</h2>\n"); $oPage->add("</div>\n"); if ($oSet->Count() > 0) { $aLeafs = array(); while ($oObj = $oSet->Fetch()) { if (get_class($oObj) == $sClass) { $aLeafs[] = $oObj->GetKey(); } } $oLeafsFilter = new DBObjectSearch($sClass); if (count($aLeafs) > 0) { $oLeafsFilter->AddCondition('id', $aLeafs, 'IN'); $oBlock = new DisplayBlock($oLeafsFilter, 'list', false); $sBlockId = 'global_search_' . $sClass; $oPage->add('<div id="' . $sBlockId . '">'); $oBlock->RenderContent($oPage, array('table_id' => $sBlockId, 'currentId' => $sBlockId)); $oPage->add('</div>'); $oPage->P(' '); // Some space ? // Hide "no object found" $oPage->add_ready_script('$("#no_object_found").hide();'); } } $oPage->add_ready_script(<<<EOF \$('#full_text_indicator').hide(); \$('#full_text_progress,#full_text_progress_placeholder').hide(500); EOF ); break; default: $oPage->p("Invalid query.");
if ($sFilter != '') { $oFilter = DBSearch::unserialize($sFilter); $oDisplayBlock = new DisplayBlock($oFilter, 'open_flash_chart_ajax', false); $oDisplayBlock->RenderContent($oPage, $aParams); } else { $oPage->add("<chart>\n<chart_type>3d pie</chart_type><!-- empty filter '{$sFilter}' --></chart>\n."); } break; case 'modal_details': $oPage->SetContentType('text/html'); $key = utils::ReadParam('id', 0); $oFilter = new DBObjectSearch($sClass); $oFilter->AddCondition('id', $key, '='); $oPage->Add("<p style=\"width:100%; margin-top:-5px;padding:3px; background-color:#33f; color:#fff;\">Object Details</p>\n"); $oDisplayBlock = new DisplayBlock($oFilter, 'details', false); $oDisplayBlock->RenderContent($oPage); $oPage->Add("<input type=\"button\" class=\"jqmClose\" value=\" Close \" />\n"); break; case 'link': $oPage->SetContentType('text/html'); $sClass = utils::ReadParam('sclass', 'logInfra', false, 'class'); $sAttCode = utils::ReadParam('attCode', 'name'); //$sOrg = utils::ReadParam('org_id', ''); $sName = utils::ReadParam('q', ''); $iMaxCount = utils::ReadParam('max', 30); $iCount = 0; $oFilter = new DBObjectSearch($sClass); $oFilter->AddCondition($sAttCode, $sName, 'Begins with'); //$oFilter->AddCondition('org_id', $sOrg, '='); $oSet = new CMDBObjectSet($oFilter, array($sAttCode => true)); while ($iCount < $iMaxCount && ($oObj = $oSet->fetch())) {