create.class.php 1.9 KB

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