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_stats', "user_is_company_founder");
38 $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
39 } elseif ($blockInstance->getValueInstance()->ifUserIsOwner()) {
40 // User owns the company
41 $blockInstance->assignMessageField('company_stats', "user_is_company_owner");
42 $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
43 } elseif ($blockInstance->getValueInstance()->ifUserIsEmployee()) {
44 // User is employed in company
45 $blockInstance->assignMessageField('company_stats', "user_is_employed_in_company");
46 $blockInstance->assignLinkFieldWithAction('company_link' , "employee_overview");
48 // No company participation!
49 $blockInstance->assignMessageField('company_stats', "user_not_assigned_company");
50 $blockInstance->assignLinkFieldWithAction('company_link' , "found_new_company");
53 // Flush the content out to a template variable
54 $blockInstance->flushContent();
56 // End of all PHP commands
58 <div id="content_header">
59 Willkommen im Loginbereich von {?app_full_name?}!
62 <div id="content_body">
66 <div id="persona_data" title="Informationen zu Deinem Spieleaccount">
67 <div id="persona_header">
71 <div id="persona_body">
75 <div id="logout_link">
76 [<a href="$config[base_url]/index.php?app=ship-simu&page=login_area&action=logout"
77 title="Aus dem Spiel ausloggen">Ausloggen</a>]
81 <div id="company_data" title="Informationen zu der aktuell ausgewählten Reederei">
82 <div id="company_header">
86 <div id="company_body">