X-Git-Url: https://git.mxchange.org/?p=shipsimu.git;a=blobdiff_plain;f=application%2Fship-simu%2Ftemplates%2Fde%2Fcode%2Flogin_main.ctp;h=56adbab9a194936144e0488ca9e22ef1c17bda21;hp=b059c7f778ebb8b1d3286ebfff13843b58b2e6fa;hb=4f70843ae8428f051d70ccff5bb43fc4c03dda8d;hpb=d527a312ec4b2983fc0ecda2179ce335c1a5a1f9 diff --git a/application/ship-simu/templates/de/code/login_main.ctp b/application/ship-simu/templates/de/code/login_main.ctp index b059c7f..56adbab 100644 --- a/application/ship-simu/templates/de/code/login_main.ctp +++ b/application/ship-simu/templates/de/code/login_main.ctp @@ -1,26 +1,81 @@ prefetchValueInstance('user'); +$blockInstance->prefetchValueInstance('user', 'user_points'); // Assign fields with template variables $blockInstance->assignField('username'); +$blockInstance->assignFieldWithFilter('user_status', 'user_status_translator'); +$blockInstance->assignFieldWithFilter('points', 'format_number'); // Shall we include registration date? if ($blockInstance->ifIncludeRegistrationStamp()) { // Then assign it as well! - $blockInstance->assignFieldWithFilter('registered', 'formatTimestamp'); + $blockInstance->assignFieldWithFilter('registered', 'format_timestamp'); } // END - if // Flush the content out to a template variable $blockInstance->flushContent(); -// End of all PHP commands +////////////////////////////////////// +// Assign the shipping company data // +////////////////////////////////////// + +// Get a new instance for personal data +$blockInstance = ObjectFactory::createObjectByConfiguredName('web_block_helper', array($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' , 'company_overview'); + $blockInstance->assignMessageField('company', 'link_text_company_overview'); + $blockInstance->assignMessageField('company_title', 'link_title_company_overview'); +} elseif ($blockInstance->getValueInstance()->ifUserIsOwner()) { + // User owns the company + $blockInstance->assignMessageField('company_status', 'user_is_company_owner'); + $blockInstance->assignLinkFieldWithAction('company' , 'company_overview'); + $blockInstance->assignMessageField('company', 'link_text_company_overview'); + $blockInstance->assignMessageField('company_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' , 'employee_overview'); + $blockInstance->assignMessageField('company', 'link_text_employee_overview'); + $blockInstance->assignMessageField('company_title', 'link_title_employee_overview'); +} else { + // No company participation! + $blockInstance->assignMessageField('company_status', 'user_not_assigned_company'); + $blockInstance->assignLinkFieldWithAction('company' , 'company'); + $blockInstance->assignMessageField('company', 'link_text_company'); + $blockInstance->assignMessageField('company_title', 'link_title_company'); +} + +// Flush the content out to a template variable +$blockInstance->flushContent(); + +// Get helper instance +$linkInstance = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'logout')); + +// Add action +$linkInstance->addActionLinkById('logout', 'logout'); + +// Flush the content +$linkInstance->flushContent(); + +// [EOC] ?>
- Willkommen im Loginbereich von {?app_full_name?}! + Willkommen im Loginbereich von {?app_full_name?}!
@@ -36,9 +91,8 @@ $blockInstance->flushContent(); {?persona_data?}
-