Merge branch 'master' of git.mxchange.org:/var/cache/git/repos/shipsimu
[shipsimu.git] / application / shipsimu / templates / de / code / action_ship_simu_login_company.ctp
1 <?php
2 // Get a link helper instance
3 $linkInstance = ObjectFactory::createObjectByConfiguredName('html_link_helper_class', array($this, 'list_companies'));
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 Reederei gr&uuml;nden, um dich 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 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', "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 // Checks wether the money bank has opened
47 if ($linkInstance->getValueInstance()->ifMoneyBankHasOpened()) {
48         // Add link group for money bank
49         $linkInstance->addLinkGroup('moneybank', "Leihe dir zu g&uuml;nstigen Zinsen Geld aus, wenn du mehr brauchst!");
50
51         // Add link to moneybank
52         if ($linkInstance->getValueInstance()->ifUserAllowedTakeCreditsFromMoneyBank()) {
53                 // Display link to money bank page
54                 $linkInstance->addActionLinkById('moneybank', 'virtual_money_bank');
55         } elseif ($linkInstance->getValueInstance()->ifUserHasMaximumCreditsWithMoneyBank()) {
56                 // Maximum credits reached which a money bank can lent
57                 $linkInstance->addLinkNote('moneybank_depleted', "Die Spielebank kann dir kein Geld mehr leihen, bitte zahle es auch wieder zur&uuml;ck.");
58                 $linkInstance->addActionLinkById('moneybank_payback_credits', 'payback_credits_to_money_bank');
59         } else {
60                 // Unexpected state of the bank
61                 $linkInstance->addLinkNote('moneybank_error', "Es wurde ein Fehler in der Spielebank erkannt. Bitte melde dies dem Support.");
62         }
63 } else {
64         // Money bank is closed!
65         $linkInstance->addLinkGroup('moneybank', "Die Spielebank hat geschlossen.");
66         $linkInstance->addLinkNote('moneybank_closed', "Die Spielebank hat derzeit geschlossen. Bitte sp&auml;ter nochmal versuchen.");
67 }
68
69 // Add link group for refill page
70 $linkInstance->addLinkGroup('refill_page', "Hole dir Geld von uns zu fairen Preisen!");
71
72 if ($linkInstance->ifRefillPageActive()) {
73         // Display link to refill page
74         $linkInstance->addActionLinkById('refill', 'refill_virtual_money');
75 } else {
76         // Refill page not active
77         $linkInstance->addLinkNote('refill_disabled', "Das Aufladen ist derzeit nicht m&ouml;glich oder gest&ouml;rt und wurde von uns deaktiviert.");
78 }
79
80 // Flush content to the template
81 $linkInstance->flushContent();
82
83 // [EOC]
84 ?>
85 <div class="table_main" id="list_companies">
86         <div class="table_header">
87                 Auflistung der Reedereien, an denenen du dich beteiligst:
88         </div>
89
90         <div class="table_list">
91                 {?company_list?}
92         </div>
93
94         <div class="table_footer">
95                 {?list_companies?}
96         </div>
97 </div>