browser.class.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /*
  3. * This file is part of MODX Revolution.
  4. *
  5. * Copyright (c) MODX, LLC. All Rights Reserved.
  6. *
  7. * For complete copyright and license information, see the COPYRIGHT and LICENSE
  8. * files found in the top-level directory of this distribution.
  9. */
  10. /**
  11. * "Media Browser" controller
  12. */
  13. class MediaBrowserManagerController extends modManagerController
  14. {
  15. /**
  16. * @inherit
  17. */
  18. public function checkPermissions()
  19. {
  20. return $this->modx->hasPermission('file_manager');
  21. }
  22. /**
  23. * Register custom CSS/JS for the page
  24. *
  25. * @return void
  26. */
  27. public function loadCustomCssJs()
  28. {
  29. // $mgrUrl = $this->modx->getOption('manager_url', null, MODX_MANAGER_URL);
  30. // $this->addJavascript($mgrUrl . 'assets/modext/widgets/media/browser.js');
  31. $this->addHtml(
  32. <<<HTML
  33. <script type="text/javascript">
  34. // <![CDATA[
  35. Ext.onReady(function() {
  36. Ext.getCmp('modx-layout').hideLeftbar(true, false);
  37. MODx.add('modx-media-view');
  38. });
  39. // ]]>
  40. </script>
  41. HTML
  42. );
  43. }
  44. /**
  45. * @inherit
  46. */
  47. public function process(array $scriptProperties = array())
  48. {
  49. return array();
  50. }
  51. /**
  52. * @inherit
  53. */
  54. public function getPageTitle()
  55. {
  56. return $this->modx->lexicon('modx_browser');
  57. }
  58. /**
  59. * @inherit
  60. */
  61. public function getTemplateFile()
  62. {
  63. return '';
  64. }
  65. /**
  66. * @inherit
  67. */
  68. public function getLanguageTopics()
  69. {
  70. return array('file');
  71. }
  72. }