本文整理汇总了PHP中XoopsBlock::getByModule方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsBlock::getByModule方法的具体用法?PHP XoopsBlock::getByModule怎么用?PHP XoopsBlock::getByModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsBlock
的用法示例。
在下文中一共展示了XoopsBlock::getByModule方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update_block_permissions
function update_block_permissions($old_gid, $new_gid)
{
// get handlers
$gperm_handler =& xoops_gethandler('groupperm');
$module_handler =& xoops_gethandler('module');
$module =& $module_handler->getByDirname('xoonips');
$mid = $module->getVar('mid');
$block_objs =& XoopsBlock::getByModule($mid);
foreach ($block_objs as $block_obj) {
// find moderator menu block
if ($block_obj->getVar('show_func') == 'b_xoonips_moderator_show') {
$bid = $block_obj->getVar('bid');
// if old_gid don't have module admin right,
// delete the right to access from old_gid.
if (!$gperm_handler->checkRight('module_admin', $mid, $old_gid)) {
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('gperm_groupid', $old_gid));
$criteria->add(new Criteria('gperm_itemid', $bid));
$criteria->add(new Criteria('gperm_name', 'block_read'));
$gperm_handler->deleteAll($criteria);
}
// if there is no right to access moderator block in new_gid,
// the right gives new_gid.
if (!$gperm_handler->checkRight('block_read', $bid, $new_gid)) {
$gperm_handler->addRight('block_read', $bid, $new_gid);
}
break;
}
}
}
示例2: xoops_module_install_sysutil
function xoops_module_install_sysutil(&$module)
{
$gperm_handler =& xoops_gethandler('groupperm');
$mperm =& $gperm_handler->create();
$mperm->setVar('gperm_groupid', XOOPS_GROUP_ANONYMOUS);
$mperm->setVar('gperm_itemid', $module->getVar('mid'));
$mperm->setVar('gperm_name', 'module_read');
$mperm->setVar('gperm_modid', 1);
$gperm_handler->insert($mperm);
unset($mperm);
$blocks =& XoopsBlock::getByModule($module->getVar('mid'), false);
foreach ($blocks as $blc) {
$bperm =& $gperm_handler->create();
$bperm->setVar('gperm_groupid', XOOPS_GROUP_ANONYMOUS);
$bperm->setVar('gperm_itemid', $blc);
$bperm->setVar('gperm_name', 'block_read');
$bperm->setVar('gperm_modid', 1);
$gperm_handler->insert($bperm);
unset($bperm);
}
unset($blocks);
$module_handler =& xoops_gethandler('module');
$module->setVar('weight', 0);
$module->unsetNew();
$module_handler->insert($module);
return true;
}
示例3: get_block_title
function get_block_title($mid, $fname, $sfunc)
{
$block_objs =& XoopsBlock::getByModule($mid);
$block_title = '';
foreach ($block_objs as $block_obj) {
$func_file = $block_obj->getVar('func_file', 'n');
$show_func = $block_obj->getVar('show_func', 'n');
if ($func_file == $fname && $show_func == $sfunc) {
// found
$block_title = $block_obj->getVar('title', 's');
break;
}
}
return $block_title;
}
示例4: foreach
foreach ($group_defs as $def) {
if (strstr($def, '_AM_ACCESSRIGHTS') || strstr($def, '_AM_ACTIVERIGHTS')) {
eval($def);
}
}
// check $xoopsModule
if (!is_object($xoopsModule)) {
redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
}
// check access right (needs system_admin of BLOCK)
$sysperm_handler =& xoops_gethandler('groupperm');
if (!$sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_BLOCK, $xoopsUser->getGroups())) {
redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
}
// get blocks owned by the module
$block_arr =& XoopsBlock::getByModule($xoopsModule->mid());
function list_blocks()
{
global $block_arr;
// cachetime options
$cachetimes = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK, '2592000' => _MONTH);
// displaying TH
echo "\r\n\t<form action='admin.php' name='blockadmin' method='post'>\r\n\t\t<table width='90%' class='outer' cellpadding='4' cellspacing='1'>\r\n\t\t<tr valign='middle'>\r\n\t\t\t<th>" . _AM_TITLE . "</th>\r\n\t\t\t<th align='center' nowrap='nowrap'>" . _AM_SIDE . "</th>\r\n\t\t\t<th align='center'>" . _AM_WEIGHT . "</th>\r\n\t\t\t<th align='center'>" . _AM_VISIBLEIN . "</th>\r\n\t\t\t<th align='center'>" . _AM_BCACHETIME . "</th>\r\n\t\t\t<th align='right'>" . _AM_ACTION . "</th>\r\n\t\t</tr>\n";
// blocks displaying loop
$class = 'even';
foreach (array_keys($block_arr) as $i) {
$sseln = $ssel0 = $ssel1 = $ssel2 = $ssel3 = $ssel4 = "";
$weight = $block_arr[$i]->getVar("weight");
$title = $block_arr[$i]->getVar("title");
$name = $block_arr[$i]->getVar("name");
$bcachetime = $block_arr[$i]->getVar("bcachetime");
示例5: time
$tplfile->setVar('tpl_lastimported', 0);
$tplfile->setVar('tpl_lastmodified', time());
$tplfile->setVar('tpl_desc', $blocks[$i]['description'], true);
if (!$tplfile_handler->insert($tplfile)) {
$msgs[] = ' <span style="color:#ff0000;">ERROR: Could not insert template <b>' . $blocks[$i]['template'] . '</b> to the database.</span>';
} else {
$msgs[] = ' Template <b>' . $blocks[$i]['template'] . '</b> inserted to the database.';
}
}
$msgs[] = ' Block <b>' . $blocks[$i]['name'] . '</b> created. Block ID: <b>' . $newbid . '</b>';
}
}
}
}
}
$block_arr = XoopsBlock::getByModule($mid);
foreach ($block_arr as $block) {
if (!in_array($block->getVar('show_func'), $showfuncs) || !in_array($block->getVar('func_file'), $funcfiles)) {
$sql = sprintf("DELETE FROM %s WHERE bid = %u", $xoopsDB->prefix('newblocks'), $block->getVar('bid'));
if (!$xoopsDB->query($sql)) {
$msgs[] = ' <span style="color:#ff0000;">ERROR: Could not delete block <b>' . $block->getVar('name') . '</b>. Block ID: <b>' . $block->getVar('bid') . '</b></span>';
} else {
$msgs[] = ' Block <b>' . $block->getVar('name') . ' deleted. Block ID: <b>' . $block->getVar('bid') . '</b>';
}
}
}
$configs = $modules[$mid]->getInfo('config');
if ($configs != false) {
if ($modules[$mid]->getVar('hascomments') != 0) {
include_once XOOPS_ROOT_PATH . '/include/comment_constants.php';
array_push($configs, array('name' => 'com_rule', 'title' => '_CM_COMRULES', 'description' => '', 'formtype' => 'select', 'valuetype' => 'int', 'default' => 1, 'options' => array('_CM_COMAPPROVEALL' => XOOPS_COMMENT_APPROVEALL, '_CM_COMAPPROVEUSER' => XOOPS_COMMENT_APPROVEUSER, '_CM_COMAPPROVEADMIN' => XOOPS_COMMENT_APPROVEADMIN)));
示例6: xoops_template_clear_module_cache
/**
* Clear the module cache
*
* @deprecated
*
* @param int $mid Module ID
* @return
**/
function xoops_template_clear_module_cache($mid)
{
$block_arr =& XoopsBlock::getByModule($mid);
$count = count($block_arr);
if ($count > 0) {
$xoopsTpl = new XoopsTpl();
$xoopsTpl->xoops_setCaching(2);
for ($i = 0; $i < $count; $i++) {
if ($block_arr[$i]->getVar('template') != '') {
$xoopsTpl->clear_cache('db:' . $block_arr[$i]->getVar('template'), 'blk_' . $block_arr[$i]->getVar('bid'));
}
}
}
}
示例7: xoops_gethandler
function &_get_block_object_bymodule_id($mid, $asobject = true)
{
if (defined('ICMS_VERSION_BUILD') && ICMS_VERSION_BUILD > 27) {
/* ImpressCMS 1.2+ */
$block_handler =& xoops_gethandler('block');
$objs =& $block_handler->getByModule($mid, $asobject);
} else {
/* legacy support */
$objs =& XoopsBlock::getByModule($mid, $asobject);
/* from class/xoopsblock.php */
}
return $objs;
}
示例8: xoops_module_deactivate
function xoops_module_deactivate($mid)
{
global $xoopsConfig;
$module_handler =& xoops_gethandler('module');
$module =& $module_handler->get($mid);
include_once XOOPS_ROOT_PATH . '/class/template.php';
xoops_template_clear_module_cache($mid);
$module->setVar('isactive', 0);
if ($module->getVar('dirname') == "system") {
return "<p>" . sprintf(_MD_AM_FAILDEACT, "<b>" . $module->getVar('name') . "</b>") . " " . _MD_AM_ERRORSC . "<br /> - " . _MD_AM_SYSNO . "</p>";
} elseif ($module->getVar('dirname') == $xoopsConfig['startpage']) {
return "<p>" . sprintf(_MD_AM_FAILDEACT, "<b>" . $module->getVar('name') . "</b>") . " " . _MD_AM_ERRORSC . "<br /> - " . _MD_AM_STRTNO . "</p>";
} else {
if (!$module_handler->insert($module)) {
$ret = "<p>" . sprintf(_MD_AM_FAILDEACT, "<b>" . $module->getVar('name') . "</b>") . " " . _MD_AM_ERRORSC . "<br />" . $module->getHtmlErrors();
return $ret . "</p>";
}
$blocks =& XoopsBlock::getByModule($module->getVar('mid'));
$bcount = count($blocks);
for ($i = 0; $i < $bcount; $i++) {
$blocks[$i]->setVar('isactive', 0);
$blocks[$i]->store();
}
return "<p>" . sprintf(_MD_AM_OKDEACT, "<b>" . $module->getVar('name') . "</b>") . "</p>";
}
}
示例9: xoops_module_update
//.........这里部分代码省略.........
}
if ($template != '') {
$tplfile =& $tplfile_handler->create();
$tplfile->setVar('tpl_module', $dirname);
$tplfile->setVar('tpl_refid', $newbid);
$tplfile->setVar('tpl_source', $content, true);
$tplfile->setVar('tpl_tplset', 'default');
$tplfile->setVar('tpl_file', $block['template'], true);
$tplfile->setVar('tpl_type', 'block');
$tplfile->setVar('tpl_lastimported', 0);
$tplfile->setVar('tpl_lastmodified', time());
$tplfile->setVar('tpl_desc', $block['description'], true);
if (!$tplfile_handler->insert($tplfile)) {
$msgs[] = ' <span style="color:#ff0000;">' . sprintf(__('ERROR: Could not insert template %s to the database.', 'rmcommon'), "<strong>" . $block['template'] . "</strong>") . '</span>';
} else {
$newid = $tplfile->getVar('tpl_id');
$msgs[] = ' ' . sprintf(__('Template %s added to the database', 'rmcommon'), "<strong>" . $block['template'] . "</strong>");
if ($xoopsConfig['template_set'] == 'default') {
if (!xoops_template_touch($newid)) {
$msgs[] = ' <span style="color:#ff0000;">' . sprintf(__('ERROR: Template %s recompile failed', 'rmcommon'), "<strong>" . $block['template'] . "</strong>") . '</span>';
} else {
$msgs[] = ' ' . sprintf(__('Template %s recompiled', 'rmcommon'), "<strong>" . $block['template'] . "</strong>");
}
}
}
}
$msgs[] = ' ' . sprintf(__('Block %s created', 'rmcommon'), "<strong>" . $block['name'] . "</strong>") . sprintf(__("Block ID: %s", 'rmcommon'), "<strong>" . $newbid . "</strong>");
$sql = 'INSERT INTO ' . $xoopsDB->prefix('block_module_link') . ' (block_id, module_id) VALUES (' . $newbid . ', -1)';
$xoopsDB->query($sql);
}
}
}
}
$block_arr = XoopsBlock::getByModule($module->getVar('mid'));
foreach ($block_arr as $block) {
if (!in_array($block->getVar('show_func'), $showfuncs) || !in_array($block->getVar('func_file'), $funcfiles)) {
$sql = sprintf("DELETE FROM %s WHERE bid = %u", $xoopsDB->prefix('newblocks'), $block->getVar('bid'));
if (!$xoopsDB->query($sql)) {
$msgs[] = ' <span style="color:#ff0000;">' . sprintf(__('ERROR: Could not delete block %s', 'rmcommon'), "<strong>" . $block->getVar('name') . "</strong>") . sprintf(__("Block ID: %s", 'rmcommon'), "<strong>" . $block->getVar('bid') . "</strong>") . '</span>';
} else {
$msgs[] = ' Block <strong>' . $block->getVar('name') . ' deleted. Block ID: <strong>' . $block->getVar('bid') . '</strong>';
if ($block->getVar('template') != '') {
$tplfiles = $tplfile_handler->find(null, 'block', $block->getVar('bid'));
if (is_array($tplfiles)) {
$btcount = count($tplfiles);
for ($k = 0; $k < $btcount; $k++) {
if (!$tplfile_handler->delete($tplfiles[$k])) {
$msgs[] = ' <span style="color:#ff0000;">' . __('ERROR: Could not remove deprecated block template.', 'rmcommon') . '(ID: <strong>' . $tplfiles[$k]->getVar('tpl_id') . '</strong>)</span>';
} else {
$msgs[] = ' ' . sprintf(__('Block template %s deprecated', 'rmcommon'), "<strong>" . $tplfiles[$k]->getVar('tpl_file') . "</strong>");
}
}
}
}
}
}
}
}
// reset compile_id
$xoopsTpl->setCompileId();
// first delete all config entries
$config_handler =& xoops_gethandler('config');
$configs = $config_handler->getConfigs(new Criteria('conf_modid', $module->getVar('mid')));
$confcount = count($configs);
$config_delng = array();
if ($confcount > 0) {
示例10: sprintf
if (!xoops_template_touch($newid)) {
$msgs[] = ' <span style="color:#ff0000;">' . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_RECOMPILE_FAILD, "<strong>" . $block['template'] . "</strong>") . '</span>';
} else {
$msgs[] = ' ' . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_RECOMPILE, "<strong>" . $block['template'] . "</strong>");
}
}
}
}
$msgs[] = ' ' . sprintf(_AM_SYSTEM_MODULES_BLOCK_CREATED, "<strong>" . $block['name'] . "</strong>") . sprintf(_AM_SYSTEM_MODULES_BLOCK_ID, "<strong>" . $newbid . "</strong>");
$sql = 'INSERT INTO ' . $xoopsDB->prefix('block_module_link') . ' (block_id, module_id) VALUES (' . $newbid . ', -1)';
$xoopsDB->query($sql);
}
}
}
}
$block_arr = XoopsBlock::getByModule($module->getVar('mid'));
foreach ($block_arr as $block) {
if (!in_array($block->getVar('show_func'), $showfuncs) || !in_array($block->getVar('func_file'), $funcfiles)) {
$sql = sprintf("DELETE FROM %s WHERE bid = %u", $xoopsDB->prefix('newblocks'), $block->getVar('bid'));
if (!$xoopsDB->query($sql)) {
$msgs[] = ' <span style="color:#ff0000;">' . sprintf(_AM_SYSTEM_MODULES_BLOCK_DELETE_ERROR, "<strong>" . $block->getVar('name') . "</strong>") . sprintf(_AM_SYSTEM_MODULES_BLOCK_ID, "<strong>" . $block->getVar('bid') . "</strong>") . '</span>';
} else {
$msgs[] = ' Block <strong>' . $block->getVar('name') . ' deleted. Block ID: <strong>' . $block->getVar('bid') . '</strong>';
if ($block->getVar('template') != '') {
$tplfiles = $tplfile_handler->find(null, 'block', $block->getVar('bid'));
if (is_array($tplfiles)) {
$btcount = count($tplfiles);
for ($k = 0; $k < $btcount; $k++) {
if (!$tplfile_handler->delete($tplfiles[$k])) {
$msgs[] = ' <span style="color:#ff0000;">' . _AM_SYSTEM_MODULES_BLOCK_DEPRECATED_ERROR . '(ID: <strong>' . $tplfiles[$k]->getVar('tpl_id') . '</strong>)</span>';
} else {
示例11: xoops_module_install_shoutbox
/**
* @copyright The XUUPS Project http://sourceforge.net/projects/xuups/
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
* @package Shoutbox
* @author Alphalogic <alphafake@hotmail.com>
* @author tank <tanksplace@comcast.net>
* @author trabis <lusopoemas@gmail.com>
* @version $Id: module.php 0 2010-01-29 18:47:04Z trabis $
*/
function xoops_module_install_shoutbox(&$module)
{
$newmid = $module->getVar('mid');
$groups = array(XOOPS_GROUP_ADMIN, XOOPS_GROUP_USERS, XOOPS_GROUP_ANONYMOUS);
// retrieve all block ids for this module
$blocks = XoopsBlock::getByModule($newmid, false);
$msgs[] = _MD_AM_GROUP_SETTINGS_ADD;
$gperm_handler =& xoops_gethandler('groupperm');
foreach ($groups as $mygroup) {
if ($gperm_handler->checkRight('module_admin', 0, $mygroup)) {
$mperm =& $gperm_handler->create();
$mperm->setVar('gperm_groupid', $mygroup);
$mperm->setVar('gperm_itemid', $newmid);
$mperm->setVar('gperm_name', 'module_admin');
$mperm->setVar('gperm_modid', 1);
if (!$gperm_handler->insert($mperm)) {
$msgs[] = ' <span style="color:#ff0000;">' . sprintf(_MD_AM_ACCESS_ADMIN_ADD_ERROR, "<strong>" . $mygroup . "</strong>") . "</span>";
} else {
$msgs[] = " " . sprintf(_MD_AM_ACCESS_ADMIN_ADD, "<strong>" . $mygroup . "</strong>");
}
unset($mperm);
}
$mperm =& $gperm_handler->create();
$mperm->setVar('gperm_groupid', $mygroup);
$mperm->setVar('gperm_itemid', $newmid);
$mperm->setVar('gperm_name', 'module_read');
$mperm->setVar('gperm_modid', 1);
if (!$gperm_handler->insert($mperm)) {
$msgs[] = ' <span style="color:#ff0000;">' . sprintf(_MD_AM_ACCESS_USER_ADD_ERROR, "<strong>" . $mygroup . "</strong>") . "</span>";
} else {
$msgs[] = ' ' . sprintf(_MD_AM_ACCESS_USER_ADD_ERROR, "<strong>" . $mygroup . "</strong>");
}
unset($mperm);
foreach ($blocks as $blc) {
$bperm =& $gperm_handler->create();
$bperm->setVar('gperm_groupid', $mygroup);
$bperm->setVar('gperm_itemid', $blc);
$bperm->setVar('gperm_name', 'block_read');
$bperm->setVar('gperm_modid', 1);
if (!$gperm_handler->insert($bperm)) {
$msgs[] = ' <span style="color:#ff0000;">' . _MD_AM_BLOCK_ACCESS_ERROR . ' Block ID: <strong>' . $blc . '</strong> Group ID: <strong>' . $mygroup . '</strong></span>';
} else {
$msgs[] = ' ' . _MD_AM_BLOCK_ACCESS . sprintf(_MD_AM_BLOCK_ID, "<strong>" . $blc . "</strong>") . sprintf(_MD_AM_GROUP_ID, "<strong>" . $mygroup . "</strong>");
}
unset($bperm);
}
}
unset($blocks);
unset($groups);
$cacheDir = XOOPS_ROOT_PATH . '/uploads/shoutbox';
$cacheFile = $cacheDir . '/shout.csv';
if (!file_exists($cacheFile)) {
if (!is_dir($cacheDir)) {
if (!mkdir($cacheDir)) {
//$msgs[] = "Failed to create dir!";
return false;
} else {
//$msgs[] = " Dir /uploads/shoutbox/ succesfully created!";
chmod($cacheDir, 0777);
}
}
if ($file = fopen($cacheFile, 'w')) {
if (!fwrite($file, "Shoutbox|Welcome to the Shoutbox v4.x for Xoops|1|111.111.111.111|guest\n")) {
//$msgs[] = " Could not put content in file /uploads/shoutbox/shout.cvs! Please create <i>manually</i>.";
}
fclose($file);
chmod($cacheFile, 0777);
//$msgs[] = " File /uploads/shoutbox/shout.cvs succesfully created!";
return true;
} else {
//$msgs[] = " Could not create file /uploads/shoutbox/shout.cvs! Please create <i>manually</i>.";
return false;
}
} else {
return true;
}
}
示例12: xoops_gethandler
$target_mid = 0;
$target_mname = '';
$query4redirect = '?mid=0';
} else {
$target_mid = $xoopsModule->getVar('mid');
$target_mname = $xoopsModule->getVar('name');
$query4redirect = '';
}
}
// check access right (needs system_admin of BLOCK)
$sysperm_handler =& xoops_gethandler('groupperm');
if (!$sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_BLOCK, $xoopsUser->getGroups())) {
redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
}
// get blocks owned by the module
$block_arr =& XoopsBlock::getByModule($target_mid);
function list_blocks()
{
global $query4redirect, $block_arr, $xoopsGTicket;
// cachetime options
$cachetimes = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK, '2592000' => _MONTH);
// displaying TH
echo "\r\n\t<form action='admin.php' name='blockadmin' method='post'>\r\n\t\t<table width='90%' class='outer' cellpadding='4' cellspacing='1'>\r\n\t\t<tr valign='middle'>\r\n\t\t\t<th>" . _AM_TITLE . "</th>\r\n\t\t\t<th align='center' nowrap='nowrap'>" . _AM_SIDE . "</th>\r\n\t\t\t<th align='center'>" . _AM_WEIGHT . "</th>\r\n\t\t\t<th align='center'>" . _AM_VISIBLEIN . "</th>\r\n\t\t\t<th align='center'>" . _AM_BCACHETIME . "</th>\r\n\t\t\t<th align='right'>" . _AM_ACTION . "</th>\r\n\t\t</tr>\n";
// blocks displaying loop
$class = 'even';
$block_configs = get_block_configs();
foreach (array_keys($block_arr) as $i) {
$sseln = $ssel0 = $ssel1 = $ssel2 = $ssel3 = $ssel4 = "";
$weight = $block_arr[$i]->getVar("weight");
$title = $block_arr[$i]->getVar("title");
$name = $block_arr[$i]->getVar("name");
示例13: xoops_module_deactivate
/**
* @param $mid
*
* @return string
*/
function xoops_module_deactivate($mid)
{
global $xoopsConfig;
// Get module handler
$module_handler = xoops_getHandler('module');
$module = $module_handler->get($mid);
include_once XOOPS_ROOT_PATH . '/class/template.php';
xoops_template_clear_module_cache($mid);
// Display header
$msgs[] = '<div id="xo-module-log">';
$msgs .= xoops_module_log_header($module, _AM_SYSTEM_MODULES_DEACTIVATE);
// Change value
$module->setVar('isactive', 0);
if ($module->getVar('dirname') === 'system') {
$msgs[] = '<p>' . sprintf(_AM_SYSTEM_MODULES_FAILDEACT, '<strong>' . $module->getVar('name') . '</strong>') . ' ' . _AM_SYSTEM_MODULES_ERRORSC . '<br> - ' . _AM_SYSTEM_MODULES_SYSNO . '</p>';
} elseif ($module->getVar('dirname') == $xoopsConfig['startpage']) {
$msgs[] = '<p>' . sprintf(_AM_SYSTEM_MODULES_FAILDEACT, '<strong>' . $module->getVar('name') . '</strong>') . ' ' . _AM_SYSTEM_MODULES_ERRORSC . '<br> - ' . _AM_SYSTEM_MODULES_STRTNO . '</p>';
} else {
if (!$module_handler->insert($module)) {
$msgs[] = '<p>' . sprintf(_AM_SYSTEM_MODULES_FAILDEACT, '<strong>' . $module->getVar('name') . '</strong>') . ' ' . _AM_SYSTEM_MODULES_ERRORSC . '<br>' . $module->getHtmlErrors() . '</p>';
} else {
$blocks = XoopsBlock::getByModule($module->getVar('mid'));
$bcount = count($blocks);
for ($i = 0; $i < $bcount; ++$i) {
$blocks[$i]->setVar('isactive', 0);
$blocks[$i]->store();
}
$msgs[] = '<p>' . sprintf(_AM_SYSTEM_MODULES_OKDEACT, '<strong>' . $module->getVar('name') . '</strong>') . '</p>';
}
}
$msgs[] = '<div class="center"><a href="admin.php?fct=modulesadmin">' . _AM_SYSTEM_MODULES_BTOMADMIN . '</a></div>';
$ret = implode('<br>', $msgs);
return $ret;
}
示例14: xoops_header
}
xoops_header(false);
?>
</head>
<body>
<table border="0" cellspacing="5" cellpadding="0">
<tr>
<td id="leftcolumn">
<?php
$xoopsConfig['nocommon'] = '';
include XOOPS_ROOT_PATH . '/header.php';
require_once '../../class/template.php';
require_once 'blocks/xoonips_blocks.php';
$xoopsModule =& XoopsModule::getByDirname("xoonips");
//print_r($xoopsModule);
$mod_blocks =& XoopsBlock::getByModule($xoopsModule->getVar('mid'));
//print_r($blocks);
$blocks = array();
//copy only necessary block from mod_block to blocks.
foreach ($mod_blocks as $b) {
if ($b->getVar('mid') == $xoopsModule->getVar('mid')) {
if ($b->getVar('show_func') == 'b_xoonips_quick_search_show' || $b->getVar('show_func') == 'b_xoonips_tree_show') {
$blocks[$b->getVar('show_func')] = $b;
}
}
}
?>
<div class="blockTitle"><?php
echo $blocks['b_xoonips_tree_show']->getVar('title');
?>
</div>
示例15: xoops_cp_footer
// Call Footer
xoops_cp_footer();
break;
case 'display':
// Get module handler
$module_handler = xoops_getHandler('module');
$module_id = system_CleanVars($_POST, 'mid', 0, 'int');
if ($module_id > 0) {
$module = $module_handler->get($module_id);
$old = $module->getVar('isactive');
// Set value
$module->setVar('isactive', !$old);
if (!$module_handler->insert($module)) {
$error = true;
}
$blocks = XoopsBlock::getByModule($module_id);
$bcount = count($blocks);
for ($i = 0; $i < $bcount; ++$i) {
$blocks[$i]->setVar('isactive', !$old);
$blocks[$i]->store();
}
//Set active modules in cache folder
xoops_setActiveModules();
}
break;
case 'display_in_menu':
// Get module handler
$module_handler = xoops_getHandler('module');
$module_id = system_CleanVars($_POST, 'mid', 0, 'int');
if ($module_id > 0) {
$module = $module_handler->get($module_id);