当前位置: 首页>>代码示例>>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;未经允许,请勿转载。