64d88476eabb104422b6dbdadef97f137abb14fa
[shipsimu.git] / application / ship-simu / templates / de / code / action_ship_simu_login_company.ctp
1 <?php
2 // Get a link helper instance
3 $linkInstance = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'companys'));
4
5 // Prefetch the user data
6 $linkInstance->prefetchValueInstance('user');
7
8 // Add link group for company founder
9 $linkInstance->addLinkGroup('company_founder', "Vielleicht willst du eine virtuelle Reederei gr&uuml;nden, um dich virtuell selbstst&auml;ndig zu machen?");
10
11 // Maximum of allowed companies reached?
12 if ($linkInstance->getValueInstance()->ifUserCreatedMaximumAllowedCompanies()) {
13         // No more companies allowed to found
14         $linkInstance->addLinkNote('company_maximum', "Du hast zu viele Firmen gegr&uuml;ndet. Bitte denke &uuml;ber eine Fusion (Zusammenlegung) nach.");
15 } elseif ($linkInstance->getValueInstance()->ifUserHasRequiredPoints('found_new_company')) {
16         // Enough money to found company
17         $linkInstance->addActionLinkById('company_found', 'found_company');
18 }
19
20 // Add link group for government
21 $linkInstance->addLinkGroup('government', "Bewerbe dich bei anderen Firmen und hole dir eine Starthilfe vom virtuellen Staat ab wenn du nicht fl&uuml;ssig bist!");
22
23 if ($linkInstance->getValueInstance()->ifUserHasRequiredPoints('write_applications')) {
24         // Enough money to write applications to other companies
25         $linkInstance->addActionLinkById('company_list', 'list_company');
26 } elseif ($linkInstance->getValueInstance()->ifGovernmentPaysTraining()) {
27         // Government is able to pay a training in general
28         $linkInstance->addActionLinkById('government_training', 'list_training_by_government');
29
30         // Can the government pay startup help?
31         if ($linkInstance->getValueInstance()->ifGovernmentPaysStartupHelp()) {
32                 // Add link note
33                 $linkInstance->addLinkNote('government_startup_help', "Virtuelle Starthilfe beantragen:");
34
35                 // Display link to government for startup help
36                 $linkInstance->addActionLinkById('government_startup_help', 'apply_startup_help_government');
37         } // END - if
38 } elseif ($linkInstance->getValueInstance()->ifGovernmentPaysStartupHelp()) {
39         // Display link to government for startup help
40         $linkInstance->addActionLinkById('government_startup_help', 'apply_startup_help_government');
41 } else {
42         // Even government cannot help the gamer here
43         $linkInstance->addLinkNote('government_depleted', "Leider kann dir der Staat nicht mehr weiterhelfen, dich zu bewerben, da du zu oft Starthilfen erhalten hast oder ein Training absolviert hast. Hier muss aber noch weiter am Spiel gearbeitet werden. :-)");
44 }
45
46 // Add link group for money bank
47 $linkInstance->addLinkGroup('moneybank', "Leihe dir zu g&uuml;nstigen Zinsen virtuelles Geld aus, wenn du mehr brauchst!");
48
49 // Add link to moneybank
50 if ($linkInstance->getValueInstance()->ifUserAllowedTakeCreditsFromMoneyBank()) {
51         // Display link to money bank page
52         $linkInstance->addActionLinkById('moneybank', 'virtual_money_bank');
53 } elseif ($linkInstance->getValueInstance()->ifUserHasMaximumCreditsWithMoneyBank()) {
54         // Maximum credits reached which a money bank can lent
55         $linkInstance->addLinkNote('moneybank_depleted', "Die Bank kann dir kein Geld mehr leihen, bitte zahle es auch wieder zur&uuml;ck.");
56         $linkInstance->addActionLinkById('moneybank_payback_credits', 'payback_credits_to_money_bank');
57 } else {
58         // Money bank is closed!
59         $linkInstance->addLinkNote('moneybank_closed', "Die Bank hat derzeit geschlossen. Bitte sp&auml;ter nochmal versuchen.");
60 }
61
62 // Add link group for refill page
63 $linkInstance->addLinkGroup('refill_page', "Hole dir virtuelles Geld von uns zu fairen Preisen!");
64
65 if ($linkInstance->ifRefillPageActive()) {
66         // Display link to refill page
67         $linkInstance->addActionLinkById('refill', 'refill_virtual_money');
68 } else {
69         // Refill page not active
70         $linkInstance->addLinkNote('refill_disabled', "Das Aufladen ist derzeit nicht m&ouml;glich oder gest&ouml;rt und wurde von uns deaktiviert.");
71 }
72
73 // Flush content to the template
74 $linkInstance->flushContent();
75
76 // [EOC]
77 ?>
78 <div class="table_main" id="list_companies">
79         <div class="table_header">
80                 Auflistung der Reedereien, an denenen du dich beteiligst:
81         </div>
82
83         <div class="table_list">
84                 {?company_list?}
85         </div>
86
87         <div class="table_footer">
88                 {?companys?}
89         </div>
90 </div>