Exemple #1
0
 /**
  * To prevent errors when upload images with closed site
  */
 public function eventCoreIncludeCommonLanguage()
 {
     global $xoopsConfig;
     if ($xoopsConfig['cpanel'] != 'redmexico') {
         $db = XoopsDatabaseFactory::getDatabaseConnection();
         $db->queryF("UPDATE " . $db->prefix("config") . " SET conf_value='redmexico' WHERE conf_modid=0 AND conf_catid=1 AND conf_name='cpanel'");
     }
     /**
      * Check before to a rmcommon native module be installed
      */
     $fct = RMHttpRequest::get('fct', 'string', '');
     $op = RMHttpRequest::get('op', 'string', '');
     if ('modulesadmin' == $fct && 'install' == $op) {
         $dirname = RMHttpRequest::get('module', 'string', '');
         if ('' != $dirname) {
             $module = new XoopsModule();
             $module->loadInfoAsVar($dirname);
             if ($module->getInfo('rmnative')) {
                 RMUris::redirect_with_message(__('Please install %s using the modules manager from Common Utilities to prevent errors during install.', 'rmcommon'), RMCURL . '/modules.php?action=install&dir=' . $dirname, RMMSG_WARN);
             }
         }
     }
     if (RMUris::current_url() == RMCURL . '/include/upload.php' && $xoopsConfig['closesite']) {
         $security = rmc_server_var($_POST, 'rmsecurity', 0);
         $data = TextCleaner::getInstance()->decrypt($security, true);
         $data = explode("|", $data);
         // [0] = referer, [1] = session_id(), [2] = user, [3] = token
         $xoopsUser = new XoopsUser($data[0]);
         if ($xoopsUser->isAdmin()) {
             $xoopsConfig['closesite'] = 0;
         }
     }
     RMEvents::get()->run_event('rmcommon.include.common.language');
 }
