message.class.php 2.1 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 message management
  12. *
  13. * @package modx
  14. * @subpackage manager.controllers
  15. */
  16. class SecurityMessageManagerController 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('messages');
  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/security/modx.grid.message.js');
  31. $this->addJavascript($mgrUrl.'assets/modext/sections/security/message/list.js');
  32. $this->addHtml('<script>
  33. Ext.onReady(function() {
  34. MODx.perm.view_user = '.($this->modx->hasPermission('view_user') ? 1 : 0).';
  35. MODx.perm.view_role = '.($this->modx->hasPermission('view_role') ? 1 : 0).';
  36. MODx.perm.view_usergroup = '.($this->modx->hasPermission('usergroup_view') ? 1 : 0).';
  37. MODx.load({
  38. xtype: "modx-page-messages"
  39. });
  40. });</script>');
  41. }
  42. /**
  43. * Custom logic code here for setting placeholders, etc
  44. * @param array $scriptProperties
  45. * @return mixed
  46. */
  47. public function process(array $scriptProperties = array()) {}
  48. /**
  49. * Return the pagetitle
  50. *
  51. * @return string
  52. */
  53. public function getPageTitle() {
  54. return $this->modx->lexicon('messages');
  55. }
  56. /**
  57. * Return the location of the template file
  58. * @return string
  59. */
  60. public function getTemplateFile() {
  61. return '';
  62. }
  63. /**
  64. * Specify the language topics to load
  65. * @return array
  66. */
  67. public function getLanguageTopics() {
  68. return array('user','messages');
  69. }
  70. }