function xoops_module_pre_install_mywords(&$mod) { xoops_setActiveModules(); $mods = xoops_getActiveModules(); if (!in_array("rmcommon", $mods)) { $mod->setErrors('MyWords could not be instaled if <a href="http://www.redmexico.com.mx/w/common-utilities/" target="_blank">Common Utilities</a> has not be installed previously!<br />Please install <a href="http://www.redmexico.com.mx/w/common-utilities/" target="_blank">Common Utilities</a>.'); return false; } return true; }
$modversion['config'][27]['formtype'] = 'textbox'; $modversion['config'][27]['valuetype'] = 'text'; $modversion['config'][27]['default'] = '/usr/sbin/sendmail -bs'; $modversion['config'][28]['name'] = 'rss_enable'; $modversion['config'][28]['title'] = '_MI_RMC_RSSENABLE'; $modversion['config'][28]['description'] = ''; $modversion['config'][28]['formtype'] = 'yesno'; $modversion['config'][28]['valuetype'] = 'int'; $modversion['config'][28]['default'] = 1; $modversion['config'][29]['name'] = 'blocks_enable'; $modversion['config'][29]['title'] = '_MI_RMC_BLOCKSENABLE'; $modversion['config'][29]['description'] = ''; $modversion['config'][29]['formtype'] = 'yesno'; $modversion['config'][29]['valuetype'] = 'int'; $modversion['config'][29]['default'] = 0; $modversion['blocks'][] = array('file' => "comments.php", 'name' => __('Comments', 'rmcommon'), 'description' => __('Show comments from internal comments system', 'rmcommon'), 'show_func' => "rmc_bkcomments_show", 'edit_func' => "rmc_bkcomments_edit", 'template' => 'rmc_bk_comments.html', 'options' => "5|1|1|1|1"); $modversion['blocks'][] = array('file' => "custom.php", 'name' => __('Custom Block', 'rmcommon'), 'description' => __('Allows to create a block with custom content.', 'rmcommon'), 'show_func' => "", 'type' => 'custom'); $amod = xoops_getActiveModules(); if (in_array("rmcommon", $amod)) { $plugins = RMFunctions::installed_plugins(); foreach ($plugins as $plugin) { $p = RMFunctions::load_plugin($plugin); if (!method_exists($p, 'blocks')) { continue; } foreach ($p->blocks() as $block) { $block['plugin'] = 1; $modversion['blocks'][] = $block; } } }
if (!$moduleperm_handler->checkRight('module_read', $xoopsModule->getVar('mid'), XOOPS_GROUP_ANONYMOUS)) { redirect_header(XOOPS_URL . '/user.php?from=' . $xoopsModule->getVar('dirname', 'n'), 1, _NOPERM); exit; } } if ($xoopsModule->getVar('dirname', 'n') != 'system') { if (file_exists($file = $xoops->path('modules/' . $xoopsModule->getVar('dirname', 'n') . '/language/' . $xoopsConfig['language'] . '/main.php'))) { include_once $file; } else { if (file_exists($file = $xoops->path('modules/' . $xoopsModule->getVar('dirname', 'n') . '/language/english/main.php'))) { include_once $file; } } unset($file); } if ($xoopsModule->getVar('hasconfig') == 1 || $xoopsModule->getVar('hascomments') == 1 || $xoopsModule->getVar('hasnotification') == 1) { $xoopsModuleConfig = $config_handler->getConfigsByCat(0, $xoopsModule->getVar('mid')); } } else { if ($xoopsUser) { $xoopsUserIsAdmin = $xoopsUser->isAdmin(1); } } /** * YOU SHOULD AVOID USING THE FOLLOWING FUNCTION, IT WILL BE REMOVED */ //Creates 'system_modules_active' cache file if it has been deleted. xoops_getActiveModules(); $xoopsLogger->stopTime('XOOPS Boot'); $xoopsLogger->startTime('Module init'); $xoopsPreload->triggerEvent('core.include.common.end');
/** * xoops_isActiveModule() * * Checks is module is installed and active * * @return bool */ function xoops_isActiveModule($dirname) { if (isset($dirname) && in_array($dirname, xoops_getActiveModules())) { return true; } return false; }
/** * xoops_isActiveModule() * * Checks is module is installed and active * * @param $dirname * @return bool */ function xoops_isActiveModule($dirname) { return isset($dirname) && in_array($dirname, xoops_getActiveModules()); }