Exemple #2
0
 /**
  * getModule
  * 
  * @param	Legacy_AbstractModule  &$obj
  * @param	XoopsModule  $module
  * 
  * @return	void
  **/
 public static function getModule(&$obj, $module)
 {
     if ($module->getInfo('trust_dirname') == 'lecat') {
         require_once LECAT_TRUST_PATH . '/class/Module.class.php';
         $obj = new Lecat_Module($module);
     }
 }
 /**
  * getModule
  *
  * @param   Legacy_AbstractModule  &$obj
  * @param   XoopsModule  $module
  *
  * @return  void
  **/
 public static function getModule(&$obj, $module)
 {
     if ($module->getInfo('trust_dirname') == 'xupdate') {
         require_once XUPDATE_TRUST_PATH . '/class/Module.class.php';
         $obj = new Xupdate_Module($module);
     }
 }
 /**
  * getModule
  * 
  * @param	Legacy_AbstractModule  &$obj
  * @param	XoopsModule  $module
  * 
  * @return	void
  **/
 public static function getModule(&$obj, $module)
 {
     if ($module->getInfo('trust_dirname') == 'playermap') {
         require_once PLAYERMAP_TRUST_PATH . '/class/Module.class.php';
         $obj = new Playermap_Module($module);
     }
 }
 /**
  * getModule
  * 
  * @param	Legacy_AbstractModule  &$obj
  * @param	XoopsModule  $module
  * 
  * @return	void
  **/
 public static function getModule(&$obj, $module)
 {
     if ($module->getInfo('trust_dirname') == 'rpglink') {
         require_once RPGLINK_TRUST_PATH . '/class/Module.class.php';
         $obj = new Rpglink_Module($module);
     }
 }
 /**
  * get module.
  * 
  * @param Legacy_AbstractModule &$obj
  * @param XoopsModule           $module
  */
 public static function getModule(&$obj, $module)
 {
     if ($module->getInfo('trust_dirname') == COSMOAPI_TRUST_DIRNAME) {
         $mytrustdirname = COSMOAPI_TRUST_DIRNAME;
         require_once XOOPS_TRUST_PATH . '/modules/' . COSMOAPI_TRUST_DIRNAME . '/class/Module.class.php';
         $className = ucfirst(COSMOAPI_TRUST_DIRNAME) . '_Module';
         $obj = new $className($module);
     }
 }
 /**
  * uninstall tables.
  */
 private function _uninstallTables()
 {
     $dirname = $this->_mXoopsModule->get('dirname');
     $constpref = '_MI_' . strtoupper($dirname);
     $root =& XCube_Root::getSingleton();
     $db =& $root->mController->getDB();
     $tables =& $this->_mXoopsModule->getInfo('tables');
     if (is_array($tables)) {
         foreach ($tables as $table) {
             $tableName = str_replace(array('{prefix}', '{dirname}'), array(XOOPS_DB_PREFIX, $dirname), $table);
             $sql = sprintf('DROP TABLE `%s`;', $tableName);
             if ($db->query($sql)) {
                 $this->mLog->addReport(XCube_Utils::formatString(constant($constpref . '_INSTALL_MSG_TABLE_DOROPPED'), $tableName));
             } else {
                 $this->mLog->addError(XCube_Utils::formatString(constant($constpref . '_INSTALL_ERROR_TABLE_DOROPPED'), $tableName));
             }
         }
     }
 }
 /**
  * Retrieves and format the version of a given module.
  * If $module parameter is not given, then will try to get the current module version.
  *
  * Example with <strong>formatted</strong> result:
  * <pre>
  * $version = RMModules::get_module_version('mywords');
  * </pre>
  *
  * Get the same result:
  * <pre>
  * $version = RMModules::get_module_version('mywords', true, 'verbose');
  * </pre>
  *
  * Both previous examples return something like this:
  * <pre>MyWords 2.1.3 production</pre>
  *
  * Example 2. Get an array of values:
  * <pre>
  * print_r(RMModules::get_module_version('mywords', true, 'raw');
  * </pre>
  *
  * Will return:
  * <pre>
  * array
  *
  * @param  string       $module Module directory to check
  * @param  bool         $name   Return the name and version (true) or only version (false)
  * @param  string       $type   Type of data to get: 'verbose' get a formatted string, 'raw' gets an array with values.
  * @return array|string
  */
 public static function get_module_version($module = '', $name = true, $type = 'verbose')
 {
     global $xoopsModule;
     //global $version;
     if ($module != '') {
         if ($xoopsModule && $xoopsModule->dirname() == $module) {
             $mod = $xoopsModule;
         } else {
             $mod = new XoopsModule();
         }
     } else {
         $mod = new XoopsModule();
     }
     $mod->loadInfoAsVar($module);
     $version = $mod->getInfo('rmversion');
     $version = is_array($version) ? $version : array('major' => $version, 'minor' => 0, 'revision' => 0, 'stage' => 0, 'name' => $mod->getInfo('name'));
     if ($type == 'raw') {
         return $version;
     }
     return self::format_module_version($version, $name);
 }
 /**
  * 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_INSTALLED'), $this->_mXoopsModule->getInfo('name')));
     } elseif (is_object($this->_mXoopsModule)) {
         $this->mLog->addError(XCube_Utils::formatString(constant($constpref . '_INSTALL_ERROR_MODULE_INSTALLED'), $this->_mXoopsModule->getInfo('name')));
     } else {
         $this->mLog->addError(XCube_Utils::formatString(constant($constpref . '_INSTALL_ERROR_MODULE_INSTALLED'), 'something'));
     }
 }
 function _processScript()
 {
     $installScript = trim($this->_mTargetXoopsModule->getInfo('onUpdate'));
     if ($installScript != false) {
         require_once XOOPS_MODULE_PATH . "/" . $this->_mTargetXoopsModule->get('dirname') . "/" . $installScript;
         $funcName = 'xoops_module_update_' . $this->_mTargetXoopsModule->get('dirname');
         if (function_exists($funcName)) {
             if (!call_user_func($funcName, $this->_mTargetXoopsModule, $this->getCurrentVersion(), new XCube_Ref($this->mLog))) {
                 $this->mLog->addError("Failed to execute " . $funcName);
             }
         }
     }
 }
Exemple #11
0
function get_modules_list()
{
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $sql = 'SELECT * FROM ' . $db->prefix('modules') . " ORDER BY mid, weight";
    $result = $db->query($sql);
    $installed_mods = array();
    while ($row = $db->fetchArray($result)) {
        $mod = new XoopsModule();
        $mod->assignVars($row);
        $module_icon = $mod->getInfo('icon48') != '' ? XOOPS_URL . '/modules/' . $mod->getVar('dirname') . '/' . $mod->getInfo('icon48') : '';
        $module_logo = XOOPS_URL . '/modules/' . $mod->getVar('dirname') . '/' . $mod->getInfo('image');
        if ($mod->hasconfig()) {
            $config_link = $mod->getInfo('rmnative') ? XOOPS_URL . '/modules/rmcommon/settings.php?action=configure&amp;mod=' . $mod->mid() : XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $mod->mid();
        }
        $this_module = array('name' => $mod->getVar('name'), 'dirname' => $mod->getVar('dirname'), 'real_name' => $mod->getInfo('name'), 'version' => is_array($mod->getInfo('rmversion')) ? RMModules::format_module_version($mod->getInfo('rmversion')) : $mod->getVar('version') / 100, 'icon' => $module_icon, 'logo' => $module_logo, 'admin' => $mod->getVar('hasadmin') ? XOOPS_URL . '/modules/' . $mod->getVar('dirname') . '/' . $mod->getInfo('adminindex') : '', 'main' => RMUris::anchor($mod->getVar('dirname')), 'updated' => RMTimeFormatter::get()->format($mod->getVar('last_update'), __('%d% %T% %Y%', 'rmcommon')), 'config' => isset($config_link) ? $config_link : '', 'description' => $mod->getInfo('description'));
        $installed_mods[] = (object) $this_module;
    }
    return $installed_mods;
}
 function _processScript()
 {
     $installScript = trim($this->_mTargetXoopsModule->getInfo('onUpdate'));
     if ($installScript != false) {
         require_once XOOPS_MODULE_PATH . "/" . $this->_mTargetXoopsModule->get('dirname') . "/" . $installScript;
         $funcName = 'xoops_module_update_' . $this->_mTargetXoopsModule->get('dirname');
         if (function_exists($funcName)) {
             // Because X2 can use reference parameter, Legacy doesn't use the following code;'
             //if (!call_user_func($funcName, $this->_mTargetXoopsModule, $this->getCurrentVersion(), new XCube_Ref($this->mLog))) {
             $result = $funcName($this->_mTargetXoopsModule, $this->getCurrentVersion(), new XCube_Ref($this->mLog));
             if (!$result) {
                 $this->mLog->addError("Failed to execute " . $funcName);
             }
         }
     }
 }
Exemple #13
0
 /**
  * Render about page
  *
  * @param bool $logo_xoops show logo
  *
  * @return bool|mixed|string
  */
 public function renderAbout($logo_xoops = true)
 {
     $xoops = \Xoops::getInstance();
     $date = explode('/', $this->module->getInfo('release_date'));
     $author = explode(',', $this->module->getInfo('author'));
     $nickname = explode(',', $this->module->getInfo('nickname'));
     $release_date = \XoopsLocale::formatTimestamp(mktime(0, 0, 0, $date[1], $date[2], $date[0]), 's');
     $author_list = '';
     foreach (array_keys($author) as $i) {
         $author_list .= $author[$i];
         if (isset($nickname[$i]) && $nickname[$i] != '') {
             $author_list .= " (" . $nickname[$i] . "), ";
         } else {
             $author_list .= ", ";
         }
     }
     $changelog = '';
     $language = $xoops->getConfig('locale');
     if (!is_file(\XoopsBaseConfig::get('root-path') . "/modules/" . $this->module->getVar("dirname") . "/locale/" . $language . "/changelog.txt")) {
         $language = 'en_US';
     }
     $file = \XoopsBaseConfig::get('root-path') . "/modules/" . $this->module->getVar("dirname") . "/locale/" . $language . "/changelog.txt";
     if (is_readable($file)) {
         $changelog = utf8_encode(implode("<br />", file($file))) . "\n";
     } else {
         $file = \XoopsBaseConfig::get('root-path') . "/modules/" . $this->module->getVar("dirname") . "/docs/changelog.txt";
         if (is_readable($file)) {
             $changelog = utf8_encode(implode("<br />", file($file))) . "\n";
         }
     }
     $author_list = substr($author_list, 0, -2);
     $this->module->setInfo('release_date', $release_date);
     $this->module->setInfo('author_list', $author_list);
     if (is_array($this->module->getInfo('paypal'))) {
         $this->module->setInfo('paypal', $this->module->getInfo('paypal'));
     }
     $this->module->setInfo('changelog', $changelog);
     $xoops->tpl()->assign('module', $this->module);
     $this->addInfoBox(\XoopsLocale::MODULE_INFORMATION, 'info', 'id="xo-about"');
     $this->addInfoBoxLine(\XoopsLocale::C_DESCRIPTION . ' ' . $this->module->getInfo("description"), 'info');
     $this->addInfoBoxLine(\XoopsLocale::C_UPDATE_DATE . ' <span class="bold">' . \XoopsLocale::formatTimestamp($this->module->getVar("last_update"), "m") . '</span>', 'info');
     $this->addInfoBoxLine(\XoopsLocale::C_WEBSITE . ' <a class="xo-tooltip" href="http://' . $this->module->getInfo("module_website_url") . '" rel="external" title="' . $this->module->getInfo("module_website_name") . ' - ' . $this->module->getInfo("module_website_url") . '">' . $this->module->getInfo("module_website_name") . '</a>', 'info');
     $xoops->tpl()->assign('xoops_logo', $logo_xoops);
     $xoops->tpl()->assign('xo_admin_box', $this->itemInfoBox);
     return $xoops->tpl()->fetch($this->getTplPath('about'));
 }
 function _processScript()
 {
     $installScript = trim($this->_mXoopsModule->getInfo('onUninstall'));
     if ($installScript != false) {
         require_once XOOPS_MODULE_PATH . "/" . $this->_mXoopsModule->get('dirname') . "/" . $installScript;
         $funcName = 'xoops_module_uninstall_' . $this->_mXoopsModule->get('dirname');
         if (!preg_match("/^[a-zA-Z_][a-zA-Z0-9_]*\$/", $funcName)) {
             $this->mLog->addError(XCUbe_Utils::formatMessage(_AD_LEGACY_ERROR_FAILED_TO_EXECUTE_CALLBACK, $funcName));
             return;
         }
         if (function_exists($funcName)) {
             if (!call_user_func($funcName, $this->_mXoopsModule, new XCube_Ref($this->mLog))) {
                 $this->mLog->addError(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_FAILED_TO_EXECUTE_CALLBACK, $funcName));
             }
         }
     }
 }
