本文整理汇总了PHP中Vtiger_Language_Handler::getLanguageLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Language_Handler::getLanguageLabel方法的具体用法?PHP Vtiger_Language_Handler::getLanguageLabel怎么用?PHP Vtiger_Language_Handler::getLanguageLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Language_Handler
的用法示例。
在下文中一共展示了Vtiger_Language_Handler::getLanguageLabel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process(Vtiger_Request $request)
{
$mode = $request->get('mode');
if (!empty($mode)) {
$this->invokeExposedMethod($mode, $request);
return;
}
$recordModel = $this->saveRecord($request);
$settingsModuleModel = Settings_Users_Module_Model::getInstance();
$settingsModuleModel->refreshSwitchUsers();
$fieldModelList = $recordModel->getModule()->getFields();
$result = array();
foreach ($fieldModelList as $fieldName => $fieldModel) {
$fieldValue = $displayValue = Vtiger_Util_Helper::toSafeHTML($recordModel->get($fieldName));
if ($fieldModel->getFieldDataType() !== 'currency') {
$displayValue = $fieldModel->getDisplayValue($fieldValue, $recordModel->getId());
}
if ($fieldName == 'language') {
$displayValue = Vtiger_Language_Handler::getLanguageLabel($fieldValue);
}
if (($fieldName == 'currency_decimal_separator' || $fieldName == 'currency_grouping_separator') && $displayValue == ' ') {
$displayValue = vtranslate('LBL_SPACE', 'Users');
}
$result[$fieldName] = array('value' => $fieldValue, 'display_value' => $displayValue);
}
$result['_recordLabel'] = $recordModel->getName();
$result['_recordId'] = $recordModel->getId();
$response = new Vtiger_Response();
$response->setEmitType(Vtiger_Response::$EMIT_JSON);
$response->setResult($result);
$response->emit();
}
示例2: process
public function process(Vtiger_Request $request)
{
$mode = $request->get('mode');
if (!empty($mode)) {
$this->invokeExposedMethod($mode, $request);
return;
}
$recordModel = $this->saveRecord($request);
$fieldModelList = $recordModel->getModule()->getFields();
$result = array();
foreach ($fieldModelList as $fieldName => $fieldModel) {
$fieldValue = $displayValue = Vtiger_Util_Helper::toSafeHTML($recordModel->get($fieldName));
if ($fieldModel->getFieldDataType() !== 'currency') {
$displayValue = $fieldModel->getDisplayValue($fieldValue, $recordModel->getId());
}
if ($fieldName == 'language') {
$displayValue = Vtiger_Language_Handler::getLanguageLabel($fieldValue);
}
$result[$fieldName] = array('value' => $fieldValue, 'display_value' => $displayValue);
}
$result['_recordLabel'] = $recordModel->getName();
$result['_recordId'] = $recordModel->getId();
$response = new Vtiger_Response();
$response->setEmitType(Vtiger_Response::$EMIT_JSON);
$response->setResult($result);
$response->emit();
}
示例3: getDisplayValue
/**
* Function to retieve display value for a value
* @param <String> $value - value which need to be converted to display value
* @return <String> - converted display value
*/
public function getDisplayValue($value, $recordId = false)
{
if ($this->get('uitype') == 32) {
return Vtiger_Language_Handler::getLanguageLabel($value);
}
$fieldName = $this->getFieldName();
if (($fieldName == 'currency_decimal_separator' || $fieldName == 'currency_grouping_separator') && $value == ' ') {
return vtranslate('LBL_Space', 'Users');
}
return parent::getDisplayValue($value, $recordId);
}
示例4: getDisplayValue
/**
* Function to get the Display Value, for the current field type with given DB Insert Value
* @param <Object> $value
* @return <Object>
*/
public function getDisplayValue($value)
{
return Vtiger_Language_Handler::getLanguageLabel($value);
}
示例5: getDisplayValue
/**
* Function to retieve display value for a value
* @param <String> $value - value which need to be converted to display value
* @return <String> - converted display value
*/
public function getDisplayValue($value, $recordId = false)
{
if ($this->get('uitype') == 32) {
return Vtiger_Language_Handler::getLanguageLabel($value);
}
return parent::getDisplayValue($value, $recordId);
}
示例6: getDisplayValue
/**
* Function to get the Display Value, for the current field type with given DB Insert Value
* @param <Object> $value
* @return <Object>
*/
public function getDisplayValue($value, $record = false, $recordInstance = false, $rawText = false)
{
return Vtiger_Language_Handler::getLanguageLabel($value);
}