itopwebpage.class.inc.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. <?php
  2. // Copyright (C) 2010 Combodo SARL
  3. //
  4. // This program is free software; you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation; version 3 of the License.
  7. //
  8. // This program is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU General Public License for more details.
  12. //
  13. // You should have received a copy of the GNU General Public License
  14. // along with this program; if not, write to the Free Software
  15. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. /**
  17. * Class iTopWebPage
  18. *
  19. * @author Erwan Taloc <erwan.taloc@combodo.com>
  20. * @author Romain Quetiez <romain.quetiez@combodo.com>
  21. * @author Denis Flaven <denis.flaven@combodo.com>
  22. * @license http://www.opensource.org/licenses/gpl-3.0.html LGPL
  23. */
  24. require_once("../application/nicewebpage.class.inc.php");
  25. require_once("../application/usercontext.class.inc.php");
  26. require_once("../application/applicationcontext.class.inc.php");
  27. /**
  28. * Web page with some associated CSS and scripts (jquery) for a fancier display
  29. */
  30. class iTopWebPage extends NiceWebPage
  31. {
  32. private $m_sMenu;
  33. private $m_currentOrganization;
  34. private $m_aTabs;
  35. private $m_sCurrentTabContainer;
  36. private $m_sCurrentTab;
  37. public function __construct($sTitle, $currentOrganization)
  38. {
  39. parent::__construct($sTitle);
  40. $this->m_sCurrentTabContainer = '';
  41. $this->m_sCurrentTab = '';
  42. $this->m_aTabs = array();
  43. $this->m_sMenu = "";
  44. $oAppContext = new ApplicationContext();
  45. $sExtraParams = $oAppContext->GetForLink();
  46. $this->add_header("Content-type: text/html; charset=utf-8");
  47. $this->add_header("Cache-control: no-cache");
  48. $this->m_currentOrganization = $currentOrganization;
  49. $this->add_linked_script("../js/jquery.dimensions.js");
  50. $this->add_linked_script("../js/splitter.js");
  51. $this->add_linked_script("../js/jquery.tablehover.js");
  52. $this->add_linked_script("../js/jquery.treeview.js");
  53. $this->add_linked_script("../js/jquery.autocomplete.js");
  54. $this->add_linked_script("../js/jquery.bgiframe.js");
  55. $this->add_linked_script("../js/jquery.positionBy.js");
  56. $this->add_linked_script("../js/jquery.popupmenu.js");
  57. $this->add_linked_script("../js/date.js");
  58. $this->add_linked_script("../js/jquery.date.picker.js");
  59. $this->add_linked_script("../js/jquery.tablesorter.min.js");
  60. $this->add_linked_script("../js/jquery.blockUI.js");
  61. $this->add_linked_script("../js/utils.js");
  62. //$this->add_linked_script("../js/jquery-ui-personalized-1.5.3.js");
  63. $this->add_linked_script("../js/swfobject.js");
  64. $this->add_linked_stylesheet("../css/jquery.treeview.css");
  65. $this->add_linked_stylesheet("../css/jquery.autocomplete.css");
  66. $this->add_linked_stylesheet("../css/date.picker.css");
  67. $this->add_ready_script(
  68. <<<EOF
  69. //add new widget called TruncatedList to properly display truncated lists when they are sorted
  70. $.tablesorter.addWidget({
  71. // give the widget a id
  72. id: "truncatedList",
  73. // format is called when the on init and when a sorting has finished
  74. format: function(table)
  75. {
  76. // Check if there is a "truncated" line
  77. this.truncatedList = false;
  78. if ($("tr td.truncated",table).length > 0)
  79. {
  80. this.truncatedList = true;
  81. }
  82. if (this.truncatedList)
  83. {
  84. $("tr td",table).removeClass('truncated');
  85. $("tr:last td",table).addClass('truncated');
  86. }
  87. }
  88. });
  89. // Vertical splitter. The min/max/starting sizes for the left (A) pane
  90. // are set here. All values are in pixels.
  91. $("#MySplitter").splitter({
  92. type: "v",
  93. minA: 100, initA: 250, maxA: 500,
  94. accessKey: "|"
  95. });
  96. // Horizontal splitter, nested in the right pane of the vertical splitter.
  97. if ( $("#TopPane").length > 0)
  98. {
  99. $("#RightPane").splitter({
  100. type: "h" //,
  101. //minA: 100, initA: 150, maxA: 500,
  102. //accessKey: "_"
  103. });
  104. }
  105. // Manually set the outer splitter's height to fill the browser window.
  106. // This must be re-done any time the browser window is resized.
  107. $(window).bind("resize", function(){
  108. var ms = $("#MySplitter");
  109. var top = ms.offset().top; // from dimensions.js
  110. var wh = $(window).height();
  111. // Account for margin or border on the splitter container
  112. var mrg = parseInt(ms.css("marginBottom")) || 0;
  113. var brd = parseInt(ms.css("borderBottomWidth")) || 0;
  114. ms.css("height", (wh-top-mrg-brd)+"px");
  115. // IE fires resize for splitter; others don't so do it here
  116. if ( !jQuery.browser.msie )
  117. ms.trigger("resize");
  118. }).trigger("resize");
  119. var ms = $("#MySplitter");
  120. ms.trigger("resize");
  121. if ( $("#TopPane").length > 0)
  122. {
  123. $("#RightPane").trigger("resize");
  124. }
  125. $("div[id^=tabbedContent] > ul").tabs( 1, { fxFade: true, fxSpeed: 'fast' } ); // tabs
  126. $("table.listResults").tableHover(); // hover tables
  127. $(".listResults").tablesorter( { headers: { 0:{sorter: false }}, widgets: ['zebra', 'truncatedList']} ); // sortable and zebra tables
  128. $(".date-pick").datePicker( {clickInput: false, createButton: true, startDate: '1900-01-01'} ); // Date picker
  129. $('#ModalDlg').jqm({ajax: '@href', trigger: 'a.jqmTrigger', overlay:70, modal:true, toTop:true}); // jqModal Window
  130. //$('.display_block').draggable(); // make the blocks draggable
  131. EOF
  132. );
  133. $this->add_script("
  134. // For automplete
  135. function findValue(li) {
  136. if( li == null ) return alert(\"No match!\");
  137. // if coming from an AJAX call, let's use the CityId as the value
  138. if( !!li.extra ) var sValue = li.extra[0];
  139. // otherwise, let's just display the value in the text box
  140. else var sValue = li.selectValue;
  141. //alert(\"The value you selected was: \" + sValue);
  142. }
  143. function selectItem(li) {
  144. findValue(li);
  145. }
  146. function formatItem(row) {
  147. return row[0];
  148. }
  149. function goBack()
  150. {
  151. window.history.back();
  152. }
  153. ");
  154. $this->DisplayMenu();
  155. }
  156. public function AddToMenu($sHtml)
  157. {
  158. $this->m_sMenu .= $sHtml;
  159. }
  160. public function DisplayMenu()
  161. {
  162. // Combo box to select the organization
  163. $this->AddToMenu("<div id=\"OrganizationSelection\">
  164. <form style=\"display:inline\" action=\"{$_SERVER['PHP_SELF']}\"><select style=\"width:150px;font-size:x-small\" name=\"org_id\" title=\"Pick an organization\" onChange=\"this.form.submit();\">\n");
  165. // List of visible Organizations
  166. $oContext = new UserContext();
  167. $oSearchFilter = $oContext->NewFilter("bizOrganization");
  168. $oSet = new CMDBObjectSet($oSearchFilter);
  169. $sSelected = ($this->m_currentOrganization == '') ? ' selected' : '';
  170. $this->AddToMenu("<option value=\"\"$sSelected>".Dict::S('UI:AllOrganizations')."</option>");
  171. if ($oSet->Count() > 0)
  172. while($oOrg = $oSet->Fetch())
  173. {
  174. if ($this->m_currentOrganization == $oOrg->GetKey())
  175. {
  176. $oCurrentOrganization = $oOrg;
  177. $sSelected = " selected";
  178. }
  179. else
  180. {
  181. $sSelected = "";
  182. }
  183. $this->AddToMenu("<option value=\"".$oOrg->GetKey()."\"$sSelected>".$oOrg->Get('name')."</option>\n");
  184. }
  185. $this->AddToMenu("</select>\n");
  186. // Add other dimensions/context information to this form
  187. $oAppContext = new ApplicationContext();
  188. $oAppContext->Reset('org_id'); // Org id is handled above and we want to be able to change it here !
  189. $this->AddToMenu($oAppContext->GetForForm());
  190. $this->AddToMenu("</form>\n");
  191. $this->AddToMenu("</div>\n");
  192. $this->AddToMenu("<ul id=\"browser\" class=\"dir\">\n");
  193. // Display the menu
  194. $oAppContext = new ApplicationContext();
  195. // 1) Application defined menus
  196. $oSearchFilter = $oContext->NewFilter("menuNode");
  197. $oSearchFilter->AddCondition('parent_id', 0, '=');
  198. $oSearchFilter->AddCondition('type', 'application', '=');
  199. // There may be more criteria added later to have a specific menu based on the user's profile
  200. $oSet = new CMDBObjectSet($oSearchFilter, array('rank' => true));
  201. while ($oRootMenuNode = $oSet->Fetch())
  202. {
  203. $oRootMenuNode->DisplayMenu($this, 'application', $oAppContext->GetAsHash());
  204. }
  205. // 2) User defined menus (Bookmarks)
  206. $oSearchFilter = $oContext->NewFilter("menuNode");
  207. $oSearchFilter->AddCondition('parent_id', 0, '=');
  208. $oSearchFilter->AddCondition('type', 'user', '=');
  209. $oSearchFilter->AddCondition('user_id', UserRights::GetUserId(), '=');
  210. // There may be more criteria added later to have a specific menu based on the user's profile
  211. $oSet = new CMDBObjectSet($oSearchFilter, array('rank' => true));
  212. while ($oRootMenuNode = $oSet->Fetch())
  213. {
  214. $oRootMenuNode->DisplayMenu($this, 'user', $oAppContext->GetAsHash());
  215. }
  216. // 3) Administrator menu
  217. if (userRights::IsAdministrator())
  218. {
  219. $oSearchFilter = $oContext->NewFilter("menuNode");
  220. $oSearchFilter->AddCondition('parent_id', 0, '=');
  221. $oSearchFilter->AddCondition('type', 'administrator', '=');
  222. // There may be more criteria added later to have a specific menu based on the user's profile
  223. $oSet = new CMDBObjectSet($oSearchFilter, array('rank' => true));
  224. while ($oRootMenuNode = $oSet->Fetch())
  225. {
  226. $oRootMenuNode->DisplayMenu($this, 'administrator', $oAppContext->GetAsHash());
  227. }
  228. }
  229. $this->AddToMenu("</ul>\n");
  230. }
  231. /**
  232. * Outputs (via some echo) the complete HTML page by assembling all its elements
  233. */
  234. public function output()
  235. {
  236. foreach($this->a_headers as $s_header)
  237. {
  238. header($s_header);
  239. }
  240. $s_captured_output = ob_get_contents();
  241. ob_end_clean();
  242. echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
  243. echo "<html>\n";
  244. echo "<head>\n";
  245. echo "<title>{$this->s_title}</title>\n";
  246. echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
  247. echo $this->get_base_tag();
  248. // Stylesheets MUST be loaded before any scripts otherwise
  249. // jQuery scripts may face some spurious problems (like failing on a 'reload')
  250. foreach($this->a_linked_stylesheets as $a_stylesheet)
  251. {
  252. if ($a_stylesheet['condition'] != "")
  253. {
  254. echo "<!--[if {$a_stylesheet['condition']}]>\n";
  255. }
  256. echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"{$a_stylesheet['link']}\" />\n";
  257. if ($a_stylesheet['condition'] != "")
  258. {
  259. echo "<![endif]-->\n";
  260. }
  261. }
  262. foreach($this->a_linked_scripts as $s_script)
  263. {
  264. echo "<script type=\"text/javascript\" src=\"$s_script\"></script>\n";
  265. }
  266. if (count($this->m_aReadyScripts)>0)
  267. {
  268. $this->add_script("\$(document).ready(function() {\n".implode("\n", $this->m_aReadyScripts)."\n});");
  269. }
  270. if (count($this->a_scripts)>0)
  271. {
  272. echo "<script type=\"text/javascript\">\n";
  273. foreach($this->a_scripts as $s_script)
  274. {
  275. echo "$s_script\n";
  276. }
  277. echo "</script>\n";
  278. }
  279. if (count($this->a_styles)>0)
  280. {
  281. echo "<style>\n";
  282. foreach($this->a_styles as $s_style)
  283. {
  284. echo "$s_style\n";
  285. }
  286. echo "</style>\n";
  287. }
  288. echo "<link rel=\"search\" type=\"application/opensearchdescription+xml\" title=\"iTop\" href=\"./opensearch.xml.php\" />\n";
  289. echo "</head>\n";
  290. echo "<body>\n";
  291. // Display the header
  292. if (ITOP_REVISION == '$WCREV$')
  293. {
  294. // This is NOT a version built using the buil system, just display the main version
  295. $sVersionString = "iTop Version ".ITOP_VERSION;
  296. }
  297. else
  298. {
  299. // This is a build made from SVN, let display the full information
  300. $sVersionString = "iTop Version ".ITOP_VERSION." revision ".ITOP_REVISION.", built on: ".ITOP_BUILD_DATE;
  301. }
  302. echo "<div id=\"Header\">\n";
  303. echo "<div class=\"iTopLogo\" title=\"$sVersionString\"><span>iTop</span></div>\n";
  304. //echo "<div id=\"GlobalSearch\"><div style=\"border: 1px solid #999; padding:1px; background-color:#fff;\"><img src=\"../images/magnifier.gif\"/><input style=\"border:0\" type=\"text\" size=\"15\" title=\"Global Search\"></input></div></div>\n";
  305. $sText = Utils::ReadParam('text', '');
  306. $sOnClick = "";
  307. if (empty($sText))
  308. {
  309. // if no search text is supplied then
  310. // 1) the search text is filled with "your search"
  311. // 2) clicking on it will erase it
  312. $sText = Dict::S("UI:YourSearch");
  313. $sOnClick = " onclick=\"this.value='';this.onclick=null;\"";
  314. }
  315. $sUserName = UserRights::GetUser();
  316. $sIsAdmin = UserRights::IsAdministrator() ? '(Administrator)' : '';
  317. if (UserRights::IsAdministrator())
  318. {
  319. $sLogonMessage = Dict::Format('UI:LoggedAsMessage+Admin', $sUserName);
  320. }
  321. else
  322. {
  323. $sLogonMessage = Dict::Format('UI:LoggedAsMessage', $sUserName);
  324. }
  325. $sLogOffBtn = Dict::S('UI:Button:Logoff');
  326. $sSearchBtn = Dict::S('UI:Button:GlobalSearch');
  327. echo "<div id=\"Login\" style=\"position:absolute; top:18px; right:16px; width:600px;\">{$sLogonMessage}&nbsp;&nbsp;";
  328. echo "<form action=\"../pages/UI.php\" method=\"post\" style=\"display:inline\">\n";
  329. echo "<input type=\"submit\" value=\"$sLogOffBtn\" />\n";
  330. echo "<input type=\"hidden\" name=\"loginop\" value=\"logoff\" />\n";
  331. echo "</form>\n";
  332. echo "<form action=\"../pages/UI.php\" style=\"display:inline\"><div style=\"padding:1px; background-color:#fff;display:inline;\"><img src=\"../images/magnifier.gif\"/><input style=\"border:0\" type=\"text\" size=\"15\" title=\"Global Search\" name=\"text\" value=\"$sText\"$sOnClick></input></div><input type=\"submit\" value=\"$sSearchBtn\" />
  333. <input type=\"hidden\" name=\"operation\" value=\"full_text\" /></form>\n";
  334. echo "</div>\n";
  335. echo "</div>\n";
  336. // Display the menu
  337. echo "<div id=\"MySplitter\">\n";
  338. echo " <div id=\"LeftPane\">\n";
  339. echo $this->m_sMenu;
  340. echo " </div> <!-- LeftPane -->\n";
  341. echo "<div id=\"RightPane\">\n";
  342. // Render the tabs in the page (if any)
  343. foreach($this->m_aTabs as $sTabContainerName => $m_aTabs)
  344. {
  345. $sTabs = '';
  346. $container_index = 0;
  347. if (count($m_aTabs) > 0)
  348. {
  349. $sTabs = "<!-- tabs -->\n<div id=\"tabbedContent_{$container_index}\" class=\"light\">\n";
  350. $sTabs .= "<ul>\n";
  351. // Display the unordered list that will be rendered as the tabs
  352. $i = 0;
  353. foreach($m_aTabs as $sTabName => $sTabContent)
  354. {
  355. $sTabs .= "<li><a href=\"#fragment_$i\" class=\"tab\"><span>".htmlentities($sTabName, ENT_QUOTES, 'UTF-8')."</span></a></li>\n";
  356. $i++;
  357. }
  358. $sTabs .= "</ul>\n";
  359. // Now add the content of the tabs themselves
  360. $i = 0;
  361. foreach($m_aTabs as $sTabName => $sTabContent)
  362. {
  363. $sTabs .= "<div id=\"fragment_$i\">".$sTabContent."</div>\n";
  364. $i++;
  365. }
  366. $sTabs .= "</div>\n<!-- end of tabs-->\n";
  367. }
  368. $this->s_content = str_replace("\$Tabs:$sTabContainerName\$", $sTabs, $this->s_content);
  369. $container_index++;
  370. }
  371. // Display the page's content
  372. echo $this->s_content;
  373. // Add the captured output
  374. if (trim($s_captured_output) != "")
  375. {
  376. echo "<div class=\"raw_output\">$s_captured_output</div>\n";
  377. }
  378. echo $this->s_deferred_content;
  379. echo "<div class=\"jqmWindow\" id=\"ex2\">Please wait...</div>\n"; // jqModal Window
  380. echo "</div> <!-- RightPane -->\n";
  381. echo "</div> <!-- Splitter -->\n";
  382. echo "<div class=\"jqmWindow\" id=\"ModalDlg\"></div>";
  383. echo "</body>\n";
  384. echo "</html>\n";
  385. }
  386. public function AddTabContainer($sTabContainer)
  387. {
  388. $this->m_aTabs[$sTabContainer] = array();
  389. $this->add("\$Tabs:$sTabContainer\$");
  390. }
  391. public function AddToTab($sTabContainer, $sTabLabel, $sHtml)
  392. {
  393. if (!isset($this->m_aTabs[$sTabContainer][$sTabLabel]))
  394. {
  395. // Set the content of the tab
  396. $this->m_aTabs[$sTabContainer][$sTabLabel] = $sHtml;
  397. }
  398. else
  399. {
  400. // Append to the content of the tab
  401. $this->m_aTabs[$sTabContainer][$sTabLabel] .= $sHtml;
  402. }
  403. }
  404. public function SetCurrentTabContainer($sTabContainer = '')
  405. {
  406. $sPreviousTabContainer = $this->m_sCurrentTabContainer;
  407. $this->m_sCurrentTabContainer = $sTabContainer;
  408. return $sPreviousTabContainer;
  409. }
  410. public function SetCurrentTab($sTabLabel = '')
  411. {
  412. $sPreviousTab = $this->m_sCurrentTab;
  413. $this->m_sCurrentTab = $sTabLabel;
  414. return $sPreviousTab;
  415. }
  416. /**
  417. * Make the given tab the active one, as if it were clicked
  418. * DOES NOT WORK: apparently in the *old* version of jquery
  419. * that we are using this is not supported... TO DO upgrade
  420. * the whole jquery bundle...
  421. */
  422. public function SelectTab($sTabContainer, $sTabLabel)
  423. {
  424. $container_index = 0;
  425. $tab_index = 0;
  426. foreach($this->m_aTabs as $sCurrentTabContainerName => $aTabs)
  427. {
  428. if ($sTabContainer == $sCurrentTabContainerName)
  429. {
  430. foreach($aTabs as $sCurrentTabLabel => $void)
  431. {
  432. if ($sCurrentTabLabel == $sTabLabel)
  433. {
  434. break;
  435. }
  436. $tab_index++;
  437. }
  438. break;
  439. }
  440. $container_index++;
  441. }
  442. $sSelector = '#tabbedContent_'.$container_index.' > ul';
  443. $this->add_ready_script("$('$sSelector').tabs('select', $tab_index);");
  444. }
  445. public function StartCollapsibleSection($sSectionLabel, $bOpen = false)
  446. {
  447. $this->add($this->GetStartCollapsibleSection($sSectionLabel, $bOpen));
  448. }
  449. public function GetStartCollapsibleSection($sSectionLabel, $bOpen = false)
  450. {
  451. $sHtml = '';
  452. static $iSectionId = 0;
  453. $sImgStyle = $bOpen ? ' open' : '';
  454. $sHtml .= "<a id=\"LnkCollapse_$iSectionId\" class=\"CollapsibleLabel{$sImgStyle}\" href=\"#\">$sSectionLabel</a></br>\n";
  455. $sStyle = $bOpen ? '' : 'style="display:none" ';
  456. $sHtml .= "<div id=\"Collapse_$iSectionId\" $sStyle>";
  457. $this->add_ready_script("\$(\"#LnkCollapse_$iSectionId\").click(function() {\$(\"#Collapse_$iSectionId\").slideToggle('normal'); $(\"#LnkCollapse_$iSectionId\").toggleClass('open');});");
  458. //$this->add_ready_script("$('#LnkCollapse_$iSectionId').hide();");
  459. $iSectionId++;
  460. return $sHtml;
  461. }
  462. public function EndCollapsibleSection()
  463. {
  464. $this->add($this->GetEndCollapsibleSection());
  465. }
  466. public function GetEndCollapsibleSection()
  467. {
  468. return "</div>";
  469. }
  470. public function add($sHtml)
  471. {
  472. if (!empty($this->m_sCurrentTabContainer) && !empty($this->m_sCurrentTab))
  473. {
  474. $this->AddToTab($this->m_sCurrentTabContainer, $this->m_sCurrentTab, $sHtml);
  475. }
  476. else
  477. {
  478. parent::add($sHtml);
  479. }
  480. }
  481. /*
  482. public function AddSearchForm($sClassName, $bOpen = false)
  483. {
  484. $iSearchSectionId = 0;
  485. $sStyle = $bOpen ? 'SearchDrawer' : 'SearchDrawer DrawerClosed';
  486. $this->add("<div id=\"Search_$iSearchSectionId\" class=\"$sStyle\">\n");
  487. $this->add("<h1>Search form for ".Metamodel::GetName($sClassName)."</h1>\n");
  488. $this->add_ready_script("\$(\"#LnkSearch_$iSearchSectionId\").click(function() {\$(\"#Search_$iSearchSectionId\").slideToggle('normal'); $(\"#LnkSearch_$iSearchSectionId\").toggleClass('open');});");
  489. $oFilter = new DBObjectSearch($sClassName);
  490. $sFilter = $oFilter->serialize();
  491. $oSet = new CMDBObjectSet($oFilter);
  492. cmdbAbstractObject::DisplaySearchForm($this, $oSet, array('operation' => 'search', 'filter' => $sFilter, 'search_form' => true));
  493. $this->add("</div>\n");
  494. $this->add("<div class=\"HRDrawer\"/></div>\n");
  495. $this->add("<div id=\"LnkSearch_$iSearchSectionId\" class=\"DrawerHandle\">Search</div>\n");
  496. $iSearchSectionId++;
  497. }
  498. */
  499. }
  500. ?>