Exemple #15
0
 /**
  * Obtiene la version del mdulo actual
  * Esta funci?n solo funciona con m?dulos de Red M?xico Soft
  * o compatibles
  * @param bool $includename Mostrar todo el nombre del m?dulo
  * @param string $module Obtener Versi?n del M?dulo Espec?ficado
  * @param int $type 0 = String, 1 = Array
  */
 public function getVersion($includename = true, $module = '', $type = 0)
 {
     global $xoopsModule, $xoopsConfig;
     //global $version;
     if ($module != '') {
         if ($xoopsModule->dirname() == $module) {
             $mod = $xoopsModule;
         } else {
             $mod = new XoopsModule();
         }
     }
     $mod->loadInfoAsVar($module);
     $version = $mod->getInfo('rmversion');
     $version = is_array($version) ? $version : array('number' => $version, 'revision' => 0, 'status' => 0, 'name' => $mod->getInfo('name'));
     if ($type == 1) {
         return $version;
     }
     $rtn = '';
     if ($includename) {
         $rtn .= (defined($version['name']) ? constant($version['name']) : $version['name']) . ' ';
     }
     $rtn .= $version['number'];
     if ($version['revision'] > 0) {
         $rtn .= '.' . $version['revision'] / 100;
     } else {
         $rtn .= '.0';
     }
     switch ($version['status']) {
         case '-3':
             $rtn .= ' alfa';
             break;
         case '-2':
             $rtn .= ' beta';
             break;
         case '-1':
             $rtn .= ' final';
             break;
         case '0':
             break;
     }
     return $rtn;
 }
 function _processScript()
 {
     $installScript = trim($this->_mXoopsModule->getInfo('onInstall'));
     if ($installScript != false) {
         require_once XOOPS_MODULE_PATH . "/" . $this->_mXoopsModule->get('dirname') . "/" . $installScript;
         $funcName = 'xoops_module_install_' . $this->_mXoopsModule->get('dirname');
         if (!preg_match("/^[a-zA-Z_][a-zA-Z0-9_]*\$/", $funcName)) {
             $this->mLog->addError(XCube_Utils::formatString(_AD_LEGACY_ERROR_FAILED_TO_EXECUTE_CALLBACK, $funcName));
             return;
         }
         if (function_exists($funcName)) {
             // Because X2 can use reference parameter, Legacy doesn't use the following code;'
             // if (!call_user_func($funcName, $this->_mXoopsModule)) {
             $result = $funcName($this->_mXoopsModule, new XCube_Ref($this->mLog));
             if (!$result) {
                 $this->mLog->addError(XCube_Utils::formatString(_AD_LEGACY_ERROR_FAILED_TO_EXECUTE_CALLBACK, $funcName));
             }
         }
     }
 }
 /**
  * Get the available widgets list
  *
  * @return array
  */
 public static function get_available_list($mods = null)
 {
     $db = XoopsDatabaseFactory::getDatabaseConnection();
     if ($mods == null || empty($mods)) {
         $mods = RMModules::get_modules_list();
     }
     $list = array();
     // Block list to return
     foreach ($mods as $mod) {
         if (!file_exists(XOOPS_ROOT_PATH . '/modules/' . $mod['dirname'] . '/xoops_version.php')) {
             continue;
         }
         load_mod_locale($mod['dirname']);
         $module = new XoopsModule();
         $module->loadInfoAsVar($mod['dirname']);
         $list[$mod['dirname']] = array('name' => $mod['name'], 'blocks' => $module->getInfo('blocks'));
     }
     // Event generated to modify the available widgets list
     $list = RMEvents::get()->run_event('rmcommon.available.widgets', $list);
     return $list;
 }
Exemple #18
0
 /**
  * installconfigs
  *
  * @param XoopsModule $module module being installed
  *
  * @return void
  */
 public function installConfigs(XoopsModule $module)
 {
     $xoops = Xoops::getInstance();
     // now reinsert them with the new settings
     $configs = $module->getInfo('config');
     if (!is_array($configs)) {
         $configs = array();
     }
     XoopsPreload::getInstance()->triggerEvent('onModuleUpdateConfigs', array($module, &$configs));
     if (is_array($configs) && count($configs) > 0) {
         $this->trace[] = SystemLocale::MANAGING_PREFERENCES;
         $config_handler = $xoops->getHandlerConfig();
         $order = 0;
         foreach ($configs as $config) {
             // only insert ones that have been deleted previously with success
             if (!in_array($config['name'], $this->config_delng)) {
                 $confobj = $config_handler->createConfig();
                 $confobj->setVar('conf_modid', $module->getVar('mid'));
                 $confobj->setVar('conf_catid', 0);
                 $confobj->setVar('conf_name', $config['name']);
                 $confobj->setVar('conf_title', $config['title'], true);
                 $confobj->setVar('conf_desc', $config['description'], true);
                 $confobj->setVar('conf_formtype', $config['formtype']);
                 $confobj->setVar('conf_valuetype', $config['valuetype']);
                 if (isset($this->config_old[$config['name']]['value']) && $this->config_old[$config['name']]['formtype'] == $config['formtype'] && $this->config_old[$config['name']]['valuetype'] == $config['valuetype']) {
                     // preserver the old value if any
                     // form type and value type must be the same
                     $confobj->setVar('conf_value', $this->config_old[$config['name']]['value'], true);
                 } else {
                     $confobj->setConfValueForInput($config['default'], true);
                     //$confobj->setVar('conf_value', $config['default'], true);
                 }
                 $confobj->setVar('conf_order', $order);
                 $confop_msgs = '';
                 if (isset($config['options']) && is_array($config['options'])) {
                     foreach ($config['options'] as $key => $value) {
                         $confop = $config_handler->createConfigOption();
                         $confop->setVar('confop_name', $key, true);
                         $confop->setVar('confop_value', $value, true);
                         $confobj->setConfOptions($confop);
                         $confop_msgs .= '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
                         $confop_msgs .= SystemLocale::S_CONFIG_OPTION_ADDED;
                         $confop_msgs .= '&nbsp;';
                         $confop_msgs .= XoopsLocale::C_NAME;
                         $confop_msgs .= ' <strong>' . Xoops_Locale::translate($key, $module->getVar('dirname')) . '</strong> ';
                         $confop_msgs .= XoopsLocale::C_VALUE . ' <strong>' . $value . '</strong> ';
                         unset($confop);
                     }
                 }
                 ++$order;
                 if (false != $config_handler->insertConfig($confobj)) {
                     $this->trace[]['sub'] = sprintf(SystemLocale::SF_CONFIG_ADDED, "<strong>" . $config['name'] . "</strong>") . $confop_msgs;
                 } else {
                     $this->trace[]['sub'] = '<span class="red">' . sprintf(SystemLocale::EF_CONFIG_NOT_ADDED, "<strong>" . $config['name'] . "</strong>") . '</span>';
                 }
                 unset($confobj);
             }
         }
         unset($configs);
     }
 }
 /**
  * Installs all of blocks $module specify.
  * 
  * This function gets informations about blocks from xoops_version.
  * 
  * @static
  * @param XoopsModule $module
  * @param Legacy_ModuleInstallLog $log
  * @note FOR THE CUSTOM-INSTALLER
  * @see Legacy_ModuleInstallUtils::uninstallAllOfBlocks()
  */
 function installAllOfBlocks(&$module, &$log)
 {
     $definedBlocks = $module->getInfo('blocks');
     if ($definedBlocks == false) {
         return true;
     }
     $func_num = 0;
     foreach ($definedBlocks as $block) {
         $successFlag = true;
         $updateblocks = array();
         // Try (1) --- func_num
         foreach ($definedBlocks as $idx => $block) {
             if (isset($block['func_num'])) {
                 $updateblocks[$idx] = $block;
             } else {
                 $successFlag = false;
                 break;
             }
         }
         // Try (2) --- index pattern
         if ($successFlag == false) {
             $successFlag = true;
             $updateblocks = array();
             foreach ($definedBlocks as $idx => $block) {
                 if (is_int($idx)) {
                     $block['func_num'] = $idx;
                     $updateblocks[$idx] = $block;
                 } else {
                     $successFlag = false;
                     break;
                 }
             }
         }
         // Try (3) --- automatic
         if ($successFlag == false) {
             $successFlag = true;
             $updateblocks = array();
             $func_num = 0;
             foreach ($definedBlocks as $block) {
                 $block['func_num'] = $func_num;
                 $updateblocks[] = $block;
             }
         }
     }
     foreach ($updateblocks as $block) {
         $newBlock =& Legacy_ModuleInstallUtils::createBlockByInfo($module, $block, $block['func_num']);
         Legacy_ModuleInstallUtils::installBlock($module, $newBlock, $block, $log);
     }
 }
