本文整理汇总了PHP中xoops_getModuleHandler函数的典型用法代码示例。如果您正苦于以下问题:PHP xoops_getModuleHandler函数的具体用法?PHP xoops_getModuleHandler怎么用?PHP xoops_getModuleHandler使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xoops_getModuleHandler函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: about_block_page_edit
/**
* @param $options
* @return string
*/
function about_block_page_edit($options)
{
xoops_loadLanguage('blocks', 'about');
$page_handler = xoops_getModuleHandler('page', 'about');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('page_status', 1), 'AND');
$criteria->add(new Criteria('page_type', 1));
$criteria->setSort('page_order');
$criteria->setOrder('ASC');
$fields = array('page_id', 'page_title', 'page_image');
$pages = $page_handler->getAll($criteria, $fields, false);
$page_title = '';
foreach ($pages as $k => $v) {
$page_title = '<a href="' . XOOPS_URL . '/modules/' . basename(dirname(__DIR__)) . '/index.php?page_id=' . $k . '" target="_blank">' . $v['page_title'] . '</a>';
$options_page[$k] = empty($v['page_image']) ? $page_title : $page_title . '<img src="' . XOOPS_URL . '/modules/' . basename(dirname(__DIR__)) . '/assets/images/picture.png' . '" />';
}
include_once dirname(__DIR__) . '/include/xoopsformloader.php';
$form = new XoopsBlockForm();
$page_select = new XoopsFormRadio(_MB_ABOUT_BLOCKPAGE, 'options[0]', $options[0], '<br>');
$page_select->addOptionArray($options_page);
$form->addElement($page_select);
$form->addElement(new XoopsFormText(_MB_ABOUT_TEXT_LENGTH, 'options[1]', 5, 5, $options[1]));
$form->addElement(new XoopsFormText(_MB_ABOUT_VIEW_MORELINKTEXT, 'options[2]', 30, 50, $options[2]));
$form->addElement(new XoopsFormRadioYN(_MB_ABOUT_DOTITLEIMAGE, 'options[3]', $options[3]));
return $form->render();
}
开发者ID:XoopsModules25x,项目名称:about,代码行数:30,代码来源:blocks.php
示例2: getForm
/**
* @param bool $action
*
* @return XoopsThemeForm
*/
function getForm($action = false)
{
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
}
$title = $this->isNew() ? sprintf(_AM_SYSTEM_BANNERS_ADDNWBNR) : sprintf(_AM_SYSTEM_BANNERS_EDITBNR);
xoops_load('XoopsFormLoader');
$form = new XoopsThemeForm($title, 'form', $action, 'post', true);
$banner_client_Handler =& xoops_getModuleHandler('bannerclient', 'system');
$client_select = new XoopsFormSelect(_AM_SYSTEM_BANNERS_CLINAMET, 'cid', $this->getVar('cid'));
$client_select->addOptionArray($banner_client_Handler->getList());
$form->addElement($client_select, true);
$form->addElement(new XoopsFormText(_AM_SYSTEM_BANNERS_IMPPURCHT, 'imptotal', 20, 255, $this->getVar('imptotal')), true);
$form->addElement(new XoopsFormText(_AM_SYSTEM_BANNERS_IMGURLT, 'imageurl', 80, 255, $this->getVar('imageurl')), false);
$form->addElement(new XoopsFormText(_AM_SYSTEM_BANNERS_CLICKURLT, 'clickurl', 80, 255, $this->getVar('clickurl')), false);
$htmlbanner = $this->isNew() ? 0 : $this->getVar('htmlbanner');
$form->addElement(new XoopsFormRadioYN(_AM_SYSTEM_BANNERS_USEHTML, 'htmlbanner', $htmlbanner, _YES, _NO));
$form->addElement(new xoopsFormTextArea(_AM_SYSTEM_BANNERS_CODEHTML, 'htmlcode', $this->getVar('htmlcode'), 5, 50), false);
if (!$this->isNew()) {
$form->addElement(new XoopsFormHidden('bid', $this->getVar('bid')));
}
$form->addElement(new XoopsFormHidden('op', 'banner_save'));
$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
//$form->display();
return $form;
}
开发者ID:RanLee,项目名称:Xoops_demo,代码行数:31,代码来源:banner.php
示例3: smarty_function_xoInboxCount
function smarty_function_xoInboxCount($params, &$smarty)
{
global $xoopsUser;
if (!isset($xoopsUser) || !is_object($xoopsUser)) {
return;
}
$time = time();
if (isset($_SESSION['xoops_inbox_count']) && @$_SESSION['xoops_inbox_count_expire'] > $time) {
$count = intval($_SESSION['xoops_inbox_count']);
} else {
$module_handler = xoops_gethandler('module');
$pm_module = $module_handler->getByDirname('pm');
if ($pm_module && $pm_module->getVar('isactive')) {
$pm_handler =& xoops_getModuleHandler('message', 'pm');
} else {
$pm_handler =& xoops_gethandler('privmessage');
}
$criteria = new CriteriaCompo(new Criteria('read_msg', 0));
$criteria->add(new Criteria('to_userid', $xoopsUser->getVar('uid')));
$count = intval($pm_handler->getCount($criteria));
$_SESSION['xoops_inbox_count'] = $count;
$_SESSION['xoops_inbox_count_expire'] = $time + 60;
}
if (!@empty($params['assign'])) {
$smarty->assign($params['assign'], $count);
} else {
echo $count;
}
}
开发者ID:yunsite,项目名称:xoopsdc,代码行数:29,代码来源:function.xoInboxCount.php
示例4: delete
/**
* Delete an object from the database
* @see XoopsPersistableObjectHandler
*
* @param XoopsObject $obj
* @param bool $force
*
* @return bool
*/
public function delete(XoopsObject $obj, $force = false)
{
if (parent::delete($obj, $force)) {
$field_handler = xoops_getModuleHandler('field');
return $field_handler->updateAll('step_id', 0, new Criteria('step_id', $obj->getVar('step_id')), $force);
}
return false;
}
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:17,代码来源:regstep.php
示例5: profile_install_addField
function profile_install_addField($name, $title, $description, $category, $type, $valuetype, $weight, $canedit, $options, $step_id, $length, $visible = true)
{
global $module_id;
$profilefield_handler = xoops_getModuleHandler('field', 'profile');
$obj = $profilefield_handler->create();
$obj->setVar('field_name', $name, true);
$obj->setVar('field_moduleid', $module_id, true);
$obj->setVar('field_show', 1);
$obj->setVar('field_edit', $canedit ? 1 : 0);
$obj->setVar('field_config', 0);
$obj->setVar('field_title', strip_tags($title), true);
$obj->setVar('field_description', strip_tags($description), true);
$obj->setVar('field_type', $type, true);
$obj->setVar('field_valuetype', $valuetype, true);
$obj->setVar('field_options', $options, true);
if ($canedit) {
$obj->setVar('field_maxlength', $length, true);
}
$obj->setVar('field_weight', $weight, true);
$obj->setVar('cat_id', $category, true);
$obj->setVar('step_id', $step_id, true);
$profilefield_handler->insert($obj);
profile_install_setPermissions($obj->getVar('field_id'), $module_id, $canedit, $visible);
return true;
/*
//$GLOBALS['xoopsDB']->query("INSERT INTO ".$GLOBALS['xoopsDB']->prefix("profile_field")." VALUES (0, {$category}, '{$type}', {$valuetype}, '{$name}', " . $GLOBALS['xoopsDB']->quote($title) . ", " . $GLOBALS['xoopsDB']->quote($description) . ", 0, {$length}, {$weight}, '', 1, {$canedit}, 1, 0, '" . serialize($options) . "', {$step_id})");
$gperm_itemid = $obj->getVar('field_id');
unset($obj);
$gperm_modid = $module_id;
$sql = "INSERT INTO " . $GLOBALS['xoopsDB']->prefix("group_permission") .
" (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) " .
" VALUES " .
($canedit ?
" (" . XOOPS_GROUP_ADMIN . ", {$gperm_itemid}, {$gperm_modid}, 'profile_edit'), "
: "" ) .
($canedit == 1 ?
" (" . XOOPS_GROUP_USERS . ", {$gperm_itemid}, {$gperm_modid}, 'profile_edit'), "
: "" ) .
" (" . XOOPS_GROUP_ADMIN . ", {$gperm_itemid}, {$gperm_modid}, 'profile_search'), " .
" (" . XOOPS_GROUP_USERS . ", {$gperm_itemid}, {$gperm_modid}, 'profile_search') " .
" ";
$GLOBALS['xoopsDB']->query($sql);
if ( $visible ) {
$sql = "INSERT INTO " . $GLOBALS['xoopsDB']->prefix("profile_visibility") .
" (field_id, user_group, profile_group) " .
" VALUES " .
" ({$gperm_itemid}, " . XOOPS_GROUP_ADMIN . ", " . XOOPS_GROUP_ADMIN . "), " .
" ({$gperm_itemid}, " . XOOPS_GROUP_ADMIN . ", " . XOOPS_GROUP_USERS . "), " .
" ({$gperm_itemid}, " . XOOPS_GROUP_USERS . ", " . XOOPS_GROUP_ADMIN . "), " .
" ({$gperm_itemid}, " . XOOPS_GROUP_USERS . ", " . XOOPS_GROUP_USERS . "), " .
" ({$gperm_itemid}, " . XOOPS_GROUP_ANONYMOUS . ", " . XOOPS_GROUP_ADMIN . "), " .
" ({$gperm_itemid}, " . XOOPS_GROUP_ANONYMOUS . ", " . XOOPS_GROUP_USERS . ")" .
" ";
$GLOBALS['xoopsDB']->query($sql);
}
*/
}
开发者ID:gauravsaxena21,项目名称:simantz,代码行数:58,代码来源:install.php
示例6: b_mypics_lastpictures_show
function b_mypics_lastpictures_show($options)
{
$criteria = new Criteria('id', 0, '>');
$criteria->setSort('id');
$criteria->setOrder('DESC');
$criteria->setLimit($options[0]);
$handler = xoops_getModuleHandler('image', 'mypics');
$block = $handler->getLastPicturesForBlock($options[0]);
return $block;
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:10,代码来源:blocks.php
示例7: _getModuleMenus
function _getModuleMenus($module, $pid)
{
global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig;
static $id = -1;
$ret = array();
//Sanitizing $module
if (preg_match('/[^a-z0-9\\/\\\\_.:-]/i', $module)) {
return $ret;
}
$path = "modules/{$module}";
$file = $GLOBALS['xoops']->path("{$path}/xoops_version.php");
if (!file_exists($file)) {
return $ret;
}
xoops_loadLanguage('modinfo', $module);
$force = true;
$overwrite = false;
if ($force && (!is_object($xoopsModule) || $xoopsModule->getVar('dirname') != $module)) {
$_xoopsModule = is_object($xoopsModule) ? $xoopsModule : $xoopsModule;
$_xoopsModuleConfig = is_object($xoopsModuleConfig) ? $xoopsModuleConfig : $xoopsModuleConfig;
$module_handler =& xoops_gethandler('module');
$xoopsModule =& $module_handler->getByDirname($module);
$GLOBALS['xoopsModule'] =& $xoopsModule;
if (is_object($xoopsModule)) {
$config_handler =& xoops_gethandler('config');
$xoopsModuleConfig =& $config_handler->getConfigsByCat(0, $xoopsModule->getVar('mid'));
$GLOBALS['xoopsModuleConfig'] =& $xoopsModuleConfig;
}
$overwrite = true;
}
$modversion['sub'] = array();
include $file;
$handler = xoops_getModuleHandler('menu', 'mymenus');
foreach ($modversion['sub'] as $menu) {
$obj = $handler->create();
$obj->setVar('title', $menu['name']);
$obj->setVar('alt_title', $menu['name']);
$obj->setVar('link', $GLOBALS['xoops']->url("{$path}/{$menu['url']}"));
$obj->setVar('id', $id);
$obj->setVar('pid', $pid);
$ret[] = $obj->getValues();
$id--;
}
if ($overwrite) {
$xoopsModule =& $_xoopsModule;
$GLOBALS['xoopsModule'] =& $xoopsModule;
$xoopsModuleConfig =& $_xoopsModuleConfig;
$GLOBALS['xoopsModuleConfig'] =& $xoopsModuleConfig;
}
return $ret;
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:51,代码来源:dynamic.php
示例8: getForm
/**
* @param bool $action
* @return XoopsThemeForm
*/
public function getForm($action = false)
{
global $xoopsDB, $xoopsModuleConfig;
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
}
$title = $this->isNew() ? sprintf(_AM_PRESENTER_CAT_ADD) : sprintf(_AM_PRESENTER_CAT_EDIT);
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$form = new XoopsThemeForm($title, 'form', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
// Cat_pid
include_once XOOPS_ROOT_PATH . '/class/tree.php';
$categoriesHandler =& xoops_getModuleHandler('categories', 'presenter');
$criteria = new CriteriaCompo();
$categories = $categoriesHandler->getObjects($criteria);
if ($categories) {
$categories_tree = new XoopsObjectTree($categories, 'cat_id', 'cat_pid');
$cat_pid = $categories_tree->makeSelBox('cat_pid', 'cat_title', '--', $this->getVar('cat_pid', 'e'), false);
$form->addElement(new XoopsFormLabel(_AM_PRESENTER_CAT_PID, $cat_pid));
}
// Cat_title
$form->addElement(new XoopsFormText(_AM_PRESENTER_CAT_TITLE, 'cat_title', 50, 255, $this->getVar('cat_title')), true);
// Cat_desc
$form->addElement(new XoopsFormTextArea(_AM_PRESENTER_CAT_DESC, 'cat_desc', $this->getVar('cat_desc'), 4, 47), true);
// Cat_image
$cat_image = $this->getVar('cat_image') ? $this->getVar('cat_image') : 'blank.gif';
$uploadir = '/uploads/presenter/images/categories';
$imgtray = new XoopsFormElementTray(_AM_PRESENTER_CAT_IMAGE, '<br />');
$imgpath = sprintf(_AM_PRESENTER_FORMIMAGE_PATH, $uploadir);
$imageselect = new XoopsFormSelect($imgpath, 'cat_image', $cat_image);
$image_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . $uploadir);
foreach ($image_array as $image) {
$imageselect->addOption("{$image}", $image);
}
$imageselect->setExtra("onchange='showImgSelected(\"image_cat_image\", \"cat_image\", \"" . $uploadir . "\", \"\", \"" . XOOPS_URL . "\")'");
$imgtray->addElement($imageselect);
$imgtray->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_URL . "/" . $uploadir . "/" . $cat_image . "' name='image_cat_image' id='image_cat_image' alt='' />"));
$fileseltray = new XoopsFormElementTray('', '<br />');
$fileseltray->addElement(new XoopsFormFile(_AM_PRESENTER_FORMUPLOAD, 'cat_image', $xoopsModuleConfig['maxsize']));
$fileseltray->addElement(new XoopsFormLabel(''));
$imgtray->addElement($fileseltray);
$form->addElement($imgtray);
// Cat_weight
$form->addElement(new XoopsFormText(_AM_PRESENTER_CAT_WEIGHT, 'cat_weight', 50, 255, $this->getVar('cat_weight')), false);
// Cat_color
// $form->addElement(new XoopsFormColorPicker(_AM_PRESENTER_CAT_COLOR, 'cat_color', $this->getVar('cat_color')), false);
$form->addElement(new XoopsFormHidden('op', 'save'));
$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
return $form;
}
开发者ID:mambax7,项目名称:presenter,代码行数:54,代码来源:categories.php
示例9: subscribers_sendEmails
function subscribers_sendEmails()
{
global $xoopsConfig;
$thisConfigs =& subscribers_getModuleConfig();
$emailsperpack = intval($thisConfigs['emailsperpack']);
$timebpacks = intval($thisConfigs['timebpacks']);
$fromname = trim($thisConfigs['fromname']);
$fromemail = trim($thisConfigs['fromemail']);
$fromname = $fromname != '' ? $fromname : $xoopsConfig['sitename'];
$fromemail = $fromemail != '' ? $fromemail : $xoopsConfig['adminmail'];
$now = time();
$last = subscribers_getLastTime();
if ($now - $last <= $timebpacks) {
return false;
}
$this_handler =& xoops_getModuleHandler('waiting', 'subscribers');
$criteria = new CriteriaCompo();
$criteria->setSort('wt_priority DESC, wt_created');
$criteria->setOrder('ASC');
$criteria->setLimit($emailsperpack);
$objs = $this_handler->getObjects($criteria);
$count = count($objs);
unset($criteria);
if ($count == 0) {
return false;
}
include_once XOOPS_ROOT_PATH . '/kernel/user.php';
$obj_delete = array();
foreach ($objs as $obj) {
$xoopsMailer =& xoops_getMailer();
$xoopsMailer->multimailer->ContentType = "text/html";
$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH . '/modules/subscribers/language/' . $xoopsConfig['language'] . '/mail_template/');
$xoopsMailer->setTemplate('content.tpl');
$xoopsMailer->setFromName($fromname);
$xoopsMailer->setFromEmail($fromemail);
$xoopsMailer->useMail();
$xoopsMailer->setToEmails(array($obj->getVar('wt_toemail', 'n')));
$xoopsMailer->setSubject($obj->getVar('wt_subject'), 'n');
$xoopsMailer->assign('CONTENT', $obj->getVar('wt_body'));
$key = md5($obj->getVar('wt_toemail', 'n') . XOOPS_ROOT_PATH);
$xoopsMailer->assign("UNSUBSCRIBE_URL", XOOPS_URL . '/modules/subscribers/unsubscribe.php?email=' . $obj->getVar('wt_toemail', 'n') . '&key=' . $key);
$xoopsMailer->send(false);
unset($xoopsMailer);
$obj_delete[] = $obj->getVar('wt_id');
}
$criteria = new Criteria('wt_id', '(' . implode(',', $obj_delete) . ')', 'IN');
$this_handler->deleteAll($criteria, true);
subscribers_setLastTime($now);
return true;
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:50,代码来源:functions.php
示例10: langDropdown
function langDropdown()
{
$content = '';
$time = time();
if (!isset($_SESSION['XoopsMLcontent']) && @$_SESSION['XoopsMLcontent_expire'] < $time) {
include_once XOOPS_ROOT_PATH . '/kernel/module.php';
$xlanguage = XoopsModule::getByDirname('xlanguage');
if (is_object($xlanguage) && $xlanguage->getVar('isactive')) {
include_once XOOPS_ROOT_PATH . '/modules/xlanguage/include/vars.php';
include_once XOOPS_ROOT_PATH . '/modules/xlanguage/include/functions.php';
$xlanguage_handler = xoops_getModuleHandler('language', 'xlanguage');
$xlanguage_handler->loadConfig();
$lang_list =& $xlanguage_handler->getAllList();
$content .= '<select name="mlanguages" id="mlanguages">';
$content .= '<option value="">{#xoopsmlcontent_dlg.sellang}</option>';
if (is_array($lang_list) && count($lang_list) > 0) {
foreach (array_keys($lang_list) as $lang_name) {
$lang =& $lang_list[$lang_name];
$content .= '<option value="' . $lang['base']->getVar('lang_code') . '">' . $lang['base']->getVar('lang_name') . '</option>';
}
}
$content .= '</select>';
} elseif (defined('EASIESTML_LANGS') && defined('EASIESTML_LANGNAMES')) {
$easiestml_langs = explode(',', EASIESTML_LANGS);
$langnames = explode(',', EASIESTML_LANGNAMES);
$lang_options = '';
$content .= '<select name="mlanguages" id="mlanguages">';
$content .= '<option value="">{#xoopsmlcontent_dlg.sellang}</option>';
foreach ($easiestml_langs as $l => $lang) {
$content .= '<option value="' . $lang . '">' . $langnames[$l] . '</option>';
}
$content .= '</select>';
} else {
$content .= '<input type="text" name="mlanguages" />';
}
$_SESSION['XoopsMLcontent'] = $content;
$_SESSION['XoopsMLcontent_expire'] = $time + 300;
}
echo $_SESSION['XoopsMLcontent'];
}
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:40,代码来源:xoopsmlcontent.php
示例11: publisher_tag_iteminfo
/** Get item fields: title, content, time, link, uid, uname, tags *
*
* @param $items
*/
function publisher_tag_iteminfo(&$items)
{
$itemsId = array();
foreach (array_keys($items) as $catId) {
// Some handling here to build the link upon catid
// if catid is not used, just skip it
foreach (array_keys($items[$catId]) as $itemId) {
// In article, the item_id is "art_id"
$itemsId[] = (int) $itemId;
}
}
$itemHandler =& xoops_getModuleHandler('item', 'publisher');
$criteria = new Criteria('itemid', '(' . implode(', ', $itemsId) . ')', 'IN');
$itemsObj = $itemHandler->getObjects($criteria, 'itemid');
foreach (array_keys($items) as $catId) {
foreach (array_keys($items[$catId]) as $itemId) {
$itemObj = $itemsObj[$itemId];
$items[$catId][$itemId] = array('title' => $itemObj->getVar('title'), 'uid' => $itemObj->getVar('uid'), 'link' => "item.php?itemid={$itemId}", 'time' => $itemObj->getVar('datesub'), 'tags' => tag_parse_tag($itemObj->getVar('item_tag', 'n')), 'content' => '');
}
}
unset($itemsObj);
}
开发者ID:trabisdementia,项目名称:publisher,代码行数:26,代码来源:plugin.tag.php
示例12: presenter_CleanVars
*
* @copyright XOOPS Project (http://xoops.org)
* @license GPL 2.0 or later
* @package presenter
* @since 2.5.5
* @author XOOPS Development Team <[email protected]> - <http://xoops.org>
* @version $Id: 1.0 categories.php 11532 Wed 2013/08/28 4:00:27Z XOOPS Development Team $
*/
include_once __DIR__ . '/header.php';
$xoopsOption['template_main'] = 'presenter_categories.tpl';
include_once XOOPS_ROOT_PATH . '/header.php';
$start = presenter_CleanVars($_REQUEST, 'start', 0);
// Define Stylesheet
$xoTheme->addStylesheet($style);
// Get Handler
$categoriesHandler =& xoops_getModuleHandler('categories', 'presenter');
$nb_categories = $GLOBALS['xoopsModuleConfig']['userpager'];
$criteria = new CriteriaCompo();
$categories_count = $categoriesHandler->getCount($criteria);
$categories_arr = $categoriesHandler->getAll($criteria);
if ($categories_count > 0) {
foreach (array_keys($categories_arr) as $i) {
$cat['cat_id'] = $categories_arr[$i]->getVar('cat_id');
$cat['cat_pid'] = $categories_arr[$i]->getVar('cat_pid');
$cat['cat_title'] = $categories_arr[$i]->getVar('cat_title');
$cat['cat_desc'] = strip_tags($categories_arr[$i]->getVar('cat_desc'));
$cat['cat_image'] = $categories_arr[$i]->getVar('cat_image');
$cat['cat_weight'] = $categories_arr[$i]->getVar('cat_weight');
$cat['cat_color'] = $categories_arr[$i]->getVar('cat_color');
$GLOBALS['xoopsTpl']->append('categories', $cat);
$keywords[] = $categories_arr[$i]->getVar('cat_name');
开发者ID:mambax7,项目名称:presenter,代码行数:31,代码来源:categories.php
示例13: profile_stepsave_toggle
/**
* @param $step_d
* @param $step_save
*/
function profile_stepsave_toggle($step_d, $step_save)
{
$step_save = $step_save == 1 ? 0 : 1;
$handler = xoops_getModuleHandler('regstep');
$obj = $handler->get($_REQUEST['step_id']);
$obj->setVar('step_save', $step_save);
if ($handler->insert($obj, true)) {
redirect_header('step.php', 1, _PROFILE_AM_SAVESTEP_TOGGLE_SUCCESS);
} else {
redirect_header('step.php', 1, _PROFILE_AM_SAVESTEP_TOGGLE_FAILED);
}
}
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:16,代码来源:step.php
示例14: initHandler
/**
* @static function initHandler
* @param string $name
*/
public function initHandler($name)
{
$this->addLog('INIT ' . $name . ' HANDLER');
$this->handler[$name . '_handler'] = xoops_getModuleHandler($name, $this->dirname);
}
开发者ID:ggoffy,项目名称:wgteams,代码行数:9,代码来源:helper.php
示例15: xoops_loadLanguage
* @since 1.0
* @author trabis <[email protected]>
* @author Taiwen Jiang <[email protected]>
* @version $Id: search.php 10374 2012-12-12 23:39:48Z trabis $
*/
include_once __DIR__ . '/header.php';
xoops_loadLanguage('search');
//Checking general permissions
$configHandler =& xoops_getHandler('config');
$xoopsConfigSearch = $configHandler->getConfigsByCat(XOOPS_CONF_SEARCH);
if (empty($xoopsConfigSearch['enable_search'])) {
redirect_header(PUBLISHER_URL . '/index.php', 2, _NOPERM);
// exit();
}
$groups = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : XOOPS_GROUP_ANONYMOUS;
$gpermHandler =& xoops_getModuleHandler('groupperm', PUBLISHER_DIRNAME);
$module_id = $publisher->getModule()->mid();
//Checking permissions
if (!$publisher->getConfig('perm_search') || !$gpermHandler->checkRight('global', PublisherConstants::PUBLISHER_SEARCH, $groups, $module_id)) {
redirect_header(PUBLISHER_URL, 2, _NOPERM);
// exit();
}
$GLOBALS['xoopsConfig']['module_cache'][$module_id] = 0;
$xoopsOption['template_main'] = 'publisher_search.tpl';
include $GLOBALS['xoops']->path('header.php');
$module_info_search = $publisher->getModule()->getInfo('search');
include_once PUBLISHER_ROOT_PATH . '/' . $module_info_search['file'];
$limit = 10;
//$publisher->getConfig('idxcat_perpage');
$uid = 0;
$queries = array();
开发者ID:trabisdementia,项目名称:publisher,代码行数:31,代码来源:search.php
示例16: xoops_getHandler
case 'images':
$imgcat_handler = xoops_getHandler('image');
$img = $imgcat_handler->getCount();
$menu['infos'] = sprintf(_AM_SYSTEM_IMG_INFO, $img);
break;
case 'smilies':
$smilies_Handler = xoops_getModuleHandler('smilies', 'system');
$smilies = $smilies_Handler->getCount();
$menu['infos'] = sprintf(_AM_SYSTEM_SMILIES_INFO, $smilies);
break;
case 'userrank':
$userrank_Handler = xoops_getModuleHandler('userrank', 'system');
$userrank = $userrank_Handler->getCount();
$menu['infos'] = sprintf(_AM_SYSTEM_RANKS_INFO, $userrank);
break;
case 'users':
$member_handler = xoops_getModuleHandler('users', 'system');
$member = $member_handler->getCount();
$menu['infos'] = sprintf(_AM_SYSTEM_USERS_INFO, $member);
break;
}
}
$xoopsTpl->append_by_ref('menu', $menu);
unset($menu);
}
unset($modversion);
}
}
unset($dirlist);
xoops_cp_footer();
}
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:31,代码来源:admin.php
示例17: profile_visible_toggle
/**
* @param $field_id
* @param $field_required
*/
function profile_visible_toggle($field_id, $field_required)
{
$field_required = $field_required == 1 ? 0 : 1;
$this_handler = xoops_getModuleHandler('field', 'profile');
$obj = $this_handler->get($field_id);
$obj->setVar('field_required', $field_required);
if ($this_handler->insert($obj, true)) {
redirect_header('field.php', 1, _PROFILE_AM_REQUIRED_TOGGLE_SUCCESS);
} else {
redirect_header('field.php', 1, _PROFILE_AM_REQUIRED_TOGGLE_FAILED);
}
}
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:16,代码来源:field.php
示例18: header
public function header()
{
global $xoops, $xoopsConfig, $xoopsModule, $xoopsUser, $xoopsOption, $xoTheme, $xoopsTpl;
ob_start();
xoops_loadLanguage('admin', 'system');
xoops_loadLanguage('cpanel', 'system');
xoops_loadLanguage('modinfo', 'system');
$xoopsLogger = XoopsLogger::getInstance();
$xoopsLogger->stopTime('Module init');
$xoopsLogger->startTime('XOOPS output init');
if (!headers_sent()) {
header('Content-Type:text/html; charset=' . _CHARSET);
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
}
require_once XOOPS_ROOT_PATH . '/class/template.php';
require_once XOOPS_ROOT_PATH . '/class/theme.php';
if (@$GLOBALS['xoopsOption']['template_main']) {
if (false === strpos($GLOBALS['xoopsOption']['template_main'], ':')) {
$GLOBALS['xoopsOption']['template_main'] = 'db:' . $GLOBALS['xoopsOption']['template_main'];
}
}
$adminThemeFactory = new xos_opal_AdminThemeFactory();
$this->xoTheme =& $adminThemeFactory->createInstance(array('folderName' => $this->foldername, 'themesPath' => 'modules/system/themes', 'contentTemplate' => @$GLOBALS['xoopsOption']['template_main']));
$this->xoTheme->loadLocalization('admin');
$this->template =& $this->xoTheme->template;
$GLOBALS['xoTheme'] =& $this->xoTheme;
$GLOBALS['adminTpl'] =& $this->xoTheme->template;
$xoopsLogger->stopTime('XOOPS output init');
$xoopsLogger->startTime('Module display');
$xoopsPreload = XoopsPreload::getInstance();
$xoopsPreload->triggerEvent('system.class.gui.header');
if (isset($xoopsModule) && $xoopsModule->getVar('dirname') === 'system') {
$xoopsModule->loadAdminMenu();
foreach (array_keys($xoopsModule->adminmenu) as $item) {
$sys_menu[$item]['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/' . $xoopsModule->adminmenu[$item]['link'];
$GLOBALS['xoopsTpl']->append_by_ref('sys_menu', $sys_menu);
unset($sys_menu);
}
}
// Module adminmenu
if (isset($xoopsModule) && $xoopsModule->getVar('dirname') !== 'system') {
if ($xoopsModule->getInfo('system_menu')) {
$GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . '/modules/system/css/menu.css');
$xoopsModule->loadAdminMenu();
// Get menu tab handler
$menu_handler = xoops_getModuleHandler('menu', 'system');
// Define top navigation
$menu_handler->addMenuTop(XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $xoopsModule->getVar('mid', 'e'), _AM_SYSTEM_PREF);
$menu_handler->addMenuTop(XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin&op=update&module=' . $xoopsModule->getVar('dirname', 'e'), _AM_SYSTEM_UPDATE);
$menu_handler->addMenuTop(XOOPS_URL . '/modules/system/admin.php?fct=blocksadmin&op=list&filter=1&selgen=' . $xoopsModule->getVar('mid', 'e') . '&selmod=-2&selgrp=-1&selvis=-1', _AM_SYSTEM_BLOCKS);
$menu_handler->addMenuTop(XOOPS_URL . '/modules/system/admin.php?fct=tplsets&op=listtpl&tplset=default&moddir=' . $xoopsModule->getVar('dirname', 'e'), _AM_SYSTEM_TPLSETS);
$menu_handler->addMenuTop(XOOPS_URL . '/modules/system/admin.php?module=' . $xoopsModule->getVar('mid', 'e') . '&status=0&limit=10&fct=comments', _AM_SYSTEM_COMMENTS);
$menu_handler->addMenuTop(XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin&op=uninstall&module=' . $xoopsModule->getVar('dirname', 'e'), _AM_SYSTEM_UNINSTALL);
$menu_handler->addMenuTop(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'e') . '/', _AM_SYSTEM_GOTOMODULE);
// Define main tab navigation
$i = 0;
$current = $i;
foreach ($xoopsModule->adminmenu as $menu) {
if (stripos($_SERVER['REQUEST_URI'], $menu['link']) !== false) {
$current = $i;
}
$menu_handler->addMenuTabs($menu['link'], $menu['title']);
++$i;
}
if ($xoopsModule->getInfo('help')) {
if (stripos($_SERVER['REQUEST_URI'], 'admin/' . $xoopsModule->getInfo('help')) !== false) {
$current = $i;
}
$menu_handler->addMenuTabs('../system/help.php?mid=' . $xoopsModule->getVar('mid', 's') . '&' . $xoopsModule->getInfo('help'), _AM_SYSTEM_HELP);
}
// Display navigation tabs
$GLOBALS['xoopsTpl']->assign('xo_system_menu', $menu_handler->render($current, false));
}
}
}
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:79,代码来源:gui.php
示例19: XoopsGroupPermForm
$op_select->addOption('access', _PROFILE_AM_PROF_ACCESS);
$opform->addElement($op_select);
$opform->display();
$module_id = $GLOBALS['xoopsModule']->getVar('mid');
include_once $GLOBALS['xoops']->path('/class/xoopsform/grouppermform.php');
$form = new XoopsGroupPermForm($title_of_form, $module_id, $perm_name, $perm_desc, 'admin/permissions.php?op=' . $op, $anonymous);
if ($op === 'access') {
$member_handler = xoops_getHandler('member');
$glist = $member_handler->getGroupList();
foreach (array_keys($glist) as $i) {
if ($i != XOOPS_GROUP_ANONYMOUS) {
$form->addItem($i, $glist[$i]);
}
}
} else {
$profile_handler = xoops_getModuleHandler('profile');
$fields = $profile_handler->loadFields();
if ($op !== 'search') {
foreach (array_keys($fields) as $i) {
if ($restriction == '' || $fields[$i]->getVar($restriction)) {
$form->addItem($fields[$i]->getVar('field_id'), xoops_substr($fields[$i]->getVar('field_title'), 0, 25));
}
}
} else {
$searchable_types = array('textbox', 'select', 'radio', 'yesno', 'date', 'datetime', 'timezone', 'language');
foreach (array_keys($fields) as $i) {
if (in_array($fields[$i]->getVar('field_type'), $searchable_types)) {
$form->addItem($fields[$i]->getVar('field_id'), xoops_substr($fields[$i]->getVar('field_title'), 0, 25));
}
}
}
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:31,代码来源:permissions.php
示例20: xoops_cp_header
*
* @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
* @license GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html)
* @package profile
* @since 2.3.0
* @author Jan Pedersen
* @author Taiwen Jiang <[email protected]>
*/
include_once __DIR__ . '/admin_header.php';
//there is no way to override current tabs when using system menu
//this dirty hack will have to do it
$_SERVER['REQUEST_URI'] = 'admin/permissions.php';
xoops_cp_header();
$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : 'visibility';
$visibility_handler = xoops_getModuleHandler('visibility');
$field_handler = xoops_getModuleHandler('field');
$fields = $field_handler->getList();
if (isset($_REQUEST['submit'])) {
$visibility = $visibility_handler->create();
$visibility->setVar('field_id', $_REQUEST['field_id']);
$visibility->setVar('user_group', $_REQUEST['ug']);
$visibility->setVar('profile_group', $_REQUEST['pg']);
$visibility_handler->insert($visibility, true);
redirect_header('visibility.php', 2, sprintf(_PROFILE_AM_SAVEDSUCCESS, _PROFILE_AM_PROF_VISIBLE));
}
if ($op === 'del') {
$criteria = new CriteriaCompo(new Criteria('field_id', (int) $_REQUEST['field_id']));
$criteria->add(new Criteria('user_group', (int) $_REQUEST['ug']));
$criteria->add(new Criteria('profile_group', (int) $_REQUEST['pg']));
$visibility_handler->deleteAll($criteria, true);
redirect_header('visibility.php', 2, sprintf(_PROFILE_AM_DELETEDSUCCESS, _PROFILE_AM_PROF_VISIBLE));
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:31,代码来源:visibility.php
注:本文中的xoops_getModuleHandler函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论