BxBaseStudioLauncher.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup DolphinView Dolphin Studio Representation classes
  7. * @ingroup DolphinStudio
  8. * @{
  9. */
  10. define('BX_DOL_STUDIO_LAUNCHER_JS_OBJECT', 'oBxDolStudioLauncher');
  11. bx_import('BxDolStudioLauncher');
  12. bx_import('BxDolStudioTemplate');
  13. class BxBaseStudioLauncher extends BxDolStudioLauncher
  14. {
  15. function __construct()
  16. {
  17. parent::__construct();
  18. }
  19. function getPageIndex()
  20. {
  21. if(!is_array($this->aPage || empty($this->aPage)))
  22. return BX_PAGE_DEFAULT;
  23. return !empty($this->aPage[$this->sPageSelected]) ? $this->aPage[$this->sPageSelected]->getPageIndex() : BX_PAGE_DEFAULT;
  24. }
  25. function getPageJs()
  26. {
  27. $aJs = array(
  28. 'jquery-ui/jquery.ui.core.min.js',
  29. 'jquery-ui/jquery.ui.widget.min.js',
  30. 'jquery-ui/jquery.ui.mouse.min.js',
  31. 'jquery-ui/jquery.ui.sortable.min.js',
  32. 'jquery.ui.touch-punch.min.js',
  33. 'jquery.easing.js',
  34. 'jquery.cookie.min.js',
  35. 'launcher.js'
  36. );
  37. foreach($this->aIncludes as $sName => $oInclude)
  38. $aJs = array_merge($aJs, $oInclude->getJs());
  39. return $aJs;
  40. }
  41. function getPageJsObject()
  42. {
  43. return BX_DOL_STUDIO_LAUNCHER_JS_OBJECT;
  44. }
  45. function getPageCss()
  46. {
  47. $aCss = array('launcher.css');
  48. foreach($this->aIncludes as $sName => $oInclude)
  49. $aCss = array_merge($aCss, $oInclude->getCss());
  50. return $aCss;
  51. }
  52. function getPageCode($bHidden = false)
  53. {
  54. if(empty($this->aPage) || !is_array($this->aPage))
  55. return '';
  56. $sIncludes = '';
  57. foreach($this->aIncludes as $sName => $oInclude)
  58. $sIncludes .= $oInclude->getJsCode();
  59. return BxDolStudioTemplate::getInstance()->parseHtmlByName('launcher.html', array(
  60. 'js_object' => $this->getPageJsObject(),
  61. 'includes' => $sIncludes,
  62. 'items' => parent::getPageCode($bHidden)
  63. ));
  64. }
  65. }
  66. /** @} */