當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserForm::__construct方法代碼示例

本文整理匯總了PHP中UserForm::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserForm::__construct方法的具體用法?PHP UserForm::__construct怎麽用?PHP UserForm::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserForm的用法示例。


在下文中一共展示了UserForm::__construct方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: FormValidator

 /**
  * Constructor.
  * @param $request PKPRequest
  * @param $userId int optional
  * @param $author Author optional
  */
 function __construct($request, $userId = null, $author = null)
 {
     parent::__construct('controllers/grid/settings/user/form/userDetailsForm.tpl', $userId);
     if (isset($author)) {
         $this->author =& $author;
     } else {
         $this->author = null;
     }
     $site = $request->getSite();
     // Validation checks for this form
     if ($userId == null) {
         $this->addCheck(new FormValidator($this, 'username', 'required', 'user.profile.form.usernameRequired'));
         $this->addCheck(new FormValidatorCustom($this, 'username', 'required', 'user.register.form.usernameExists', array(DAORegistry::getDAO('UserDAO'), 'userExistsByUsername'), array($this->userId, true), true));
         $this->addCheck(new FormValidatorUsername($this, 'username', 'required', 'user.register.form.usernameAlphaNumeric'));
         if (!Config::getVar('security', 'implicit_auth')) {
             $this->addCheck(new FormValidator($this, 'password', 'required', 'user.profile.form.passwordRequired'));
             $this->addCheck(new FormValidatorLength($this, 'password', 'required', 'user.register.form.passwordLengthRestriction', '>=', $site->getMinPasswordLength()));
             $this->addCheck(new FormValidatorCustom($this, 'password', 'required', 'user.register.form.passwordsDoNotMatch', create_function('$password,$form', 'return $password == $form->getData(\'password2\');'), array($this)));
         }
     } else {
         $this->addCheck(new FormValidatorLength($this, 'password', 'optional', 'user.register.form.passwordLengthRestriction', '>=', $site->getMinPasswordLength()));
         $this->addCheck(new FormValidatorCustom($this, 'password', 'optional', 'user.register.form.passwordsDoNotMatch', create_function('$password,$form', 'return $password == $form->getData(\'password2\');'), array($this)));
     }
     $this->addCheck(new FormValidator($this, 'firstName', 'required', 'user.profile.form.firstNameRequired'));
     $this->addCheck(new FormValidator($this, 'lastName', 'required', 'user.profile.form.lastNameRequired'));
     $this->addCheck(new FormValidatorUrl($this, 'userUrl', 'optional', 'user.profile.form.urlInvalid'));
     $this->addCheck(new FormValidatorEmail($this, 'email', 'required', 'user.profile.form.emailRequired'));
     $this->addCheck(new FormValidatorCustom($this, 'email', 'required', 'user.register.form.emailExists', array(DAORegistry::getDAO('UserDAO'), 'userExistsByEmail'), array($this->userId, true), true));
     $this->addCheck(new FormValidatorORCID($this, 'orcid', 'optional', 'user.orcid.orcidInvalid'));
     $this->addCheck(new FormValidatorPost($this));
     $this->addCheck(new FormValidatorCSRF($this));
 }
開發者ID:PublishingWithoutWalls,項目名稱:pkp-lib,代碼行數:38,代碼來源:UserDetailsForm.inc.php

示例2: FormValidatorPost

 /**
  * Constructor.
  * @param int $userId
  * @param string $userFullName
  */
 function __construct($userId, $userFullName)
 {
     parent::__construct('controllers/grid/settings/user/form/userRoleForm.tpl', $userId);
     $this->_userFullName = $userFullName;
     $this->addCheck(new FormValidatorPost($this));
     $this->addCheck(new FormValidatorCSRF($this));
 }
開發者ID:PublishingWithoutWalls,項目名稱:pkp-lib,代碼行數:12,代碼來源:UserRoleForm.inc.php

示例3:

 function __construct(&$xmlArr)
 {
     parent::__construct($xmlArr);
     // read user profile and set fix search rule
     $profile = Openbiz::$app->getUserProfile();
     if ($profile && $profile['Id']) {
         $this->_userId = $profile['Id'];
     }
 }
開發者ID:openbizx,項目名稱:openbizx-cubix,代碼行數:9,代碼來源:AccountEditForm.php

示例4:

 function __construct(&$xmlArr)
 {
     parent::__construct($xmlArr);
     // read user profile and set fix search rule
     global $g_BizSystem;
     $profile = $g_BizSystem->getUserProfile();
     if ($profile && $profile['Id']) {
         $this->_userId = $profile['Id'];
     }
 }
開發者ID:que273,項目名稱:siremis,代碼行數:10,代碼來源:AccountEditForm.php


注:本文中的UserForm::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。