]> git.mxchange.org Git - city.git/blob - application/city/templates/code/login_form.ctp
Continued:
[city.git] / application / city / templates / code / login_form.ctp
1 <?php
2 // Import framework stuff
3 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
4
5 // Get helper instance for web forms. This will add the opening form-tag to
6 // the helper's render cache which is simply a small variable in the class
7 // BaseHelper.
8 $helperInstance = ObjectFactory::createObjectByConfiguredName('html_form_helper_class', array($this, 'city_user_login'));
9
10 // Is the form enabled?
11 if ($helperInstance->ifLoginIsEnabled()) {
12         // Form is active
13         $helperInstance->addFormGroup('login', "Gebe hier deine Logindaten ein:");
14
15         // Which login method has been configured?
16         if ($helperInstance->ifLoginWithUsername()) {
17                 // Login with user name only
18                 $helperInstance->addFormSubGroup('username', "Bitte mit deinem Nickname einloggen.");
19                 $helperInstance->addFieldText('username', "Dein Nickname:");
20                 $helperInstance->addInputTextField('username');
21         } elseif ($helperInstance->ifLoginWithEmail()) {
22                 // Login with email address only
23                 $helperInstance->addFormSubGroup('email', "Bitte mit deiner Email-Adresse einloggen.");
24                 $helperInstance->addFieldText('email', "Deine Email-Addresse:");
25                 $helperInstance->addInputTextField('email');
26         } else {
27                 // Login with email address or user name
28                 $helperInstance->addFormSubGroup('user_email', "Bitte mit deinem Nickname oder Email-Adresse einloggen.");
29                 $helperInstance->addFieldText('user_email', "Dein Nickname/Email:");
30                 $helperInstance->addInputTextField('user_email');
31         }
32
33         // Add password input field
34         $helperInstance->addFormSubGroup('pass', "Gebe dein Passwort von der Anmeldung ein.");
35         $helperInstance->addFieldText('pass', "Dein Passwort:");
36         $helperInstance->addInputPasswordField('pass');
37
38         // CAPTCHA enabled?
39         if ($helperInstance->ifFormSecuredWithCaptcha()) {
40                 $helperInstance->addFormGroup('captcha_user', "Das Benutzer-Login ist durch ein CAPTCHA gesch&uuml;tzt. Bitte wiederhole den angezeigten Code, damit du dich einloggen kannst.");
41                 $helperInstance->addCaptcha();
42         } // END - if
43
44         // Submit buttons
45         $helperInstance->addFormGroup('buttons_user', "Alles richtig eingegeben?");
46         $helperInstance->addInputResetButton("Formular leeren");
47         $helperInstance->addInputSubmitButton("Zum Spiel einloggen");
48 } else {
49         // Form is inactive
50         $helperInstance->addFormNote('form_deactivated', "Einloggen in&#39;s Spiel ist derzeit administrativ deaktiviert worden. Bitte komme sp&auml;ter noch mal wieder.");
51         $helperInstance->addFormNote('admin_notice', "Nachricht vom Admin: <span id=\"disabled_reason\">".$this->getConfigInstance()->readConfig('login_disabled_reason')."</span>");
52 }
53
54 // Formular schliessen
55 $helperInstance->flushContent();
56
57 // Ist Gastlogin erlaubt?
58 if ($helperInstance->ifGuestLoginAllowed()) {
59         // Neue Helper-Instanz holen
60         $helperInstance = ObjectFactory::createObjectByConfiguredName('html_form_helper_class', array($this, 'city_guest_login'));
61         $helperInstance->addInputHiddenConfiguredField('user', 'guest_login');
62         $helperInstance->addInputHiddenConfiguredField('passwd', 'guest_login');
63
64         // CAPTCHA enbaled?
65         if ($helperInstance->ifFormSecuredWithCaptcha()) {
66                 $helperInstance->addFormGroup('captcha_guest', "Unser Gast-Login ist durch ein CAPTCHA gesch&uuml;tzt. Bitte wiederhole den angezeigten Code, damit du dich einloggen kannst.");
67                 $helperInstance->addCaptcha();
68         } // END - if
69
70         // Submit button
71         $helperInstance->addFormGroup('buttons_guest', "Gastlogins sind in der Funkionsweise eingeschr&auml;nkt. Mehr dazu unter &quot;Gastlogin&quot;.");
72         $helperInstance->addInputSubmitButton("Als Gast einloggen");
73         $helperInstance->flushContent();
74 }
75
76 // Get helper instance
77 $helperInstance = ObjectFactory::createObjectByConfiguredName('html_link_helper_class', array($this, 'register'));
78
79 // Set link text
80 $helperInstance->addLinkWithTextById('register_login');
81
82 // Flush the content
83 $helperInstance->flushContent();
84
85 // [EOC]
86 ?>
87 <div id="content_header">
88         Einloggen zu <span class="app_name">{?app_full_name?}</span>
89 </div>
90
91 <div id="content_body">
92         <div id="login_box">
93                 {?city_user_login?}
94         </div>
95
96         <div id="guest_login">
97                 {?city_guest_login?}
98         </div>
99 </div>
100
101 <div id="content_footer">
102         Noch kein Spieleaccount? {?register?}
103 </div>