Login area - company page now with more stubs
authorRoland Häder <roland@mxchange.org>
Mon, 30 Jun 2008 20:24:58 +0000 (20:24 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 30 Jun 2008 20:24:58 +0000 (20:24 +0000)
application/ship-simu/main/actions/web/class_WebLoginCompanyAction.php
application/ship-simu/templates/de/code/action_login_company.ctp
application/ship-simu/templates/de/code/block_persona_data.ctp

index f3ffdcd050b8af2a62aec66929def240b3447122..30c6376fe84385756c858b7b3beaadd3511c4009 100644 (file)
@@ -61,9 +61,10 @@ class WebLoginCompanyAction extends BaseAction implements Commandable, Registera
         * @param       $requestInstance        An instance of a class with an Requestable interface
         * @param       $responseInstance       An instance of a class with an Responseable interface
         * @return      void
+        * @todo        Maybe add fetching company list of current user here?
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               $this->partialStub("Maybe add fetching company list here.");
+               // Unfinished method
        }
 
        /**
index a00b8cc9ec275300641175424afed66eb5fbff1b..2747805349d10adc7857a36fdfb69c8dae972538 100644 (file)
@@ -1,3 +1,40 @@
+<?php
+// Get a link helper instance
+$linkInstance = WebLinkHelper::createWebLinkHelper($this, 'company_links', 'index.php?app=ship-simu&amp;page=login_area');
+
+// Preftech the user data
+$linkInstance->prefetchValueInstance('user');
+
+// Maximum of allowed companies reached?
+if ($linkInstance->getValueInstance()->ifUserCreatedMaximumAllowedCompanies()) {
+       // No more companies allowed to create
+} elseif ($linkInstance->getValueInstance()->ifUserPointsEnougth('found_new_company')) {
+       // Enough money to found company
+} elseif ($linkInstance->getValueInstance()->ifUserPointsEnougth('write_applications')) {
+       // Enough money to write applications to other companies
+} elseif ($linkInstance->getValueInstance()->ifGovermentPaysStartupHelp()) {
+       // Display link to goverment for startup help
+} // END - if
+
+if ($linkInstance->getValueInstance()->ifUserAllowTakeCreditsFromMoneyBank()) {
+       // Display link to money bank page
+} elseif ($linkInstance->getValueInstance()->ifUserHasMaximumCreditsWithMoneyBank()) {
+       // Maximum credits reached which a money bank can lent
+} else {
+       // Money bank is closed!
+}
+
+if ($linkInstance->getValueInstance()->ifRefillPageActive()) {
+       // Display link to refill page
+} else {
+       // Refill page not active
+}
+
+// Flush content to the template
+$linkInstance->flushContent();
+
+// End of PHP commands
+?>
 <div class="table_header" id="list_company_header">
        Auflistung der Reedereien, an denenen du dich beteiligst:
 </div>
@@ -7,7 +44,5 @@
 </div>
 
 <div class="table_footer">
-       [<a href="$config[base_url]/index.php?app=ship-simu&amp;page=login_area&amp;action=new_company" title="Hier kannst du mit ausreichend Guthaben eine neue Reederei gr&uuml;nden.">Neue Reederei gr&uuml;nden</a>]&nbsp;-
-       [<a href="$config[base_url]/index.php?app=ship-simu&amp;page=login_area&amp;action=list_companies" title="Wenn du dich bei einer Reederei bewerben willst, versuche mal hier dein Gl&uuml;ck.">Reedereien auflisten</a>]&nbsp;-
-       [<a href="$config[base_url]/index.php?app=ship-simu&amp;page=login_area&amp;action=search_companies" title="Suche hier direkt nach einer Reederei anhand des Namens oder Firmenk&uuml;rzels.">Reederei suchen</a>]
+       {?company_links?}
 </div>
index f51077b0c0500dae9fdf2fca6742b4f3c9db71e1..b12393f6e39cc4c2d6122ce38e3543ee4b60ddcc 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Get a helper instance for the profile link (and maybe later more!)
-$helperInstance = WebLinkHelper::createWebLinkHelper($this, 'profile_link');
+$helperInstance = WebLinkHelper::createWebLinkHelper($this, 'profile_link', 'index.php?app=ship-simu&amp;page=login_area');
 
 // Prefetch user instance
 $helperInstance->prefetchValueInstance('user');