create.class.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 create page
  12. *
  13. * @package modx
  14. * @subpackage manager.controllers
  15. */
  16. class SystemDashboardsCreateManagerController 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. return array();
  32. }
  33. /**
  34. * Register custom CSS/JS for the page
  35. * @return void
  36. */
  37. public function loadCustomCssJs() {
  38. $this->addJavascript($this->modx->getOption('manager_url')."assets/modext/widgets/system/modx.panel.dashboard.js");
  39. $this->addJavascript($this->modx->getOption('manager_url').'assets/modext/sections/system/dashboards/create.js');
  40. $this->addHtml('<script type="text/javascript">Ext.onReady(function() {
  41. MODx.add("modx-page-dashboard-create");
  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','user');
  65. }
  66. /**
  67. * Get the Help URL
  68. * @return string
  69. */
  70. public function getHelpUrl() {
  71. return 'Dashboards';
  72. }
  73. }