Exemple #20
0
function module_uninstall_now()
{
    global $xoopsSecurity, $xoopsConfig;
    $mod = rmc_server_var($_POST, 'module', '');
    if (!$xoopsSecurity->check()) {
        redirectMsg('modules.php', __('Sorry, this operation could not be completed!', 'rmcommon'), 1);
        die;
    }
    $module_handler = xoops_gethandler('module');
    if (!$module_handler->getByDirname($mod)) {
        redirectMsg('modules.php', sprintf(__('Module %s is not installed yet!', 'rmcommon'), $mod), 1);
        die;
    }
    $file = XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/admin/modulesadmin.php';
    if (file_exists($file)) {
        include_once $file;
    } else {
        include_once str_replace($xoopsConfig['language'], 'english', $file);
    }
    include_once XOOPS_ROOT_PATH . '/modules/system/admin/modulesadmin/modulesadmin.php';
    RMEvents::get()->run_event('rmcommon.uninstalling.module', $mod);
    $module_log = xoops_module_uninstall($mod);
    $module_log = RMEvents::get()->run_event('rmcommon.module.uninstalled', $module_log, $mod);
    RMFunctions::create_toolbar();
    RMTemplate::get()->add_style('modules.css', 'rmcommon');
    xoops_cp_header();
    $module = new XoopsModule();
    $module->loadInfo($mod, false);
    $log_title = sprintf(__('Uninstall log for %s', 'rmcommon'), $module ? $module->getInfo('name') : $mod);
    $action = rmc_server_var($_POST, 'action', '');
    include RMTemplate::get()->get_template('rmc_mod_log.php', 'module', 'rmcommon');
    xoops_cp_footer();
}
Exemple #21
0
 /**
  * getForm
  *
  * @param array                   &$obj array of config objects
  * @param XoopsModule|XoopsObject &$mod module
  *
  * @return void
  */
 public function getForm(&$obj, XoopsModule &$mod)
 {
     $xoops = Xoops::getInstance();
     $config_handler = $xoops->getHandlerConfig();
     parent::__construct('', 'pref_form', 'admin.php?fct=preferences', 'post', true);
     if ($mod->getVar('dirname') != 'system') {
         $xoops->loadLanguage('modinfo', $mod->getVar('dirname'));
     }
     $xoops->loadLocale($mod->getVar('dirname'));
     $configs = $mod->getInfo('config');
     $configNames = array();
     foreach (array_keys($configs) as $i) {
         $configNames[$configs[$i]['name']] =& $configs[$i];
     }
     $configCats = $mod->getInfo('configcat');
     if (!$configCats) {
         $configCats = array('default' => array('name' => SystemLocale::OTHER_SETTINGS, 'description' => ''));
     }
     if (!in_array('default', array_keys($configCats))) {
         $configCats['default'] = array('name' => SystemLocale::OTHER_SETTINGS, 'description' => '');
     }
     foreach (array_keys($configNames) as $name) {
         if (!isset($configNames[$name]['category'])) {
             $configNames[$name]['category'] = 'default';
         }
     }
     $tabtray = new Xoops\Form\TabTray('', 'pref_tabtay', $xoops->getModuleConfig('jquery_theme', 'system'));
     $tabs = array();
     foreach ($configCats as $name => $info) {
         $tabs[$name] = new Xoops\Form\Tab($info['name'], 'pref_tab_' . $name);
         if (isset($info['description']) && $info['description'] != '') {
             $tabs[$name]->addElement(new Xoops\Form\Label('', $info['description']));
         }
     }
     $xoops->preload()->triggerEvent('onSystemPreferencesForm', array($mod));
     if (!empty($_REQUEST["redirect"])) {
         $myts = MyTextSanitizer::getInstance();
         $this->addElement(new Xoops\Form\Hidden('redirect', $myts->htmlSpecialChars($_REQUEST["redirect"])));
     } elseif ($mod->getInfo('adminindex')) {
         $this->addElement(new Xoops\Form\Hidden('redirect', \XoopsBaseConfig::get('url') . '/modules/' . $mod->getVar('dirname') . '/' . $mod->getInfo('adminindex')));
     }
     $count = count($obj);
     for ($i = 0; $i < $count; ++$i) {
         $title = Xoops_Locale::translate($obj[$i]->getVar('conf_title'), $mod->getVar('dirname'));
         $desc = $obj[$i]->getVar('conf_desc') != '' ? Xoops_Locale::translate($obj[$i]->getVar('conf_desc'), $mod->getVar('dirname')) : '';
         switch ($obj[$i]->getVar('conf_formtype')) {
             case 'textarea':
                 $myts = MyTextSanitizer::getInstance();
                 if ($obj[$i]->getVar('conf_valuetype') == 'array') {
                     // this is exceptional.. only when value type is arrayneed a smarter way for this
                     $ele = $obj[$i]->getVar('conf_value') != '' ? new Xoops\Form\TextArea($title, $obj[$i]->getVar('conf_name'), $myts->htmlSpecialChars(implode('|', $obj[$i]->getConfValueForOutput())), 5, 5) : new Xoops\Form\TextArea($title, $obj[$i]->getVar('conf_name'), '', 5, 5);
                 } else {
                     $ele = new Xoops\Form\TextArea($title, $obj[$i]->getVar('conf_name'), $myts->htmlSpecialChars($obj[$i]->getConfValueForOutput()), 5, 5);
                 }
                 break;
             case 'select':
                 $ele = new Xoops\Form\Select($title, $obj[$i]->getVar('conf_name'), $obj[$i]->getConfValueForOutput());
                 $options = $config_handler->getConfigOptions(new Criteria('conf_id', $obj[$i]->getVar('conf_id')));
                 $opcount = count($options);
                 for ($j = 0; $j < $opcount; ++$j) {
                     $optval = Xoops_Locale::translate($options[$j]->getVar('confop_value'), $mod->getVar('dirname'));
                     $optkey = Xoops_Locale::translate($options[$j]->getVar('confop_name'), $mod->getVar('dirname'));
                     $ele->addOption($optval, $optkey);
                 }
                 break;
             case 'select_multi':
                 $ele = new Xoops\Form\Select($title, $obj[$i]->getVar('conf_name'), $obj[$i]->getConfValueForOutput(), 5, true);
                 $options = $config_handler->getConfigOptions(new Criteria('conf_id', $obj[$i]->getVar('conf_id')));
                 $opcount = count($options);
                 for ($j = 0; $j < $opcount; ++$j) {
                     $optval = Xoops_Locale::translate($options[$j]->getVar('confop_value'), $mod->getVar('dirname'));
                     $optkey = Xoops_Locale::translate($options[$j]->getVar('confop_name'), $mod->getVar('dirname'));
                     $ele->addOption($optval, $optkey);
                 }
                 break;
             case 'yesno':
                 $ele = new Xoops\Form\RadioYesNo($title, $obj[$i]->getVar('conf_name'), $obj[$i]->getConfValueForOutput());
                 break;
             case 'theme':
             case 'theme_multi':
                 $ele = $obj[$i]->getVar('conf_formtype') != 'theme_multi' ? new Xoops\Form\Select($title, $obj[$i]->getVar('conf_name'), $obj[$i]->getConfValueForOutput()) : new Xoops\Form\Select($title, $obj[$i]->getVar('conf_name'), $obj[$i]->getConfValueForOutput(), 5, true);
                 $dirlist = XoopsLists::getThemesList();
                 if (!empty($dirlist)) {
                     asort($dirlist);
                     $ele->addOptionArray($dirlist);
                 }
                 break;
             case 'tplset':
                 $ele = new Xoops\Form\Select($title, $obj[$i]->getVar('conf_name'), $obj[$i]->getConfValueForOutput());
                 $tplset_handler = $xoops->getHandlerTplset();
                 $tplsetlist = $tplset_handler->getNameList();
                 asort($tplsetlist);
                 foreach ($tplsetlist as $key => $name) {
                     $ele->addOption($key, $name);
                 }
                 break;
             case 'cpanel':
                 $ele = new Xoops\Form\Hidden($obj[$i]->getVar('conf_name'), $obj[$i]->getConfValueForOutput());
                 /*
                                     $ele = new Xoops\Form\Select($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
                                     XoopsLoad::load("cpanel", "system");
                                     $list = XoopsSystemCpanel::getGuis();
                                     $ele->addOptionArray($list);  */
                 break;
             case 'timezone':
                 $ele = new Xoops\Form\SelectTimeZone($title, $obj[$i]->getVar('conf_name'), $obj[$i]->getConfValueForOutput());
                 break;
             case 'language':
                 $ele = new Xoops\Form\SelectLanguage($title, $obj[$i]->getVar('conf_name'), $obj[$i]->getConfValueForOutput());
                 break;
             case 'locale':
                 $ele = new Xoops\Form\SelectLocale($title, $obj[$i]->getVar('conf_name'), $obj[$i]->getConfValueForOutput());
                 break;
             case 'startpage':
                 $ele = new Xoops\Form\Select($title, $obj[$i]->getVar('conf_name'), $obj[$i]->getConfValueForOutput());
                 $module_handler = $xoops->getHandlerModule();
                 $criteria = new CriteriaCompo(new Criteria('hasmain', 1));
                 $criteria->add(new Criteria('isactive', 1));
                 $moduleslist = $module_handler->getNameList($criteria, true);
                 $moduleslist['--'] = XoopsLocale::NONE;
                 $ele->addOptionArray($moduleslist);
                 break;
             case 'group':
                 $ele = new Xoops\Form\SelectGroup($title, $obj[$i]->getVar('conf_name'), false, $obj[$i]->getConfValueForOutput(), 1, false);
                 break;
             case 'group_multi':
                 $ele = new Xoops\Form\SelectGroup($title, $obj[$i]->getVar('conf_name'), false, $obj[$i]->getConfValueForOutput(), 5, true);
                 break;
                 // RMV-NOTIFY: added 'user' and 'user_multi'
             // RMV-NOTIFY: added 'user' and 'user_multi'
             case 'user':
                 $ele = new Xoops\Form\SelectUser($title, $obj[$i]->getVar('conf_name'), false, $obj[$i]->getConfValueForOutput(), 1, false);
                 break;
             case 'user_multi':
                 $ele = new Xoops\Form\SelectUser($title, $obj[$i]->getVar('conf_name'), false, $obj[$i]->getConfValueForOutput(), 5, true);
                 break;
             case 'module_cache':
                 $module_handler = $xoops->getHandlerModule();
                 $modules = $module_handler->getObjectsArray(new Criteria('hasmain', 1), true);
                 $currrent_val = $obj[$i]->getConfValueForOutput();
                 $cache_options = array('0' => XoopsLocale::NO_CACHE, '30' => sprintf(XoopsLocale::F_SECONDS, 30), '60' => XoopsLocale::ONE_MINUTE, '300' => sprintf(XoopsLocale::F_MINUTES, 5), '1800' => sprintf(XoopsLocale::F_MINUTES, 30), '3600' => XoopsLocale::ONE_HOUR, '18000' => sprintf(XoopsLocale::F_HOURS, 5), '86400' => XoopsLocale::ONE_DAY, '259200' => sprintf(XoopsLocale::F_DAYS, 3), '604800' => XoopsLocale::ONE_WEEK, '2592000' => XoopsLocale::ONE_MONTH);
                 if (count($modules) > 0) {
                     $ele = new Xoops\Form\ElementTray($title, '<br />');
                     foreach (array_keys($modules) as $mid) {
                         $c_val = isset($currrent_val[$mid]) ? (int) $currrent_val[$mid] : null;
                         $selform = new Xoops\Form\Select($modules[$mid]->getVar('name'), $obj[$i]->getVar('conf_name') . "[{$mid}]", $c_val);
                         $selform->addOptionArray($cache_options);
                         $ele->addElement($selform);
                         unset($selform);
                     }
                 } else {
                     $ele = new Xoops\Form\Label($title, SystemLocale::NO_MODULE_TO_CACHE);
                 }
                 break;
             case 'site_cache':
                 $ele = new Xoops\Form\Select($title, $obj[$i]->getVar('conf_name'), $obj[$i]->getConfValueForOutput());
                 $ele->addOptionArray(array('0' => XoopsLocale::NO_CACHE, '30' => sprintf(XoopsLocale::F_SECONDS, 30), '60' => XoopsLocale::ONE_MINUTE, '300' => sprintf(XoopsLocale::F_MINUTES, 5), '1800' => sprintf(XoopsLocale::F_MINUTES, 30), '3600' => XoopsLocale::ONE_HOUR, '18000' => sprintf(XoopsLocale::F_HOURS, 5), '86400' => XoopsLocale::ONE_DAY, '259200' => sprintf(XoopsLocale::F_DAYS, 3), '604800' => XoopsLocale::ONE_WEEK, '2592000' => XoopsLocale::ONE_MONTH));
                 break;
             case 'password':
                 $myts = MyTextSanitizer::getInstance();
                 $ele = new Xoops\Form\Password($title, $obj[$i]->getVar('conf_name'), 5, 255, $myts->htmlSpecialChars($obj[$i]->getConfValueForOutput()));
                 break;
             case 'color':
                 $myts = MyTextSanitizer::getInstance();
                 $ele = new Xoops\Form\ColorPicker($title, $obj[$i]->getVar('conf_name'), $myts->htmlSpecialChars($obj[$i]->getConfValueForOutput()));
                 break;
             case 'hidden':
                 $myts = MyTextSanitizer::getInstance();
                 $ele = new Xoops\Form\Hidden($obj[$i]->getVar('conf_name'), $myts->htmlSpecialChars($obj[$i]->getConfValueForOutput()));
                 break;
             case 'textbox':
             default:
                 $myts = MyTextSanitizer::getInstance();
                 $ele = new Xoops\Form\Text($title, $obj[$i]->getVar('conf_name'), 5, 255, $myts->htmlSpecialChars($obj[$i]->getConfValueForOutput()));
                 break;
         }
         $hidden = new Xoops\Form\Hidden('conf_ids[]', $obj[$i]->getVar('conf_id'));
         if (isset($ele)) {
             $ele->setDescription($desc);
             if ($obj[$i]->getVar('conf_formtype') != 'hidden') {
                 $name = 'default';
                 if (isset($configNames[$obj[$i]->getVar('conf_name')]['category'])) {
                     $name = $configNames[$obj[$i]->getVar('conf_name')]['category'];
                 }
                 $tabs[$name]->addElement($ele);
             } else {
                 $this->addElement($ele);
             }
             $this->addElement($hidden);
             unset($ele);
             unset($hidden);
         }
     }
     foreach (array_keys($tabs) as $name) {
         if ($tabs[$name]->getElements()) {
             $tabtray->addElement($tabs[$name]);
         }
     }
     $this->addElement($tabtray);
     $this->addElement(new Xoops\Form\Hidden('op', 'save'));
     $this->addElement(new Xoops\Form\Button('', 'button', XoopsLocale::A_SUBMIT, 'submit'));
 }
             } else {
                 $libmap = array();
             }
         }
     }
 } else {
     $libmap = array();
 }
 // Get Harvest Comparison Request on Peers API's
 $mobject = new XoopsModule();
 $mobject->loadInfoAsVar($module);
 if ($peers = XoopsCache::read(basename(dirname(dirname(__DIR__))) . '.available.peers')) {
     $uris = $peers['harvest']['modules']['uris'];
     shuffle($uris);
     foreach ($uris as $uri) {
         $harvest[md5($uri)] = json_decode(getURIData($uri, array('module' => $module, 'modinfo' => $mobject->getInfo(), 'url' => XOOPS_URL, 'salt' => sha1(_RESOURCES_SALT_BLOWFISH), 'modmap' => $modmap, 'libmap' => 'libmap', 'mode' => 'module', 'timezone' => date_default_timezone_get(), 'microtime' => microtime(true))), true);
     }
 }
 mkdirSecure(XOOPS_VAR_PATH . DIRECTORY_SEPARATOR . basename(__DIR__));
 mkdirSecure($path = XOOPS_VAR_PATH . DIRECTORY_SEPARATOR . basename(__DIR__) . DIRECTORY_SEPARATOR . 'harvest');
 if (file_exists($ffile = XOOPS_VAR_PATH . DIRECTORY_SEPARATOR . basename(__DIR__) . DIRECTORY_SEPARATOR . "harvest.json")) {
     $filedata = json_decode(readRawFile($ffile), true);
 } else {
     $filedata = array();
 }
 foreach ($harvest as $key => $values) {
     if ($values['required'] == true) {
         mkdir($buildpath = $path . DIRECTORY_SEPARATOR . $values['session'], 0777, true);
         foreach ($values['modmap'] as $key => $file) {
             mkdir($buildpath . DIRECTORY_SEPARATOR . $file['path'], 0777, true);
             copyfile($GLOBALS['xoops']->path($file['path'] . DIRECTORY_SEPARATOR . $file['file']), $buildpath . DIRECTORY_SEPARATOR . $file['path'] . DIRECTORY_SEPARATOR . $file['file']);
Exemple #23
0
        } else {
            if ($mod->getVar('hasmain')) {
                $main_link = XOOPS_URL . '/modules/' . $mod->dirname();
            } else {
                $main_link = "#";
            }
        }
    } else {
        if ($mod->getVar('hasmain')) {
            $main_link = XOOPS_URL . '/modules/' . $mod->dirname();
        } else {
            $main_link = "#";
        }
    }
    // Admin section
    $admin_link = $mod->getVar('hasadmin') ? XOOPS_URL . '/modules/' . $mod->dirname() . '/' . $mod->getInfo('adminindex') : '';
    //$deficon = XOOPS_ROOT_PATH.'/modules/rmcommon/themes/twop6/images/modules/'.$mod->dirname().'.png';
    $modules[] = array('id' => $mod->getVar('mid'), 'name' => $mod->getVar('name'), 'realname' => $mod->getInfo('name'), 'version' => $mod->getInfo('rmnative') ? RMModules::format_module_version($mod->getInfo('rmversion')) : $mod->getInfo('version'), 'description' => $mod->getInfo('description'), 'image' => XOOPS_URL . '/modules/' . $mod->getVar('dirname') . '/' . $mod->getInfo('image'), 'link' => $main_link, 'admin_link' => $admin_link, 'updated' => formatTimestamp($mod->getVar('last_update'), 's'), 'author' => $mod->getInfo('author'), 'author_mail' => $mod->getInfo('authormail'), 'author_web' => $mod->getInfo('authorweb'), 'author_url' => $mod->getInfo('authorurl'), 'license' => $mod->getInfo('license'), 'dirname' => $mod->getInfo('dirname'), 'active' => $mod->getVar('isactive'));
}
// Event for installed modules
$modules = RMEvents::get()->run_event('rmcommon.installed.modules', $modules, $installed_dirs);
//include dirname(dirname(__FILE__)).'/include/modules.php';
foreach ($modules as $mod) {
    ?>
<a rel="tooltip" href="<?php 
    echo $mod['admin_link'];
    ?>
" title="<?php 
    echo $mod['name'];
    ?>
">
Exemple #24
0
    $mod->assignVars($row);
    $installed_dirs[] = $mod->dirname();
    if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $mod->getVar('dirname') . '/class/' . strtolower($mod->getVar('dirname') . 'controller') . '.php')) {
        include_once XOOPS_ROOT_PATH . '/modules/' . $mod->getVar('dirname') . '/class/' . strtolower($mod->getVar('dirname') . 'controller') . '.php';
        $class = ucfirst($mod->getVar('dirname')) . 'Controller';
        $class = new $class();
        if (method_exists($class, 'get_main_link')) {
            $main_link = $class->get_main_link();
        } else {
            if ($mod->getVar('hasmain')) {
                $main_link = XOOPS_URL . '/modules/' . $mod->dirname();
            } else {
                $main_link = "#";
            }
        }
    } else {
        if ($mod->getVar('hasmain')) {
            $main_link = XOOPS_URL . '/modules/' . $mod->dirname();
        } else {
            $main_link = "#";
        }
    }
    // Admin section
    $admin_link = $mod->getVar('hasadmin') ? XOOPS_URL . '/modules/' . $mod->dirname() . '/' . $mod->getInfo('adminindex') : '';
    $deficon = XOOPS_ROOT_PATH . '/modules/rmcommon/themes/designia/images/modules/' . $mod->dirname() . '.png';
    $modules[] = array('id' => $mod->getVar('mid'), 'name' => $mod->getVar('name'), 'realname' => $mod->getInfo('name'), 'version' => $mod->getInfo('rmnative') ? RMUtilities::format_version($mod->getInfo('rmversion')) : $mod->getInfo('version'), 'description' => $mod->getInfo('description'), 'image' => is_file($deficon) ? str_replace(XOOPS_ROOT_PATH, XOOPS_URL, $deficon) : XOOPS_URL . '/modules/' . $mod->getVar('dirname') . '/' . ($mod->getInfo('icon32') ? $mod->getInfo('icon32') : $mod->getInfo('image')), 'link' => $main_link, 'admin_link' => $admin_link, 'updated' => formatTimestamp($mod->getVar('last_update'), 's'), 'author' => $mod->getInfo('author'), 'author_mail' => $mod->getInfo('authormail'), 'author_web' => $mod->getInfo('authorweb'), 'author_url' => $mod->getInfo('authorurl'), 'license' => $mod->getInfo('license'), 'dirname' => $mod->getInfo('dirname'), 'active' => $mod->getVar('isactive'));
}
// Event for installed modules
$modules = RMEvents::get()->run_event('rmcommon.installed.modules', $modules, $installed_dirs);
//include dirname(dirname(__FILE__)).'/include/modules.php';
//die();
 /**
  * getModule
  * 
  * @param	Legacy_AbstractModule  &$obj
  * @param	XoopsModule  $module
  * 
  * @return	void
  **/
 public static function getModule(&$obj, $module)
 {
     if ($module->getInfo('trust_dirname') == 'trpg') {
         require_once TRPG_TRUST_PATH . '/class/Module.class.php';
         $obj = new Trpg_Module($module);
     }
 }
