index.class.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. * @package modx
  4. */
  5. /**
  6. * Loads the Context list page
  7. *
  8. * @package modx
  9. * @subpackage manager.controllers
  10. */
  11. class ContextManagerController 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('view_context');
  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/system/modx.grid.context.js');
  26. $this->addJavascript($mgrUrl.'assets/modext/sections/context/list.js');
  27. $this->addHtml("<script>
  28. Ext.onReady(function(){
  29. MODx.add('modx-page-contexts');
  30. });</script>");
  31. }
  32. /**
  33. * Custom logic code here for setting placeholders, etc
  34. * @param array $scriptProperties
  35. * @return mixed
  36. */
  37. public function process(array $scriptProperties = array()) {}
  38. /**
  39. * Return the pagetitle
  40. *
  41. * @return string
  42. */
  43. public function getPageTitle() {
  44. return $this->modx->lexicon('contexts');
  45. }
  46. /**
  47. * Return the location of the template file
  48. * @return string
  49. */
  50. public function getTemplateFile() {
  51. return '';
  52. }
  53. /**
  54. * Specify the language topics to load
  55. * @return array
  56. */
  57. public function getLanguageTopics() {
  58. return array('context');
  59. }
  60. /**
  61. * Get the Help URL
  62. * @return string
  63. */
  64. public function getHelpUrl() {
  65. return 'Contexts';
  66. }
  67. }