| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php defined('BX_DOL') or die('hack attempt');
- /**
- * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * CC-BY License - http://creativecommons.org/licenses/by/3.0/
- *
- * @defgroup BaseGeneral Base classes for modules
- * @ingroup TridentModules
- *
- * @{
- */
- /**
- * Module representation.
- */
- class BxBaseModGeneralTemplate extends BxDolModuleTemplate
- {
- protected $MODULE;
- protected $_oModule;
- function __construct(&$oConfig, &$oDb)
- {
- parent::__construct($oConfig, $oDb);
- $this->addCss ('main.css');
- }
-
- public function getModule()
- {
- if (!$this->_oModule) {
- $sName = $this->_oConfig->getName();
- $this->_oModule = BxDolModule::getInstance($sName);
- }
- return $this->_oModule;
- }
- public function getJsCode($sType, $aParams = array(), $bWrap = true)
- {
- $sBaseUri = $this->_oConfig->getBaseUri();
- $sJsClass = $this->_oConfig->getJsClass($sType);
- $sJsObject = $this->_oConfig->getJsObject($sType);
- $aParams = array_merge(array(
- 'sActionUri' => $sBaseUri,
- 'sActionUrl' => BX_DOL_URL_ROOT . $sBaseUri,
- 'sObjName' => $sJsObject,
- 'aHtmlIds' => array(),
- 'oRequestParams' => array()
- ), $aParams);
- $sContent = "var " . $sJsObject . " = new " . $sJsClass . "(" . json_encode($aParams) . ");";
- return !$bWrap ? $sContent : $this->_wrapInTagJsCode($sContent);
- }
- function entryLocation ($iContentId)
- {
- $CNF = &$this->getModule()->_oConfig->CNF;
- if (empty($CNF['OBJECT_METATAGS']))
- return '';
- $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS']);
- if (!($sLocationString = $oMetatags->locationsString($iContentId)))
- return '';
- $aVars = array (
- 'location' => $sLocationString
- );
- return $this->parseHtmlByName('entry-location.html', $aVars);
- }
- }
- /** @} */
|