BxBaseStudioLauncher.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. function __construct() {
  15. parent::__construct();
  16. }
  17. function getPageIndex() {
  18. if(!is_array($this->aPage || empty($this->aPage)))
  19. return BX_PAGE_DEFAULT;
  20. return !empty($this->aPage[$this->sPageSelected]) ? $this->aPage[$this->sPageSelected]->getPageIndex() : BX_PAGE_DEFAULT;
  21. }
  22. function getPageJs() {
  23. $aJs = array(
  24. 'jquery.ui.core.min.js',
  25. 'jquery.ui.widget.min.js',
  26. 'jquery.ui.mouse.min.js',
  27. 'jquery.ui.sortable.min.js',
  28. 'jquery.ui.touch-punch.min.js',
  29. 'jquery.easing.js',
  30. 'jquery.cookie.js',
  31. 'launcher.js'
  32. );
  33. foreach($this->aIncludes as $sName => $oInclude)
  34. $aJs = array_merge($aJs, $oInclude->getJs());
  35. return $aJs;
  36. }
  37. function getPageJsObject() {
  38. return BX_DOL_STUDIO_LAUNCHER_JS_OBJECT;
  39. }
  40. function getPageCss() {
  41. $aCss = array('launcher.css');
  42. foreach($this->aIncludes as $sName => $oInclude)
  43. $aCss = array_merge($aCss, $oInclude->getCss());
  44. return $aCss;
  45. }
  46. function getPageCode($bHidden = false) {
  47. if(empty($this->aPage) || !is_array($this->aPage))
  48. return '';
  49. $sIncludes = '';
  50. foreach($this->aIncludes as $sName => $oInclude)
  51. $sIncludes .= $oInclude->getJsCode();
  52. return BxDolStudioTemplate::getInstance()->parseHtmlByName('launcher.html', array(
  53. 'js_object' => $this->getPageJsObject(),
  54. 'includes' => $sIncludes,
  55. 'items' => parent::getPageCode($bHidden)
  56. ));
  57. }
  58. }
  59. /** @} */