update.class.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /*
  3. * This file is part of the Fred package.
  4. *
  5. * Copyright (c) MODX, LLC
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. require_once dirname(dirname(dirname(__FILE__))) . '/index.class.php';
  11. /**
  12. * @package fred
  13. * @subpackage controllers
  14. */
  15. class FredElementUpdateManagerController extends FredBaseManagerController
  16. {
  17. public function process(array $scriptProperties = [])
  18. {
  19. }
  20. public function getPageTitle()
  21. {
  22. return $this->modx->lexicon('fred.elements.update');
  23. }
  24. public function loadCustomCssJs()
  25. {
  26. $this->addJavascript($this->fred->getOption('jsUrl') . 'utils/utils.js');
  27. $this->addJavascript($this->fred->getOption('jsUrl') . 'utils/combos.js');
  28. $this->addJavascript($this->fred->getOption('jsUrl') . 'home/widgets/element_option_set.window.js');
  29. $this->addJavascript($this->fred->getOption('jsUrl') . 'element/panel.js');
  30. $this->addLastJavascript($this->fred->getOption('jsUrl') . 'element/page.js');
  31. $this->addHtml('
  32. <script type="text/javascript">
  33. Ext.onReady(function() {
  34. MODx.load({
  35. xtype: "fred-page-element"
  36. });
  37. });
  38. </script>
  39. ');
  40. $this->modx->invokeEvent('FredElementFormRender');
  41. }
  42. public function getTemplateFile()
  43. {
  44. return $this->fred->getOption('templatesPath') . 'element.tpl';
  45. }
  46. public function checkPermissions()
  47. {
  48. if (!$this->modx->hasPermission('fred_element_save')) {
  49. return false;
  50. }
  51. return parent::checkPermissions();
  52. }
  53. }