Changeset View
Changeset View
Standalone View
Standalone View
branches/5.3.x/core/units/email_templates/email_template_tp.php
Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Line(s) | |||||
$field_options = $object->GetFieldOptions('RecipientType'); | $field_options = $object->GetFieldOptions('RecipientType'); | ||||
$virtual_field_options = $this->getUnitConfig()->getVirtualFieldByName('RecipientType'); | $virtual_field_options = $this->getUnitConfig()->getVirtualFieldByName('RecipientType'); | ||||
$field_options['options'] = $virtual_field_options['options']; | $field_options['options'] = $virtual_field_options['options']; | ||||
$object->SetFieldOptions('RecipientType', $field_options); | $object->SetFieldOptions('RecipientType', $field_options); | ||||
} | } | ||||
} | /** | ||||
No newline at end of file | * Determine if primary translation should be shown | ||||
* | |||||
* @param Array $params | |||||
* @return string | |||||
* @access protected | |||||
*/ | |||||
protected function ShowSourceLanguage($params) | |||||
{ | |||||
if ( $this->IsNewItem($params) ) { | |||||
return false; | |||||
} | |||||
$object = $this->getObject($params); | |||||
/* @var $object kDBItem */ | |||||
$ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | |||||
/* @var $ml_helper kMultiLanguageHelper */ | |||||
return !$ml_helper->editingInSourceLanguage($object->GetDBField('TranslateFromLanguage')); | |||||
} | |||||
/** | |||||
* Shows field label with %s replaced with source translation language | |||||
* | |||||
* @param Array $params | |||||
* @return string | |||||
* @access protected | |||||
*/ | |||||
protected function SourceLanguageTitle($params) | |||||
{ | |||||
$object = $this->getObject($params); | |||||
/* @var $object kDBItem */ | |||||
$ml_helper = $this->Application->recallObject('kMultiLanguageHelper'); | |||||
/* @var $ml_helper kMultiLanguageHelper */ | |||||
return $ml_helper->replaceSourceLanguage($object, $params['label']); | |||||
} | |||||
} |