public function getLanguageFile($language_iso_code, __ActionIdentity $action_identity = null) { if ($action_identity != null) { $filename = $action_identity->getControllerCode() . '.ini'; } else { $filename = $this->_filename; } $return_value = $this->_language_dir . DIRECTORY_SEPARATOR . $language_iso_code . DIRECTORY_SEPARATOR . $filename; return $return_value; }
public function setActionIdentity(__ActionIdentity $action_identity) { //if the controller code is dynamic, meaning that it's a variable: if ($this->_controller_code_variable != null) { $this->setControllerCode($action_identity->getControllerCode()); } //if the action code is dynamic, meaning that it's a variable: if ($this->_action_code_variable != null) { $this->setActionCode($action_identity->getActionCode()); } }
/** * Set the parameters for controller + action by specifying an action identity (which contains both values) * * @param __ActionIdentity $action_identity */ public function setActionIdentity(__ActionIdentity $action_identity) { $this->addParameter(__ApplicationContext::getInstance()->getPropertyContent('REQUEST_CONTROLLER_CODE'), $action_identity->getControllerCode()); $this->addParameter(__ApplicationContext::getInstance()->getPropertyContent('REQUEST_ACTION_CODE'), $action_identity->getActionCode()); }
public function loadActionResources(__ActionIdentity $action_identity, $language_iso_code = null) { if ($language_iso_code == null) { $language_iso_code = __I18n::getInstance()->getLocale()->getLanguageIsoCode(); } $controller_code = $action_identity->getControllerCode(); $cache = __ApplicationContext::getInstance()->getCache(); $action_resources_key = '__ActionResources__' . $language_iso_code . '__' . $controller_code; $action_resources = $cache->getData($action_resources_key); if ($action_resources == null) { $action_resources = array(); $action_controller_definition = __ActionControllerResolver::getInstance()->getActionControllerDefinition($controller_code); $I18n_resource_groups = $action_controller_definition->getI18nResourceGroups(); if (count($I18n_resource_groups) == 0) { $I18n_resource_groups[] = $controller_code; } foreach ($I18n_resource_groups as $I18n_resource_group) { $resources_group_to_load = new __ActionIdentity($I18n_resource_group); foreach ($this->_resource_providers[PERSISTENCE_LEVEL_ACTION] as &$resource_provider) { $action_resources = $resource_provider->loadResources($language_iso_code, $resources_group_to_load) + $action_resources; } } $cache->setData($action_resources_key, $action_resources); } if (!key_exists($controller_code, $this->_loaded_action_codes)) { $this->_resource_table->addActionResources($action_resources, $action_identity, $language_iso_code); $this->_loaded_action_codes[$controller_code] = true; } return $action_resources; }