index.class.php 1.7 KB

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