/** * uninstallBlockByFuncNum * * @param int $func_num * @param XoopsModule &$module * @param Legacy_ModuleInstallLog &$log * * @return bool **/ public static function uninstallBlockByFuncNum($func_num, &$module, &$log) { $blockHandler =& Xupdate_Utils::getModuleHandler('newblocks', 'legacy'); $cri = new CriteriaCompo(); $cri->add(new Criteria('dirname', $module->get('dirname'))); $cri->add(new Criteria('func_num', $func_num)); $blocks =& $blockHandler->getObjects($cri); $successFlag = true; foreach ($blocks as $block) { if ($blockHandler->delete($block)) { $log->addReport(XCube_Utils::formatString(_MI_XUPDATE_INSTALL_MSG_BLOCK_UNINSTALLED, $block->get('name'))); } else { $log->addError(XCube_Utils::formatString(_MI_XUPDATE_INSTALL_ERROR_BLOCK_UNINSTALLED, $block->get('name'))); $successFlag = false; } } return $successFlag; }