Changeset 56 for trunk/www/view/user.php
- Timestamp:
- Aug 4, 2009, 9:53:52 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/view/user.php
r55 r56 3 3 class UserView extends Module 4 4 { 5 var $OptionsFormClass = array( 6 'Title' => 'Základní nastavení', 7 'Table' => 'User', 8 'SubmitText' => 'Uložit', 9 'Items' => array( 10 'Login' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''), 11 'Password' => array('Type' => 'Password', 'Caption' => 'Heslo', 'Default' => ''), 12 'Name' => array('Type' => 'String', 'Caption' => 'Zobrazované jméno', 'Default' => ''), 13 'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''), 14 //'PhoneNumber' => array('Type' => 'String', 'Caption' => 'Telefón', 'Default' => ''), 15 //'ICQ' => array('Type' => 'String', 'Caption' => 'ICQ', 'Default' => ''), 16 ), 17 ); 18 var $RegisterFormClass = array( 19 'Title' => 'Registrace uživatele', 20 'SubmitText' => 'Registrovat', 21 'Table' => 'User', 22 'Items' => array( 23 'Login' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''), 24 'Password' => array('Type' => 'Password', 'Caption' => 'Heslo', 'Default' => ''), 25 'Password2' => array('Type' => 'Password', 'Caption' => 'Potvrzení hesla', 'Default' => ''), 26 'Name' => array('Type' => 'String', 'Caption' => 'Zobrazované jméno', 'Default' => ''), 27 'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''), 28 //'PhoneNumber' => array('Type' => 'String', 'Caption' => 'Telefón', 'Default' => ''), 29 //'ICQ' => array('Type' => 'String', 'Caption' => 'ICQ', 'Default' => ''), 30 ), 31 ); 32 var $PasswordRecoveryFormClass = array( 33 'Title' => 'Obnova hesla', 34 'SubmitText' => 'Obnovit', 35 'Table' => '', 36 'Items' => array( 37 'Name' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''), 38 'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''), 39 ), 40 ); 41 var $LoginFormClass = array( 42 'Title' => 'Přihlášení uživatele', 43 'SubmitText' => 'Přihlásit', 44 'Table' => '', 45 'Items' => array( 46 'Username' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''), 47 'Password' => array('Type' => 'Password', 'Caption' => 'Heslo', 'Default' => ''), 48 ), 49 ); 50 5 51 function LoginForm() 6 52 { 7 53 global $Config; 8 54 9 $Form = new Form( 'UserLogin');55 $Form = new Form($this->LoginFormClass); 10 56 $Form->OnSubmit = '?Action=Login'; 11 57 $Output = $Form->ShowEditForm(); … … 19 65 function LoginResult() 20 66 { 21 $Form = new Form( 'UserLogin');67 $Form = new Form($this->LoginFormClass); 22 68 $Form->OnSubmit = '?Action=Login'; 23 69 $Form->LoadValuesFromForm(); … … 40 86 if($Config['Web']['UserRegistrationEnabled']) 41 87 { 42 $Form = new Form( 'UserRegister', array());88 $Form = new Form($this->RegisterFormClass, array()); 43 89 $Form->LoadValuesFromForm(); 44 90 $Result = $this->System->Modules['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name']); … … 62 108 function PasswordRecoveryFinish() 63 109 { 64 $Form = new Form( 'PasswordRecovery');110 $Form = new Form($this->PasswordRecoveryFormClass); 65 111 $Form->LoadValuesFromForm(); 66 112 $Result = $this->System->Modules['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']); … … 75 121 function PasswordRecovery() 76 122 { 77 $Form = new Form( 'PasswordRecovery');123 $Form = new Form($this->PasswordRecoveryFormClass); 78 124 $Form->OnSubmit = '?Action=PasswordRecovery2'; 79 125 $Output = $Form->ShowEditForm(); … … 90 136 function Options() 91 137 { 92 $UserOptions = new Form( 'UserOptions');138 $UserOptions = new Form($this->OptionsFormClass); 93 139 $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']); 94 140 $UserOptions->OnSubmit = '?Action=UserOptionsSave'; … … 99 145 function OptionsSave() 100 146 { 101 $UserOptions = new Form( 'UserOptions', array());147 $UserOptions = new Form($this->OptionsFormClass, array()); 102 148 $UserOptions->LoadValuesFromForm(); 103 149 $UserOptions->SaveValuesToDatabase($this->System->Modules['User']->User['Id']); … … 116 162 if($Config['Web']['UserRegistrationEnabled']) 117 163 { 118 $Form = new Form( 'UserRegister');164 $Form = new Form($this->RegisterFormClass); 119 165 $Form->LoadValuesFromForm(); 120 166 $Form->OnSubmit = '?Action=UserRegisterSave';
Note:
See TracChangeset
for help on using the changeset viewer.