/** * @return mixed */ protected function _init() { if ($this->_module->isCustomModule()) { $uploadDir = IfwPsn_Wp_Proxy_Blog::getUploadDir(); $this->_url = $uploadDir['baseurl'] . '/' . $this->_customLocationName . '/' . $this->_pathinfo->getDirname() . '/'; } else { // built-in module $dirnamePathParts = array_reverse(explode(DIRECTORY_SEPARATOR, $this->_pathinfo->getDirnamePath())); $this->_url = plugins_url($dirnamePathParts[3]) . '/modules/' . $this->_pathinfo->getDirname() . '/'; } $this->_urlFiles = $this->_url . 'files/'; $this->_urlCss = $this->_urlFiles . 'css/'; $this->_urlJs = $this->_urlFiles . 'js/'; $this->_urlImg = $this->_urlFiles . 'img/'; $this->_version = $this->_module->getVersion(); $this->_name = $this->_module->getName(); $this->_description = $this->_module->getDescription(); $this->_textDomain = $this->_module->getTextDomain(); $this->_homepage = $this->_module->getHomepage(); }
/** * @param IfwPsn_Wp_Module_Bootstrap_Abstract $module * @return bool */ public function isActivated(IfwPsn_Wp_Module_Bootstrap_Abstract $module) { // built-in modules are always activated return $module->getLocationName() == IfwPsn_Wp_Module_Manager::LOCATION_NAME_BUILTIN || $this->_inStorage($module->getId()); }