2 // Get a link helper instance
3 $linkInstance = ObjectFactory::createObjectByConfiguredName('html_link_helper_class', array($this, 'list_companies'));
5 // Prefetch the user data
6 $linkInstance->prefetchValueInstance('user');
8 // Add link group for company founder
9 $linkInstance->addLinkGroup('company_founder', "Vielleicht willst du eine Reederei gründen, um dich selbstständig zu machen?");
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ündet. Bitte denke ü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');
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üssig bist!");
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');
30 // Can the government pay startup help?
31 if ($linkInstance->getValueInstance()->ifGovernmentPaysStartupHelp()) {
33 $linkInstance->addLinkNote('government_startup_help', "Starthilfe beantragen:");
35 // Display link to government for startup help
36 $linkInstance->addActionLinkById('government_startup_help', 'apply_startup_help_government');
38 } elseif ($linkInstance->getValueInstance()->ifGovernmentPaysStartupHelp()) {
39 // Display link to government for startup help
40 $linkInstance->addActionLinkById('government_startup_help', 'apply_startup_help_government');
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. :-)");
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ünstigen Zinsen Geld aus, wenn du mehr brauchst!");
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ück.");
58 $linkInstance->addActionLinkById('moneybank_payback_credits', 'payback_credits_to_money_bank');
60 // Unexpected state of the bank
61 $linkInstance->addLinkNote('moneybank_error', "Es wurde ein Fehler in der Spielebank erkannt. Bitte melde dies dem Support.");
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äter nochmal versuchen.");
69 // Add link group for refill page
70 $linkInstance->addLinkGroup('refill_page', "Hole dir Geld von uns zu fairen Preisen!");
72 if ($linkInstance->ifRefillPageActive()) {
73 // Display link to refill page
74 $linkInstance->addActionLinkById('refill', 'refill_virtual_money');
76 // Refill page not active
77 $linkInstance->addLinkNote('refill_disabled', "Das Aufladen ist derzeit nicht möglich oder gestört und wurde von uns deaktiviert.");
80 // Flush content to the template
81 $linkInstance->flushContent();
85 <div class="table_main" id="list_companies">
86 <div class="table_header">
87 Auflistung der Reedereien, an denenen du dich beteiligst:
90 <div class="table_list">
94 <div class="table_footer">