Esempio n. 1
0
 function _processReport()
 {
     if (!$this->mLog->hasError()) {
         $this->mLog->add(XCube_Utils::formatMessage(_AD_LEGACY_MESSAGE_UPDATING_MODULE_SUCCESSFUL, $this->_mCurrentXoopsModule->get('name')));
     } else {
         $this->mLog->addError(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_UPDATING_MODULE_FAILURE, $this->_mCurrentXoopsModule->get('name')));
     }
 }
Esempio n. 2
0
 function _processReport()
 {
     if (!$this->mLog->hasError()) {
         $this->mLog->add(XCube_Utils::formatString(_AD_LEGACY_MESSAGE_INSTALLATION_MODULE_SUCCESSFUL, $this->_mXoopsModule->get('name')));
     } else {
         $this->mLog->addError(XCube_Utils::formatString(_AD_LEGACY_ERROR_INSTALLATION_MODULE_FAILURE, $this->_mXoopsModule->get('name')));
     }
 }
Esempio n. 3
0
 /**
  * Copy from hash of oldConfig to hash of cubeConfig completely. This
  * member function is for the case that a module config is just clone of
  * the old config of the category.
  * 
  * @access private
  * @param array $oldConfigs hash array of config items. see _getOldConfigs().
  * @param array $cubeConfigs hash array of config items. see _getCubeConfigs().
  * @param string $dirname A name of module directory for logging.
  * @see _copy()
  */
 function _fullCopy(&$oldConfigs, &$cubeConfigs, $dirname)
 {
     foreach (array_keys($oldConfigs) as $key) {
         if (isset($cubeConfigs[$key])) {
             $this->_copy($oldConfigs[$key], $cubeConfigs[$key], $dirname);
         } else {
             $this->mLog->addError(XCube_Utils::formatMessage(_MI_XUPGRADE_ERROR_FIND_CONFIG, $key, 'user'));
         }
     }
 }
 /**
  * save xoops module.
  *
  * @param XoopsModule &$module
  */
 public function saveXoopsModule(&$module)
 {
     $dirname = $module->get('dirname');
     $constpref = '_MI_' . strtoupper($dirname);
     $moduleHandler =& Cosmoapi_Utils::getXoopsHandler('module');
     if ($moduleHandler->insert($module)) {
         $this->mLog->addReport(constant($constpref . '_INSTALL_MSG_UPDATE_FINISHED'));
     } else {
         $this->mLog->addError(constant($constpref . '_INSTALL_ERROR_UPDATE_FINISHED'));
     }
 }
 /**
  * process report.
  */
 private function _processReport()
 {
     $dirname = $this->_mXoopsModule->get('dirname');
     $constpref = '_MI_' . strtoupper($dirname);
     if (!$this->mLog->hasError()) {
         $this->mLog->add(XCube_Utils::formatString(constant($constpref . '_INSTALL_MSG_MODULE_UNINSTALLED'), $this->_mXoopsModule->get('name')));
     } elseif (is_object($this->_mXoopsModule)) {
         $this->mLog->addError(XCube_Utils::formatString(constant($constpref . '_INSTALL_ERROR_MODULE_UNINSTALLED'), $this->_mXoopsModule->get('name')));
     } else {
         $this->mLog->addError(XCube_Utils::formatString(constant($constpref . '_INSTALL_ERROR_MODULE_UNINSTALLED'), 'something'));
     }
 }
 /**
  * Uninstalls all of module templates $module specify. This function is
  * usefull for uninstaller and updater. In the case of update, you should
  * call this function before installAllOfModuleTemplates(). In the case of
  * uninstall, you must set 'false' to $defaultOnly.
  * 
  * This function gets informations about templates from the database.
  * 
  * @warning
  * 
  * This function depends the specific spec of Legacy_RenderSystem, but this
  * static function is needed by the 2nd installer of Legacy System.
  * 
  * @static
  * @param XoopsModule $module
  * @param Legacy_ModuleInstallLog $log
  * @param bool $defaultOnly Indicates whether this function deletes templates from all of tplsets.
  * @note FOR THE CUSTOM-INSTALLER
  * @see Legacy_ModuleInstallUtils::installAllOfModuleTemplates()
  */
 function _uninstallAllOfModuleTemplates(&$module, $tplset, &$log)
 {
     //
     // The following processing depends on the structure of Legacy_RenderSystem.
     //
     $tplHandler =& xoops_gethandler('tplfile');
     $delTemplates = null;
     $delTemplates =& $tplHandler->find($tplset, 'module', $module->get('mid'));
     if (is_array($delTemplates) && count($delTemplates) > 0) {
         //
         // clear cache
         //
         $xoopsTpl = new XoopsTpl();
         $xoopsTpl->clear_cache(null, "mod_" . $module->get('dirname'));
         foreach ($delTemplates as $tpl) {
             if (!$tplHandler->delete($tpl)) {
                 $log->addError(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_TEMPLATE_UNINSTALLED, $tpl->get('tpl_file')));
             }
         }
     }
 }