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