| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- <?php
- /**
- * @package Dolphin Core
- * @copyright Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license CC-BY - http://creativecommons.org/licenses/by/3.0/
- */
- defined('BX_DOL') or die('hack attempt');
- /**
- * Base class for Config classes in modules engine.
- *
- * The object of the class contains different basic configuration settings which are necessary for all modules.
- *
- *
- * Example of usage:
- * @see any module included in the default Dolphin's package.
- *
- *
- * Memberships/ACL:
- * Doesn't depend on user's membership.
- *
- *
- * Alerts:
- * no alerts available
- *
- */
- class BxDolModuleConfig extends BxDol {
- var $_iId;
- var $_sName;
- var $_sVendor;
- var $_sClassPrefix;
- var $_sDbPrefix;
- var $_sDirectory;
- var $_sUri;
- var $_sHomePath;
- var $_sClassPath;
- var $_sHomeUrl;
- /**
- * constructor
- */
- function BxDolModuleConfig($aModule) {
- parent::BxDol();
- $this->_iId = empty($aModule['id']) ? 0 : (int)$aModule['id'];
- $this->_sName = isset($aModule['name']) ? $aModule['name'] : '';
- $this->_sVendor = $aModule['vendor'];
- $this->_sClassPrefix = $aModule['class_prefix'];
- $this->_sDbPrefix = $aModule['db_prefix'];
- $this->_sDirectory = $aModule['path'];
- $this->_sHomePath = BX_DIRECTORY_PATH_MODULES . $this->_sDirectory;
- $this->_sClassPath = $this->_sHomePath . 'classes/';
- $this->_sUri = $aModule['uri'];
- $this->_sHomeUrl = BX_DOL_URL_MODULES . $this->_sDirectory;
- }
- function getId() {
- return $this->_iId;
- }
- function getName() {
- return $this->_sName;
- }
- function getClassPrefix() {
- return $this->_sClassPrefix;
- }
- function getDbPrefix() {
- return $this->_sDbPrefix;
- }
- function getDirectory() {
- return $this->_sDirectory;
- }
- function getHomePath() {
- return $this->_sHomePath;
- }
- function getClassPath() {
- return $this->_sClassPath;
- }
- /**
- * Get unique URI.
- *
- * @return string with unique URI.
- */
- function getUri() {
- return $this->_sUri;
- }
- /**
- * Get base URI which depends on the Permalinks mechanism.
- *
- * example /modules/?r=module_uri or /m/module_uri
- * @return string with base URI.
- */
- function getBaseUri() {
- bx_import('BxDolPermalinks');
- return BxDolPermalinks::getInstance()->permalink('modules/?r=' . $this->_sUri . '/');
- }
- /**
- * Get full URL.
- *
- * @return string with full URL.
- */
- function getHomeUrl() {
- return $this->_sHomeUrl;
- }
- }
|