當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CCrmFieldMulti::GetEntityName方法代碼示例

本文整理匯總了PHP中CCrmFieldMulti::GetEntityName方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCrmFieldMulti::GetEntityName方法的具體用法?PHP CCrmFieldMulti::GetEntityName怎麽用?PHP CCrmFieldMulti::GetEntityName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CCrmFieldMulti的用法示例。


在下文中一共展示了CCrmFieldMulti::GetEntityName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: strtoupper

	</span>
	<span class="crm-fld-icon crm-fld-icon-input"></span>
</span>');
$typeID = strtoupper($arResult['TYPE_ID']);
$readOnly = isset($arResult['READ_ONLY']) ? $arResult['READ_ONLY'] : false;
?>
<table cellspacing="0" cellpadding="0" border="0" class="bx-crm-view-fieldset-content-table">
<?php 
foreach ($arValues as $ID => &$arValue) {
    $valueType = $arValue['VALUE_TYPE'];
    $value = $arValue['VALUE'];
    $fieldID = "FM.{$typeID}.{$valueType}.{$ID}";
    ?>
	<tr>
		<td class="bx-field-name bx-padding"><?php 
    echo htmlspecialcharsbx(CCrmFieldMulti::GetEntityName($typeID, strtoupper($valueType), true));
    ?>
:</td>
		<td class="bx-field-value">
			<?php 
    if ($readOnly) {
        echo '<div class="crm-fld-block-readonly">', CCrmFieldMulti::GetTemplate($typeID, $valueType, $value), '</div>';
    } else {
        $templateType = '_INPUT_';
        $editorFieldType = strtolower($typeID);
        if ($typeID === 'PHONE' || $typeID === 'EMAIL' || $typeID === 'WEB') {
            $templateType = '_LINK_';
            if ($typeID === 'WEB' && $valueType !== 'WORK' && $valueType !== 'HOME' && $valueType !== 'OTHER') {
                $editorFieldType .= '-' . strtolower($valueType);
            }
        } elseif ($typeID === 'IM') {
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:31,代碼來源:template.php

示例2: CreateMultiFields

 public static function CreateMultiFields($fieldTypeID, &$fieldValues, &$formFields, $fieldParams = array(), $readOnlyMode = true)
 {
     $fieldTypeID = strtoupper(strval($fieldTypeID));
     if ($fieldTypeID === '' || !is_array($fieldValues) || count($fieldValues) === 0 || !is_array($formFields)) {
         return false;
     }
     if (!is_array($fieldParams)) {
         $fieldParams = array();
     }
     foreach ($fieldValues as $ID => &$data) {
         $valueType = isset($data['VALUE_TYPE']) ? strtoupper($data['VALUE_TYPE']) : '';
         $value = isset($data['VALUE']) ? $data['VALUE'] : '';
         $fieldID = "FM.{$fieldTypeID}.{$valueType}";
         $field = array('id' => $fieldID, 'name' => CCrmFieldMulti::GetEntityName($fieldTypeID, $valueType, true));
         if ($readOnlyMode) {
             $field['type'] = 'label';
             $field['value'] = CCrmFieldMulti::GetTemplate($fieldTypeID, $valueType, $value);
         } else {
             $templateType = 'INPUT';
             $editorFieldType = strtolower($fieldTypeID);
             if ($fieldTypeID === 'PHONE' || $fieldTypeID === 'EMAIL' || $fieldTypeID === 'WEB') {
                 $templateType = '_LINK_';
                 if ($fieldTypeID === 'WEB') {
                     if ($valueType !== 'WORK' && $valueType !== 'HOME' && $valueType !== 'OTHER') {
                         $editorFieldType .= '-' . strtolower($valueType);
                     }
                 }
             } elseif ($fieldTypeID === 'IM') {
                 $templateType = $valueType === 'SKYPE' || $valueType === 'ICQ' || $valueType === 'MSN' ? '_LINK_' : 'INPUT';
                 $editorFieldType .= '-' . strtolower($valueType);
             }
             $template = isset(self::$TEMPLATES[$templateType]) ? self::$TEMPLATES[$templateType] : '';
             if ($template === '') {
                 $field['type'] = 'label';
                 $field['value'] = CCrmFieldMulti::GetTemplate($fieldTypeID, $valueType, $value);
             } else {
                 $viewValue = $value;
                 if ($fieldTypeID === 'PHONE') {
                     $viewValue = CCrmCallToUrl::Format($value);
                 } elseif ($fieldTypeID === 'EMAIL') {
                     $viewValue = "mailto:{$value}";
                 } elseif ($fieldTypeID === 'WEB') {
                     if ($valueType === 'OTHER' || $valueType === 'WORK' || $valueType === 'HOME') {
                         $hasProto = preg_match('/^http(?:s)?:\\/\\/(.+)/', $value, $urlMatches) > 0;
                         if ($hasProto) {
                             $value = $urlMatches[1];
                         } else {
                             $viewValue = "http://{$value}";
                         }
                     } elseif ($valueType === 'FACEBOOK') {
                         $viewValue = "http://www.facebook.com/{$value}/";
                     } elseif ($valueType === 'TWITTER') {
                         $viewValue = "http://twitter.com/{$value}/";
                     } elseif ($valueType === 'LIVEJOURNAL') {
                         $viewValue = "http://{$value}.livejournal.com/";
                     }
                 } elseif ($fieldTypeID === 'IM') {
                     if ($valueType === 'SKYPE') {
                         $viewValue = "skype:{$value}?chat";
                     } elseif ($valueType === 'ICQ') {
                         $viewValue = "http://www.icq.com/people/{$value}/";
                     } elseif ($valueType === 'MSN') {
                         $viewValue = "msn:{$value}";
                     }
                 }
                 $field['type'] = 'custom';
                 $field['value'] = str_replace(array('#NAME#', '#FIELD_TYPE#', '#VALUE#', '#VIEW_VALUE#'), array($fieldID, htmlspecialcharsbx($editorFieldType), htmlspecialcharsbx($value), htmlspecialcharsbx($viewValue)), $template);
             }
         }
         $formFields[] = !empty($fieldParams) ? array_merge($field, $fieldParams) : $field;
     }
     unset($data);
     return true;
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:74,代碼來源:crm_component_helper.php


注:本文中的CCrmFieldMulti::GetEntityName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。