示例#1
0
 public function unregisterModule($module, &$content)
 {
     $content[] = dgettext('boost', 'Unregistering module from core.');
     $db = new PHPWS_DB('modules');
     $db->addWhere('title', $module->title);
     $result = $db->delete();
     if (PHPWS_Error::isError($result)) {
         PHPWS_Error::log($result);
         $content[] = dgettext('boost', 'An error occurred while unregistering.');
         $content[] = dgettext('boost', 'Check your logs for more information.');
     } else {
         $content[] = dgettext('boost', 'Unregistering module from Boost was successful.');
         $result = PHPWS_Settings::unregister($module->title);
         if (PHPWS_Error::isError($result)) {
             PHPWS_Error::log($result);
             $content[] = dgettext('boost', 'Module\'s settings could not be removed. See your error log.');
         } else {
             $content[] = dgettext('boost', 'Module\'s settings removed successfully.');
         }
         if (Key::unregisterModule($module->title)) {
             $content[] = dgettext('boost', 'Key unregistration successful.');
         } else {
             $content[] = dgettext('boost', 'Some key unregistrations were unsuccessful. Check your logs.');
         }
         if ($module->isUnregister()) {
             $selfselfResult = $this->unregisterModToMod($module, $module, $content);
             $otherResult = $this->unregisterOthersToSelf($module, $content);
         }
         $selfResult = $this->unregisterSelfToOthers($module, $content);
         $result = $this->unregisterAll($module);
     }
     return $result;
 }