widget.grid-rer.php 1.0 KB

12345678910111213141516171819202122232425262728293031
  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. * Renders a grid of recently edited resources by the active user
  12. *
  13. * @package modx
  14. * @subpackage dashboard
  15. */
  16. class modDashboardWidgetRecentlyEditedResources extends modDashboardWidgetInterface {
  17. public function render() {
  18. $this->controller->addJavascript($this->modx->getOption('manager_url').'assets/modext/widgets/security/modx.grid.user.recent.resource.js');
  19. $this->controller->addHtml('<script type="text/javascript">Ext.onReady(function() {
  20. MODx.load({
  21. xtype: "modx-grid-user-recent-resource"
  22. ,user: "'.$this->modx->user->get('id').'"
  23. ,renderTo: "modx-grid-user-recent-resource"
  24. });
  25. });</script>');
  26. return $this->getFileChunk('dashboard/recentlyeditedresources.tpl');
  27. }
  28. }
  29. return 'modDashboardWidgetRecentlyEditedResources';