当前位置: 首页>>代码示例>>PHP>>正文


PHP CList::is_field方法代码示例

本文整理汇总了PHP中CList::is_field方法的典型用法代码示例。如果您正苦于以下问题:PHP CList::is_field方法的具体用法?PHP CList::is_field怎么用?PHP CList::is_field使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CList的用法示例。


在下文中一共展示了CList::is_field方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getListData

 protected function getListData()
 {
     $list = new CList($this->iblockId);
     $this->lists['FIELDS'] = $list->getFields();
     $this->lists['SELECT'] = array('ID', 'IBLOCK_ID', 'NAME', 'IBLOCK_SECTION_ID', 'CREATED_BY', 'BP_PUBLISHED');
     $this->lists['DATA'] = array();
     $this->lists['DATA']['NAME'] = Loc::getMessage('LISTS_SEAC_FIELD_NAME_DEFAULT');
     $this->lists['DATA']['IBLOCK_SECTION_ID'] = '';
     foreach ($this->lists['FIELDS'] as $fieldId => $field) {
         $this->lists['FIELDS'][$fieldId]['NAME'] = htmlspecialcharsbx($this->lists['FIELDS'][$fieldId]['NAME']);
         if ($list->is_field($fieldId)) {
             if ($fieldId == 'ACTIVE_FROM' || $fieldId == 'PREVIEW_PICTURE' || $fieldId == 'DETAIL_PICTURE') {
                 if ($field['DEFAULT_VALUE'] === '=now') {
                     $this->lists['DATA'][$fieldId] = ConvertTimeStamp(time() + CTimeZone::GetOffset(), 'FULL');
                 } elseif ($field['DEFAULT_VALUE'] === '=today') {
                     $this->lists['DATA'][$fieldId] = ConvertTimeStamp(time() + CTimeZone::GetOffset(), 'SHORT');
                 } else {
                     $this->lists['DATA'][$fieldId] = '';
                 }
             } else {
                 $this->lists['DATA'][$fieldId] = $field['DEFAULT_VALUE'];
             }
             $this->lists['SELECT'][] = $fieldId;
         } elseif (is_array($field['PROPERTY_USER_TYPE']) && array_key_exists('GetPublicEditHTML', $field['PROPERTY_USER_TYPE'])) {
             $this->lists['DATA'][$fieldId] = array('n0' => array('VALUE' => $field['DEFAULT_VALUE'], 'DESCRIPTION' => ''));
         } elseif ($field['PROPERTY_TYPE'] == 'L') {
             $this->lists['DATA'][$fieldId] = array();
             $propEnums = CIBlockProperty::getPropertyEnum($field['ID']);
             while ($enum = $propEnums->fetch()) {
                 if ($enum['DEF'] == 'Y') {
                     $this->lists['DATA'][$fieldId][] = $enum['ID'];
                 }
             }
         } elseif ($field['PROPERTY_TYPE'] == 'F') {
             $this->lists['DATA'][$fieldId] = array('n0' => array('VALUE' => $field['DEFAULT_VALUE'], 'DESCRIPTION' => ''));
         } elseif ($field['PROPERTY_TYPE'] == 'G' || $field['PROPERTY_TYPE'] == 'E') {
             $this->lists['DATA'][$fieldId] = array($field['DEFAULT_VALUE']);
         } else {
             $this->lists['DATA'][$fieldId] = array('n0' => array('VALUE' => $field['DEFAULT_VALUE'], 'DESCRIPTION' => ''));
             if ($field['MULTIPLE'] == 'Y') {
                 if (is_array($field['DEFAULT_VALUE']) || strlen($field['DEFAULT_VALUE'])) {
                     $this->lists['DATA'][$fieldId]['n1'] = array('VALUE' => '', 'DESCRIPTION' => '');
                 }
             }
         }
         if ($fieldId == 'CREATED_BY') {
             $this->lists['SELECT'][] = 'CREATED_USER_NAME';
         }
         if ($fieldId == 'MODIFIED_BY') {
             $this->lists['SELECT'][] = 'USER_NAME';
         }
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:53,代码来源:ajax.php

示例2: htmlspecialcharsbx

                }
                $data[$key] = $value;
            } else {
                $data[$key] = htmlspecialcharsbx($value);
            }
        }
        $data["~LIST_FIELD_EDIT_URL"] = str_replace(array("#list_id#", "#field_id#", "#group_id#"), array($arResult["IBLOCK_ID"], $ID, $arParams["SOCNET_GROUP_ID"]), $arParams["~LIST_FIELD_EDIT_URL"]);
        $data["LIST_FIELD_EDIT_URL"] = htmlspecialcharsbx($data["~LIST_FIELD_EDIT_URL"]);
        $aCols = array("TYPE" => $arResult["TYPES"][$data["TYPE"]], "NAME" => '<a target="_self" href="' . $data["LIST_FIELD_EDIT_URL"] . '">' . $data["NAME"] . '</a>');
        $aActions = array(array("ICONCLASS" => "edit", "TEXT" => GetMessage("CC_BLF_ACTION_MENU_EDIT"), "ONCLICK" => "jsUtils.Redirect(arguments, '" . CUtil::JSEscape($data["~LIST_FIELD_EDIT_URL"]) . "')", "DEFAULT" => true));
        if ($data["TYPE"] != "NAME") {
            $aActions[] = array("SEPARATOR" => true);
            $aActions[] = array("ICONCLASS" => "delete", "TEXT" => GetMessage("CC_BLF_ACTION_MENU_DELETE"), "ONCLICK" => "bxGrid_" . $arResult["GRID_ID"] . ".DeleteItem('" . $ID . "', '" . GetMessage("CC_BLF_ACTION_MENU_DELETE_CONF") . "')");
        }
        $aEditable = array();
        if ($obList->is_field($arField["TYPE"])) {
            $aEditable["MULTIPLE"] = false;
            $data["MULTIPLE"] = "N";
        }
        if ($obList->is_readonly($ID)) {
            $aEditable["IS_REQUIRED"] = false;
            $data["IS_REQUIRED"] = "N";
        } elseif ($ID == "NAME") {
            $aEditable["IS_REQUIRED"] = false;
            $data["IS_REQUIRED"] = "Y";
        }
        $arResult["ROWS"][] = array("id" => $ID, "data" => $data, "actions" => $aActions, "columns" => $aCols, "editable" => $aEditable);
    }
    $CACHE_MANAGER->EndTagCache();
    $this->EndResultCache();
}
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例3: intval

        $copy_id = intval($_REQUEST["copy_id"]);
    }
}
$arResult["COPY_ID"] = $copy_id;
$obList = new CList($arIBlock["ID"]);
$arResult["FIELDS"] = $obList->GetFields();
if ($bBizproc) {
    $arSelect = array("ID", "IBLOCK_ID", "NAME", "IBLOCK_SECTION_ID", "CREATED_BY", "BP_PUBLISHED");
} else {
    $arSelect = array("ID", "IBLOCK_ID", "NAME", "IBLOCK_SECTION_ID");
}
$arProps = array();
foreach ($arResult["FIELDS"] as $FIELD_ID => $arField) {
    $arResult["FIELDS"][$FIELD_ID]["~NAME"] = $arResult["FIELDS"][$FIELD_ID]["NAME"];
    $arResult["FIELDS"][$FIELD_ID]["NAME"] = htmlspecialcharsbx($arResult["FIELDS"][$FIELD_ID]["NAME"]);
    if ($obList->is_field($FIELD_ID)) {
        $arSelect[] = $FIELD_ID;
    } else {
        $arProps[] = $FIELD_ID;
    }
    if ($FIELD_ID == "CREATED_BY") {
        $arSelect[] = "CREATED_USER_NAME";
    }
    if ($FIELD_ID == "MODIFIED_BY") {
        $arSelect[] = "USER_NAME";
    }
}
$rsElement = CIBlockElement::GetList(array(), array("IBLOCK_ID" => $arResult["IBLOCK_ID"], "=ID" => $copy_id ? $copy_id : $arParams["ELEMENT_ID"]), false, false, $arSelect);
$arResult["ELEMENT"] = $rsElement->GetNextElement();
if (is_object($arResult["ELEMENT"])) {
    $arResult["ELEMENT_FIELDS"] = $arResult["ELEMENT"]->GetFields();
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php

示例4: unset

}
if (preg_match("/^(G|G:|E|E:)/", $data["TYPE"])) {
    $arResult["LINK_IBLOCKS"] = CLists::GetIBlocks($arParams["~IBLOCK_TYPE_ID"], !$arParams["CAN_EDIT"], $arParams["~SOCNET_GROUP_ID"]);
    if (substr($data["TYPE"], 0, 1) == "G") {
        unset($arResult["LINK_IBLOCKS"][$arResult["IBLOCK_ID"]]);
    }
}
$arResult["FORM_DATA"] = array();
foreach ($data as $key => $value) {
    $arResult["FORM_DATA"]["~" . $key] = $value;
    if (is_array($value)) {
        foreach ($value as $key1 => $value1) {
            $value[$key1] = htmlspecialcharsbx($value1);
        }
        $arResult["FORM_DATA"][$key] = $value;
    } else {
        $arResult["FORM_DATA"][$key] = htmlspecialcharsbx($value);
    }
}
$arResult["CAN_BE_MULTIPLE"] = !$obList->is_field($data["TYPE"]);
$arResult["CAN_BE_OPTIONAL"] = $data["TYPE"] != "NAME";
$arResult["IS_READ_ONLY"] = $arResult["FIELD_ID"] ? $obList->is_readonly($arResult["FIELD_ID"]) : CListFieldTypeList::GetByID($data["TYPE"])->IsReadonly();
$this->IncludeComponentTemplate();
if ($arResult["FIELD_ID"]) {
    $APPLICATION->SetTitle(GetMessage("CC_BLFE_TITLE_EDIT", array("#NAME#" => htmlspecialcharsex($arResult["FIELD"]["NAME"]))));
} else {
    $APPLICATION->SetTitle(GetMessage("CC_BLFE_TITLE_NEW"));
}
$APPLICATION->AddChainItem($arResult["IBLOCK"]["NAME"], $arResult["~LIST_URL"]);
$APPLICATION->AddChainItem(GetMessage("CC_BLFE_CHAIN_LIST_EDIT"), $arResult["~LIST_EDIT_URL"]);
$APPLICATION->AddChainItem(GetMessage("CC_BLFE_CHAIN_FIELDS"), $arResult["~LIST_FIELDS_URL"]);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例5: getElementFields

 protected function getElementFields($iblockId, $elementId)
 {
     $totalResult = array();
     $list = new CList($iblockId);
     $listFields = $list->getFields();
     foreach ($listFields as $fieldId => $field) {
         $totalResult[$fieldId] = $field;
     }
     $elementQuery = CIBlockElement::getList(array(), array("IBLOCK_ID" => $iblockId, "=ID" => $elementId), false, false, array('*'));
     $elementObject = $elementQuery->getNextElement();
     $elementNewData = $elementObject->getFields();
     if (is_array($elementNewData)) {
         foreach ($elementNewData as $fieldId => $fieldValue) {
             if (!$list->is_field($fieldId)) {
                 continue;
             }
             if (isset($totalResult[$fieldId]["NAME"])) {
                 $totalResult[$fieldId]["VALUE"] = $fieldValue;
             }
         }
     }
     $query = \CIblockElement::getPropertyValues($iblockId, array('ID' => $elementId));
     if ($propertyValues = $query->fetch()) {
         foreach ($propertyValues as $id => $values) {
             if ($id == "IBLOCK_ELEMENT_ID") {
                 continue;
             }
             $fieldId = "PROPERTY_" . $id;
             $totalResult[$fieldId]["VALUE"] = $values;
         }
     }
     return $totalResult;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:33,代码来源:class.php


注:本文中的CList::is_field方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。