Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/languages/languages_item.php
Show First 20 Lines • Show All 188 Lines • ▼ Show 20 Line(s) | |||||
* @param mixed $id item id of keys->values hash to load item by | * @param mixed $id item id of keys->values hash to load item by | ||||
* @param string $id_field_name Optional parameter to load item by given Id field | * @param string $id_field_name Optional parameter to load item by given Id field | ||||
* @param bool $cachable cache this query result based on it's prefix serial | * @param bool $cachable cache this query result based on it's prefix serial | ||||
* @return bool True if item has been loaded, false otherwise | * @return bool True if item has been loaded, false otherwise | ||||
* @throws kRedirectException | * @throws kRedirectException | ||||
*/ | */ | ||||
public function Load($id, $id_field_name = null, $cachable = true) | public function Load($id, $id_field_name = null, $cachable = true) | ||||
{ | { | ||||
if ( $cachable && $this->IsTempTable() ) { | |||||
$cachable = false; | |||||
} | |||||
$default = false; | $default = false; | ||||
if ($id == 'default') { | if ($id == 'default') { | ||||
// domain based primary language | // domain based primary language | ||||
$default = true; | $default = true; | ||||
$id = $this->Application->siteDomainField('PrimaryLanguageId'); | $id = $this->Application->siteDomainField('PrimaryLanguageId'); | ||||
if ($id) { | if ($id) { | ||||
$res = parent::Load($id, $id_field_name, $cachable); | $res = parent::Load($id, $id_field_name, $cachable); | ||||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | |||||
$available_languages = $this->Application->siteDomainField('Languages'); | $available_languages = $this->Application->siteDomainField('Languages'); | ||||
if ($available_languages) { | if ($available_languages) { | ||||
return strpos($available_languages, '|' .$id . '|') !== false; | return strpos($available_languages, '|' .$id . '|') !== false; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
} | } | ||||
No newline at end of file |