本文整理汇总了PHP中icms类的典型用法代码示例。如果您正苦于以下问题:PHP icms类的具体用法?PHP icms怎么用?PHP icms使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了icms类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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;
}
}
}
示例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));
}
}
示例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>');
}
示例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;
}
示例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());
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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() . '" />';
}
示例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;
}
示例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);
}
}
}
}
}
示例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);
}
}
}
}
}
示例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);
}
示例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;
}