BxBaseStudioLauncher.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.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. /** @} */