update.class.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. class SymlinkUpdateManagerController extends ResourceUpdateManagerController {
  11. /**
  12. * Register custom CSS/JS for the page
  13. * @return void
  14. */
  15. public function loadCustomCssJs() {
  16. $managerUrl = $this->context->getOption('manager_url', MODX_MANAGER_URL, $this->modx->_userConfig);
  17. $this->addJavascript($managerUrl.'assets/modext/widgets/element/modx.panel.tv.renders.js');
  18. $this->addJavascript($managerUrl.'assets/modext/widgets/resource/modx.grid.resource.security.local.js');
  19. $this->addJavascript($managerUrl.'assets/modext/widgets/resource/modx.panel.resource.tv.js');
  20. $this->addJavascript($managerUrl.'assets/modext/widgets/resource/modx.panel.resource.js');
  21. $this->addJavascript($managerUrl.'assets/modext/widgets/resource/modx.panel.resource.symlink.js');
  22. $this->addJavascript($managerUrl.'assets/modext/sections/resource/update.js');
  23. $this->addJavascript($managerUrl.'assets/modext/sections/resource/symlink/update.js');
  24. $this->addHtml('
  25. <script type="text/javascript">
  26. // <![CDATA[
  27. MODx.config.publish_document = "'.$this->canPublish.'";
  28. MODx.onDocFormRender = "'.$this->onDocFormRender.'";
  29. MODx.ctx = "'.$this->resource->get('context_key').'";
  30. Ext.onReady(function() {
  31. MODx.load({
  32. xtype: "modx-page-symlink-update"
  33. ,resource: "'.$this->resource->get('id').'"
  34. ,record: '.$this->modx->toJSON($this->resourceArray).'
  35. ,publish_document: "'.$this->canPublish.'"
  36. ,preview_url: "'.$this->previewUrl.'"
  37. ,locked: '.($this->locked ? 1 : 0).'
  38. ,lockedText: "'.$this->lockedText.'"
  39. ,canSave: '.($this->canSave ? 1 : 0).'
  40. ,canEdit: '.($this->canEdit ? 1 : 0).'
  41. ,canCreate: '.($this->canCreate ? 1 : 0).'
  42. ,canCreateRoot: '.($this->canCreateRoot ? 1 : 0).'
  43. ,canDuplicate: '.($this->canDuplicate ? 1 : 0).'
  44. ,canDelete: '.($this->canDelete ? 1 : 0).'
  45. ,show_tvs: '.(!empty($this->tvCounts) ? 1 : 0).'
  46. });
  47. });
  48. // ]]>
  49. </script>');
  50. /* load RTE */
  51. $this->loadRichTextEditor();
  52. }
  53. /**
  54. * Return the location of the template file
  55. * @return string
  56. */
  57. public function getTemplateFile() {
  58. return 'resource/symlink/update.tpl';
  59. }
  60. }