Exemple #26
0
 /**
  * getModule
  * 
  * @param   Legacy_AbstractModule  &$obj
  * @param   XoopsModule  $module
  * 
  * @return  void
  **/
 public static function getModule(&$obj, $module)
 {
     if ($module->getInfo('trust_dirname') == 'af_dmm') {
         require_once AF_DMM_TRUST_PATH . '/class/Module.class.php';
         $obj = new Af_dmm_Module($module);
     }
 }
 /**
  * @param string $paypal
  * @param bool   $logo_xoops
  *
  * @return string
  */
 public function renderAbout($paypal = '', $logo_xoops = true)
 {
     $path = XOOPS_URL . '/Frameworks/moduleclasses/icons/32/';
     $ret = "<table>\n<tr>\n";
     $ret .= "<td width=\"50%\">\n";
     $date = explode('/', $this->_obj->getInfo('release_date'));
     $author = explode(',', $this->_obj->getInfo('author'));
     $nickname = explode(',', $this->_obj->getInfo('nickname'));
     $release_date = formatTimestamp(mktime(0, 0, 0, $date[1], $date[2], $date[0]), 's');
     $module_info = '<div id="about"><label>' . _AM_MODULEADMIN_ABOUT_DESCRIPTION . '</label><text>' . $this->_obj->getInfo('description') . '</text><br>
     <label>' . _AM_MODULEADMIN_ABOUT_UPDATEDATE . '</label><text class="bold">' . formatTimestamp($this->_obj->getVar('last_update'), 'm') . '</text><br>
     <label>' . _AM_MODULEADMIN_ABOUT_MODULESTATUS . '</label><text>' . $this->_obj->getInfo('module_status') . '</text><br>
     <label>' . _AM_MODULEADMIN_ABOUT_WEBSITE . '</label><text><a class="tooltip" href="http://' . $this->_obj->getInfo('module_website_url') . '" rel="external" title="' . $this->_obj->getInfo('module_website_name') . ' - ' . $this->_obj->getInfo('module_website_url') . '">
                     ' . $this->_obj->getInfo('module_website_name') . '</a></text></div>';
     $ret .= "<table>\n<tr>\n<td width=\"100px\">\n";
     $ret .= "<img src='" . XOOPS_URL . '/modules/' . $this->_obj->getVar('dirname') . '/' . $this->_obj->getInfo('image') . "' alt='" . $this->_obj->getVar('name') . "' style='float: left; margin-right: 10px;' />\n";
     $ret .= "</td><td>\n";
     $ret .= "<div style='margin-top: 1px; margin-bottom: 4px; font-size: 18px; line-height: 18px; color: #2F5376; font-weight: bold;'>\n";
     $ret .= $this->_obj->getInfo('name') . ' ' . $this->_obj->getInfo('version') . ' ' . $this->_obj->getInfo('module_status') . ' (' . $release_date . ")\n";
     $ret .= "<br>\n";
     $ret .= "</div>\n";
     $ret .= "<div style='line-height: 16px; font-weight: bold;'>\n";
     $ret .= 'by ';
     foreach (array_keys($author) as $i) {
         $ret .= $author[$i];
         if (isset($nickname[$i]) && $nickname[$i] != '') {
             $ret .= ' (' . $nickname[$i] . '), ';
         } else {
             $ret .= ', ';
         }
     }
     $ret = substr($ret, 0, -2);
     $ret .= "</div>\n";
     $ret .= "<div style='line-height: 16px;'>\n";
     $ret .= "<a href=\"http://" . $this->_obj->getInfo('license_url') . "\" target=\"_blank\" >" . $this->_obj->getInfo('license') . "</a>\n";
     $ret .= "<br>\n";
     $ret .= "<a href=\"http://" . $this->_obj->getInfo('website') . "\" target=\"_blank\" >" . $this->_obj->getInfo('website') . "</a>\n";
     $ret .= "<br>\n";
     $ret .= "<br>\n";
     if ($paypal != '') {
         $ret .= '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
                  <input type="hidden" name="cmd" value="_s-xclick">
                  <input type="hidden" name="hosted_button_id" value="' . $paypal . '">
                  <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" style="background-color:transparent;">
                  <img alt="" border="0" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1">
                  </form>';
     }
     $ret .= "</div>\n";
     $ret .= "</td>\n</tr>\n</table>\n";
     $this->addInfoBox(_AM_MODULEADMIN_ABOUT_MODULEINFO);
     $this->addInfoBoxLine(_AM_MODULEADMIN_ABOUT_MODULEINFO, $module_info, '', '', 'information');
     $ret .= $this->renderInfoBox();
     $ret .= "</td>\n";
     $ret .= "<td width=\"50%\">\n";
     $ret .= "<fieldset><legend class=\"label\">\n";
     $ret .= _AM_MODULEADMIN_ABOUT_CHANGELOG;
     $ret .= "</legend><br>\n";
     $ret .= "<div class=\"txtchangelog\">\n";
     $language = $GLOBALS['xoopsConfig']['language'];
     if (!is_file(XOOPS_ROOT_PATH . '/modules/' . $this->_obj->getVar('dirname') . '/language/' . $language . '/changelog.txt')) {
         $language = 'english';
     }
     $language = empty($language) ? $GLOBALS['xoopsConfig']['language'] : $language;
     $file = XOOPS_ROOT_PATH . '/modules/' . $this->_obj->getVar('dirname') . '/language/' . $language . '/changelog.txt';
     if (is_readable($file)) {
         $ret .= implode('<br>', file($file)) . "\n";
     } else {
         $file = XOOPS_ROOT_PATH . '/modules/' . $this->_obj->getVar('dirname') . '/docs/changelog.txt';
         if (is_readable($file)) {
             $ret .= implode('<br>', file($file)) . "\n";
         }
     }
     $ret .= "</div>\n";
     $ret .= "</fieldset>\n";
     $ret .= "</td>\n";
     $ret .= "</tr>\n";
     $ret .= "</table>\n";
     if ($logo_xoops == true) {
         $ret .= "<div align=\"center\">";
         $ret .= "<a href=\"http://www.xoops.org\" target=\"_blank\"><img src=\"" . $path . "xoopsmicrobutton.gif\" alt=\"XOOPS\" title=\"XOOPS\"></a>";
         $ret .= '</div>';
     }
     return $ret;
 }
 /**
  * getModule
  * 
  * @param   Legacy_AbstractModule  &$obj
  * @param   XoopsModule  $module
  * 
  * @return  void
  **/
 public static function getModule(&$obj, $module)
 {
     if ($module->getInfo('trust_dirname') == 'xcforum') {
         require_once XCFORUM_TRUST_PATH . '/class/Module.class.php';
         $obj = new Xcforum_Module($module);
     }
 }
