@@ 614-627 (lines=14) @@ | ||
611 | } else { |
|
612 | // execute module specific preupdate script if any |
|
613 | $update_script = $module->getInfo('onUpdate'); |
|
614 | if (false != $update_script && trim($update_script) != '') { |
|
615 | XoopsLoad::loadFile($xoops->path('modules/' . $mod . '/' . trim($update_script))); |
|
616 | $func = 'xoops_module_preupdate_' . $mod; |
|
617 | if (function_exists($func)) { |
|
618 | $result = $func($module, $prev_version); |
|
619 | if (!$result) { |
|
620 | $this->trace[] = sprintf(XoopsLocale::EF_NOT_EXECUTED, $func); |
|
621 | $this->trace = array_merge($this->error, $module->getErrors()); |
|
622 | } else { |
|
623 | $this->trace[] = sprintf(XoopsLocale::SF_EXECUTED, "<strong>{$func}</strong>"); |
|
624 | $this->trace = array_merge($this->trace, $module->getMessages()); |
|
625 | } |
|
626 | } |
|
627 | } |
|
628 | ||
629 | // update schema |
|
630 | $schema_file = $module->getInfo('schema'); |
|
@@ 664-677 (lines=14) @@ | ||
661 | ||
662 | // execute module specific update script if any |
|
663 | $update_script = $module->getInfo('onUpdate'); |
|
664 | if (false != $update_script && trim($update_script) != '') { |
|
665 | XoopsLoad::loadFile($xoops->path('modules/' . $mod . '/' . trim($update_script))); |
|
666 | $func = 'xoops_module_update_' . $mod; |
|
667 | if (function_exists($func)) { |
|
668 | $result = $func($module, $prev_version); |
|
669 | if (!$result) { |
|
670 | $this->trace[] = sprintf(XoopsLocale::EF_NOT_EXECUTED, $func); |
|
671 | $this->trace = array_merge($this->error, $module->getErrors()); |
|
672 | } else { |
|
673 | $this->trace[] = sprintf(XoopsLocale::SF_EXECUTED, "<strong>{$func}</strong>"); |
|
674 | $this->trace = array_merge($this->trace, $module->getMessages()); |
|
675 | } |
|
676 | } |
|
677 | } |
|
678 | $this->trace[] = sprintf(XoopsLocale::SF_UPDATED, '<strong>' . $module->getVar('name', 's') . '</strong>'); |
|
679 | return $module; |
|
680 | } |