navigator.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. * Display the Flash navigator, in the whole pane
  18. */
  19. require_once('../approot.inc.php');
  20. require_once(APPROOT.'/application/application.inc.php');
  21. require_once(APPROOT.'/application/itopwebpage.class.inc.php');
  22. require_once(APPROOT.'/application/startup.inc.php');
  23. require_once(APPROOT.'/application/loginwebpage.class.inc.php');
  24. LoginWebPage::DoLogin(); // Check user rights and prompt if needed
  25. $sOperation = utils::ReadParam('operation', 'menu');
  26. $oAppContext = new ApplicationContext();
  27. $oP = new iTopWebPage("iTop - Navigator");
  28. // Main program
  29. $sClass = utils::ReadParam('class', '');
  30. $id = utils::ReadParam('id', 0);
  31. $sRelation = utils::ReadParam('relation', 'neighbours');
  32. try
  33. {
  34. $width = 1000;
  35. $height = 700;
  36. $sDrillUrl = urlencode('../pages/UI.php?operation=details');
  37. // $sParams = "pWidth=$width&pHeight=$height&drillUrl=".urlencode('../pages/UI.php?operation=details')."&displayController=false&xmlUrl=".urlencode("./xml.navigator.php")."&obj_class=$sClass&obj_id=$id&relation=$sRelation";
  38. // $oP->add("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"$width\" height=\"$height\" id=\"navigator\" align=\"middle\">
  39. // <param name=\"allowScriptAccess\" value=\"sameDomain\" />
  40. // <param name=\"allowFullScreen\" value=\"false\" />
  41. // <param name=\"FlashVars\" value=\"$sParams\" />
  42. // <param name=\"movie\" value=\"../images/navigator.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" />
  43. // <embed src=\"../images/navigator.swf\" flashVars=\"$sParams\" quality=\"high\" bgcolor=\"#ffffff\" width=\"$width\" height=\"$height\" name=\"navigator\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.adobe.com/go/getflashplayer\" />
  44. // </object>\n");
  45. $oP->add("<div id=\"navigator\">If the chart does not display, <a href=\"http://get.adobe.com/flash/\" target=\"_blank\">install Flash</a></div>\n");
  46. $oP->add_ready_script(<<<EOF
  47. var iWidth = $('.ui-layout-content').width();
  48. var iHeight = $('.ui-layout-content').height();
  49. swfobject.embedSWF("../navigator/navigator.swf", "navigator", "100%", "100%","9.0.0", "expressInstall.swf",
  50. { pWidth: iWidth, pHeight: iHeight, drillUrl: '$sDrillUrl', displayController: false, obj_class: '$sClass', obj_id: $id, relation: '$sRelation'},
  51. {wmode: 'transparent'}
  52. );
  53. EOF
  54. );
  55. }
  56. catch(CoreException $e)
  57. {
  58. $oP->p('<b>An error occured while running the query:</b>');
  59. $oP->p($e->getHtmlDesc());
  60. }
  61. catch(Exception $e)
  62. {
  63. $oP->p('<b>An error occured while running the query:</b>');
  64. $oP->p($e->getMessage());
  65. }
  66. $oP->output();
  67. ?>