Exemple #29
0
function module_uninstall_now()
{
    global $xoopsSecurity, $xoopsConfig, $rmTpl, $xoopsDB;
    $dir = RMHttpRequest::post('module', 'string', '');
    if (!$xoopsSecurity->check()) {
        redirectMsg('modules.php', __('Sorry, this operation could not be completed!', 'rmcommon'), 1);
        die;
    }
    $module_handler = xoops_gethandler('module');
    if (!($mod = $module_handler->getByDirname($dir))) {
        redirectMsg('modules.php', sprintf(__('Module %s is not installed yet!', 'rmcommon'), $mod), 1);
        die;
    }
    $file = XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/admin/modulesadmin.php';
    if (file_exists($file)) {
        include_once $file;
    } else {
        include_once str_replace($xoopsConfig['language'], 'english', $file);
    }
    include_once XOOPS_ROOT_PATH . '/modules/system/admin/modulesadmin/modulesadmin.php';
    RMEvents::get()->run_event('rmcommon.uninstalling.module', $mod);
    $module_log = xoops_module_uninstall($dir);
    // Remove comments
    $sql = "DELETE FROM " . $xoopsDB->prefix("mod_rmcommon_comments") . " WHERE id_obj='{$dir}'";
    if ($xoopsDB->queryF($sql)) {
        $module_log .= '<br><span class="text-success"><span class="fa fa-check"></span> Comments deleted successfully!</span>';
    } else {
        $module_log .= '<br><span class="text-danger"><span class="fa fa-exclamation-triangle"></span> Comments could not be deleted: ' . $xoopsDB->error() . '</span>';
    }
    // Remove notifications
    $sql = "DELETE FROM " . $xoopsDB->prefix("mod_rmcommon_notifications") . " WHERE element='{$dir}' AND `type`='module'";
    if ($xoopsDB->queryF($sql)) {
        $module_log .= '<br><span class="text-success"><span class="fa fa-check"></span> Notifications deleted successfully!</span>';
    } else {
        $module_log .= '<br><span class="text-danger"><span class="fa fa-exclamation-triangle"></span> Notifications could not be deleted: ' . $xoopsDB->error() . '</span>';
    }
    $module_log = RMEvents::get()->run_event('rmcommon.module.uninstalled', $module_log, $mod);
    //RMFunctions::create_toolbar();
    RMTemplate::get()->add_style('modules.min.css', 'rmcommon');
    RMBreadCrumb::get()->add_crumb(__('Modules Management', 'rmcommon'), 'modules.php');
    RMBreadCrumb::get()->add_crumb(sprintf(__('%s install log', 'rmcommon'), $mod->getVar('name')));
    $rmTpl->assign('xoops_pagetitle', sprintf(__('%s install log', 'rmcommon'), $mod->getVar('name')));
    xoops_cp_header();
    $module = new XoopsModule();
    $module->loadInfo($mod, false);
    $log_title = sprintf(__('Uninstall log for %s', 'rmcommon'), $module ? $module->getInfo('name') : $mod);
    $action = rmc_server_var($_POST, 'action', '');
    include RMTemplate::get()->get_template('rmc-modules-log.php', 'module', 'rmcommon');
    xoops_cp_footer();
}
Exemple #30
0
 */
include dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php';
$xoopsLogger->activated = false;
set_time_limit(0);
// Get modules
$sql = "SELECT * FROM " . $xoopsDB->prefix("modules") . " WHERE isactive=1";
$result = $xoopsDB->query($sql);
$urls = array();
$modNames = array();
/**
 * Load existing modules and fetch data to request remote server information
 */
while ($row = $xoopsDB->fetchArray($result)) {
    $mod = new XoopsModule();
    $mod->assignVars($row);
    $info = $mod->getInfo();
    if (!isset($info['rmversion'])) {
        continue;
    }
    if (!isset($info['updateurl'])) {
        continue;
    }
    $modNames[$mod->dirname()] = $info['name'];
    $v = $info['rmversion'];
    if (isset($v['major'])) {
        $version = $v['major'] . '.' . $v['minor'] . '.' . $v['revision'] . '.' . $v['stage'];
    } else {
        $version = $v['number'] . '.' . $v['revision'] / 10 . '.' . $v['status'];
    }
    $urls[$mod->dirname()] = $info['updateurl'] . (strpos($info['updateurl'], '?') === false ? '?' : '&') . 'action=check&id=' . $mod->dirname() . '&version=' . $version;
}