moddocument.class.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. * {@inheritdoc}
  12. *
  13. * This modResource derivative represents a traditional web document that stores
  14. * it's primary content in the modX database container.
  15. *
  16. * @todo Determine if this class is unnecessary; modResource represents this
  17. * default web document and nothing unique is done in this class currently,
  18. * other than changing the default class_key.
  19. *
  20. * @package modx
  21. */
  22. class modDocument extends modResource {
  23. /**
  24. * Overrides modResource::__construct to set the class key for this Resource type
  25. * @param xPDO $xpdo A reference to the xPDO|modX instance
  26. */
  27. function __construct(& $xpdo) {
  28. parent :: __construct($xpdo);
  29. $this->set('class_key','modDocument');
  30. $this->showInContextMenu = true;
  31. }
  32. /**
  33. * Use this in your extended Resource class to display the text for the context menu item, if showInContextMenu is
  34. * set to true.
  35. * @return array
  36. */
  37. public function getContextMenuText() {
  38. return array(
  39. 'text_create' => $this->xpdo->lexicon('document'),
  40. 'text_create_here' => $this->xpdo->lexicon('document_create_here'),
  41. );
  42. }
  43. }