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();
 }
Exemple #2
0
 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();
 }
Exemple #3
0
 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();
 }
Exemple #4
0
 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);
     }
 }