More renamed
[shipsimu.git] / application / ship-simu / templates / de / code / login_main.ctp
1 <?php
2 ///////////////////////////////
3 // Assign personal user data //
4 ///////////////////////////////
5
6 // Get a new instance for personal data
7 $blockInstance = ObjectFactory::createObjectByConfiguredName('web_block_helper', array($this, 'persona_data'));
8
9 // Set the data source instance which must exist in registry
10 $blockInstance->prefetchValueInstance('user', 'user_points');
11
12 // Assign fields with template variables
13 $blockInstance->assignField('username');
14 $blockInstance->assignFieldWithFilter('user_status', 'user_status_translator');
15 $blockInstance->assignFieldWithFilter('points', 'format_number');
16
17 // Shall we include registration date?
18 if ($blockInstance->ifIncludeRegistrationStamp()) {
19         // Then assign it as well!
20         $blockInstance->assignFieldWithFilter('registered', 'format_timestamp');
21 } // END - if
22
23 // Flush the content out to a template variable
24 $blockInstance->flushContent();
25
26 //////////////////////////////////////
27 // Assign the shipping company data //
28 //////////////////////////////////////
29
30 // Get a new instance for personal data
31 $blockInstance = ObjectFactory::createObjectByConfiguredName('web_block_helper', array($this, 'company_data'));
32
33 // Set the data source instance
34 $blockInstance->prefetchValueInstance('company', 'user');
35
36 // Assign the company name
37 if ($blockInstance->getValueInstance()->ifUserIsFounder()) {
38         // User is the founder of the company
39         $blockInstance->assignMessageField('company_status', 'user_is_company_founder');
40         $blockInstance->assignLinkFieldWithAction('company' , 'company_overview');
41         $blockInstance->assignMessageField('company', 'link_text_company_overview');
42         $blockInstance->assignMessageField('company_title', 'link_title_company_overview');
43 } elseif ($blockInstance->getValueInstance()->ifUserIsOwner()) {
44         // User owns the company
45         $blockInstance->assignMessageField('company_status', 'user_is_company_owner');
46         $blockInstance->assignLinkFieldWithAction('company' , 'company_overview');
47         $blockInstance->assignMessageField('company', 'link_text_company_overview');
48         $blockInstance->assignMessageField('company_title', 'link_title_company_overview');
49 } elseif ($blockInstance->getValueInstance()->ifUserIsEmployee()) {
50         // User is employed in company
51         $blockInstance->assignMessageField('company_status', 'user_is_employed_in_company');
52         $blockInstance->assignLinkFieldWithAction('company' , 'employee_overview');
53         $blockInstance->assignMessageField('company', 'link_text_employee_overview');
54         $blockInstance->assignMessageField('company_title', 'link_title_employee_overview');
55 } else {
56         // No company participation!
57         $blockInstance->assignMessageField('company_status', 'user_not_assigned_company');
58         $blockInstance->assignLinkFieldWithAction('company' , 'company');
59         $blockInstance->assignMessageField('company', 'link_text_company');
60         $blockInstance->assignMessageField('company_title', 'link_title_company');
61 }
62
63 // Flush the content out to a template variable
64 $blockInstance->flushContent();
65
66 // Get helper instance
67 $linkInstance = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'logout'));
68
69 // Add action
70 $linkInstance->addActionLinkById('logout', 'logout');
71
72 // Flush the content
73 $linkInstance->flushContent();
74
75 // [EOC]
76 ?>
77 <div id="content_header">
78         Willkommen im Loginbereich von <span class="app_name">{?app_full_name?}</span>!
79 </div>
80
81 <div id="content_body">
82         {?login_content?}
83 </div>
84
85 <div id="persona_data" title="Informationen zu Deinem Spieleaccount">
86         <div id="persona_header">
87                 Account-Infos:
88         </div>
89
90         <div id="persona_body">
91                 {?persona_data?}
92         </div>
93
94         <div id="logout">
95                 {?logout?}
96         </div>
97 </div>
98
99 <div id="company_data" title="Informationen zu der aktuell ausgew&auml;hlten Reederei">
100         <div id="company_header">
101                 Reederei-Infos:
102         </div>
103
104         <div id="company_body">
105                 {?company_data?}
106         </div>
107 </div>