/** * @param modX $modx * @param array $config */ function __construct(modX &$modx, array $config = array()) { $this->modx =& $modx; $corePath = $this->modx->getOption('msprofile_core_path', $config, $this->modx->getOption('core_path') . 'components/msprofile/'); $assetsUrl = $this->modx->getOption('msprofile_assets_url', $config, $this->modx->getOption('assets_url') . 'components/msprofile/'); $connectorUrl = $assetsUrl . 'connector.php'; $this->config = array_merge(array('assetsUrl' => $assetsUrl, 'cssUrl' => $assetsUrl . 'css/', 'jsUrl' => $assetsUrl . 'js/', 'imagesUrl' => $assetsUrl . 'images/', 'connectorUrl' => $connectorUrl, 'corePath' => $corePath, 'modelPath' => $corePath . 'model/', 'chunksPath' => $corePath . 'elements/chunks/', 'templatesPath' => $corePath . 'elements/templates/', 'chunkSuffix' => '.chunk.tpl', 'snippetsPath' => $corePath . 'elements/snippets/', 'processorsPath' => $corePath . 'processors/'), $config); $this->modx->addPackage('msprofile', $this->config['modelPath']); $this->modx->lexicon->load('msprofile:default'); $this->ms2 = $modx->getService('miniShop2'); $this->ms2->initialize($this->modx->context->key); }