2 ///////////////////////////////
3 // Assign personal user data //
4 ///////////////////////////////
6 // Get a new instance for personal data
7 $blockInstance = WebBlockHelper::createWebBlockHelper($this, 'persona_data');
9 // Set the data source instance which must exist in registry
10 $blockInstance->prefetchValueInstance('user');
12 // Assign fields with template variables
13 $blockInstance->assignField('username');
15 // Shall we include registration date?
16 if ($blockInstance->ifIncludeRegistrationStamp()) {
17 // Then assign it as well!
18 $blockInstance->assignFieldWithFilter('registered', 'formatTimestamp');
21 // Flush the content out to a template variable
22 $blockInstance->flushContent();
24 //////////////////////////////////////
25 // Assign the shipping company data //
26 //////////////////////////////////////
28 // Get a new instance for personal data
29 $blockInstance = WebBlockHelper::createWebBlockHelper($this, 'company_data');
31 // Set the data source instance
32 $blockInstance->prefetchValueInstance('company', 'user');
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");
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");
61 // Flush the content out to a template variable
62 $blockInstance->flushContent();
64 // End of all PHP commands
66 <div id="content_header">
67 Willkommen im Loginbereich von {?app_full_name?}!
70 <div id="content_body">
74 <div id="persona_data" title="Informationen zu Deinem Spieleaccount">
75 <div id="persona_header">
79 <div id="persona_body">
83 <div id="logout_link">
84 [<a href="$config[base_url]/index.php?app=ship-simu&page=login_area&action=logout"
85 title="Aus dem Spiel ausloggen">Ausloggen</a>]
89 <div id="company_data" title="Informationen zu der aktuell ausgewählten Reederei">
90 <div id="company_header">
94 <div id="company_body">