index.class.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 dashboard management page
  12. *
  13. * @package modx
  14. * @subpackage manager.controllers
  15. */
  16. class SystemDashboardsManagerController 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('dashboards');
  23. }
  24. /**
  25. * Custom logic code here for setting placeholders, etc
  26. *
  27. * @param array $scriptProperties
  28. * @return array
  29. */
  30. public function process(array $scriptProperties = array()) {
  31. $placeholders = array();
  32. return $placeholders;
  33. }
  34. /**
  35. * Register custom CSS/JS for the page
  36. * @return void
  37. */
  38. public function loadCustomCssJs() {
  39. $this->addJavascript($this->modx->getOption('manager_url')."assets/modext/widgets/system/modx.grid.dashboard.widgets.js");
  40. $this->addJavascript($this->modx->getOption('manager_url')."assets/modext/widgets/system/modx.panel.dashboards.js");
  41. $this->addJavascript($this->modx->getOption('manager_url').'assets/modext/sections/system/dashboards/list.js');
  42. $this->addHtml('<script type="text/javascript">
  43. Ext.onReady(function() {
  44. MODx.add("modx-page-dashboards");
  45. });
  46. </script>');
  47. }
  48. /**
  49. * Return the pagetitle
  50. *
  51. * @return string
  52. */
  53. public function getPageTitle() {
  54. return $this->modx->lexicon('dashboards');
  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('dashboards');
  69. }
  70. /**
  71. * Get the Help URL
  72. * @return string
  73. */
  74. public function getHelpUrl() {
  75. return 'Dashboards';
  76. }
  77. }