itopwebpage.class.inc.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  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. function BackToDetails(sClass, id)
  154. {
  155. window.location.href = './UI.php?operation=details&class='+sClass+'&id='+id;
  156. }
  157. ");
  158. $this->DisplayMenu();
  159. }
  160. public function AddToMenu($sHtml)
  161. {
  162. $this->m_sMenu .= $sHtml;
  163. }
  164. public function DisplayMenu()
  165. {
  166. // Combo box to select the organization
  167. $this->AddToMenu("<div id=\"OrganizationSelection\">
  168. <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");
  169. // List of visible Organizations
  170. $oContext = new UserContext();
  171. $oSearchFilter = $oContext->NewFilter("bizOrganization");
  172. $oSet = new CMDBObjectSet($oSearchFilter);
  173. $sSelected = ($this->m_currentOrganization == '') ? ' selected' : '';
  174. $this->AddToMenu("<option value=\"\"$sSelected>".Dict::S('UI:AllOrganizations')."</option>");
  175. if ($oSet->Count() > 0)
  176. while($oOrg = $oSet->Fetch())
  177. {
  178. if ($this->m_currentOrganization == $oOrg->GetKey())
  179. {
  180. $oCurrentOrganization = $oOrg;
  181. $sSelected = " selected";
  182. }
  183. else
  184. {
  185. $sSelected = "";
  186. }
  187. $this->AddToMenu("<option value=\"".$oOrg->GetKey()."\"$sSelected>".$oOrg->Get('name')."</option>\n");
  188. }
  189. $this->AddToMenu("</select>\n");
  190. // Add other dimensions/context information to this form
  191. $oAppContext = new ApplicationContext();
  192. $oAppContext->Reset('org_id'); // Org id is handled above and we want to be able to change it here !
  193. $this->AddToMenu($oAppContext->GetForForm());
  194. $this->AddToMenu("</form>\n");
  195. $this->AddToMenu("</div>\n");
  196. $this->AddToMenu("<ul id=\"browser\" class=\"dir\">\n");
  197. // Display the menu
  198. $oAppContext = new ApplicationContext();
  199. // 1) Application defined menus
  200. $oSearchFilter = $oContext->NewFilter("menuNode");
  201. $oSearchFilter->AddCondition('parent_id', 0, '=');
  202. $oSearchFilter->AddCondition('type', 'application', '=');
  203. // There may be more criteria added later to have a specific menu based on the user's profile
  204. $oSet = new CMDBObjectSet($oSearchFilter, array('rank' => true));
  205. while ($oRootMenuNode = $oSet->Fetch())
  206. {
  207. $oRootMenuNode->DisplayMenu($this, 'application', $oAppContext->GetAsHash());
  208. }
  209. // 2) User defined menus (Bookmarks)
  210. $oSearchFilter = $oContext->NewFilter("menuNode");
  211. $oSearchFilter->AddCondition('parent_id', 0, '=');
  212. $oSearchFilter->AddCondition('type', 'user', '=');
  213. $oSearchFilter->AddCondition('user_id', UserRights::GetUserId(), '=');
  214. // There may be more criteria added later to have a specific menu based on the user's profile
  215. $oSet = new CMDBObjectSet($oSearchFilter, array('rank' => true));
  216. while ($oRootMenuNode = $oSet->Fetch())
  217. {
  218. $oRootMenuNode->DisplayMenu($this, 'user', $oAppContext->GetAsHash());
  219. }
  220. // 3) Administrator menu
  221. if (userRights::IsAdministrator())
  222. {
  223. $oSearchFilter = $oContext->NewFilter("menuNode");
  224. $oSearchFilter->AddCondition('parent_id', 0, '=');
  225. $oSearchFilter->AddCondition('type', 'administrator', '=');
  226. // There may be more criteria added later to have a specific menu based on the user's profile
  227. $oSet = new CMDBObjectSet($oSearchFilter, array('rank' => true));
  228. while ($oRootMenuNode = $oSet->Fetch())
  229. {
  230. $oRootMenuNode->DisplayMenu($this, 'administrator', $oAppContext->GetAsHash());
  231. }
  232. }
  233. $this->AddToMenu("</ul>\n");
  234. }
  235. /**
  236. * Outputs (via some echo) the complete HTML page by assembling all its elements
  237. */
  238. public function output()
  239. {
  240. foreach($this->a_headers as $s_header)
  241. {
  242. header($s_header);
  243. }
  244. $s_captured_output = ob_get_contents();
  245. ob_end_clean();
  246. echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
  247. echo "<html>\n";
  248. echo "<head>\n";
  249. echo "<title>{$this->s_title}</title>\n";
  250. echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
  251. echo $this->get_base_tag();
  252. // Stylesheets MUST be loaded before any scripts otherwise
  253. // jQuery scripts may face some spurious problems (like failing on a 'reload')
  254. foreach($this->a_linked_stylesheets as $a_stylesheet)
  255. {
  256. if ($a_stylesheet['condition'] != "")
  257. {
  258. echo "<!--[if {$a_stylesheet['condition']}]>\n";
  259. }
  260. echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"{$a_stylesheet['link']}\" />\n";
  261. if ($a_stylesheet['condition'] != "")
  262. {
  263. echo "<![endif]-->\n";
  264. }
  265. }
  266. foreach($this->a_linked_scripts as $s_script)
  267. {
  268. echo "<script type=\"text/javascript\" src=\"$s_script\"></script>\n";
  269. }
  270. if (count($this->m_aReadyScripts)>0)
  271. {
  272. $this->add_script("\$(document).ready(function() {\n".implode("\n", $this->m_aReadyScripts)."\n});");
  273. }
  274. if (count($this->a_scripts)>0)
  275. {
  276. echo "<script type=\"text/javascript\">\n";
  277. foreach($this->a_scripts as $s_script)
  278. {
  279. echo "$s_script\n";
  280. }
  281. echo "</script>\n";
  282. }
  283. if (count($this->a_styles)>0)
  284. {
  285. echo "<style>\n";
  286. foreach($this->a_styles as $s_style)
  287. {
  288. echo "$s_style\n";
  289. }
  290. echo "</style>\n";
  291. }
  292. echo "<link rel=\"search\" type=\"application/opensearchdescription+xml\" title=\"iTop\" href=\"./opensearch.xml.php\" />\n";
  293. echo "</head>\n";
  294. echo "<body>\n";
  295. // Display the header
  296. if (ITOP_REVISION == '$WCREV$')
  297. {
  298. // This is NOT a version built using the buil system, just display the main version
  299. $sVersionString = "iTop Version ".ITOP_VERSION;
  300. }
  301. else
  302. {
  303. // This is a build made from SVN, let display the full information
  304. $sVersionString = "iTop Version ".ITOP_VERSION." revision ".ITOP_REVISION.", built on: ".ITOP_BUILD_DATE;
  305. }
  306. echo "<div id=\"Header\">\n";
  307. echo "<div class=\"iTopLogo\" title=\"$sVersionString\"><span>iTop</span></div>\n";
  308. //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";
  309. $sText = Utils::ReadParam('text', '');
  310. $sOnClick = "";
  311. if (empty($sText))
  312. {
  313. // if no search text is supplied then
  314. // 1) the search text is filled with "your search"
  315. // 2) clicking on it will erase it
  316. $sText = Dict::S("UI:YourSearch");
  317. $sOnClick = " onclick=\"this.value='';this.onclick=null;\"";
  318. }
  319. $sUserName = UserRights::GetUser();
  320. $sIsAdmin = UserRights::IsAdministrator() ? '(Administrator)' : '';
  321. if (UserRights::IsAdministrator())
  322. {
  323. $sLogonMessage = Dict::Format('UI:LoggedAsMessage+Admin', $sUserName);
  324. }
  325. else
  326. {
  327. $sLogonMessage = Dict::Format('UI:LoggedAsMessage', $sUserName);
  328. }
  329. $sLogOffBtn = Dict::S('UI:Button:Logoff');
  330. $sSearchBtn = Dict::S('UI:Button:GlobalSearch');
  331. echo "<div id=\"Login\" style=\"position:absolute; top:18px; right:16px; width:600px;\">{$sLogonMessage}&nbsp;&nbsp;";
  332. echo "<form action=\"../pages/UI.php\" method=\"post\" style=\"display:inline\">\n";
  333. echo "<input type=\"submit\" value=\"$sLogOffBtn\" />\n";
  334. echo "<input type=\"hidden\" name=\"loginop\" value=\"logoff\" />\n";
  335. echo "</form>\n";
  336. 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\" />
  337. <input type=\"hidden\" name=\"operation\" value=\"full_text\" /></form>\n";
  338. echo "</div>\n";
  339. echo "</div>\n";
  340. // Display the menu
  341. echo "<div id=\"MySplitter\">\n";
  342. echo " <div id=\"LeftPane\">\n";
  343. echo $this->m_sMenu;
  344. echo " </div> <!-- LeftPane -->\n";
  345. echo "<div id=\"RightPane\">\n";
  346. // Render the tabs in the page (if any)
  347. foreach($this->m_aTabs as $sTabContainerName => $m_aTabs)
  348. {
  349. $sTabs = '';
  350. $container_index = 0;
  351. if (count($m_aTabs) > 0)
  352. {
  353. $sTabs = "<!-- tabs -->\n<div id=\"tabbedContent_{$container_index}\" class=\"light\">\n";
  354. $sTabs .= "<ul>\n";
  355. // Display the unordered list that will be rendered as the tabs
  356. $i = 0;
  357. foreach($m_aTabs as $sTabName => $sTabContent)
  358. {
  359. $sTabs .= "<li><a href=\"#fragment_$i\" class=\"tab\"><span>".htmlentities($sTabName, ENT_QUOTES, 'UTF-8')."</span></a></li>\n";
  360. $i++;
  361. }
  362. $sTabs .= "</ul>\n";
  363. // Now add the content of the tabs themselves
  364. $i = 0;
  365. foreach($m_aTabs as $sTabName => $sTabContent)
  366. {
  367. $sTabs .= "<div id=\"fragment_$i\">".$sTabContent."</div>\n";
  368. $i++;
  369. }
  370. $sTabs .= "</div>\n<!-- end of tabs-->\n";
  371. }
  372. $this->s_content = str_replace("\$Tabs:$sTabContainerName\$", $sTabs, $this->s_content);
  373. $container_index++;
  374. }
  375. // Display the page's content
  376. echo $this->s_content;
  377. // Add the captured output
  378. if (trim($s_captured_output) != "")
  379. {
  380. echo "<div class=\"raw_output\">$s_captured_output</div>\n";
  381. }
  382. echo $this->s_deferred_content;
  383. echo "<div class=\"jqmWindow\" id=\"ex2\">Please wait...</div>\n"; // jqModal Window
  384. echo "</div> <!-- RightPane -->\n";
  385. echo "</div> <!-- Splitter -->\n";
  386. echo "<div class=\"jqmWindow\" id=\"ModalDlg\"></div>";
  387. echo "</body>\n";
  388. echo "</html>\n";
  389. }
  390. public function AddTabContainer($sTabContainer)
  391. {
  392. $this->m_aTabs[$sTabContainer] = array();
  393. $this->add("\$Tabs:$sTabContainer\$");
  394. }
  395. public function AddToTab($sTabContainer, $sTabLabel, $sHtml)
  396. {
  397. if (!isset($this->m_aTabs[$sTabContainer][$sTabLabel]))
  398. {
  399. // Set the content of the tab
  400. $this->m_aTabs[$sTabContainer][$sTabLabel] = $sHtml;
  401. }
  402. else
  403. {
  404. // Append to the content of the tab
  405. $this->m_aTabs[$sTabContainer][$sTabLabel] .= $sHtml;
  406. }
  407. }
  408. public function SetCurrentTabContainer($sTabContainer = '')
  409. {
  410. $sPreviousTabContainer = $this->m_sCurrentTabContainer;
  411. $this->m_sCurrentTabContainer = $sTabContainer;
  412. return $sPreviousTabContainer;
  413. }
  414. public function SetCurrentTab($sTabLabel = '')
  415. {
  416. $sPreviousTab = $this->m_sCurrentTab;
  417. $this->m_sCurrentTab = $sTabLabel;
  418. return $sPreviousTab;
  419. }
  420. /**
  421. * Make the given tab the active one, as if it were clicked
  422. * DOES NOT WORK: apparently in the *old* version of jquery
  423. * that we are using this is not supported... TO DO upgrade
  424. * the whole jquery bundle...
  425. */
  426. public function SelectTab($sTabContainer, $sTabLabel)
  427. {
  428. $container_index = 0;
  429. $tab_index = 0;
  430. foreach($this->m_aTabs as $sCurrentTabContainerName => $aTabs)
  431. {
  432. if ($sTabContainer == $sCurrentTabContainerName)
  433. {
  434. foreach($aTabs as $sCurrentTabLabel => $void)
  435. {
  436. if ($sCurrentTabLabel == $sTabLabel)
  437. {
  438. break;
  439. }
  440. $tab_index++;
  441. }
  442. break;
  443. }
  444. $container_index++;
  445. }
  446. $sSelector = '#tabbedContent_'.$container_index.' > ul';
  447. $this->add_ready_script("$('$sSelector').tabs('select', $tab_index);");
  448. }
  449. public function StartCollapsibleSection($sSectionLabel, $bOpen = false)
  450. {
  451. $this->add($this->GetStartCollapsibleSection($sSectionLabel, $bOpen));
  452. }
  453. public function GetStartCollapsibleSection($sSectionLabel, $bOpen = false)
  454. {
  455. $sHtml = '';
  456. static $iSectionId = 0;
  457. $sImgStyle = $bOpen ? ' open' : '';
  458. $sHtml .= "<a id=\"LnkCollapse_$iSectionId\" class=\"CollapsibleLabel{$sImgStyle}\" href=\"#\">$sSectionLabel</a></br>\n";
  459. $sStyle = $bOpen ? '' : 'style="display:none" ';
  460. $sHtml .= "<div id=\"Collapse_$iSectionId\" $sStyle>";
  461. $this->add_ready_script("\$(\"#LnkCollapse_$iSectionId\").click(function() {\$(\"#Collapse_$iSectionId\").slideToggle('normal'); $(\"#LnkCollapse_$iSectionId\").toggleClass('open');});");
  462. //$this->add_ready_script("$('#LnkCollapse_$iSectionId').hide();");
  463. $iSectionId++;
  464. return $sHtml;
  465. }
  466. public function EndCollapsibleSection()
  467. {
  468. $this->add($this->GetEndCollapsibleSection());
  469. }
  470. public function GetEndCollapsibleSection()
  471. {
  472. return "</div>";
  473. }
  474. public function add($sHtml)
  475. {
  476. if (!empty($this->m_sCurrentTabContainer) && !empty($this->m_sCurrentTab))
  477. {
  478. $this->AddToTab($this->m_sCurrentTabContainer, $this->m_sCurrentTab, $sHtml);
  479. }
  480. else
  481. {
  482. parent::add($sHtml);
  483. }
  484. }
  485. /*
  486. public function AddSearchForm($sClassName, $bOpen = false)
  487. {
  488. $iSearchSectionId = 0;
  489. $sStyle = $bOpen ? 'SearchDrawer' : 'SearchDrawer DrawerClosed';
  490. $this->add("<div id=\"Search_$iSearchSectionId\" class=\"$sStyle\">\n");
  491. $this->add("<h1>Search form for ".Metamodel::GetName($sClassName)."</h1>\n");
  492. $this->add_ready_script("\$(\"#LnkSearch_$iSearchSectionId\").click(function() {\$(\"#Search_$iSearchSectionId\").slideToggle('normal'); $(\"#LnkSearch_$iSearchSectionId\").toggleClass('open');});");
  493. $oFilter = new DBObjectSearch($sClassName);
  494. $sFilter = $oFilter->serialize();
  495. $oSet = new CMDBObjectSet($oFilter);
  496. cmdbAbstractObject::DisplaySearchForm($this, $oSet, array('operation' => 'search', 'filter' => $sFilter, 'search_form' => true));
  497. $this->add("</div>\n");
  498. $this->add("<div class=\"HRDrawer\"/></div>\n");
  499. $this->add("<div id=\"LnkSearch_$iSearchSectionId\" class=\"DrawerHandle\">Search</div>\n");
  500. $iSearchSectionId++;
  501. }
  502. */
  503. }
  504. ?>