application/ship-simu/starter.php -text
application/ship-simu/templates/.htaccess -text
application/ship-simu/templates/de/.htaccess -text
+application/ship-simu/templates/de/code/block_company_data.ctp -text
application/ship-simu/templates/de/code/block_persona_data.ctp -text
application/ship-simu/templates/de/code/captch_graphic_code.ctp -text
application/ship-simu/templates/de/code/footer.ctp -text
return $participates;
}
+ /**
+ * Checks wether the current user in registry is the company founder
+ *
+ * @return $isFounder Wether the current user is the company founder
+ */
+ public function ifUserIsFounder () {
+ // Default is not the founder
+ $isFounder = false;
+
+ // Get result instance
+ $resultInstance = $this->getResultInstance();
+
+ // Is it set?
+ if ($resultInstance instanceof SearchableResult) {
+ // Result found so analyse it
+ $this->partialStub("Check if user is company founder.");
+ } // END - if
+
+ // Return result
+ return $isFounder;
+ }
+
+ /**
+ * Checks wether the current user in registry is the company owner
+ *
+ * @return $isOwner Wether the current user is the company owner
+ */
+ public function ifUserIsOwner () {
+ // Default is not the owner
+ $isOwner = false;
+
+ // Get result instance
+ $resultInstance = $this->getResultInstance();
+
+ // Is it set?
+ if ($resultInstance instanceof SearchableResult) {
+ // Result found so analyse it
+ $this->partialStub("Check if user is company owner.");
+ } // END - if
+
+ // Return result
+ return $isOwner;
+ }
+
+ /**
+ * Checks wether the current user in registry is an employee in this company
+ *
+ * @return $isOwner Wether the current user is an employee in this company
+ */
+ public function ifUserIsEmployee () {
+ // Default is no employee
+ $isEmployee = false;
+
+ // Get result instance
+ $resultInstance = $this->getResultInstance();
+
+ // Is it set?
+ if ($resultInstance instanceof SearchableResult) {
+ // Result found so he is employee
+ $isEmployee = true;
+ } // END - if
+
+ // Return result
+ return $isEmployee;
+ }
+
//----------------------------------------------------------------------------
// From here is very old code which needs to be translated and changed heavily
//----------------------------------------------------------------------------
--- /dev/null
+<div class="gamer_name_div">
+ Firmenstatus: <span class="company_status">{?company_status?}</span>
+</div>
+<div class="gamer_profile_div">
+ <a href="$config[base_url]/index.php?app=ship-simu&page=login_area&action={?company_link_action?}"
+ title="{?company_link_title?}">{?company_link_text?}</a>
+</div>
$helperInstance->prefetchValueInstance('user');
// Flush the content out
-$helperInstance->flushContent();
+//$helperInstance->flushContent();
// End of PHP commands
?>
// Assign the company name
if ($blockInstance->getValueInstance()->ifUserIsFounder()) {
// User is the founder of the company
- $blockInstance->assignMessageField('company_stats', "user_is_company_founder");
+ $blockInstance->assignMessageField('company_status', "user_is_company_founder");
$blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
+ $blockInstance->assignMessageField('company_link_text', "link_text_company_overview");
+ $blockInstance->assignMessageField('company_link_title', "link_title_company_overview");
} elseif ($blockInstance->getValueInstance()->ifUserIsOwner()) {
// User owns the company
- $blockInstance->assignMessageField('company_stats', "user_is_company_owner");
+ $blockInstance->assignMessageField('company_status', "user_is_company_owner");
$blockInstance->assignLinkFieldWithAction('company_link' , "company_overview");
+ $blockInstance->assignMessageField('company_link_text', "link_text_company_overview");
+ $blockInstance->assignMessageField('company_link_title', "link_title_company_overview");
} elseif ($blockInstance->getValueInstance()->ifUserIsEmployee()) {
// User is employed in company
- $blockInstance->assignMessageField('company_stats', "user_is_employed_in_company");
+ $blockInstance->assignMessageField('company_status', "user_is_employed_in_company");
$blockInstance->assignLinkFieldWithAction('company_link' , "employee_overview");
+ $blockInstance->assignMessageField('company_link_text', "link_text_employee_overview");
+ $blockInstance->assignMessageField('company_link_title', "link_title_employee_overview");
} else {
// No company participation!
- $blockInstance->assignMessageField('company_stats', "user_not_assigned_company");
+ $blockInstance->assignMessageField('company_status', "user_not_assigned_company");
$blockInstance->assignLinkFieldWithAction('company_link' , "found_new_company");
+ $blockInstance->assignMessageField('company_link_text', "link_text_new_company");
+ $blockInstance->assignMessageField('company_link_title', "link_title_new_company");
}
// Flush the content out to a template variable
return $withRegistration;
}
+ /**
+ * Assignes a template variable with a message from a given message id
+ *
+ * @param $templateVariable Template variable to assign
+ * @param $messageId Message id to load an assign
+ * @return void
+ */
+ public function assignMessageField ($templateVariable, $messageId) {
+ // Get message
+ $message = $this->getLanguageInstance()->getMessage($messageId);
+
+ // And assign it
+ $this->getTemplateInstance()->assignVariable($templateVariable, $message);
+ }
+
+ /**
+ * Assigns a link field with a given value
+ *
+ * @param $linkField "Link field" (variable) to assign
+ * @param $actionValue Action value to assign
+ * @return void
+ */
+ public function assignLinkFieldWithAction ($linkField, $actionValue) {
+ $this->getTemplateInstance()->assignVariable($linkField . '_action', $actionValue);
+ }
+
/**
* Flush the content out,e g. to a template variable
*