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