]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/templates/de/code/login_main.ctp
Errors in confirmation/company link fixed
[shipsimu.git] / application / ship-simu / templates / de / code / login_main.ctp
index 3b8ef416150a50c3f5e466f9638cd1a063dcf6bf..fb4771b89f942b73b22caa6b26ac172d914d5e38 100644 (file)
@@ -4,13 +4,14 @@
 ///////////////////////////////
 
 // Get a new instance for personal data
-$blockInstance = WebBlockHelper::createWebBlockHelper($this, 'persona_data');
+$blockInstance = ObjectFactory::createObjectByConfiguredName('web_block_helper', array($this, 'persona_data'));
 
 // Set the data source instance which must exist in registry
 $blockInstance->prefetchValueInstance('user');
 
 // Assign fields with template variables
 $blockInstance->assignField('username');
+$blockInstance->assignFieldWithFilter('user_status', "user_status_translator");
 
 // Shall we include registration date?
 if ($blockInstance->ifIncludeRegistrationStamp()) {
@@ -26,7 +27,7 @@ $blockInstance->flushContent();
 //////////////////////////////////////
 
 // Get a new instance for personal data
-$blockInstance = WebBlockHelper::createWebBlockHelper($this, 'company_data');
+$blockInstance = ObjectFactory::createObjectByConfiguredName('web_block_helper', array($this, 'company_data'));
 
 // Set the data source instance
 $blockInstance->prefetchValueInstance('company', 'user');
@@ -35,36 +36,45 @@ $blockInstance->prefetchValueInstance('company', 'user');
 if ($blockInstance->getValueInstance()->ifUserIsFounder()) {
        // User is the founder of the company
        $blockInstance->assignMessageField('company_status', "user_is_company_founder");
-       $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
-       $blockInstance->assignMessageField('company_link_text', "link_text_company_overview");
-       $blockInstance->assignMessageField('company_link_title', "link_title_company_overview");
+       $blockInstance->assignLinkFieldWithAction('company' , "company_overview");
+       $blockInstance->assignMessageField('company', "link_text_company_overview");
+       $blockInstance->assignMessageField('company_title', "link_title_company_overview");
 } elseif ($blockInstance->getValueInstance()->ifUserIsOwner()) {
        // User owns the company
        $blockInstance->assignMessageField('company_status', "user_is_company_owner");
-       $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
-       $blockInstance->assignMessageField('company_link_text', "link_text_company_overview");
-       $blockInstance->assignMessageField('company_link_title', "link_title_company_overview");
+       $blockInstance->assignLinkFieldWithAction('company' , "company_overview");
+       $blockInstance->assignMessageField('company', "link_text_company_overview");
+       $blockInstance->assignMessageField('company_title', "link_title_company_overview");
 } elseif ($blockInstance->getValueInstance()->ifUserIsEmployee()) {
        // User is employed in company
        $blockInstance->assignMessageField('company_status', "user_is_employed_in_company");
-       $blockInstance->assignLinkFieldWithAction('company_link' , "employee_overview");
-       $blockInstance->assignMessageField('company_link_text', "link_text_employee_overview");
-       $blockInstance->assignMessageField('company_link_title', "link_title_employee_overview");
+       $blockInstance->assignLinkFieldWithAction('company' , "employee_overview");
+       $blockInstance->assignMessageField('company', "link_text_employee_overview");
+       $blockInstance->assignMessageField('company_title', "link_title_employee_overview");
 } else {
        // No company participation!
        $blockInstance->assignMessageField('company_status', "user_not_assigned_company");
-       $blockInstance->assignLinkFieldWithAction('company_link' , "found_new_company");
-       $blockInstance->assignMessageField('company_link_text', "link_text_new_company");
-       $blockInstance->assignMessageField('company_link_title', "link_title_new_company");
+       $blockInstance->assignLinkFieldWithAction('company' , "company");
+       $blockInstance->assignMessageField('company', "link_text_company");
+       $blockInstance->assignMessageField('company_title', "link_title_company");
 }
 
 // Flush the content out to a template variable
 $blockInstance->flushContent();
 
-// End of all PHP commands
+// Get helper instance
+$linkInstance = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'logout'));
+
+// Add action
+$linkInstance->addActionLinkById('logout', 'logout');
+
+// Flush the content
+$linkInstance->flushContent();
+
+// [EOC]
 ?>
 <div id="content_header">
-       Willkommen im Loginbereich  von {?app_full_name?}!
+       Willkommen im Loginbereich von <span class="app_name">{?app_full_name?}</span>!
 </div>
 
 <div id="content_body">
@@ -80,9 +90,8 @@ $blockInstance->flushContent();
                {?persona_data?}
        </div>
 
-       <div id="logout_link">
-               [<a href="$config[base_url]/index.php?app=ship-simu&amp;page=login_area&amp;action=logout"
-                title="Aus dem Spiel ausloggen">Ausloggen</a>]
+       <div id="logout">
+               {?logout?}
        </div>
 </div>