BxDolStudioMenuTop.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 TridentStudio Trident Studio
  7. * @{
  8. */
  9. define('BX_DOL_STUDIO_MT_LEFT', 'left');
  10. define('BX_DOL_STUDIO_MT_CENTER', 'center');
  11. define('BX_DOL_STUDIO_MT_RIGHT', 'right');
  12. define('BX_DOL_STUDIO_MTB_CIRCLE', 'circ');
  13. define('BX_DOL_STUDIO_MTB_RECTANGLE', 'rect');
  14. class BxDolStudioMenuTop extends BxDol
  15. {
  16. protected $aItems;
  17. protected $aVisible;
  18. function __construct()
  19. {
  20. parent::__construct();
  21. $this->aVisible = array(
  22. BX_DOL_STUDIO_MT_LEFT => false,
  23. BX_DOL_STUDIO_MT_CENTER => false,
  24. BX_DOL_STUDIO_MT_RIGHT => false
  25. );
  26. $this->aItems[BX_DOL_STUDIO_MT_LEFT] = array(
  27. 'edit' => array(
  28. 'name' => 'edit',
  29. 'icon' => 'move',
  30. 'onclick' => $this->getJsObject() . '.clickEdit(this);',
  31. 'title' => '_adm_tmi_cpt_edit'
  32. ),
  33. 'favorite' => array(
  34. 'name' => 'favorite',
  35. 'icon' => 'star',
  36. 'onclick' => $this->getJsObject() . '.clickFavorite(this);',
  37. 'title' => '_adm_tmi_cpt_favorite'
  38. ),
  39. 'extensions' => array(
  40. 'name' => 'extensions',
  41. 'icon' => 'plus',
  42. 'link' => BX_DOL_URL_STUDIO . 'store.php?page=goodies',
  43. 'title' => '_adm_tmi_cpt_extensions'
  44. ),
  45. );
  46. $aMatch = array();
  47. $iResult = preg_match("/^(https?:\/\/)?(.*)\/$/", BX_DOL_URL_ROOT, $aMatch);
  48. $this->aItems[BX_DOL_STUDIO_MT_CENTER] = $iResult ? $aMatch[2] : '';
  49. $this->aItems[BX_DOL_STUDIO_MT_RIGHT] = array(
  50. 'site' => array(
  51. 'name' => 'site',
  52. 'icon' => 'home',
  53. 'link' => BX_DOL_URL_ROOT,
  54. 'title' => '_adm_tmi_cpt_site'
  55. ),
  56. 'logout' => array(
  57. 'name' => 'logout',
  58. 'icon' => 'power-off',
  59. 'link' => BX_DOL_URL_ROOT . 'logout.php',
  60. 'onclick' => $this->getJsObject() . ".clickLogout(this);",
  61. 'title' => '_adm_tmi_cpt_logout'
  62. )
  63. );
  64. }
  65. function setVisible($sPosition, $bValue)
  66. {
  67. $this->aVisible[$sPosition] = $bValue;
  68. }
  69. function setVisibleAll()
  70. {
  71. $this->aVisible = array(
  72. BX_DOL_STUDIO_MT_LEFT => true,
  73. BX_DOL_STUDIO_MT_CENTER => true,
  74. BX_DOL_STUDIO_MT_RIGHT => true
  75. );
  76. }
  77. }
  78. /** @} */