本文整理汇总了PHP中icms类的典型用法代码示例。如果您正苦于以下问题:PHP icms类的具体用法?PHP icms怎么用?PHP icms使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了icms类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: eventStartOutputInit
/**
* Function to be triggered at the end of the core boot process
*
* @return void
*/
function eventStartOutputInit() {
global $xoopsTpl;
if (is_object(icms::$user)) {
foreach (icms::$user->vars as $key => $value) {
$user[$key] = $value;
}
foreach ($user as $key => $value) {
foreach ($user [$key] as $key1 => $value1) {
if ($key1 == 'value') {
if ($key == 'last_login') {
$value1 = formatTimestamp(
isset($_SESSION['xoopsUserLastLogin'])
? $_SESSION['xoopsUserLastLogin']
: time(),
_DATESTRING
);
}
$user [$key] = $value1;
}
}
}
$pm_handler = icms::handler('icms_data_privmessage');
$criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('read_msg', 0));
$criteria->add(new icms_db_criteria_Item('to_userid', icms::$user->getVar('uid')));
$user['new_messages'] = $pm_handler->getCount($criteria);
$xoopsTpl->assign('user', $user);
}
}
开发者ID:nao-pon,项目名称:impresscms,代码行数:34,代码来源:userinfo.php
示例2: __construct
/**
* Constructor
*
* @param string $caption Caption
* @param string $name "name" attribute
* @param string $value Initial text
* @param int $rows Number of rows
* @param int $cols Number of columns
* @param string $hiddentext Hidden Text
*/
public function __construct($caption, $name, $value, $rows = 5, $cols = 50, $hiddentext = "xoopsHiddenText", $options = array())
{
parent::__construct($caption, $name, $value, $rows, $cols);
$this->_hiddenText = $hiddentext;
global $icmsConfig, $icmsModule;
$groups = is_object(icms::$user) ? icms::$user->getGroups() : ICMS_GROUP_ANONYMOUS;
$moduleid = is_object($icmsModule) && $name != 'com_text' ? $icmsModule->getVar('mid') : 1;
if (isset($options['editor']) && $options['editor'] != '' && $options['editor'] != $icmsConfig['editor_default']) {
$editor_default = $options['editor'];
} else {
$editor_default = $icmsConfig['editor_default'];
}
$gperm_handler = icms::handler('icms_member_groupperm');
if (file_exists(ICMS_EDITOR_PATH . "/" . $editor_default . "/xoops_version.php") && $gperm_handler->checkRight('use_wysiwygeditor', $moduleid, $groups, 1, FALSE)) {
include ICMS_EDITOR_PATH . "/" . $editor_default . "/xoops_version.php";
$this->htmlEditor = array($editorversion['class'], ICMS_EDITOR_PATH . "/" . $editorversion['dirname'] . "/" . $editorversion['file']);
}
if (!empty($this->htmlEditor)) {
$options['name'] = $this->_name;
$options['value'] = $this->_value;
list($class, $path) = $this->htmlEditor;
include_once $path;
if (class_exists($class)) {
$this->htmlEditor = new $class($options);
} else {
$this->htmlEditor = FALSE;
}
}
}
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:39,代码来源:Dhtmltextarea.php
示例3: __construct
/**
* Constructor
* @param icms_ipf_Object $object target object
* @param string $key the key
*/
public function __construct($object, $key)
{
parent::__construct($object->vars[$key]['form_caption'], " ");
$fileObj = $object->getFileObj($key);
$module_handler = icms::handler("icms_module");
$module = $module_handler->getByDirname($object->handler->_moduleName);
if ($fileObj->getVar("url") != "") {
$this->addElement(new icms_form_elements_Label("", _CO_ICMS_CURRENT_FILE . $fileObj->render() . "<br /><br />"));
}
if ($fileObj->isNew()) {
$this->addElement(new icms_ipf_form_elements_Fileupload($fileObj, $key));
$this->addElement(new icms_form_elements_Label("", "<br /><br /><small>" . _CO_ICMS_URL_FILE_DSC . "</small>"));
$this->addElement(new icms_form_elements_Label("", "<br />" . _CO_ICMS_URL_FILE));
$this->addElement(new icms_ipf_form_elements_Text($fileObj, "url_" . $key));
}
$this->addElement(new icms_form_elements_Hidden("mid_" . $key, $module->getVar("mid")));
$this->addElement(new icms_form_elements_Label("", "<br />" . _CO_ICMS_CAPTION));
$this->addElement(new icms_ipf_form_elements_Text($fileObj, "caption_" . $key));
$this->addElement(new icms_form_elements_Label("", "<br />" . _CO_ICMS_DESC));
$this->addElement(new icms_ipf_form_elements_Text($fileObj, "desc_" . $key));
if (!$fileObj->isNew()) {
$this->addElement(new icms_form_elements_Label("", "<br />" . _CO_ICMS_CHANGE_FILE));
$this->addElement(new icms_ipf_form_elements_Fileupload($fileObj, $key));
$this->addElement(new icms_form_elements_Label("", "<br /><br /><small>" . _CO_ICMS_URL_FILE_DSC . "</small>"));
$this->addElement(new icms_form_elements_Label("", "<br />" . _CO_ICMS_URL_FILE));
$this->addElement(new icms_ipf_form_elements_Text($fileObj, "url_" . $key));
}
}
开发者ID:nao-pon,项目名称:impresscms,代码行数:33,代码来源:Richfile.php
示例4: __construct
/**
* Constructor
*
* @param object &$tpl
* @param boolean $use_icons
* @param boolean $do_iconcheck
*/
private function __construct(&$tpl, $use_icons = TRUE, $do_iconcheck = FALSE)
{
$this->_tpl =& $tpl;
$this->_useIcons = $use_icons;
$this->_doIconCheck = $do_iconcheck;
$this->_memberHandler = icms::handler('icms_member');
$this->_statusText = array(XOOPS_COMMENT_PENDING => '<span style="text-decoration: none; font-weight: bold; color: #00ff00;">' . _CM_PENDING . '</span>', XOOPS_COMMENT_ACTIVE => '<span style="text-decoration: none; font-weight: bold; color: #ff0000;">' . _CM_ACTIVE . '</span>', XOOPS_COMMENT_HIDDEN => '<span style="text-decoration: none; font-weight: bold; color: #0000ff;">' . _CM_HIDDEN . '</span>');
}
开发者ID:nao-pon,项目名称:impresscms,代码行数:15,代码来源:Renderer.php
示例5: getVideoToDisplay
/**
* get video to display
*
* @param bool $main true if video is main video
* @return str html code to display video
*/
public function getVideoToDisplay($main = false)
{
$module = icms::handler("icms_module")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE);
$width = $main ? $module->config['width_maintube'] : $module->config['width_tube'];
$height = $main ? $module->config['height_maintube'] : $module->config['height_tube'];
$ret = '<embed src="http://www.youtube.com/v/' . $this->getVar('youtube_code') . '&fs=1&hl=' . _LANGCODE . '" type="application/x-shockwave-flash" allowfullscreen="true" width="' . $width . '" height="' . $height . '"></embed>';
return $ret;
}
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:14,代码来源:Videos.php
示例6: __construct
/**
* Constructor
*
* @param string $caption
* @param string $name
* @param bool $include_anon Include group "anonymous"?
* @param mixed $value Pre-selected value (or array of them).
* @param int $size Number or rows. "1" makes a drop-down-list.
* @param bool $multiple Allow multiple selections?
*/
public function __construct($caption, $name, $include_anon = false, $value = null, $size = 1, $multiple = false)
{
parent::__construct($caption, $name, $value, $size, $multiple);
$member_handler = icms::handler('icms_member');
if (!$include_anon) {
$this->addOptionArray($member_handler->getGroupList(new icms_db_criteria_Item('groupid', ICMS_GROUP_ANONYMOUS, '!=')));
} else {
$this->addOptionArray($member_handler->getGroupList());
}
}
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:20,代码来源:Group.php
示例7: protector_notify_base
function protector_notify_base($mydirname, $category, $item_id)
{
include_once dirname(__FILE__) . '/include/common_functions.php';
$db =& icms_db_Factory::instance();
$module_handler = icms::handler('icms_module');
$module =& $module_handler->getByDirname($mydirname);
if ($category == 'global') {
$item['name'] = '';
$item['url'] = '';
return $item;
}
}
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:12,代码来源:notification.php
示例8: authenticate
/**
* Authenticate user
* @param string $uname
* @param string $pwd
* @return object {@link icms_member_user_Object} icms_member_user_Object object
*/
public function authenticate($uname, $pwd = null)
{
$member_handler = icms::handler('icms_member');
$user = $member_handler->loginUser($uname, $pwd);
icms::$session->enableRegenerateId = true;
icms::$session->sessionOpen();
if ($user == false) {
icms::$session->destroy(session_id());
$this->setErrors(1, _US_INCORRECTLOGIN);
}
return $user;
}
开发者ID:nao-pon,项目名称:impresscms,代码行数:18,代码来源:Xoops.php
示例9: b_profile_usermenu_show
function b_profile_usermenu_show($options)
{
global $icmsConfigUser;
if (!is_object(icms::$user)) {
return;
}
icms_loadLanguageFile(basename(dirname(dirname(__FILE__))), 'modinfo');
$block = array();
$dirname = basename(dirname(dirname(__FILE__)));
$config_handler = icms::handler('icms_config');
$privmessage_handler = icms::handler('icms_data_privmessage');
$module = icms::handler('icms_module')->getByDirname($dirname, TRUE);
$criteria = new icms_db_criteria_Compo();
$criteria->add(new icms_db_criteria_Item('read_msg', 0));
$criteria->add(new icms_db_criteria_Item('to_userid', icms::$user->getVar('uid')));
$newmsg = $privmessage_handler->getCount($criteria);
$i = 0;
if (icms::$user->isAdmin()) {
$block[++$i]['name'] = _MB_SYSTEM_ADMENU;
$block[$i]['url'] = ICMS_URL . "/admin.php";
}
$block[++$i]['name'] = _MB_SYSTEM_VACNT;
$block[$i]['url'] = ICMS_URL . "/modules/" . $dirname . "/" . ($module->config['profile_social'] ? "index.php?uid=" . icms::$user->getVar('uid') : "userinfo.php?uid=" . icms::$user->getVar('uid'));
$block[++$i]['name'] = _MB_SYSTEM_INBOX;
$block[$i]['url'] = ICMS_URL . "/viewpmsg.php";
$block[$i]['extra'] = $newmsg;
$block[++$i]['name'] = _MB_SYSTEM_NOTIF;
$block[$i]['url'] = ICMS_URL . "/notifications.php";
if ($module->config['profile_social']) {
$block[++$i]['name'] = _MI_PROFILE_SEARCH;
$block[$i]['url'] = ICMS_URL . "/modules/" . $dirname . "/search.php";
}
$block[++$i]['name'] = _MI_PROFILE_EDITACCOUNT;
$block[$i]['url'] = ICMS_URL . "/modules/" . $dirname . "/edituser.php";
$block[++$i]['name'] = _MI_PROFILE_CHANGEPASS;
$block[$i]['url'] = ICMS_URL . "/modules/" . $dirname . "/changepass.php";
if ($icmsConfigUser['allow_chgmail']) {
$block[++$i]['name'] = _MI_PROFILE_CHANGEMAIL;
$block[$i]['url'] = ICMS_URL . "/modules/" . $dirname . "/changemail.php";
}
if ($icmsConfigUser['self_delete']) {
$block[++$i]['name'] = _MI_PROFILE_DELETEACCOUNT;
$block[$i]['url'] = ICMS_URL . "/modules/" . $dirname . "/edituser.php?op=delete";
}
if ($module->config['profile_social']) {
$block[++$i]['name'] = _MI_PROFILE_MYCONFIGS;
$block[$i]['url'] = ICMS_URL . "/modules/" . $dirname . "/configs.php";
}
$block[++$i]['name'] = _MB_SYSTEM_LOUT;
$block[$i]['url'] = ICMS_URL . "/user.php?op=logout";
return $block;
}
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:52,代码来源:blocks.php
示例10: getTribeuserAvatar
/**
* get avatar of the tribeuser
*
* @global array $icmsConfigUser user configuration
* @return string tribeuser avatar
*/
public function getTribeuserAvatar()
{
global $icmsConfigUser;
$tribeUserId = $this->getVar('user_id', 'e');
$thisUser = icms::handler('icms_member')->getUser($tribeUserId);
if (!is_object($thisUser)) {
return;
}
$avatar = $thisUser->gravatar();
if (!$icmsConfigUser['avatar_allow_gravatar'] && strpos($avatar, 'http://www.gravatar.com/avatar/') !== false) {
return false;
}
return '<img src="' . $thisUser->gravatar() . '" />';
}
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:20,代码来源:Tribeuser.php
示例11: _checkUser
function _checkUser($username, $password)
{
if (isset($this->user)) {
return true;
}
$member_handler = icms::handler('icms_member');
$this->user =& $member_handler->loginUser(addslashes($username), addslashes($password));
if (!is_object($this->user)) {
unset($this->user);
return false;
}
$moduleperm_handler = icms::handler('icms_member_groupperm');
if (!$moduleperm_handler->checkRight('module_read', $this->module->getVar('mid'), $this->user->getGroups())) {
unset($this->user);
return false;
}
return true;
}
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:18,代码来源:xmlrpcapi.php
示例12: __construct
/**
* Constructor
* @param object $object reference to targetobject (@link icms_ipf_Object)
* @param string $key the form name
*/
public function __construct($object, $key)
{
$var = $object->vars[$key];
$control = $object->getControl($key);
if (isset($control['delimeter'])) {
$this->_delimeter = $control['delimeter'];
}
parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e'), $this->_delimeter);
// Adding the options inside this Radio element
// If the custom method is not from a module, than it's from the core
if (isset($control['options'])) {
$this->addOptionArray($control['options']);
} else {
// let's find out if the method we need to call comes from an already defined object
if (isset($control['object'])) {
if (method_exists($control['object'], $control['method'])) {
if ($option_array = $control['object']->{$control}['method']()) {
// Adding the options array to the Radio element
$this->addOptionArray($option_array);
}
}
} else {
// finding the itemHandler; if none, let's take the itemHandler of the $object
if (isset($control['itemHandler'])) {
if (!$control['module']) {
// Creating the specified core object handler
$control_handler = icms::handler($control['itemHandler']);
} else {
$control_handler =& icms_getModuleHandler($control['itemHandler'], $control['module']);
}
} else {
$control_handler =& $object->handler;
}
// Checking if the specified method exists
if (method_exists($control_handler, $control['method'])) {
// TODO : How could I pass the parameters in the following call ...
if ($option_array = $control_handler->{$control}['method']()) {
// Adding the options array to the Radio element
$this->addOptionArray($option_array);
}
}
}
}
}
开发者ID:nao-pon,项目名称:impresscms,代码行数:49,代码来源:Radio.php
示例13: __construct
/**
* Constructor
* @param object $object reference to targetobject (@link icms_ipf_Object)
* @param string $key the form name
*/
public function __construct($object, $key)
{
$var = $object->vars[$key];
$size = isset($var['size']) ? $var['size'] : ($this->_multiple ? 5 : 1);
// Adding the options inside this SelectBox
// If the custom method is not from a module, than it's from the core
$control = $object->getControl($key);
$value = isset($control['value']) ? $control['value'] : $object->getVar($key, 'e');
parent::__construct($var['form_caption'], $key, $value, $size, $this->_multiple);
if (isset($control['options'])) {
$this->addOptionArray($control['options']);
} else {
// let's find if the method we need to call comes from an already defined object
if (isset($control['object'])) {
if (method_exists($control['object'], $control['method'])) {
if ($option_array = $control['object']->{$control}['method']()) {
// Adding the options array to the select element
$this->addOptionArray($option_array);
}
}
} else {
// finding the itemHandler; if none, let's take the itemHandler of the $object
if (isset($control['itemHandler'])) {
if (!isset($control['module'])) {
// Creating the specified core object handler
$control_handler = icms::handler($control['itemHandler']);
} else {
$control_handler =& icms_getModuleHandler($control['itemHandler'], $control['module']);
}
} else {
$control_handler =& $object->handler;
}
// Checking if the specified method exists
if (method_exists($control_handler, $control['method'])) {
$option_array = call_user_func_array(array($control_handler, $control['method']), isset($control['params']) ? $control['params'] : array());
if (is_array($option_array) && count($option_array) > 0) {
// Adding the options array to the select element
$this->addOptionArray($option_array);
}
}
}
}
}
开发者ID:nao-pon,项目名称:impresscms,代码行数:48,代码来源:Select.php
示例14: __construct
/**
* Constructor
* @param icms_ipf_Object $object target object
* @param string $key the key
*/
public function __construct($object, $key)
{
parent::__construct($object->vars[$key]['form_caption'], " ");
$urllinkObj = $object->getUrlLinkObj($key);
$module_handler = icms::handler("icms_module");
$module = $module_handler->getByDirname($object->handler->_moduleName);
$this->addElement(new icms_form_elements_Label("", _CO_ICMS_URLLINK_URL));
$this->addElement(new icms_ipf_form_elements_Text($urllinkObj, "url_" . $key));
$this->addElement(new icms_form_elements_Label("", "<br/>" . _CO_ICMS_CAPTION));
$this->addElement(new icms_ipf_form_elements_Text($urllinkObj, "caption_" . $key));
$this->addElement(new icms_form_elements_Label("", "<br/>" . _CO_ICMS_DESC));
$this->addElement(new icms_ipf_form_elements_Text($urllinkObj, "desc_" . $key));
$this->addElement(new icms_form_elements_Label("", "<br/>" . _CO_ICMS_URLLINK_TARGET));
$this->addElement(new icms_form_elements_Hidden("mid_" . $key, $module->getVar("mid")));
$targ_val = $urllinkObj->getVar("target");
$targetRadio = new icms_form_elements_Radio("", "target_" . $key, $targ_val != "" ? $targ_val : "_blank");
$control = $urllinkObj->getControl("target");
$targetRadio->addOptionArray($control["options"]);
$this->addElement($targetRadio);
}
开发者ID:nao-pon,项目名称:impresscms,代码行数:25,代码来源:Urllink.php
示例15: service
/**
* Initialize the config handler.
* @param $db
*/
public static function service()
{
if (isset(self::$instance)) {
return self::$instance;
}
$instance = icms::handler('icms_config');
$configs = $instance->getConfigsByCat(array(ICMS_CONF, ICMS_CONF_USER, ICMS_CONF_METAFOOTER, ICMS_CONF_MAILER, ICMS_CONF_AUTH, ICMS_CONF_MULILANGUAGE, ICMS_CONF_PERSONA, ICMS_CONF_PLUGINS, ICMS_CONF_CAPTCHA, ICMS_CONF_SEARCH));
$GLOBALS['icmsConfig'] = $configs[ICMS_CONF];
$GLOBALS['xoopsConfig'] =& $GLOBALS['icmsConfig'];
$GLOBALS['icmsConfigUser'] = $configs[ICMS_CONF_USER];
$GLOBALS['icmsConfigMetaFooter'] = $configs[ICMS_CONF_METAFOOTER];
$GLOBALS['icmsConfigMailer'] = $configs[ICMS_CONF_MAILER];
$GLOBALS['icmsConfigAuth'] = $configs[ICMS_CONF_AUTH];
$GLOBALS['icmsConfigMultilang'] = $configs[ICMS_CONF_MULILANGUAGE];
$GLOBALS['icmsConfigPersona'] = $configs[ICMS_CONF_PERSONA];
$GLOBALS['icmsConfigPlugins'] = $configs[ICMS_CONF_PLUGINS];
$GLOBALS['icmsConfigCaptcha'] = $configs[ICMS_CONF_CAPTCHA];
$GLOBALS['icmsConfigSearch'] = $configs[ICMS_CONF_SEARCH];
return self::$instance = $instance;
}
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:24,代码来源:Handler.php
示例16: __construct
/**
* Constructor
* @param object $object reference to targetobject (@link icms_ipf_Object)
* @param string $key the form name
*/
public function __construct($object, $key)
{
$control = $object->getControl($key);
if (isset($control['delimeter'])) {
$this->_delimeter = $control['delimeter'];
}
parent::__construct($object->vars[$key]['form_caption'], $key, $object->getVar($key), $this->_delimeter);
if (isset($control['options'])) {
$this->addOptionArray($control['options']);
} else {
// let's find if the method we need to call comes from an already defined object
if (isset($control['object'])) {
if (method_exists($control['object'], $control['method'])) {
if ($option_array = $control['object']->{$control}['method']()) {
// Adding the options array to the select element
$this->addOptionArray($option_array);
}
}
} else {
// finding the itemHandler; if none, let's take the itemHandler of the $object
if (isset($control['itemHandler'])) {
if (!isset($control['module'])) {
// Creating the specified core object handler
$control_handler = icms::handler($control['itemHandler']);
} else {
$control_handler =& icms_getModuleHandler($control['itemHandler'], $control['module']);
}
} else {
$control_handler =& $object->handler;
}
// Checking if the specified method exists
if (method_exists($control_handler, $control['method'])) {
$option_array = call_user_func_array(array($control_handler, $control['method']), isset($control['params']) ? $control['params'] : array());
if (is_array($option_array) && count($option_array) > 0) {
// Adding the options array to the select element
$this->addOptionArray($option_array);
}
}
}
}
}
开发者ID:nao-pon,项目名称:impresscms,代码行数:46,代码来源:Checkbox.php
示例17: getPluginsArray
/**
* Get an array of plugins
* @param string $path
* @return multitype:
*/
public function getPluginsArray($path)
{
$module_handler = icms::handler('icms_module');
$criteria = new icms_db_criteria_Compo();
$criteria->add(new icms_db_criteria_Item('isactive', 1));
$tempModulesObj = $module_handler->getObjects($criteria);
$modulesObj = array();
foreach ($tempModulesObj as $moduleObj) {
$modulesObj[$moduleObj->getVar('dirname')] = $moduleObj;
}
$aFiles = str_replace('.php', '', icms_core_Filesystem::getFileList(ICMS_ROOT_PATH . '/plugins/' . $path . '/', '', array('php')));
$ret = array();
foreach ($aFiles as $pluginName) {
$module_xoops_version_file = ICMS_ROOT_PATH . "/modules/{$pluginName}/xoops_version.php";
$module_icms_version_file = ICMS_ROOT_PATH . "/modules/{$pluginName}/icms_version.php";
if ((file_exists($module_xoops_version_file) || file_exists($module_icms_version_file)) && isset($modulesObj[$pluginName])) {
$ret[$pluginName] = $modulesObj[$pluginName]->getVar('name');
}
}
return $ret;
}
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:26,代码来源:Handler.php
示例18: __construct
/**
* Constructor
*
* @param string $caption
* @param string $name
* @param mixed $value Pre-selected value (or array of them).
* For an item with massive members, such as "Registered Users", "$value" should be used to store selected temporary users only instead of all members of that item
* @param bool $include_anon Include user "anonymous"?
* @param int $size Number or rows. "1" makes a drop-down-list.
* @param bool $multiple Allow multiple selections?
*/
public function __construct($caption, $name, $include_anon = FALSE, $value = NULL, $size = 1, $multiple = FALSE, $showremovedusers = FALSE, $justremovedusers = FALSE)
{
$limit = 200;
$select_element = new icms_form_elements_Select('', $name, $value, $size, $multiple);
if ($include_anon) {
$select_element->addOption(0, $GLOBALS['icmsConfig']['anonymous']);
}
$member_handler = icms::handler('icms_member');
$user_count = $member_handler->getUserCount();
$value = is_array($value) ? $value : (empty($value) ? array() : array($value));
if ($user_count > $limit && count($value) > 0) {
$criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item("uid", "(" . implode(",", $value) . ")", "IN"));
} else {
$criteria = new icms_db_criteria_Compo();
$criteria->setLimit($limit);
}
$criteria->setSort('uname');
if (!$showremovedusers) {
$criteria->add(new icms_db_criteria_Item('level', '-1', '!='));
} elseif ($showremovedusers && $justremovedusers) {
$criteria->add(new icms_db_criteria_Item('level', '-1'));
}
$criteria->setOrder('ASC');
$users = $member_handler->getUserList($criteria);
$select_element->addOptionArray($users);
if ($user_count <= $limit) {
parent::__construct($caption, "", $name);
$this->addElement($select_element);
return;
}
icms_loadLanguageFile('core', 'findusers');
$js_addusers = "<script type=\"text/javascript\">\r\n\t\t\t\t\tfunction addusers(opts){\r\n\t\t\t\t\t\tvar num = opts.substring(0, opts.indexOf(\":\"));\r\n\t\t\t\t\t\topts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n\t\t\t\t\t\tvar sel = xoopsGetElementById(\"" . $name . ($multiple ? "[]" : "") . "\");\r\n\t\t\t\t\t\tvar arr = new Array(num);\r\n\t\t\t\t\t\tfor (var n=0; n < num; n++) {\r\n\t\t\t\t\t\t\tvar nm = opts.substring(0, opts.indexOf(\":\"));\r\n\t\t\t\t\t\t\topts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n\t\t\t\t\t\t\tvar val = opts.substring(0, opts.indexOf(\":\"));\r\n\t\t\t\t\t\t\topts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n\t\t\t\t\t\t\tvar txt = opts.substring(0, nm - val.length);\r\n\t\t\t\t\t\t\topts = opts.substring(nm - val.length, opts.length);\r\n\t\t\t\t\t\t\tvar added = false;\r\n\t\t\t\t\t\t\tfor (var k = 0; k < sel.options.length; k++) {\r\n\t\t\t\t\t\t\t\tif (sel.options[k].value == val){\r\n\t\t\t\t\t\t\t\t\tadded = true;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (added == false) {\r\n\t\t\t\t\t\t\t\tsel.options[k] = new Option(txt, val);\r\n\t\t\t\t\t\t\t\tsel.options[k].selected = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t</script>";
$token = icms::$security->createToken();
$action_tray = new icms_form_elements_Tray("", " | ");
$action_tray->addElement(new icms_form_elements_Label('', "<a href='#' onclick='var sel = xoopsGetElementById(\"" . $name . ($multiple ? "[]" : "") . "\");for (var i = sel.options.length-1; i >= 0; i--) {if (!sel.options[i].selected) {sel.options[i] = null;}}; return false;'>" . _MA_USER_REMOVE . "</a>"));
$action_tray->addElement(new icms_form_elements_Label('', "<a href='#' onclick='openWithSelfMain(\"" . ICMS_URL . "/include/findusers.php?target={$name}&multiple={$multiple}&token={$token}\", \"userselect\", 800, 600, null); return false;' >" . _MA_USER_MORE . "</a>" . $js_addusers));
parent::__construct($caption, '<br /><br />', $name);
$this->addElement($select_element);
$this->addElement($action_tray);
}
开发者ID:nao-pon,项目名称:impresscms,代码行数:51,代码来源:User.php
示例19: profile_search
/**
* Return search results and show images on userinfo page
*
* @param array $queryarray the terms to look
* @param text $andor the conector between the terms to be looked
* @param int $limit The number of maximum results
* @param int $offset from wich register start
* @param int $userid from which user to look
* @return array $ret with all results
*/
function profile_search($queryarray, $andor, $limit, $offset, $userid)
{
global $icmsConfigUser;
$ret = array();
$i = 0;
$dirname = basename(dirname(dirname(__FILE__)));
// check if anonymous users can access profiles
if (!is_object(icms::$user) && !$icmsConfigUser['allow_annon_view_prof']) {
return $ret;
}
// check if tribes are activated in module configuration
$module = icms::handler('icms_module')->getByDirname($dirname, TRUE);
if (!$module->config['enable_tribes']) {
return $ret;
}
$profile_tribes_handler = icms_getModuleHandler('tribes', basename(dirname(dirname(__FILE__))), 'profile');
$criteria = new icms_db_criteria_Compo();
// if those two lines are uncommented, "all search results" isn't showing in the search results
//if ($offset) $criteria->setStart($offset);
//if ($limit) $criteria->setLimit((int)$limit);
$criteria->setSort('title');
if ($userid) {
$criteria->add(new icms_db_criteria_Item('uid_owner', $userid));
}
if (is_array($queryarray) && count($queryarray) > 0) {
foreach ($queryarray as $query) {
$criteria_query = new icms_db_criteria_Compo();
$criteria_query->add(new icms_db_criteria_Item('title', '%' . $query . '%', 'LIKE'));
$criteria_query->add(new icms_db_criteria_Item('tribe_desc', '%' . $query . '%', 'LIKE'), 'OR');
$criteria->add($criteria_query, $andor);
unset($criteria_query);
}
}
$tribes = $profile_tribes_handler->getObjects($criteria, false, false);
foreach ($tribes as $tribe) {
$ret[$i++] = array("image" => 'images/tribes.gif', "link" => $tribe['itemUrl'], "title" => $tribe['title'], "time" => strtotime($tribe['creation_time']), "uid" => $tribe['uid_owner']);
}
return $ret;
}
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:49,代码来源:search.inc.php
示例20: smarty_function_xoInboxCount
function smarty_function_xoInboxCount($params, &$smarty)
{
if (!isset(icms::$user) || !is_object(icms::$user)) {
return;
}
$time = time();
if (isset($_SESSION['xoops_inbox_count']) && @$_SESSION['xoops_inbox_count_expire'] > $time) {
$count = (int) $_SESSION['xoops_inbox_count'];
} else {
$pm_handler = icms::handler('icms_data_privmessage');
$criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('read_msg', 0));
$criteria->add(new icms_db_criteria_Item('to_userid', icms::$user->getVar('uid')));
$count = (int) $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:LeeGlendenning,项目名称:formulize,代码行数:22,代码来源:function.xoInboxCount.php
注:本文中的icms类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论