]> git.mxchange.org Git - shipsimu.git/blobdiff - application/shoutbox/templates/de/code/login_main.ctp
Shoutbox stub added (will be moved out later on)
[shipsimu.git] / application / shoutbox / templates / de / code / login_main.ctp
diff --git a/application/shoutbox/templates/de/code/login_main.ctp b/application/shoutbox/templates/de/code/login_main.ctp
new file mode 100644 (file)
index 0000000..df6c2ba
--- /dev/null
@@ -0,0 +1,96 @@
+<?php
+///////////////////////////////
+// Assign personal user data //
+///////////////////////////////
+
+// Get a new instance for personal data
+$blockInstance = WebBlockHelper::createWebBlockHelper($this, 'persona_data');
+
+// Set the data source instance which must exist in registry
+$blockInstance->prefetchValueInstance('user');
+
+// Assign fields with template variables
+$blockInstance->assignField('username');
+$blockInstance->assignFieldWithFilter('user_status', "user_status_translator");
+
+// Shall we include registration date?
+if ($blockInstance->ifIncludeRegistrationStamp()) {
+       // Then assign it as well!
+       $blockInstance->assignFieldWithFilter('registered', 'formatTimestamp');
+} // END - if
+
+// Flush the content out to a template variable
+$blockInstance->flushContent();
+
+//////////////////////////////////////
+// Assign the shipping company data //
+//////////////////////////////////////
+
+// Get a new instance for personal data
+$blockInstance = WebBlockHelper::createWebBlockHelper($this, 'company_data');
+
+// Set the data source instance
+$blockInstance->prefetchValueInstance('company', 'user');
+
+// Assign the company name
+if ($blockInstance->getValueInstance()->ifUserIsFounder()) {
+       // User is the founder of the company
+       $blockInstance->assignMessageField('company_status', "user_is_company_founder");
+       $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
+       $blockInstance->assignMessageField('company_link_text', "link_text_company_overview");
+       $blockInstance->assignMessageField('company_link_title', "link_title_company_overview");
+} elseif ($blockInstance->getValueInstance()->ifUserIsOwner()) {
+       // User owns the company
+       $blockInstance->assignMessageField('company_status', "user_is_company_owner");
+       $blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
+       $blockInstance->assignMessageField('company_link_text', "link_text_company_overview");
+       $blockInstance->assignMessageField('company_link_title', "link_title_company_overview");
+} elseif ($blockInstance->getValueInstance()->ifUserIsEmployee()) {
+       // User is employed in company
+       $blockInstance->assignMessageField('company_status', "user_is_employed_in_company");
+       $blockInstance->assignLinkFieldWithAction('company_link' , "employee_overview");
+       $blockInstance->assignMessageField('company_link_text', "link_text_employee_overview");
+       $blockInstance->assignMessageField('company_link_title', "link_title_employee_overview");
+} else {
+       // No company participation!
+       $blockInstance->assignMessageField('company_status', "user_not_assigned_company");
+       $blockInstance->assignLinkFieldWithAction('company_link' , "company");
+       $blockInstance->assignMessageField('company_link_text', "link_text_company");
+       $blockInstance->assignMessageField('company_link_title', "link_title_company");
+}
+
+// Flush the content out to a template variable
+$blockInstance->flushContent();
+
+// Get helper instance
+$helper = WebLinkHelper::createWebLinkHelper($this, 'logout_action_link', 'index.php?app={?app_short_name?}&amp;page=login_area');
+
+// Add action
+$helper->addActionLink('logout', "Ausloggen");
+
+// Flush the content
+$helper->flushContent();
+
+// End of all PHP commands
+?>
+<div id="content_header">
+       Willkommen im Loginbereich  von {?app_full_name?}!
+</div>
+
+<div id="content_body">
+       {?login_content?}
+</div>
+
+<div id="persona_data" title="Informationen zu Deinem Loginaccount">
+       <div id="persona_header">
+               Account-Infos:
+       </div>
+
+       <div id="persona_body">
+               {?persona_data?}
+       </div>
+
+       <div id="logout_link">
+               {?logout_action_link?}
+       </div>
+</div>