| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php defined('BX_DOL') or die('hack attempt');
- /**
- * Copyright (c) UNA, Inc - https://una.io
- * MIT License - https://opensource.org/licenses/MIT
- *
- * @defgroup Directory Directory
- * @ingroup UnaModules
- *
- * @{
- */
- class BxDirMenuSnippetMeta extends BxBaseModTextMenuSnippetMeta
- {
- protected $_sCategoryUrl;
-
- public function __construct($aObject, $oTemplate = false)
- {
- $this->_sModule = 'bx_directory';
- parent::__construct($aObject, $oTemplate);
- $CNF = &$this->_oModule->_oConfig->CNF;
- $this->_sCategoryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_CATEGORIES'], array($CNF['GET_PARAM_CATEGORY'] => ''));
- }
- protected function _getMenuItemCategory($aItem)
- {
- $CNF = &$this->_oModule->_oConfig->CNF;
- if(empty($CNF['FIELD_CATEGORY']) || empty($this->_aContentInfo[$CNF['FIELD_CATEGORY']]))
- return false;
- $iCategory = (int)$this->_aContentInfo[$CNF['FIELD_CATEGORY']];
- $aCategory = $this->_oModule->_oDb->getCategories(array('type' => 'id', 'id' => $iCategory));
- if(empty($aCategory) || !is_array($aCategory))
- return false;
- return $this->getUnitMetaItemLink(_t($aCategory['title']), array(
- 'href' => $this->_sCategoryUrl . $iCategory
- ));
- }
- }
- /** @} */
|