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