BxBaseStudioLauncher.php 2.1 KB

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