/**
  * smartUpdateAllOfBlocks
  * 
  * @param   XoopsModule  &$module
  * @param   Legacy_ModuleInstallLog  &$log
  * 
  * @return  void
  **/
 public static function smartUpdateAllOfBlocks(&$module, &$log)
 {
     $dirname = $module->get('dirname');
     $fileReader = new Legacy_ModinfoX2FileReader($dirname);
     $dbReader = new Legacy_ModinfoX2DBReader($dirname);
     $blocks =& $dbReader->loadBlockInformations();
     $blocks->update($fileReader->loadBlockInformations());
     foreach ($blocks->mBlocks as $block) {
         switch ($block->mStatus) {
             case LEGACY_INSTALLINFO_STATUS_LOADED:
                 Leimg_InstallUtils::updateBlockTemplateByInfo($block, $module, $log);
                 break;
             case LEGACY_INSTALLINFO_STATUS_UPDATED:
                 Leimg_InstallUtils::updateBlockByInfo($block, $module, $log);
                 break;
             case LEGACY_INSTALLINFO_STATUS_NEW:
                 Leimg_InstallUtils::installBlockByInfo($block, $module, $log);
                 break;
             case LEGACY_INSTALLINFO_STATUS_DELETED:
                 Leimg_InstallUtils::uninstallBlockByFuncNum($block->mFuncNum, $module, $log);
                 break;
             default:
                 break;
         }
     }
 }
 function smartUpdateAllOfBlocks(&$module, &$log)
 {
     $dirname = $module->get('dirname');
     $fileReader = new Legacy_ModinfoX2FileReader($dirname);
     $latestBlocks =& $fileReader->loadBlockInformations();
     $dbReader = new Legacy_ModinfoX2DBReader($dirname);
     $currentBlocks =& $dbReader->loadBlockInformations();
     $currentBlocks->update($latestBlocks);
     foreach (array_keys($currentBlocks->mBlocks) as $idx) {
         switch ($currentBlocks->mBlocks[$idx]->mStatus) {
             case LEGACY_INSTALLINFO_STATUS_LOADED:
                 Legacy_ModuleInstallUtils::updateBlockTemplateByInfo($currentBlocks->mBlocks[$idx], $module, $log);
                 break;
             case LEGACY_INSTALLINFO_STATUS_UPDATED:
                 Legacy_ModuleInstallUtils::updateBlockByInfo($currentBlocks->mBlocks[$idx], $module, $log);
                 break;
             case LEGACY_INSTALLINFO_STATUS_NEW:
                 Legacy_ModuleInstallUtils::installBlockByInfo($currentBlocks->mBlocks[$idx], $module, $log);
                 break;
             case LEGACY_INSTALLINFO_STATUS_DELETED:
                 Legacy_ModuleInstallUtils::uninstallBlockByFuncNum($currentBlocks->mBlocks[$idx]->mFuncNum, $module, $log);
                 break;
         }
     }
 }