Permalink
Browse files

adjustment to support PHP 7

  • Loading branch information...
nao-pon committed Dec 20, 2018
1 parent 1669f44 commit b92bef43a471b62aac3478a8bd9e99b3487713fd
@@ -340,7 +340,7 @@ function xoops_template_create($resource_type, $resource_name, &$template_source
**/
function xoops_template_clear_module_cache($mid)
{
$block_arr =& XoopsBlock::getByModule($mid);
$block_arr =& XoopsBlock::sGetByModule($mid);
$count = count($block_arr);
if ($count > 0) {
$xoopsTpl = new XoopsTpl();
@@ -152,7 +152,7 @@
}
}
}
$block_arr = XoopsBlock::getByModule($mid);
$block_arr = XoopsBlock::sGetByModule($mid);
foreach ($block_arr as $block) {
if (!in_array($block->getVar('show_func'), $showfuncs) || !in_array($block->getVar('func_file'), $funcfiles)) {
$sql = sprintf("DELETE FROM %s WHERE bid = %u", $xoopsDB->prefix('newblocks'), $block->getVar('bid'));
@@ -314,12 +314,15 @@ public function &getAllBlocks($rettype='object', $side=null, $visible=null, $ord
$ret =& $handler->getAllBlocks($rettype, $side, $visible, $orderby, $isactive);
return $ret;
}
public function &getByModule($moduleid, $asobject=true)
{
public static function &sGetByModule($moduleid, $asobject=true) {
$handler = xoops_gethandler('block');
$ret =& $handler->getByModule($moduleid, $asobject);
return $ret;
}
public function &getByModule($moduleid, $asobject=true)
{
return self::sGetByModule($moduleid, $asobject);
}
public function &getAllByGroupModule($groupid, $module_id=0, $toponlyblock=false, $visible=null, $orderby='b.weight,b.bid', $isactive=1)
{
$handler = xoops_gethandler('block');
@@ -17,9 +17,9 @@ class LegacyRender_Cacheclear extends XCube_ActionFilter
{
public function preBlockFilter()
{
$this->mRoot->mDelegateManager->add('Legacy_ModuleInstallAction.InstallSuccess', 'LegacyRender_Cacheclear::cacheClear');
$this->mRoot->mDelegateManager->add('Legacy_ModuleUpdateAction.UpdateSuccess', 'LegacyRender_Cacheclear::cacheClear');
$this->mRoot->mDelegateManager->add('Legacy_ModuleUninstaller._fireNotifyUninstallTemplateBegun', 'LegacyRender_Cacheclear::cacheClear');
$this->mRoot->mDelegateManager->add('Legacy_ModuleInstallAction.InstallSuccess', array($this, 'cacheClear'));
$this->mRoot->mDelegateManager->add('Legacy_ModuleUpdateAction.UpdateSuccess', array($this, 'cacheClear'));
$this->mRoot->mDelegateManager->add('Legacy_ModuleUninstaller._fireNotifyUninstallTemplateBegun', array($this, 'cacheClear'));
}
public function cacheClear(&$module)

0 comments on commit b92bef4

Please sign in to comment.