create.class.php 2.1 KB

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