/** * get block. * * @param Legacy_AbstractBlockProcedure &$obj * @param XoopsBlock $block */ public static function getBlock(&$obj, $block) { $moduleHandler =& xoops_gethandler('module'); $module =& $moduleHandler->get($block->get('mid')); if (is_object($module) && $module->getInfo('trust_dirname') == COSMOAPI_TRUST_DIRNAME) { require_once XOOPS_TRUST_PATH . '/modules/' . COSMOAPI_TRUST_DIRNAME . '/blocks/' . $block->get('func_file'); $className = ucfirst(COSMOAPI_TRUST_DIRNAME) . '_' . substr($block->get('show_func'), 4); $obj = new $className($block); } }
/** * getBlock * * @param Legacy_AbstractBlockProcedure &$obj * @param XoopsBlock $block * * @return void **/ public static function getBlock(&$obj, $block) { $moduleHandler =& Xcforum_Utils::getXoopsHandler('module'); $module =& $moduleHandler->get($block->get('mid')); if (is_object($module) && $module->getInfo('trust_dirname') == 'xcforum') { require_once XCFORUM_TRUST_PATH . '/blocks/' . $block->get('func_file'); $className = 'Xcforum_' . substr($block->get('show_func'), 4); $obj = new $className($block); } }
/** * @private * Uninstalls the block template data specified by $block of $module. * @param XoopsBlock $block * @param XoopsModule $module This object is must the module which has $block. * @param string $tplset A name of the template set. If this is null, uninstalls * all templates of any template-sets. * @param $log * @remarks * This method users template handlers of the kernel. But, if they are hooked, * they may not do something. So, abstraction mechanism is possible enough. */ function _uninstallBlockTemplate(&$block, &$module, $tplset, &$log) { $handler =& xoops_gethandler('tplfile'); $criteria = new CriteriaCompo(); $criteria->add(new Criteria('tpl_refid', $block->get('bid'))); $criteria->add(new Criteria('tpl_file', $block->get('template'))); $criteria->add(new Criteria('tpl_module', $module->get('dirname'))); $criteria->add(new Criteria('tpl_type', 'block')); if ($tplset != null) { // See 'FIXME' $criteria->add(new Criteria('tpl_tplset', $tplset)); } $handler->deleteAll($criteria); }
/** * Gets a file path of a cache file for module contents. * @param Legacy_BlockCacheInformation $cacheInfo * @return string */ function getCacheFilePath() { $filepath = null; $this->mGetCacheFilePath->call(new XCube_Ref($filepath), $this); if (!$filepath) { $id = md5(XOOPS_SALT . '(' . implode('_', $this->mIdentityArr) . ')' . implode('_', $this->mGroupArr)); $filepath = $this->getCacheFileBase($this->mBlock->get('bid'), $id); } return $filepath; }
function getWeight() { return $this->_mBlock->get('weight'); }
/** * Gets a file path of a cache file for module contents. * @param Legacy_BlockCacheInformation $cacheInfo * @return string */ function getCacheFilePath() { $filepath = null; $this->mGetCacheFilePath->call(new XCube_Ref($filepath), $this); if (!$filepath) { $id = md5(XOOPS_SALT . "(" . implode("_", $this->mIdentityArr) . ")" . implode("_", $this->mGroupArr)); $filepath = XOOPS_CACHE_PATH . "/bid" . $this->mBlock->get('bid') . '_' . $id . ".cache.html"; } return $filepath; }