本文整理汇总了PHP中xoops_getenv函数的典型用法代码示例。如果您正苦于以下问题:PHP xoops_getenv函数的具体用法?PHP xoops_getenv怎么用?PHP xoops_getenv使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xoops_getenv函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderSelect
function renderSelect($showbutton = false)
{
if ($this->total < $this->perpage) {
return;
}
$total_pages = ceil($this->total / $this->perpage);
$ret = '';
if ($total_pages > 1) {
$ret = '<form name="pagenavform" action="' . xoops_getenv('PHP_SELF') . '">';
$ret .= '<select name="pagenavselect" onchange="location=this.options[this.options.selectedIndex].value;">';
$counter = 1;
$current_page = intval(floor(($this->current + $this->perpage) / $this->perpage));
while ($counter <= $total_pages) {
if ($counter == $current_page) {
$ret .= '<option value="' . $this->url . ($counter - 1) * $this->perpage . '" selected="selected">' . $counter . '</option>';
} else {
$ret .= '<option value="' . $this->url . ($counter - 1) * $this->perpage . '">' . $counter . '</option>';
}
$counter++;
}
$ret .= '</select>';
if ($showbutton) {
$ret .= ' <input type="submit" value="' . _GO . '" />';
}
$ret .= '</form>';
}
return $ret;
}
示例2: setupBlock
function setupBlock()
{
$showFlag = 0;
$mid = 0;
if ($this->mController->mRoot->mContext->mModule != null) {
$showFlag = preg_match("/index\\.php\$/i", xoops_getenv('PHP_SELF')) && $this->mController->mRoot->mContext->mXoopsConfig['startpage'] == $this->mController->mRoot->mContext->mXoopsModule->get('dirname');
$mid = $this->mController->mRoot->mContext->mXoopsModule->get('mid');
} else {
//
// If you does not have module_contoller, this request is to toppage or other pages of toppage.
//
// $mid = preg_match("/index\.php$/i", xoops_getenv('PHP_SELF')) ? -1 : 0;
$pathArray = parse_url(!empty($_SERVER['PATH_INFO']) ? substr($_SERVER['PHP_SELF'], 0, -strlen($_SERVER['PATH_INFO'])) : $_SERVER['PHP_SELF']);
$mid = preg_match("#(/index\\.php|/)\$#i", @$pathArray['path']) ? -1 : 0;
}
$blockHandler =& xoops_gethandler('block');
$showCenterFlag = SHOW_CENTERBLOCK_LEFT | SHOW_CENTERBLOCK_CENTER | SHOW_CENTERBLOCK_RIGHT;
$showRightFlag = SHOW_SIDEBLOCK_RIGHT;
$showFlag = SHOW_SIDEBLOCK_LEFT | $showRightFlag | $showCenterFlag;
$groups = is_object($this->mController->mRoot->mContext->mXoopsUser) ? $this->mController->mRoot->mContext->mXoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
$blockObjects =& $blockHandler->getBlocks($groups, $mid, $showFlag);
foreach ($blockObjects as $blockObject) {
$block =& Legacy_Utils::createBlockProcedure($blockObject);
if ($block->prepare() !== false) {
$this->mController->_mBlockChain[] =& $block;
}
unset($block);
unset($blockObject);
}
}
示例3: editcat
function editcat($catid = '')
{
$name = '';
$description = '';
global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify;
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
if ($modify) {
$result = $xoopsDB->query("SELECT name, description FROM " . $xoopsDB->prefix("faqcategories") . " WHERE catID = '{$catid}'");
list($name, $description) = mysql_fetch_row($result);
if (mysql_num_rows($result) == 0) {
redirect_header("index.php", 1, _AM_NOCATTOEDIT);
exit;
}
$sform = new XoopsThemeForm(_AM_MODIFYCAT, "op", xoops_getenv('PHP_SELF'));
} else {
$sform = new XoopsThemeForm(_AM_ADDCAT, "op", xoops_getenv('PHP_SELF'));
}
$sform->addElement(new XoopsFormText(_AM_CATNAME, 'name', 50, 80, $name), true);
$sform->addElement(new XoopsFormDhtmlTextArea(_AM_CATDESCRIPT, 'description', $description, 15, 60));
$sform->addElement(new XoopsFormHidden('catid', $catid));
$sform->addElement(new XoopsFormHidden('modify', $modify));
$button_tray = new XoopsFormElementTray('', '');
$hidden = new XoopsFormHidden('op', 'addcat');
$button_tray->addElement($hidden);
if ($modify == '0') {
$button_tray->addElement(new XoopsFormButton('', 'update', _AM_CREATE, 'submit'));
} else {
$button_tray->addElement(new XoopsFormButton('', 'update', _AM_MODIFY, 'submit'));
}
$sform->addElement($button_tray);
$sform->display();
unset($hidden);
}
示例4: redirect
function redirect($message, $toFrompage = false)
{
if ($toFrompage) {
$url = XOOPS_URL . '/';
/* @var $cookie Openid_Context */
$cookie =& OpenID_Utils::load('context');
$cookie->accept('openid_frompage', 'string', 'cookie');
if ($frompage = $cookie->get('openid_frompage')) {
$parsed = parse_url(XOOPS_URL);
$url = isset($parsed['scheme']) ? $parsed['scheme'] . '://' : 'http://';
if (isset($parsed['host'])) {
$url .= $parsed['host'];
if (isset($parsed['port'])) {
$url .= ':' . $parsed['port'];
}
} else {
$url .= xoops_getenv('HTTP_HOST');
}
$url .= trim($frompage);
}
} else {
$url = XOOPS_URL . '/';
}
unset($_SESSION['openid_response']);
setcookie('openid_frompage', '', time() - 3600);
redirect_header($url, 2, $message);
}
示例5: b_legacy_themes_show
function b_legacy_themes_show($options)
{
global $xoopsConfig;
if (count($xoopsConfig['theme_set_allowed']) == 0) {
return null;
}
$block = array();
if (xoops_getenv('REQUEST_METHOD') == 'POST') {
$block['isEnableChanger'] = 0;
return $block;
}
$block['isEnableChanger'] = 1;
$theme_options = array();
$handler =& xoops_getmodulehandler('theme', 'legacy');
foreach ($xoopsConfig['theme_set_allowed'] as $name) {
$theme =& $handler->get($name);
if ($theme != null) {
$theme_option['name'] = $name;
$theme_option['screenshot'] = $theme->getShow('screenshot');
$theme_option['screenshotUrl'] = XOOPS_THEME_URL . "/" . $name . "/" . $theme->getShow('screenshot');
if ($name == $xoopsConfig['theme_set']) {
$theme_option['selected'] = 'selected="selected"';
$block['theme_selected_screenshot'] = $theme->getShow('screenshot');
} else {
$theme_option['selected'] = '';
}
$theme_options[] = $theme_option;
}
}
$block['count'] = count($xoopsConfig['theme_set_allowed']);
$block['mode'] = $options[0];
$block['width'] = $options[1];
$block['theme_options'] = $theme_options;
return $block;
}
示例6: displayForm
/**
* XoopsfaqCategory::displayForm()
*
* @return
*/
function displayForm()
{
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$caption = $this->isNew() ? _AM_XOOPSFAQ_CREATENEW : sprintf(_AM_XOOPSFAQ_MODIFYITEM, $this->getVar('category_title'));
$form = new XoopsThemeForm($caption, 'content', xoops_getenv('PHP_SELF'));
$form->addElement(new XoopsFormHiddenToken());
$form->addElement(new xoopsFormHidden('op', 'save'));
$form->addElement(new xoopsFormHidden('category_id', $this->getVar('category_id', 'e')));
// title
$category_title = new XoopsFormText(_AM_XOOPSFAQ_E_CATEGORY_TITLE, 'category_title', 50, 150, $this->getVar('category_title', 'e'));
$category_title->setDescription(_AM_XOOPSFAQ_E_CATEGORY_TITLE_DSC);
$form->addElement($category_title, true);
// order
$category_order = new XoopsFormText(_AM_XOOPSFAQ_E_CATEGORY_WEIGHT, 'category_order', 5, 5, $this->getVar('category_order', 'e'));
$category_order->setDescription(_AM_XOOPSFAQ_E_CATEGORY_WEIGHT_DSC);
$form->addElement($category_order, false);
$btnTray = new XoopsFormElementTray('', '');
$btnSubmit = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
$btnTray->addElement($btnSubmit);
$btnCancel = new XoopsFormButton('', '', _CANCEL, 'button');
$btnCancel->setExtra('onclick="history.go(-1)"');
$btnTray->addElement($btnCancel);
$form->addElement($btnTray);
$form->display();
}
示例7: execute
function execute(&$controller)
{
if (!preg_match("/^\\w+\$/", $this->mActionName)) {
die;
}
//
// Create action object by mActionName
//
$className = "Pm_" . ucfirst($this->mActionName) . "Action";
$fileName = ucfirst($this->mActionName) . "Action";
if ($this->mAdminFlag) {
$fileName = XOOPS_MODULE_PATH . "/pm/admin/actions/{$fileName}.class.php";
} else {
$fileName = XOOPS_MODULE_PATH . "/pm/actions/{$fileName}.class.php";
}
if (!file_exists($fileName)) {
die;
}
require_once $fileName;
if (XC_CLASS_EXISTS($className)) {
$this->mAction =& new $className();
}
if (!is_object($this->mAction)) {
$this->doActionNotFoundError($controller);
return;
}
$handler =& xoops_gethandler('config');
$moduleConfig =& $handler->getConfigsByDirname('pm');
$this->mAction->prepare($controller, $controller->mRoot->mContext->mXoopsUser, $moduleConfig);
if (!$this->mAction->hasPermission($controller, $controller->mRoot->mContext->mXoopsUser, $moduleConfig)) {
$this->doPermissionError($controller);
return;
}
if (xoops_getenv("REQUEST_METHOD") == "POST") {
$viewStatus = $this->mAction->execute($controller, $controller->mRoot->mContext->mXoopsUser);
} else {
$viewStatus = $this->mAction->getDefaultView($controller, $controller->mRoot->mContext->mXoopsUser);
}
switch ($viewStatus) {
case PM_FRAME_VIEW_SUCCESS:
$this->mAction->executeViewSuccess($controller, $controller->mRoot->mContext->mXoopsUser, $controller->mRoot->mContext->mModule->getRenderTarget());
break;
case PM_FRAME_VIEW_ERROR:
$this->mAction->executeViewError($controller, $controller->mRoot->mContext->mXoopsUser, $controller->mRoot->mContext->mModule->getRenderTarget());
break;
case PM_FRAME_VIEW_INDEX:
$this->mAction->executeViewIndex($controller, $controller->mRoot->mContext->mXoopsUser, $controller->mRoot->mContext->mModule->getRenderTarget());
break;
case PM_FRAME_VIEW_INPUT:
$this->mAction->executeViewInput($controller, $controller->mRoot->mContext->mXoopsUser, $controller->mRoot->mContext->mModule->getRenderTarget());
break;
case PM_FRAME_VIEW_PREVIEW:
$this->mAction->executeViewPreview($controller, $controller->mRoot->mContext->mXoopsUser, $controller->mRoot->mContext->mModule->getRenderTarget());
break;
case PM_FRAME_VIEW_CANCEL:
$this->mAction->executeViewCancel($controller, $controller->mRoot->mContext->mXoopsUser, $controller->mRoot->mContext->mModule->getRenderTarget());
break;
}
}
示例8: __construct
/**
* form_room_type constructor.
* @param $RoomType
*/
public function __construct(&$RoomType)
{
$this->Obj =& $RoomType;
parent::__construct(_AM_MARTIN_HOTEL_ROOM_CATEGORY, "op", xoops_getenv('PHP_SELF') . "?action=typesave&typeid=" . $RoomType['room_type_id']);
$this->setExtra('enctype="multipart/form-data"');
$this->createElements();
$this->createButtons();
}
示例9: My_PageNav
function My_PageNav( $total_items, $items_perpage, $current_start, $start_name='start', $extra_arg='' )
{
$this->total = intval( $total_items ) ;
$this->perpage = intval( $items_perpage ) ;
$this->current = intval( $current_start ) ;
if ( $extra_arg != '' && ( substr( $extra_arg, -5 ) != '&' || substr( $extra_arg, -1 ) != '&' ) ) $extra_arg .= '&' ;
$this->url = xoops_getenv( 'PHP_SELF' ).'?'.$extra_arg.trim( $start_name ).'=' ;
}
示例10: Openid_Admin_Controller
function Openid_Admin_Controller()
{
require_once XOOPS_ROOT_PATH . "/modules/openid/class/handler/{$this->_control}.php";
$className = 'Openid_Handler_' . ucfirst($this->_control);
$this->_handler = new $className();
$this->_keyField = $this->_handler->_keyField;
$this->_url = xoops_getenv('PHP_SELF') . '?controller=' . $this->_control;
}
示例11: form_hotel_city
function form_hotel_city(&$HotelCityObj)
{
$this->Obj =& $HotelCityObj;
$this->XoopsThemeForm('酒店城市', "op", xoops_getenv('PHP_SELF') . "?action=save");
$this->setExtra('enctype="multipart/form-data"');
$this->createElements();
$this->createButtons();
}
示例12: __construct
/**
* form_hotel_service_type constructor.
* @param $HotelServiceTypeObj
*/
public function __construct(&$HotelServiceTypeObj)
{
$this->Obj =& $HotelServiceTypeObj;
parent::__construct(_AM_MARTIN_SERVICE_CATEGORY, "op", xoops_getenv('PHP_SELF') . "?action=typesave");
$this->setExtra('enctype="multipart/form-data"');
$this->createElements();
$this->createButtons();
}
示例13: isPost
function isPost()
{
if (xoops_getenv('REQUEST_METHOD') == "POST") {
return 1;
} else {
return 0;
}
}
示例14: form_hotel_service_type
function form_hotel_service_type(&$HotelServiceTypeObj)
{
$this->Obj =& $HotelServiceTypeObj;
$this->XoopsThemeForm('酒店服务类别', "op", xoops_getenv('PHP_SELF') . "?action=typesave");
$this->setExtra('enctype="multipart/form-data"');
$this->createElements();
$this->createButtons();
}
示例15: __construct
/**
* form_hotel_city constructor.
* @param $HotelCityObj
*/
public function __construct(&$HotelCityObj)
{
$this->Obj =& $HotelCityObj;
parent::__construct(_AM_MARTIN_HOTEL_CITY, "op", xoops_getenv('PHP_SELF') . "?action=save");
$this->setExtra('enctype="multipart/form-data"');
$this->createElements();
$this->createButtons();
}