Exemplo n.º 1
0
 public function registerModule($module, &$content)
 {
     $content[] = dgettext('boost', 'Registering module to core.');
     $db = new PHPWS_DB('modules');
     $db->addWhere('title', $module->title);
     $db->delete();
     $db->resetWhere();
     if (!$module->getProperName()) {
         $module->setProperName($module->getProperName(true));
     }
     $result = $module->save();
     if (PHPWS_Error::isError($result)) {
         PHPWS_Error::log($result);
         $content[] = dgettext('boost', 'An error occurred during registration.');
         $content[] = dgettext('boost', 'Check your logs for more information.');
     } else {
         $content[] = dgettext('boost', 'Registration successful.');
         if ($module->isRegister()) {
             $selfselfResult = $this->registerModToMod($module, $module, $content);
             $otherResult = $this->registerOthersToSelf($module, $content);
         }
         $selfResult = $this->registerSelfToOthers($module, $content);
     }
     $filename = sprintf('%smod/%s/inc/key.php', PHPWS_SOURCE_DIR, $module->title);
     if (is_file($filename)) {
         $content[] = dgettext('boost', 'Registered to Key.');
         Key::registerModule($module->title);
     }
     $content[] = '<br />';
     return $result;
 }