index.class.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. * Loads the Media Sources page
  12. *
  13. * @package modx
  14. * @subpackage manager.controllers
  15. */
  16. class SourceManagerController extends modManagerController {
  17. /**
  18. * Check for any permissions or requirements to load page
  19. * @return bool
  20. */
  21. public function checkPermissions() {
  22. return $this->modx->hasPermission('source_view');
  23. }
  24. /**
  25. * Register custom CSS/JS for the page
  26. * @return void
  27. */
  28. public function loadCustomCssJs() {
  29. $mgrUrl = $this->modx->getOption('manager_url',null,MODX_MANAGER_URL);
  30. $this->addJavascript($mgrUrl.'assets/modext/widgets/source/modx.panel.sources.js');
  31. $this->addJavascript($mgrUrl.'assets/modext/sections/source/index.js');
  32. $this->addHtml('<script type="text/javascript">Ext.onReady(function() { MODx.add("modx-page-sources"); });</script>');
  33. }
  34. /**
  35. * Custom logic code here for setting placeholders, etc
  36. * @param array $scriptProperties
  37. * @return mixed
  38. */
  39. public function process(array $scriptProperties = array()) {}
  40. /**
  41. * Return the pagetitle
  42. *
  43. * @return string
  44. */
  45. public function getPageTitle() {
  46. return $this->modx->lexicon('sources');
  47. }
  48. /**
  49. * Return the location of the template file
  50. * @return string
  51. */
  52. public function getTemplateFile() {
  53. return '';
  54. }
  55. /**
  56. * Specify the language topics to load
  57. * @return array
  58. */
  59. public function getLanguageTopics() {
  60. return array('source','namespace');
  61. }
  62. /**
  63. * Get the Help URL
  64. * @return string
  65. */
  66. public function getHelpUrl() {
  67. return 'Media+Sources';
  68. }
  69. }