本文整理汇总了PHP中setParam函数的典型用法代码示例。如果您正苦于以下问题:PHP setParam函数的具体用法?PHP setParam怎么用?PHP setParam使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setParam函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processing
public function processing()
{
$oController = new BxDolUpgradeController();
if ($oController->setMaintenanceMode(true)) {
// if upgrade was successful
if (($sFolder = $oController->getAvailableUpgrade()) && $oController->runUpgrade($sFolder)) {
// write upgrade log
$oController->writeLog();
// send email notification
bx_import('BxDolLanguages');
sendMailTemplateSystem('t_UpgradeSuccess', array('new_version' => bx_get_ver(true), 'conclusion' => $oController->getConclusion() ? _t('_sys_upgrade_conclusion', $oController->getConclusion()) : ''));
// if next upgrade is available (in case of bulk upgrade) then schedule to run it upon next cron run
$sUpgradeDir = pathinfo(__FILE__, PATHINFO_DIRNAME);
if ($oController->getAvailableUpgrade()) {
$oUpgrader = bx_instance('BxDolUpgrader');
$oUpgrader->setTransientUpgradeCronJob($sUpgradeDir);
} elseif (0 === strpos($sUpgradeDir, BX_DIRECTORY_PATH_TMP)) {
@bx_rrmdir($sUpgradeDir);
}
}
$oController->setMaintenanceMode(false);
}
// if something went grong during upgrade
if ($sErrorMsg = $oController->getErrorMsg()) {
// write upgrade log
$oController->writeLog();
// send email notification
sendMailTemplateSystem('t_UpgradeFailed', array('error_msg' => $sErrorMsg));
// disable auto-upgrade if it is failed
setParam('sys_autoupdate_system', '');
}
}
示例2: onValidateId
protected function onValidateId()
{
$id = param("id");
if (!hasPerm(AUTH_MGR) || is_null(param("id"))) {
setParam("id", $_SESSION["empId"]);
}
}
示例3: uninstall
function uninstall($aParams)
{
$aResult = parent::uninstall($aParams);
if ($aResult['result'] && getParam($this->_sParamDefaultPayment) == $this->_aConfig['home_uri']) {
setParam($this->_sParamDefaultPayment, '');
}
return $aResult;
}
示例4: __construct
/**
* constructor
*/
function __construct()
{
if (isset($_POST['hide_admin_help']) && $_POST['hide_admin_help']) {
setParam('sys_show_admin_help', '');
echo '1';
exit;
}
$this->aBlocks = array('help' => 'on' == getParam('sys_show_admin_help') ? true : false, 'links' => true, 'charts' => true, 'stats' => true);
}
示例5: param
function param($name, $value = null)
{
if ($value !== null) {
setParam($name, $value);
}
if (preg_match('/^([^\\[]+)\\[([^\\]]*)\\]$/', $name, $m)) {
$name = $m[1];
}
return isset($_REQUEST[$name]) ? $_REQUEST[$name] : null;
}
示例6: BxDolAdminDashboard
/**
* constructor
*/
function BxDolAdminDashboard()
{
parent::BxDolMistake();
if (isset($_POST['hide_admin_help']) && $_POST['hide_admin_help']) {
setParam('sys_show_admin_help', '');
echo '1';
exit;
}
$this->aBlocks = array('help' => 'on' == getParam('sys_show_admin_help') ? true : false, 'links' => true, 'charts' => true, 'stats' => true);
}
示例7: processing
public function processing()
{
if ('on' != getParam('sys_autoupdate_system')) {
return;
}
$o = bx_instance('BxDolUpgrader');
if (!$o->prepare()) {
sendMailTemplateSystem('t_UpgradeFailed', array('error_msg' => $o->getError()));
setParam('sys_autoupdate_system', '');
// disable auto-update if it is failed
}
}
示例8: setParam
echo $ad['blank'] ? 'target="_blank"' : '';
?>
>
<img style="width:565px;height:53px;" src="<?php
echo $ad["pic_url"];
?>
">
</a>
<?php
}
?>
</div>
<div class="search">
<form name="searchform" id="searchform" action="index.php" method="get">
<?php
echo setParam(array('m' => 'search', 'a' => 'index'));
?>
<span class="search-area fl">
<input name="keywords" id="keywords" class="txt" value="请输入想找的宝贝" title="请输入想找的宝贝" type="text" onblur="if (value=='') {value='请输入想找的宝贝'}" onfocus="if(value=='请输入想找的宝贝') {value=''}">
</span>
<input value="搜全站" class="smt fr" type="submit">
</form>
</div>
</div>
<div class="mainNav">
<div class="nav">
<?php
$allsort = IndexModel::I()->getAllSort();
?>
<ul id="" class="navigation fl">
示例9: _removeFields
function _removeFields($sType)
{
switch ($sType) {
case 'html':
case 'json':
case 'exceptions':
break;
default:
return array();
}
$s = getParam("sys_{$sType}_fields");
if (!$s) {
return;
}
$a = unserialize($s);
unset($a[$this->_aConfig['home_uri']]);
$s = serialize($a);
setParam("sys_{$sType}_fields", $s);
}
示例10: resetPage
function resetPage()
{
if ($this->oPage->bResetable) {
$sQuery = "DELETE FROM `{$this->sDBTable}` WHERE `Page` = '{$this->sPage_db}'";
db_res($sQuery);
execSqlFile($this->oPage->sDefaultSqlFile);
if ($this->oPage->sName == 'index') {
setParam('promoWidth', '960');
ResizeAllPromos();
}
}
echo (int) $this->oPage->bResetable;
}
示例11: U
<script type="text/javascript">
var m1 = o2.find('.menu-text').html();
var m2 = o1.find('a').html();
$("#breadcrumbs .breadcrumb li:eq(1)").html(m1);
$("#breadcrumbs .breadcrumb li:eq(2)").html(m2);
</script>
<div class="page-content">
<div class="row">
<div class="col-xs-12">
<!-- PAGE CONTENT BEGINS -->
<form class="form-horizontal" role="form" action="<?php
echo U('admin/addsort');
?>
" method="post">
<?php
echo setParam(array('op' => 'do', 'sort_id' => $sort['sort_id'], 'p_id' => $sort['p_id']));
?>
<?php
if (!$sort_id && !$p_id) {
?>
<div class="form-group">
<label class="col-sm-2 control-label no-padding-right" for="form-field-1">类型<span style="color:#f00;">*</span></label>
<div class="col-sm-9">
<select class="col-sm-12" name="type" onchange="changesort($(this).val())">
<option value="1">商品分类</option>
<option value="2">文章分类</option>
</select>
</div>
<script type='text/javascript'>
$("select[name='type'] option[value='<?php
echo $sort[type];
示例12: bx_import
require_once BX_DIRECTORY_PATH_INC . 'design.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'admin_design.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'admin.inc.php';
bx_import('BxDolSiteMaps');
class BxDolAdmFormSitemap extends BxTemplFormView
{
function __construct()
{
$aCustomForm = array('form_attrs' => array('id' => 'sys-adm-sitemap', 'name' => 'sys-adm-sitemap', 'method' => 'post'), 'inputs' => array('sys_sitemap_generated' => array('type' => 'custom', 'content' => mb_strlen(@file_get_contents(BxDolSiteMaps::getSiteMapIndexPath())) > 32 ? '<span class="sys-adm-enabled">' . _t('_Yes') . '</span>' : '<span class="sys-adm-disabled">' . _t('_No') . '</span>', 'caption' => _t('_sys_sitemap_form_caption_sitemap_generated')), 'sys_sitemap_enable' => array('type' => 'checkbox', 'name' => 'sys_sitemap_enable', 'value' => 'on', 'checked' => 'on' == getParam('sys_sitemap_enable') ? true : false, 'caption' => _t('_sys_sitemap_form_caption')), 'Submit' => array('type' => 'submit', 'name' => 'sitemap_enable', 'value' => _t('_Submit'))));
parent::__construct($aCustomForm);
}
}
$logged['admin'] = member_auth(1, true, true);
// process actions
if (isset($_POST['sitemap_enable'])) {
setParam('sys_sitemap_enable', $_POST['sys_sitemap_enable'] ? 'on' : '');
BxDolSiteMaps::generateAllSiteMaps();
}
$iNameIndex = 9;
$sPageTitle = _t('_sys_sitemap');
$_page_cont[$iNameIndex]['page_main_code'] = PageCodeSitemap();
$_page = array('name_index' => $iNameIndex, 'header' => $sPageTitle, 'header_text' => $sPageTitle, 'css_name' => array('forms_adv.css'));
PageCodeAdmin();
function PageCodeSitemap()
{
global $aPages;
$oForm = new BxDolAdmFormSitemap();
$aList = BxDolSiteMapsQuery::getAllActiveSystemsFromCache();
$aListForTemplate = array();
foreach ($aList as $i => $a) {
$aListForTemplate[] = array('title_translated' => _t($a['title']));
示例13: saveIndexPageSettings
function saveIndexPageSettings()
{
setParam('default_country', $_POST['default_country']);
setParam('top_members_mode', $_POST['top_members_mode']);
setParam('featured_mode', $_POST['featured_mode']);
setParam('featured_num', $_POST['featured_num']);
setParam('top_members_max_num', $_POST['top_members_max_num']);
setParam('top_photos_max_num', $_POST['top_photos_max_num']);
?>
<div class="succ">Index page parameters successfully changed.</div><br />
<?php
}
示例14: actionUpload
function actionUpload($sType, $aFile, $aFtpInfo)
{
$sLogin = htmlspecialchars_adv(clear_xss($aFtpInfo['login']));
$sPassword = htmlspecialchars_adv(clear_xss($aFtpInfo['password']));
$sPath = htmlspecialchars_adv(clear_xss($aFtpInfo['path']));
setParam('sys_ftp_login', $sLogin);
setParam('sys_ftp_password', $sPassword);
setParam('sys_ftp_dir', $sPath);
$sErrMsg = false;
$sName = mktime();
$sAbsolutePath = BX_DIRECTORY_PATH_ROOT . "tmp/" . $sName . '.zip';
$sPackageRootFolder = false;
if (!class_exists('ZipArchive')) {
$sErrMsg = '_adm_txt_modules_zip_not_available';
}
if (!$sErrMsg && $this->_isArchive($aFile['type']) && move_uploaded_file($aFile['tmp_name'], $sAbsolutePath)) {
// extract uploaded zip package into tmp folder
$oZip = new ZipArchive();
if ($oZip->open($sAbsolutePath) !== TRUE) {
$sErrMsg = '_adm_txt_modules_cannot_unzip_package';
}
if (!$sErrMsg) {
$sPackageRootFolder = $oZip->numFiles > 0 ? $oZip->getNameIndex(0) : false;
if (file_exists(BX_DIRECTORY_PATH_ROOT . 'tmp/' . $sPackageRootFolder)) {
// remove existing tmp folder with the same name
bx_rrmdir(BX_DIRECTORY_PATH_ROOT . 'tmp/' . $sPackageRootFolder);
}
if ($sPackageRootFolder && !$oZip->extractTo(BX_DIRECTORY_PATH_ROOT . 'tmp/')) {
$sErrMsg = '_adm_txt_modules_cannot_unzip_package';
}
$oZip->close();
}
// upload files to the correct folder via FTP
if (!$sErrMsg && $sPackageRootFolder) {
$oFtp = new BxDolFtp($_SERVER['HTTP_HOST'], $sLogin, $sPassword, $sPath);
if (!$oFtp->connect()) {
$sErrMsg = '_adm_txt_modules_cannot_connect_to_ftp';
}
if (!$sErrMsg && !$oFtp->isDolphin()) {
$sErrMsg = '_adm_txt_modules_destination_not_valid';
}
if (!$sErrMsg) {
$sConfigPath = BX_DIRECTORY_PATH_ROOT . "tmp/" . $sPackageRootFolder . $this->_aTypesConfig[$sType]['configfile'];
if (file_exists($sConfigPath)) {
include $sConfigPath;
$sConfigVar = !empty($this->_aTypesConfig[$sType]['configvarindex']) ? ${$this->_aTypesConfig[$sType]['configvar']}[$this->_aTypesConfig[$sType]['configvarindex']] : ${$this->_aTypesConfig[$sType]['configvar']};
$sSubfolder = $this->_aTypesConfig[$sType]['subfolder'];
$sSubfolder = str_replace('{configvar}', $sConfigVar, $sSubfolder);
$sSubfolder = str_replace('{packagerootfolder}', $sPackageRootFolder, $sSubfolder);
if (!$oFtp->copy(BX_DIRECTORY_PATH_ROOT . "tmp/" . $sPackageRootFolder . '/', $this->_aTypesConfig[$sType]['folder'] . $sSubfolder)) {
$sErrMsg = '_adm_txt_modules_ftp_copy_failed';
}
} else {
$sErrMsg = '_adm_txt_modules_wrong_package_format';
}
}
} else {
$sErrMsg = '_adm_txt_modules_cannot_unzip_package';
}
// remove temporary files
bx_rrmdir(BX_DIRECTORY_PATH_ROOT . 'tmp/' . $sPackageRootFolder);
unlink($sAbsolutePath);
} else {
$sErrMsg = '_adm_txt_modules_cannot_upload_package';
}
return $sErrMsg ? $sErrMsg : '_adm_txt_modules_success_upload';
}
示例15: saveChanges
function saveChanges(&$aData)
{
$aCategories = explode(',', process_db_input($aData['cat'], BX_TAGS_STRIP));
foreach ($aCategories as $mixedCategory) {
if (!is_numeric($mixedCategory) || isset($this->_aCustomCategories[$mixedCategory]['save'])) {
$mixedResult = $this->{$this->_aCustomCategories[$mixedCategory]['save']}($aData);
if ($mixedResult !== true) {
return $mixedResult;
}
} else {
if (is_numeric($mixedCategory)) {
$aItems = $this->_oDb->getAll("SELECT `Name` AS `name`, `desc` AS `title`, `Type` AS `type`, `AvailableValues` AS `extra`, `check` AS `check`, `err_text` AS `check_error` FROM `sys_options` WHERE `kateg`= ?", [$mixedCategory]);
$aItemsData = array();
foreach ($aItems as $aItem) {
if (is_array($aData[$aItem['name']])) {
foreach ($aData[$aItem['name']] as $sKey => $sValue) {
$aItemsData[$aItem['name']][$sKey] = process_db_input($sValue, BX_TAGS_STRIP);
}
} else {
$aItemsData[$aItem['name']] = process_db_input($aData[$aItem['name']], BX_TAGS_STRIP);
}
if (!empty($aItem['check'])) {
$oFunction = create_function('$arg0', $aItem['check']);
if (!$oFunction($aItemsData[$aItem['name']])) {
$this->_iCategoryActive = (int) $mixedCategory;
return MsgBox("'" . $aItem['title'] . "' " . $aItem['check_error'], $this->_iResultTimer);
}
}
$bIsset = isset($aItemsData[$aItem['name']]);
if ($bIsset && is_array($aItemsData[$aItem['name']])) {
$aItemsData[$aItem['name']] = implode(',', $aItemsData[$aItem['name']]);
} else {
if (!$bIsset) {
$aItemsData[$aItem['name']] = $this->_empty($aItem);
}
}
setParam($aItem['name'], $aItemsData[$aItem['name']]);
}
}
}
if (isset($this->_aCustomCategories[$mixedCategory]['on_save'])) {
$this->{$this->_aCustomCategories[$mixedCategory]['on_save']}();
}
}
return MsgBox(_t('_adm_txt_settings_success'), $this->_iResultTimer);
}