2 // Get form helper instance
3 $helperInstance = ObjectFactory::createObjectByConfiguredName('html_form_helper_class', array($this, 'city_map'));
5 // Prefetch user instance
6 $helperInstance->prefetchValueInstance('user', 'city_manager');
8 // Get manager instance
9 $managerInstance = ManagerFactory::createManagerByType('city');
12 $userInstance = Registry::getRegistry()->getInstance('user');
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ädte gründen.");
18 } elseif (!$managerInstance->isCityAlreadyFounded()) {
19 // No, then generate form:
20 // Add group for personal data
21 $helperInstance->addFormGroup('city_create', "Gründe deine erste Stadt.");
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');
29 if ($helperInstance->ifFormSecuredWithCaptcha()) {
30 $helperInstance->addFormGroup('captcha_user', "Die virtuelle Beantragung von Starthilfe ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit du die Starthilfe beantragen kannst.");
31 $helperInstance->addCaptcha();
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äter auch weitere Städte anlegen, fange aber erstmal klein an.");
40 // Flush the finished form
41 $helperInstance->flushContent();
43 // City has already been created
48 <div id="government_frame">
49 <div id="government_header">
53 <div id="government_form">