本文整理汇总了PHP中xoops_getrequest函数的典型用法代码示例。如果您正苦于以下问题:PHP xoops_getrequest函数的具体用法?PHP xoops_getrequest怎么用?PHP xoops_getrequest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xoops_getrequest函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
function execute(&$controller, &$xoopsUser)
{
if (xoops_getrequest('_form_control_cancel') != null) {
return USER_FRAME_VIEW_CANCEL;
}
$isNew = $this->mObject->isNew();
$ret = parent::execute($controller, $xoopsUser);
if ($ret == USER_FRAME_VIEW_SUCCESS && $isNew) {
$handler =& xoops_getmodulehandler('users_search');
$uidArr = $handler->getUids($this->mFilter->getCriteria(0, 0));
$handler =& xoops_getmodulehandler('mailjob_link');
foreach ($uidArr as $uid) {
$obj =& $handler->create();
$obj->set('mailjob_id', $this->mObject->get('mailjob_id'));
$obj->set('uid', $uid);
$handler->insert($obj);
}
}
return $ret;
}
示例2: executeViewInput
function executeViewInput(&$controller, &$xoopsUser, &$render)
{
$render->setTemplateName("tplfile_clone.html");
$render->setAttribute('actionForm', $this->mActionForm);
$render->setAttribute('object', $this->mObject);
$render->setAttribute('tpl_id', xoops_getrequest('tpl_id'));
}
示例3: _getId
function _getId()
{
$root =& XCube_Root::getSingleton();
$uid = is_object($root->mContext->mXoopsUser) ? $root->mContext->mXoopsUser->get('uid') : 0;
return isset($_REQUEST['uid']) ? intval(xoops_getrequest('uid')) : $uid;
}
示例4: _setupObject
function _setupObject()
{
parent::_setupObject();
if (is_object($this->mObject) && $this->mObject->isNew()) {
$this->mObject->set('cid', xoops_getrequest('cid'));
}
}
示例5: fetch
function fetch()
{
parent::fetch();
$root =& XCube_Root::getSingleton();
$rank_special = $root->mContext->mRequest->getRequest('rank_special');
$option_field = $root->mContext->mRequest->getRequest('option_field');
$search = $root->mContext->mRequest->getRequest('search');
if (isset($_REQUEST['rank_special'])) {
$this->mNavi->addExtra('rank_special', xoops_getrequest('rank_special'));
$this->_mCriteria->add(new Criteria('rank_special', xoops_getrequest('rank_special')));
}
if (isset($_REQUEST['option_field'])) {
$this->mNavi->addExtra('option_field', xoops_getrequest('option_field'));
$this->mOptionField = $option_field;
if ($this->mOptionField == "special") {
//only system avatar
$this->_mCriteria->add(new Criteria('rank_special', '1'));
} elseif ($this->mOptionField == "normal") {
//only custom avatar
$this->_mCriteria->add(new Criteria('rank_special', '0'));
} else {
//all
}
}
//
if (!empty($search)) {
$this->mKeyword = $search;
$this->mNavi->addExtra('search', $this->mKeyword);
$this->_mCriteria->add(new Criteria('rank_title', '%' . $this->mKeyword . '%', 'LIKE'));
}
$this->_mCriteria->addSort($this->getSort(), $this->getOrder());
}
示例6: checkLogin
function checkLogin(&$xoopsUser)
{
$root =& XCube_Root::getSingleton();
if ($root->mContext->mUser->isInRole('Site.RegisteredUser')) {
return;
}
$root->mLanguageManager->loadModuleMessageCatalog('user');
$userHandler =& xoops_getmodulehandler('users', 'user');
$criteria = new CriteriaCompo();
if (xoops_getrequest('uname') != "" && strpos(xoops_getrequest('uname'), '@') !== false) {
$criteria->add(new Criteria('email', xoops_getrequest('uname')));
} else {
$criteria->add(new Criteria('uname', xoops_getrequest('uname')));
// use for both e-mail or uname logiin
// $criteria->add(new Criteria('uname','')); // use for only e-mail logiin
}
$criteria->add(new Criteria('pass', md5(xoops_getrequest('pass'))));
$userArr =& $userHandler->getObjects($criteria);
if (count($userArr) != 1) {
return;
}
if ($userArr[0]->get('level') == 0) {
return;
}
$handler =& xoops_gethandler('user');
$user =& $handler->get($userArr[0]->get('uid'));
$xoopsUser = $user;
require_once XOOPS_ROOT_PATH . '/include/session.php';
xoops_session_regenerate();
$_SESSION = array();
$_SESSION['xoopsUserId'] = $xoopsUser->get('uid');
$_SESSION['xoopsUserGroups'] = $xoopsUser->getGroups();
}
示例7: execute
function execute(&$controller, &$xoopsUser)
{
//in case of result of user-search
if (!isset($_REQUEST['batchjob'])) {
return $this->getDefaultView($controller, $xoopsUser);
}
//To return user to proper-url with search condition
$this->mFilter =& $this->_getFilterForm();
$this->mFilter->fetch();
//
if (xoops_getrequest('_form_control_cancel') != null) {
return USER_FRAME_VIEW_CANCEL;
}
$this->mActionForm->fetch();
$this->mActionForm->validate();
if ($this->mActionForm->hasError()) {
return $this->_processConfirm($controller, $xoopsUser);
}
else {
return $this->_processSave($controller, $xoopsUser);
}
}
示例8: getDefaultView
function getDefaultView(&$controller, &$xoopsUser)
{
$dirname = xoops_getrequest('dirname');
if (!preg_match("/^[a-zA-Z_][a-zA-Z0-9_]*\$/", $dirname)) {
return LEGACY_FRAME_VIEW_ERROR;
}
if (!is_dir(XOOPS_MODULE_PATH . "/" . $dirname)) {
return LEGACY_FRAME_VIEW_ERROR;
}
$moduleHandler =& xoops_gethandler('module');
$this->mModuleObject =& $moduleHandler->getByDirname($dirname);
//
// If a module is installed, load modinfo and go to special displaying.
//
if (is_object($this->mModuleObject)) {
$this->mModuleObject->loadAdminMenu();
$this->mModuleObject->loadInfo($dirname);
$this->mInstalledFlag = true;
} else {
$this->mModuleObject =& $moduleHandler->create();
$this->mModuleObject->loadInfoAsVar($dirname);
$this->mInstalledFlag = false;
}
return LEGACY_FRAME_VIEW_SUCCESS;
}
示例9: getDefaultView
function getDefaultView(&$controller, &$xoopsUser)
{
$id = xoops_getrequest('tpl_id');
$handler =& xoops_getmodulehandler('tplfile');
$this->mObject =& $handler->get($id);
return $this->mObject != null ? LEGACYRENDER_FRAME_VIEW_SUCCESS : LEGACYRENDER_FRAME_VIEW_ERROR;
}
示例10: executeViewIndex
function executeViewIndex(&$controller, &$xoopsUser, &$render)
{
$render->setTemplateName("legacy_image_list.html");
foreach (array_keys($this->mObjects) as $key) {
$this->mObjects[$key]->loadImagecategory();
}
$render->setAttribute("objects", $this->mObjects);
$render->setAttribute("pageNavi", $this->mFilter->mNavi);
$render->setAttribute('imgcatId', $this->mImgcatId);
$handler =& xoops_getmodulehandler('imagecategory', 'legacy');
if (is_object($xoopsUser)) {
$groups = $xoopsUser->getGroups();
} else {
$groups = array(XOOPS_GROUP_ANONYMOUS);
}
$categoryArr =& $handler->getObjectsWithReadPerm($groups, 1);
$render->setAttribute('categoryArr', $categoryArr);
//
// If current category object exists, check the permission of uploading.
//
$hasUploadPerm = null;
if ($this->mCategory != null) {
$hasUploadPerm = $this->mCategory->hasUploadPerm($groups);
}
$render->setAttribute('hasUploadPerm', $hasUploadPerm);
$render->setAttribute("category", $this->mCategory);
//echo xoops_getrequest('target');die();
$render->setAttribute('target', htmlspecialchars(xoops_getrequest('target'), ENT_QUOTES));
}
示例11: execute
function execute(&$controller, &$xoopsUser)
{
if (!is_object($this->mMailjob)) {
return USER_FRAME_VIEW_ERROR;
}
if (xoops_getrequest('_form_control_cancel') != null) {
return USER_FRAME_VIEW_CANCEL;
}
$this->mActionForm->fetch();
$this->mActionForm->validate();
if ($this->mActionForm->hasError()) {
return USER_FRAME_VIEW_INPUT;
}
$root =& XCube_Root::getSingleton();
if ($this->mMailjob->get('is_pm')) {
$this->mMailjob->mSend->add(array(&$this, "sendPM"));
}
if ($this->mMailjob->get('is_mail')) {
$this->mMailjob->mSend->add(array(&$this, "sendMail"));
}
$this->mMailjob->send($xoopsUser);
$this->mMailjob->loadUserCount();
return ($this->mMailjob->mUserCount > 0) ? USER_FRAME_VIEW_INPUT : USER_FRAME_VIEW_SUCCESS;
}
示例12: execute
function execute(&$controller, &$xoopsUser)
{
if (xoops_getrequest('_form_control_cancel') != null) {
return LEGACYRENDER_FRAME_VIEW_CANCEL;
}
$this->mActionForm->fetch();
$this->mActionForm->validate();
if ($this->mActionForm->hasError()) {
return $this->getDefaultView($controller, $xoopsUser);
}
require_once XOOPS_ROOT_PATH . "/class/class.tar.php";
$tar = new tar();
$formFile = $this->mActionForm->get('upload');
//
// [Warn] access private member directly
// TODO We should define the access method because we oftern
// access private member of XCube_FormFile.
//
$tar->openTar($formFile->_mTmpFileName);
if (!is_array($tar->files)) {
return LEGACYRENDER_FRAME_VIEW_ERROR;
}
$tplsetName = null;
foreach ($tar->files as $id => $info) {
$infoArr = explode('/', str_replace("\\", '/', $info['name']));
$tplsetName = $this->mActionForm->get('tplset_name');
if ($tplsetName == null) {
$tplsetName = trim($infoArr[0]);
}
if ($tplsetName != null) {
break;
}
}
//
// Check tplset name.
//
if ($tplsetName == null || preg_match('/[' . preg_quote('\\/:*?"<>|', '/') . ']/', $tplsetName)) {
$this->_addErrorMessage(_AD_LEGACYRENDER_ERROR_TPLSET_NAME_WRONG);
return LEGACYRENDER_FRAME_VIEW_ERROR;
}
$handler =& xoops_getmodulehandler('tplset');
if ($handler->getCount(new Criteria('tplset_name', $tplsetName)) != 0) {
$this->_addErrorMessage(XCube_Utils::formatMessage(_AD_LEGACYRENDER_ERROR_TPLSET_ALREADY_EXISTS, $tplsetName));
return LEGACYRENDER_FRAME_VIEW_ERROR;
}
$tplset =& $handler->create();
$tplset->set('tplset_name', $tplsetName);
if (!$handler->insert($tplset)) {
$this->_addErrorMessage(_AD_LEGACYRENDER_ERROR_COULD_NOT_SAVE_TPLSET);
return LEGACYRENDER_FRAME_VIEW_ERROR;
}
$themeimages = array();
if (!$this->_fetchTemplateFiles($tar, $tplset, $themeimages)) {
return LEGACYRENDER_FRAME_VIEW_ERROR;
}
if (!$this->_fetchImageset($tar, $tplset, $themeimages)) {
return LEGACYRENDER_FRAME_VIEW_ERROR;
}
return LEGACYRENDER_FRAME_VIEW_SUCCESS;
}
示例13: getDefaultView
function getDefaultView(&$controller, &$xoopsUser)
{
if ((!isset($_REQUEST['actkey'])) || (!$this->mObject)) {
$controller->executeForward(XOOPS_URL . '/');
}
if ($this->mObject->get('actkey') != xoops_getrequest('actkey')) {
$controller->executeRedirect(XOOPS_URL . '/', 3, _MD_USER_MESSAGE_ACTKEYNOT);
}
if ($this->mObject->get('level') > 0) {
$controller->executeRedirect(XOOPS_URL . '/user.php', 3, _MD_USER_MESSAGE_ACONTACT);
}
$this->mObject->set('level', '1');
//
// Force update with GET request
//
$this->mObjectHandler->insert($this->mObject, true);
if ($this->mConfig['activation_type'] == 2) {
$builder =new User_RegistAdminCommitMailBuilder();
$director =new User_UserRegistMailDirector($builder, $this->mObject, $controller->mRoot->mContext->getXoopsConfig(), $this->mConfig);
$director->contruct();
$mailer=&$builder->getResult();
if ($mailer->send()) {
$controller->executeRedirect(XOOPS_URL . '/', 5, sprintf(_MD_USER_MESSAGE_ACTVMAILOK, $this->mObject->get('uname')));
} else {
$controller->executeRedirect(XOOPS_URL . '/', 5, sprintf(_MD_USER_MESSAGE_ACTVMAILNG, $this->mObject->get('uname')));
}
} else {
$controller->executeRedirect(XOOPS_URL . '/user.php', 5, _MD_USER_MESSAGE_ACTLOGIN);
}
}
示例14: getDefaultView
function getDefaultView(&$controller, &$xoopsUser)
{
$flag = parent::getDefaultView($controller, $xoopsUser);
if ($flag == LEGACY_FRAME_VIEW_INPUT && $this->_enableCatchImgcat()) {
$this->mActionForm->set('imgcat_id', xoops_getrequest('imgcat_id'));
}
return $flag;
}
示例15: fetch
function fetch()
{
parent::fetch();
if (isset($_REQUEST['target'])) {
$this->mNavi->addExtra('target', xoops_getrequest('target'));
}
$this->_mCriteria->addSort($this->getSort(), $this->getOrder());
}