e9e25d99136be8031b25a51f4abe9975d98cc92d
[shipsimu.git] / application / blog / 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');
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 = ObjectFactory::createObjectByConfiguredName('web_block_helper', array($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 // Get helper instance
66 $helper = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'logout_action_link', 'index.php?app={?app_short_name?}&amp;page=login_area'));
67
68 // Add action
69 $helper->addActionLink('logout', "Ausloggen");
70
71 // Flush the content
72 $helper->flushContent();
73
74 // [EOC]
75 ?>
76 <div id="content_header">
77         Willkommen im Loginbereich  von <span class=\"app_name\">{?app_full_name?}</span>!
78 </div>
79
80 <div id="content_body">
81         {?login_content?}
82 </div>
83
84 <div id="persona_data" title="Informationen zu Deinem Loginaccount">
85         <div id="persona_header">
86                 Account-Infos:
87         </div>
88
89         <div id="persona_body">
90                 {?persona_data?}
91         </div>
92
93         <div id="logout_link">
94                 {?logout_action_link?}
95         </div>
96 </div>