]> git.mxchange.org Git - city.git/blobdiff - application/city/templates/de/code/action_city_login_city_map.ctp
Updated 'core' + added output of city name.
[city.git] / application / city / templates / de / code / action_city_login_city_map.ctp
index 09a2faef5a584964ac8b833cdfc005c0a0d0e314..c5b8480dc8517699b3a82daa8eebcee4c07c957f 100644 (file)
@@ -3,11 +3,14 @@
 $helperInstance = ObjectFactory::createObjectByConfiguredName('html_form_helper_class', array($this, 'city_map'));
 
 // Prefetch user instance
-$helperInstance->prefetchValueInstance('user', 'city_manager');
+$helperInstance->prefetchValueInstance('user');
 
 // Get manager instance
 $managerInstance = ManagerFactory::createManagerByType('city');
 
+// Now set the extra instance
+$helperInstance->setExtraInstance($managerInstance);
+
 // Get user instance
 $userInstance = Registry::getRegistry()->getInstance('user');
 
@@ -17,7 +20,7 @@ if ($userInstance->isGuest()) {
        $helperInstance->addFormNote('guest', "Du musst dich beim Spiel {?app_full_name?} anmelden, dann kannst du erst Städte gründen.");
 } elseif (!$managerInstance->isCityAlreadyFounded()) {
        // No, then generate form:
-       // Add group for personal data
+       // Add group for city creation (first city only)
        $helperInstance->addFormGroup('city_create', "Gründe deine erste Stadt.");
 
        // City name input field
@@ -40,7 +43,17 @@ if ($userInstance->isGuest()) {
        // Flush the finished form
        $helperInstance->flushContent();
 } else {
-       // City has already been created
+       // Add notice
+       $helperInstance->addFormGroup('city_created', "Deine Stadt {?block_city_name?}:");
+
+       // Assign all data fields
+       $helperInstance->assignField('city_name');
+
+       // A city has already been created, so render it
+       $managerInstance->renderCityMap($helperInstance);
+
+       // Flush the finished form
+       $helperInstance->flushContent();
 }
 
 // [EOC]