81d3c0abbc945b511cc28ba1b709ca7c4079bf5c
[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 = WebBlockHelper::createWebBlockHelper($this, 'persona_data');
8
9 // Set the data source instance which must exist in registry
10 $blockInstance->prefetchValueInstance('user');
11
12 // Assign fields with template variables
13 $blockInstance->assignField('username');
14 $blockInstance->assignFieldWithFilter('user_status', "user_status_translator");
15
16 // Shall we include registration date?
17 if ($blockInstance->ifIncludeRegistrationStamp()) {
18         // Then assign it as well!
19         $blockInstance->assignFieldWithFilter('registered', 'formatTimestamp');
20 } // END - if
21
22 // Flush the content out to a template variable
23 $blockInstance->flushContent();
24
25 //////////////////////////////////////
26 // Assign the shipping company data //
27 //////////////////////////////////////
28
29 // Get a new instance for personal data
30 $blockInstance = WebBlockHelper::createWebBlockHelper($this, 'company_data');
31
32 // Set the data source instance
33 $blockInstance->prefetchValueInstance('company', 'user');
34
35 // Assign the company name
36 if ($blockInstance->getValueInstance()->ifUserIsFounder()) {
37         // User is the founder of the company
38         $blockInstance->assignMessageField('company_status', "user_is_company_founder");
39         $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
40         $blockInstance->assignMessageField('company_link_text', "link_text_company_overview");
41         $blockInstance->assignMessageField('company_link_title', "link_title_company_overview");
42 } elseif ($blockInstance->getValueInstance()->ifUserIsOwner()) {
43         // User owns the company
44         $blockInstance->assignMessageField('company_status', "user_is_company_owner");
45         $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
46         $blockInstance->assignMessageField('company_link_text', "link_text_company_overview");
47         $blockInstance->assignMessageField('company_link_title', "link_title_company_overview");
48 } elseif ($blockInstance->getValueInstance()->ifUserIsEmployee()) {
49         // User is employed in company
50         $blockInstance->assignMessageField('company_status', "user_is_employed_in_company");
51         $blockInstance->assignLinkFieldWithAction('company_link' , "employee_overview");
52         $blockInstance->assignMessageField('company_link_text', "link_text_employee_overview");
53         $blockInstance->assignMessageField('company_link_title', "link_title_employee_overview");
54 } else {
55         // No company participation!
56         $blockInstance->assignMessageField('company_status', "user_not_assigned_company");
57         $blockInstance->assignLinkFieldWithAction('company_link' , "company");
58         $blockInstance->assignMessageField('company_link_text', "link_text_company");
59         $blockInstance->assignMessageField('company_link_title', "link_title_company");
60 }
61
62 // Flush the content out to a template variable
63 $blockInstance->flushContent();
64
65 // End of all PHP commands
66 ?>
67 <div id="content_header">
68         Willkommen im Loginbereich  von {?app_full_name?}!
69 </div>
70
71 <div id="content_body">
72         {?login_content?}
73 </div>
74
75 <div id="persona_data" title="Informationen zu Deinem Spieleaccount">
76         <div id="persona_header">
77                 Account-Infos:
78         </div>
79
80         <div id="persona_body">
81                 {?persona_data?}
82         </div>
83
84         <div id="logout_link">
85                 [<a href="$config[base_url]/index.php?app=ship-simu&amp;page=login_area&amp;action=logout"
86                  title="Aus dem Spiel ausloggen">Ausloggen</a>]
87         </div>
88 </div>
89
90 <div id="company_data" title="Informationen zu der aktuell ausgew&auml;hlten Reederei">
91         <div id="company_header">
92                 Reederei-Infos:
93         </div>
94
95         <div id="company_body">
96                 {?company_data?}
97         </div>
98 </div>