From 35c8b7301832f61bef1ed145ffe2348628e365dc Mon Sep 17 00:00:00 2001
From: Roland Haeder <roland@mxchange.org>
Date: Sat, 18 Apr 2015 03:55:36 +0200
Subject: [PATCH] Updated 'core' + added output of city name.

Signed-off-by: Roland Haeder <roland@mxchange.org>
---
 .../class_CityInformationDatabaseWrapper.php  |  2 +-
 .../de/code/action_city_login_city_map.ctp    | 19 ++++++++++++++++---
 core                                          |  2 +-
 3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/application/city/main/database/frontend/city/class_CityInformationDatabaseWrapper.php b/application/city/main/database/frontend/city/class_CityInformationDatabaseWrapper.php
index 8de393d..e5cc911 100644
--- a/application/city/main/database/frontend/city/class_CityInformationDatabaseWrapper.php
+++ b/application/city/main/database/frontend/city/class_CityInformationDatabaseWrapper.php
@@ -151,7 +151,7 @@ class CityInformationDatabaseWrapper extends BaseDatabaseWrapper implements City
 		$managerInstance->setResultInstance($resultInstance);
 
 		// Has it been founded?
-		$hasFounded = $resultInstance->valid();
+		$hasFounded = $resultInstance->next();
 
 		// Return result
 		return $hasFounded;
diff --git a/application/city/templates/de/code/action_city_login_city_map.ctp b/application/city/templates/de/code/action_city_login_city_map.ctp
index 09a2fae..c5b8480 100644
--- a/application/city/templates/de/code/action_city_login_city_map.ctp
+++ b/application/city/templates/de/code/action_city_login_city_map.ctp
@@ -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&auml;dte gr&uuml;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&uuml;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]
diff --git a/core b/core
index b9437a2..607732d 160000
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit b9437a2a7c4a83e8c03d3a7508dfb0ccf270a94b
+Subproject commit 607732d1a427409037b600f2c5a17ca9846f0f5f
-- 
2.39.5