BxBaseModTextPageEntry.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup BaseText Base classes for text modules
  7. * @ingroup TridentModules
  8. *
  9. * @{
  10. */
  11. bx_import('BxBaseModGeneralPageEntry');
  12. bx_import('BxDolModule');
  13. bx_import('BxDolMenu');
  14. /**
  15. * Entry create/edit pages
  16. */
  17. class BxBaseModTextPageEntry extends BxBaseModGeneralPageEntry
  18. {
  19. public function __construct($aObject, $oTemplate = false)
  20. {
  21. parent::__construct($aObject, $oTemplate);
  22. $CNF = &$this->_oModule->_oConfig->CNF;
  23. // select view entry submenu
  24. $oMenuSumbemu = BxDolMenu::getObjectInstance('sys_site_submenu');
  25. $oMenuSumbemu->setObjectSubmenu($CNF['OBJECT_MENU_SUBMENU_VIEW_ENTRY'], $CNF['OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION']);
  26. $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
  27. if ($iContentId)
  28. $this->_aContentInfo = $this->_oModule->_oDb->getContentInfoById($iContentId);
  29. if ($this->_aContentInfo) {
  30. $this->addMarkers($this->_aContentInfo); // every field can be used as marker
  31. $this->addMarkers(array(
  32. 'title' => strmaxtextlen($this->_aContentInfo[$CNF['FIELD_TEXT']], 20, '...'),
  33. ));
  34. }
  35. }
  36. }
  37. /** @} */