index.class.php 2.0 KB

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