本文整理汇总了PHP中BxDolForm::genCsrfToken方法的典型用法代码示例。如果您正苦于以下问题:PHP BxDolForm::genCsrfToken方法的具体用法?PHP BxDolForm::genCsrfToken怎么用?PHP BxDolForm::genCsrfToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BxDolForm
的用法示例。
在下文中一共展示了BxDolForm::genCsrfToken方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLoginForm
function getLoginForm()
{
$oTemplate = BxDolStudioTemplate::getInstance();
$sUrlRelocate = bx_get('relocate');
if (empty($sUrlRelocate) || basename($sUrlRelocate) == 'index.php') {
$sUrlRelocate = '';
}
$oTemplate->addJsTranslation(array('_adm_txt_login_username', '_adm_txt_login_password'));
$sHtml = $oTemplate->parseHtmlByName('login_form.html', array('role' => BX_DOL_ROLE_ADMIN, 'csrf_token' => BxDolForm::genCsrfToken(true), 'relocate_url' => bx_html_attribute($sUrlRelocate), 'action_url' => BX_DOL_URL_ROOT . 'member.php', 'forgot_password_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password')));
$sHtml = $oTemplate->parseHtmlByName('login.html', array('form' => $this->transBox('bx-std-login-form-box', $sHtml, true)));
$oTemplate->setPageNameIndex(BX_PAGE_CLEAR);
$oTemplate->setPageParams(array('css_name' => array('forms.css', 'login.css'), 'js_name' => array('jquery-ui/jquery.ui.position.min.js', 'jquery.form.min.js', 'jquery.dolPopup.js', 'login.js'), 'header' => _t('_adm_page_cpt_login')));
$oTemplate->setPageContent('page_main_code', $sHtml);
$oTemplate->getPageCode();
}
示例2: __construct
function __construct($aInfo, $oTemplate)
{
parent::__construct();
if ($oTemplate) {
$this->oTemplate = $oTemplate;
} else {
$this->oTemplate = BxDolTemplate::getInstance();
}
$this->aFormAttrs = isset($aInfo['form_attrs']) ? $aInfo['form_attrs'] : array();
$this->aInputs = isset($aInfo['inputs']) ? $aInfo['inputs'] : array();
$this->aParams = isset($aInfo['params']) ? $aInfo['params'] : array();
// get form element id
$this->id = $this->aFormAttrs['id'] = !empty($this->aFormAttrs['id']) ? $this->aFormAttrs['id'] : (!empty($this->aFormAttrs['name']) ? $this->aFormAttrs['name'] : 'form_advanced');
// set default method
if (!isset($this->aFormAttrs['method'])) {
$this->aFormAttrs['method'] = BX_DOL_FORM_METHOD_POST;
}
// set default action
if (!isset($this->aFormAttrs['action'])) {
$this->aFormAttrs['action'] = '';
}
$this->_sCheckerHelper = isset($this->aParams['checker_helper']) ? $this->aParams['checker_helper'] : '';
BxDolForm::genCsrfToken();
}
示例3: BxDolForm
function BxDolForm($aInfo)
{
$this->aFormAttrs = isset($aInfo['form_attrs']) ? $aInfo['form_attrs'] : array();
$this->aTableAttrs = isset($aInfo['table_attrs']) ? $aInfo['table_attrs'] : array();
$this->aInputs = isset($aInfo['inputs']) ? $aInfo['inputs'] : array();
$this->aParams = isset($aInfo['params']) ? $aInfo['params'] : array();
// get form element id
$this->id = $this->aFormAttrs['id'] = !empty($this->aFormAttrs['id']) ? $this->aFormAttrs['id'] : (!empty($this->aFormAttrs['name']) ? $this->aFormAttrs['name'] : 'form_advanced');
// set default method
if (!isset($this->aFormAttrs['method'])) {
$this->aFormAttrs['method'] = BX_DOL_FORM_METHOD_GET;
}
// set default action
if (!isset($this->aFormAttrs['action'])) {
$this->aFormAttrs['action'] = '';
}
$this->_sCheckerHelper = isset($this->aParams['checker_helper']) ? $this->aParams['checker_helper'] : '';
BxDolForm::genCsrfToken();
$oZ = new BxDolAlerts('form', 'init', 0, 0, array('form_object' => $this, 'form_attrs' => &$this->aFormAttrs, 'table_attrs' => &$this->aTableAttrs, 'params' => &$this->aParams, 'inputs' => &$this->aInputs));
$oZ->alert();
}
示例4: BxDolForm
function BxDolForm($aInfo)
{
$this->aFormAttrs = isset($aInfo['form_attrs']) ? $aInfo['form_attrs'] : array();
$this->aTableAttrs = isset($aInfo['table_attrs']) ? $aInfo['table_attrs'] : array();
$this->aInputs = isset($aInfo['inputs']) ? $aInfo['inputs'] : array();
$this->aParams = isset($aInfo['params']) ? $aInfo['params'] : array();
// get form element id
$this->id = $this->aFormAttrs['id'] = !empty($this->aFormAttrs['id']) ? $this->aFormAttrs['id'] : (!empty($this->aFormAttrs['name']) ? $this->aFormAttrs['name'] : 'form_advanced');
// set default method
if (!isset($this->aFormAttrs['method'])) {
$this->aFormAttrs['method'] = BX_DOL_FORM_METHOD_GET;
}
// set default action
if (!isset($this->aFormAttrs['action'])) {
$this->aFormAttrs['action'] = '';
}
$this->_sCheckerHelper = isset($this->aParams['checker_helper']) ? $this->aParams['checker_helper'] : '';
BxDolForm::genCsrfToken();
$aCss = array('forms_adv.css', 'plugins/jquery/themes/|calendar-blue.css', 'plugins/jquery/themes/|ui.datepicker.css');
$aCalendarLangs = array('en' => 1, 'af' => 1, 'al' => 1, 'bg' => 1, 'br' => 1, 'ca' => 1, 'cs' => 1, 'da' => 1, 'de' => 1, 'du' => 1, 'el' => 1, 'es' => 1, 'fi' => 1, 'fr' => 1, 'he' => 1, 'hr' => 1, 'hu' => 1, 'it' => 1, 'ja' => 1, 'jp' => 1, 'ko' => 1, 'lt' => 1, 'lv' => 1, 'nl' => 1, 'no' => 1, 'pl' => 1, 'pt' => 1, 'ro' => 1, 'ru' => 1, 'si' => 1, 'sk' => 1, 'sp' => 1, 'sv' => 1, 'tr' => 1, 'zh' => 1);
$aJs = array('jquery.dynDateTime.js', 'plugins/jquery/langs/|calendar-' . (isset($aCalendarLangs[$GLOBALS['sCurrentLanguage']]) ? $GLOBALS['sCurrentLanguage'] : 'en') . '.js', 'ui.core.js', 'ui.slider.js', 'ui.datepicker.js');
if (isset($GLOBALS['oSysTemplate'])) {
$GLOBALS['oSysTemplate']->addJs($aJs);
$GLOBALS['oSysTemplate']->addCss($aCss);
}
if (isset($GLOBALS['oAdmTemplate'])) {
$GLOBALS['oAdmTemplate']->addJs($aJs);
$GLOBALS['oAdmTemplate']->addCss($aCss);
}
}