]> git.mxchange.org Git - city.git/blob - application/city/templates/de/code/action_city_login_city_map.ctp
09a2faef5a584964ac8b833cdfc005c0a0d0e314
[city.git] / application / city / templates / de / code / action_city_login_city_map.ctp
1 <?php
2 // Get form helper instance
3 $helperInstance = ObjectFactory::createObjectByConfiguredName('html_form_helper_class', array($this, 'city_map'));
4
5 // Prefetch user instance
6 $helperInstance->prefetchValueInstance('user', 'city_manager');
7
8 // Get manager instance
9 $managerInstance = ManagerFactory::createManagerByType('city');
10
11 // Get user instance
12 $userInstance = Registry::getRegistry()->getInstance('user');
13
14 // Is a city already founded?
15 if ($userInstance->isGuest()) {
16         // Guests are not allowed to found cities
17         $helperInstance->addFormNote('guest', "Du musst dich beim Spiel {?app_full_name?} anmelden, dann kannst du erst St&auml;dte gr&uuml;nden.");
18 } elseif (!$managerInstance->isCityAlreadyFounded()) {
19         // No, then generate form:
20         // Add group for personal data
21         $helperInstance->addFormGroup('city_create', "Gr&uuml;nde deine erste Stadt.");
22
23         // City name input field
24         $helperInstance->addFormSubGroup('city_name', "Bitte gebe den Namen der Stadt ein.");
25         $helperInstance->addFieldText('city_name', "Dein Stadtname:");
26         $helperInstance->addInputTextField('city_name');
27
28         // CAPTCHA enabled?
29         if ($helperInstance->ifFormSecuredWithCaptcha()) {
30                 $helperInstance->addFormGroup('captcha_user', "Die virtuelle Beantragung von Starthilfe ist durch ein CAPTCHA gesch&uuml;tzt. Bitte wiederhole den angezeigten Code, damit du die Starthilfe beantragen kannst.");
31                 $helperInstance->addCaptcha();
32         } // END - if
33
34         // Final notices
35         $helperInstance->addFormGroup('buttons', "Soll so die Stadt angelegt werden?");
36         $helperInstance->addInputResetButton("Alles nochmal eingeben");
37         $helperInstance->addInputSubmitButton("Stadt anlegen");
38         $helperInstance->addFormNote('more_cities', "Du kannst sp&auml;ter auch weitere St&auml;dte anlegen, fange aber erstmal klein an.");
39
40         // Flush the finished form
41         $helperInstance->flushContent();
42 } else {
43         // City has already been created
44 }
45
46 // [EOC]
47 ?>
48 <div id="government_frame">
49         <div id="government_header">
50                 Stadtkarte
51         </div>
52
53         <div id="government_form">
54                 {?city_map?}
55         </div>
56 </div>