本文整理汇总了PHP中CIBlock::GetMessages方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlock::GetMessages方法的具体用法?PHP CIBlock::GetMessages怎么用?PHP CIBlock::GetMessages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlock
的用法示例。
在下文中一共展示了CIBlock::GetMessages方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetPropertyFieldHtmlMulty
public function GetPropertyFieldHtmlMulty($arProperty, $arValues, $strHTMLControlName)
{
global $APPLICATION;
$arSettings = self::PrepareSettings($arProperty);
$arSymbols = self::GetSymbols($arSettings);
$strResult = '';
if (isset($strHTMLControlName['MODE']) && 'iblock_element_admin' == $strHTMLControlName['MODE']) {
$arResult = false;
foreach ($arValues as $intPropertyValueID => $arOneValue) {
$mxElement = self::GetPropertyValue($arProperty, $arOneValue);
if (is_array($mxElement)) {
$arResult[] = '<input type="text" name="' . $strHTMLControlName["VALUE"] . '[' . $intPropertyValueID . ']" id="' . $strHTMLControlName["VALUE"] . '[' . $intPropertyValueID . ']" value="' . $arOneValue['VALUE'] . '" size="5">' . '<input type="button" value="..." onClick="jsUtils.OpenWindow(\'iblock_element_search.php?lang=' . LANGUAGE_ID . '&IBLOCK_ID=' . $arProperty["LINK_IBLOCK_ID"] . '&n=' . urlencode($strHTMLControlName["VALUE"] . '[' . $intPropertyValueID . ']') . '\', 800, 600);">' . ' <span id="sp_' . $strHTMLControlName["VALUE"] . '[' . $intPropertyValueID . ']" >' . $mxElement['NAME'] . '</span>';
}
}
if ((int) $arProperty['MULTIPLE_CNT'] > 0) {
for ($i = 0; $i < $arProperty['MULTIPLE_CNT']; $i++) {
$arResult[] = '<input type="text" name="' . $strHTMLControlName["VALUE"] . '[n' . $i . ']" id="' . $strHTMLControlName["VALUE"] . '[n' . $i . ']" value="" size="5">' . '<input type="button" value="..." onClick="jsUtils.OpenWindow(\'iblock_element_search.php?lang=' . LANGUAGE_ID . '&IBLOCK_ID=' . $arProperty["LINK_IBLOCK_ID"] . '&n=' . urlencode($strHTMLControlName["VALUE"] . '[n' . $i . ']') . '\', 800, 600);">' . ' <span id="sp_' . $strHTMLControlName["VALUE"] . '[n' . $i . ']" ></span>';
}
}
$strResult = implode('<br />', $arResult);
} else {
$mxResultValue = self::GetValueForAutoCompleteMulti($arProperty, $arValues, $arSymbols['BAN_SYM'], $arSymbols['REP_SYM']);
$strResultValue = is_array($mxResultValue) ? htmlspecialcharsback(implode("\n", $mxResultValue)) : '';
ob_start();
$strRandControlID = $strHTMLControlName["VALUE"] . '_' . mt_rand(0, 10000);
$control_id = $APPLICATION->IncludeComponent("bitrix:main.lookup.input", "iblockedit", array("CONTROL_ID" => preg_replace("/[^a-zA-Z0-9_]/i", "x", $strRandControlID), "INPUT_NAME" => $strHTMLControlName['VALUE'] . '[]', "INPUT_NAME_STRING" => "inp_" . $strHTMLControlName['VALUE'], "INPUT_VALUE_STRING" => $strResultValue, "START_TEXT" => Loc::getMessage('BT_UT_EAUTOCOMPLETE_MESS_INVITE'), "MULTIPLE" => $arProperty["MULTIPLE"], "MAX_WIDTH" => $arSettings['MAX_WIDTH'], "MIN_HEIGHT" => $arSettings['MIN_HEIGHT'], "MAX_HEIGHT" => $arSettings['MAX_HEIGHT'], "IBLOCK_ID" => $arProperty["LINK_IBLOCK_ID"], 'BAN_SYM' => $arSymbols['BAN_SYM_STRING'], 'REP_SYM' => $arSymbols['REP_SYM_STRING'], 'FILTER' => 'Y'), null, array("HIDE_ICONS" => "Y"));
if ($arSettings['VIEW'] == 'T') {
$name = $APPLICATION->IncludeComponent('bitrix:main.tree.selector', 'iblockedit', array("INPUT_NAME" => $strHTMLControlName['VALUE'], 'ONSELECT' => 'jsMLI_' . $control_id . '.SetValue', 'MULTIPLE' => $arProperty["MULTIPLE"], 'SHOW_INPUT' => 'N', 'SHOW_BUTTON' => 'Y', 'GET_FULL_INFO' => 'Y', "START_TEXT" => Loc::getMessage("BT_UT_EAUTOCOMPLETE_MESS_LIST_INVITE"), 'BUTTON_CAPTION' => Loc::getMessage('BT_UT_EAUTOCOMPLETE_MESS_CHOOSE_ELEMENT'), 'BUTTON_TITLE' => Loc::getMessage('BT_UT_EAUTOCOMPLETE_MESS_CHOOSE_ELEMENT_MULTI_DESCR'), "NO_SEARCH_RESULT_TEXT" => Loc::getMessage("BT_UT_EAUTOCOMPLETE_MESS_NO_SEARCH_RESULT_TEXT"), "IBLOCK_ID" => $arProperty["LINK_IBLOCK_ID"], 'BAN_SYM' => $arSymbols['BAN_SYM_STRING'], 'REP_SYM' => $arSymbols['REP_SYM_STRING']), null, array("HIDE_ICONS" => "Y"));
} elseif ($arSettings['VIEW'] == 'E') {
?>
<input style="float: left; margin-right: 10px; margin-top: 5px;" type="button" value="<?php
echo Loc::getMessage('BT_UT_EAUTOCOMPLETE_MESS_SEARCH_ELEMENT');
?>
"
title="<?php
echo Loc::getMessage('BT_UT_EAUTOCOMPLETE_MESS_SEARCH_ELEMENT_MULTI_DESCR');
?>
"
onclick="jsUtils.OpenWindow('/bitrix/admin/iblock_element_search.php?lang=<?php
echo LANGUAGE_ID;
?>
&IBLOCK_ID=<?php
echo $arProperty["LINK_IBLOCK_ID"];
?>
&n=&k=&m=y&lookup=<?php
echo 'jsMLI_' . $control_id;
?>
', 900, 600);"><?php
}
if ($arProperty['USER_TYPE_SETTINGS']['SHOW_ADD'] == 'Y') {
if ($arSettings['IBLOCK_MESS'] == 'Y') {
$arLangMess = CIBlock::GetMessages($arProperty["LINK_IBLOCK_ID"]);
$strButtonCaption = $arLangMess['ELEMENT_ADD'];
if ('' == $strButtonCaption) {
$strButtonCaption = Loc::getMessage('BT_UT_EAUTOCOMPLETE_MESS_NEW_ELEMENT');
}
} else {
$strButtonCaption = Loc::getMessage('BT_UT_EAUTOCOMPLETE_MESS_NEW_ELEMENT');
}
?>
<input type="button" style="margin-top: 5px;" value="<?php
echo htmlspecialcharsbx($strButtonCaption);
?>
"
title="<?php
echo Loc::getMessage('BT_UT_EAUTOCOMPLETE_MESS_NEW_ELEMENT_DESCR');
?>
"
onclick="jsUtils.OpenWindow('<?php
echo '/bitrix/admin/' . CIBlock::GetAdminElementEditLink($arProperty["LINK_IBLOCK_ID"], null, array('menu' => null, 'IBLOCK_SECTION_ID' => -1, 'find_section_section' => -1, 'lookup' => 'jsMLI_' . $control_id));
?>
', 900, 600);"
><?php
}
$strResult = ob_get_contents();
ob_end_clean();
}
return $strResult;
}
示例2: foreach
echo $r["ID"];
?>
"></span>
</td>
</tr>
<?php
}
?>
<?php
}
?>
<?php
}
//if(CIBlockRights::UserHasRightTo($ID, $ID, "iblock_rights_edit"))
$tabControl->BeginNextTab();
$arMessages = CIBlock::GetMessages($ID);
if ($bVarsFromForm) {
foreach ($arMessages as $MESSAGE_ID => $MESSAGE_TEXT) {
$arMessages[$MESSAGE_ID] = $_REQUEST[$MESSAGE_ID];
}
}
if ($arIBTYPE["SECTIONS"] == "Y") {
?>
<tr>
<td width="40%"><?php
echo GetMessage("IB_E_SECTIONS_NAME");
?>
</td>
<td width="60%">
<input type="text" name="SECTIONS_NAME" size="40" maxlength="100" value="<?php
echo htmlspecialcharsbx($arMessages["SECTIONS_NAME"]);
示例3: GetMessage
if ($arResult["Step"] <= 0) {
$arResult["Step"] = 1;
}
if ($arResult["Step"] > 1 && !check_bitrix_sessid()) {
$arResult["Step"] = 1;
$arResult["ErrorMessage"] .= GetMessage("BPWC_WNC_SESSID") . ". ";
}
$runtime = CBPRuntime::GetRuntime();
$runtime->StartRuntime();
$documentService = $runtime->GetService("DocumentService");
$arResult["DocumentFields"] = $documentService->GetDocumentFields(array("bizproc", "CBPVirtualDocument", "type_" . intval($arParams["BLOCK_ID"])));
$arResult["Data"] = array("Name" => "", "Description" => "", "FilterableFields" => array(), "VisibleFields" => array(), "Sort" => 100, "Image" => 0, "ElementAdd" => GetMessage("BPWC_WNC_PNADD"), "UserGroups" => array(2), "Template" => "", "TemplateVariables" => array(), "ComponentTemplates" => array());
if ($arParams["BLOCK_ID"] > 0) {
$db = CIBlock::GetList(array(), array("ID" => $arParams["BLOCK_ID"], "TYPE" => $arParams["IBLOCK_TYPE"], "ACTIVE" => "Y"));
if ($ar = $db->Fetch()) {
$arMessagesTmp = CIBlock::GetMessages($ar["ID"]);
$arG = array();
$arP = CIBlock::GetGroupPermissions($ar["ID"]);
foreach ($arP as $key => $value) {
if ($value == "R") {
$arG[] = $key;
}
}
$v1 = $ar["DESCRIPTION"];
$v2 = array();
$v3 = array();
$v5 = array();
if (strlen($ar["DESCRIPTION"]) > 0 && substr($ar["DESCRIPTION"], 0, strlen("v2:")) == "v2:") {
$v4 = @unserialize(substr($ar["DESCRIPTION"], 3));
if (is_array($v4)) {
$v1 = $v4["DESCRIPTION"];
示例4: StartExportCatalog
function StartExportCatalog($with_metadata = true, $changes_only = false)
{
if ($this->next_step["catalog"]) {
fwrite($this->fp, "\t<" . GetMessage("IBLOCK_XML2_OFFER_LIST") . ">\n");
} else {
fwrite($this->fp, "\t<" . GetMessage("IBLOCK_XML2_CATALOG") . ">\n");
}
if ($this->PRODUCT_IBLOCK_ID) {
$xml_id = $this->GetIBlockXML_ID($this->PRODUCT_IBLOCK_ID, CIBlock::GetArrayByID($this->PRODUCT_IBLOCK_ID, "XML_ID"));
} else {
$xml_id = $this->GetIBlockXML_ID($this->arIBlock["ID"], $this->arIBlock["XML_ID"]);
}
$this->arIBlock["XML_ID"] = $xml_id;
fwrite($this->fp, $this->formatXMLNode(2, GetMessage("IBLOCK_XML2_ID"), $xml_id));
if ($with_metadata) {
fwrite($this->fp, $this->formatXMLNode(2, GetMessage("IBLOCK_XML2_METADATA_ID"), $xml_id));
fwrite($this->fp, $this->formatXMLNode(2, GetMessage("IBLOCK_XML2_NAME"), $this->arIBlock["NAME"]));
if (strlen($this->arIBlock["DESCRIPTION"]) > 0) {
fwrite($this->fp, $this->formatXMLNode(2, GetMessage("IBLOCK_XML2_DESCRIPTION"), FormatText($this->arIBlock["DESCRIPTION"], $this->arIBlock["DESCRIPTION_TYPE"])));
}
if ($this->bExtended) {
fwrite($this->fp, $this->formatXMLNode(2, GetMessage("IBLOCK_XML2_BX_CODE"), $this->arIBlock["CODE"]) . $this->formatXMLNode(2, GetMessage("IBLOCK_XML2_BX_SORT"), intval($this->arIBlock["SORT"])) . $this->formatXMLNode(2, GetMessage("IBLOCK_XML2_BX_LIST_URL"), $this->arIBlock["LIST_PAGE_URL"]) . $this->formatXMLNode(2, GetMessage("IBLOCK_XML2_BX_DETAIL_URL"), $this->arIBlock["DETAIL_PAGE_URL"]) . $this->formatXMLNode(2, GetMessage("IBLOCK_XML2_BX_SECTION_URL"), $this->arIBlock["SECTION_PAGE_URL"]) . $this->formatXMLNode(2, GetMessage("IBLOCK_XML2_BX_CANONICAL_URL"), $this->arIBlock["CANONICAL_PAGE_URL"]) . $this->formatXMLNode(2, GetMessage("IBLOCK_XML2_BX_PICTURE"), $this->ExportFile($this->arIBlock["PICTURE"])) . $this->formatXMLNode(2, GetMessage("IBLOCK_XML2_BX_INDEX_ELEMENTS"), $this->arIBlock["INDEX_ELEMENT"] == "Y" ? "true" : "false") . $this->formatXMLNode(2, GetMessage("IBLOCK_XML2_BX_INDEX_SECTIONS"), $this->arIBlock["INDEX_SECTION"] == "Y" ? "true" : "false") . $this->formatXMLNode(2, GetMessage("IBLOCK_XML2_BX_WORKFLOW"), $this->arIBlock["WORKFLOW"] == "Y" ? "true" : "false"));
fwrite($this->fp, "\t\t<" . GetMessage("IBLOCK_XML2_LABELS") . ">\n");
$arLabels = CIBlock::GetMessages($this->arIBlock["ID"]);
foreach ($arLabels as $id => $label) {
fwrite($this->fp, $this->formatXMLNode(3, GetMessage("IBLOCK_XML2_LABEL"), array(GetMessage("IBLOCK_XML2_ID") => $id, GetMessage("IBLOCK_XML2_VALUE") => $label)));
}
fwrite($this->fp, "\t\t</" . GetMessage("IBLOCK_XML2_LABELS") . ">\n");
$iblockTemplates = new \Bitrix\Iblock\InheritedProperty\IblockTemplates($this->arIBlock["ID"]);
$this->exportInheritedTemplates(2, $iblockTemplates);
}
}
if ($with_metadata || $this->only_price) {
$this->ExportPrices();
}
if ($changes_only) {
fwrite($this->fp, $this->formatXMLNode(2, GetMessage("IBLOCK_XML2_UPDATE_ONLY"), "true"));
}
if ($this->next_step["catalog"]) {
fwrite($this->fp, "\t\t<" . GetMessage("IBLOCK_XML2_OFFERS") . ">\n");
} else {
fwrite($this->fp, "\t\t<" . GetMessage("IBLOCK_XML2_POSITIONS") . ">\n");
}
}
示例5: GetArrayByID
/**
* <p>Возвращает массив <a href="http://dev.1c-bitrix.ru/api_help/iblock/fields.php#fiblock">полей</a> информационного блока.</p> <p><b>Примечание</b>: если инфоблока с таким ID не существует, то функция вернет false.</p>
*
*
*
*
* @param int $ID Идентификатор информационного блока <br>
*
*
*
* @param string $FIELD = "" Идентификатор поля. Если этот параметр задан, то функция вернет
* значение конкретного поля. <br>
*
*
*
* @return array <p>Массив полей инфоблока.</p>
*
*
* <h4>Example</h4>
* <pre>
* <?<br>echo CIBlock::GetArrayByID($IBLOCK_ID, "NAME");<br>?>
* </pre>
*
*
*
* <h4>See Also</h4>
* <ul> <li><a href="http://dev.1c-bitrix.ru/api_help/iblock/fields.php#fiblock">Поля инфоблока</a></li>
* </ul><a name="examples"></a>
*
*
* @static
* @link http://dev.1c-bitrix.ru/api_help/iblock/classes/ciblock/GetArrayByID.php
* @author Bitrix
*/
public static function GetArrayByID($ID, $FIELD = "")
{
/** @global CDatabase $DB */
global $DB;
$ID = intval($ID);
if (CACHED_b_iblock === false) {
$res = $DB->Query("\n\t\t\t\tSELECT b_iblock.*," . $DB->DateToCharFunction("TIMESTAMP_X") . " TIMESTAMP_X\n\t\t\t\tfrom b_iblock\n\t\t\t\tWHERE ID = " . $ID);
$arResult = $res->Fetch();
if ($arResult) {
$arMessages = CIBlock::GetMessages($ID);
$arResult = array_merge($arResult, $arMessages);
$arResult["FIELDS"] = CIBlock::GetFields($ID);
}
} else {
global $CACHE_MANAGER;
$bucket_size = intval(CACHED_b_iblock_bucket_size);
if ($bucket_size <= 0) {
$bucket_size = 20;
}
$bucket = intval($ID / $bucket_size);
$cache_id = $bucket_size . "iblock" . $bucket;
if ($CACHE_MANAGER->Read(CACHED_b_iblock, $cache_id, "b_iblock")) {
$arIBlocks = $CACHE_MANAGER->Get($cache_id);
} else {
$arIBlocks = array();
$res = $DB->Query("\n\t\t\t\t\tSELECT b_iblock.*," . $DB->DateToCharFunction("TIMESTAMP_X") . " TIMESTAMP_X\n\t\t\t\t\tfrom b_iblock\n\t\t\t\t\tWHERE ID between " . $bucket * $bucket_size . " AND " . (($bucket + 1) * $bucket_size - 1));
while ($arIBlock = $res->Fetch()) {
$arMessages = CIBlock::GetMessages($arIBlock["ID"]);
$arIBlock = array_merge($arIBlock, $arMessages);
$arIBlock["FIELDS"] = CIBlock::GetFields($arIBlock["ID"]);
$arIBlocks[$arIBlock["ID"]] = $arIBlock;
}
$CACHE_MANAGER->Set($cache_id, $arIBlocks);
}
if (isset($arIBlocks[$ID])) {
$arResult = $arIBlocks[$ID];
if (!array_key_exists("ELEMENT_DELETE", $arResult)) {
$arMessages = CIBlock::GetMessages($ID);
$arResult = array_merge($arResult, $arMessages);
CIBlock::CleanCache($ID);
}
if (!array_key_exists("FIELDS", $arResult)) {
$arResult["FIELDS"] = CIBlock::GetFields($ID);
CIBlock::CleanCache($ID);
}
} else {
$arResult = false;
}
}
if ($FIELD) {
return $arResult[$FIELD];
} else {
return $arResult;
}
}
示例6: GetPropertyFieldHtmlMulty
public function GetPropertyFieldHtmlMulty($arProperty, $arValues, $strHTMLControlName)
{
global $APPLICATION;
$arSettings = self::PrepareSettings($arProperty);
$arSymbols = self::GetSymbols($arSettings);
$strResult = '';
if (isset($strHTMLControlName['MODE']) && 'iblock_element_admin' == $strHTMLControlName['MODE']) {
$arResult = false;
foreach ($arValues as $intPropertyValueID => $arOneValue) {
$mxElement = false;
$mxElement = self::GetPropertyValue($arProperty, $arOneValue);
if (is_array($mxElement)) {
$arResult[] = '<input type="text" name="' . $strHTMLControlName["VALUE"] . '[' . $intPropertyValueID . ']" id="' . $strHTMLControlName["VALUE"] . '[' . $intPropertyValueID . ']" value="' . $arOneValue['VALUE'] . '" size="5">' . '<input type="button" value="..." onClick="jsUtils.OpenWindow(\'iblock_element_search.php?lang=' . LANGUAGE_ID . '&IBLOCK_ID=' . $arProperty["LINK_IBLOCK_ID"] . '&n=' . urlencode($strHTMLControlName["VALUE"] . '[' . $intPropertyValueID . ']') . '\', 600, 500);">' . ' <span id="sp_' . $strHTMLControlName["VALUE"] . '[' . $intPropertyValueID . ']" >' . $mxElement['NAME'] . '</span>';
}
}
if (0 < intval($arProperty['MULTIPLE_CNT'])) {
for ($i = 0; $i < $arProperty['MULTIPLE_CNT']; $i++) {
$arResult[] = '<input type="text" name="' . $strHTMLControlName["VALUE"] . '[n' . $i . ']" id="' . $strHTMLControlName["VALUE"] . '[n' . $i . ']" value="" size="5">' . '<input type="button" value="..." onClick="jsUtils.OpenWindow(\'iblock_element_search.php?lang=' . LANGUAGE_ID . '&IBLOCK_ID=' . $arProperty["LINK_IBLOCK_ID"] . '&n=' . urlencode($strHTMLControlName["VALUE"] . '[n' . $i . ']') . '\', 600, 500);">' . ' <span id="sp_' . $strHTMLControlName["VALUE"] . '[n' . $i . ']" ></span>';
}
}
$strResult = implode('<br />', $arResult);
} else {
$mxResultValue = self::GetValueForAutoCompleteMulti($arProperty, $arValues, $arSymbols['BAN_SYM'], $arSymbols['REP_SYM']);
$strResultValue = is_array($mxResultValue) ? htmlspecialcharsback(implode("\n", $mxResultValue)) : '';
ob_start();
$control_id = $APPLICATION->IncludeComponent("bitrix:main.lookup.input", "iblockedit", array("CONTROL_ID" => preg_replace("/[^a-zA-Z0-9_]/i", "x", $strHTMLControlName["VALUE"]), "INPUT_NAME" => $strHTMLControlName['VALUE'] . '[]', "INPUT_NAME_STRING" => "inp_" . $strHTMLControlName['VALUE'], "INPUT_VALUE_STRING" => $strResultValue, "START_TEXT" => GetMessage('BT_UT_EAUTOCOMPLETE_MESS_INVITE'), "MULTIPLE" => $arProperty["MULTIPLE"], "MAX_WIDTH" => $arSettings['MAX_WIDTH'], "MIN_HEIGHT" => $arSettings['MIN_HEIGHT'], "MAX_HEIGHT" => $arSettings['MAX_HEIGHT'], "IBLOCK_ID" => $arProperty["LINK_IBLOCK_ID"], 'BAN_SYM' => $arSymbols['BAN_SYM_STRING'], 'REP_SYM' => $arSymbols['REP_SYM_STRING']), null, array("HIDE_ICONS" => "Y"));
if ('T' == $arSettings['VIEW']) {
$name = $APPLICATION->IncludeComponent('bitrix:main.tree.selector', 'iblockedit', array("INPUT_NAME" => $strHTMLControlName['VALUE'], 'ONSELECT' => 'jsMLI_' . $control_id . '.SetValue', 'MULTIPLE' => $arProperty["MULTIPLE"], 'SHOW_INPUT' => 'N', 'SHOW_BUTTON' => 'Y', 'GET_FULL_INFO' => 'Y', "START_TEXT" => GetMessage("BT_UT_EAUTOCOMPLETE_MESS_LIST_INVITE"), 'BUTTON_CAPTION' => GetMessage('BT_UT_EAUTOCOMPLETE_MESS_CHOOSE_ELEMENT'), 'BUTTON_TITLE' => GetMessage('BT_UT_EAUTOCOMPLETE_MESS_CHOOSE_ELEMENT_MULTI_DESCR'), "NO_SEARCH_RESULT_TEXT" => GetMessage("BT_UT_EAUTOCOMPLETE_MESS_NO_SEARCH_RESULT_TEXT"), "IBLOCK_ID" => $arProperty["LINK_IBLOCK_ID"], 'BAN_SYM' => $arSymbols['BAN_SYM_STRING'], 'REP_SYM' => $arSymbols['REP_SYM_STRING']), null, array("HIDE_ICONS" => "Y"));
} elseif ('E' == $arSettings['VIEW']) {
$APPLICATION->IncludeComponent('bitrix:iblock.button.element.search', 'iblockedit', array('ONSELECT' => 'jsMLI_' . $control_id, 'MULTIPLE' => $arProperty["MULTIPLE"], 'LANG' => LANGUAGE_ID, "IBLOCK_ID" => $arProperty["LINK_IBLOCK_ID"], 'BUTTON_CAPTION' => GetMessage('BT_UT_EAUTOCOMPLETE_MESS_SEARCH_ELEMENT'), 'BUTTON_TITLE' => GetMessage('BT_UT_EAUTOCOMPLETE_MESS_SEARCH_ELEMENT_MULTI_DESCR')), null, array("HIDE_ICONS" => "Y"));
}
if ('Y' == $arProperty['USER_TYPE_SETTINGS']['SHOW_ADD']) {
$strButtonCaption = '';
if ('Y' == $arSettings['IBLOCK_MESS']) {
$arLangMess = CIBlock::GetMessages($arProperty["LINK_IBLOCK_ID"]);
$strButtonCaption = $arLangMess['ELEMENT_ADD'];
} else {
$strButtonCaption = GetMessage('BT_UT_EAUTOCOMPLETE_MESS_NEW_ELEMENT');
}
$APPLICATION->IncludeComponent('bitrix:iblock.button.element.add', 'iblockedit', array('LANG' => LANGUAGE_ID, "IBLOCK_ID" => $arProperty["LINK_IBLOCK_ID"], "ONSELECT" => 'jsMLI_' . $control_id, "MULTIPLE" => $arProperty["MULTIPLE"], 'BUTTON_CAPTION' => $strButtonCaption, 'BUTTON_TITLE' => GetMessage('BT_UT_EAUTOCOMPLETE_MESS_NEW_ELEMENT_MULTI_DESCR')), null, array("HIDE_ICONS" => "Y"));
}
$strResult = ob_get_contents();
ob_end_clean();
}
return $strResult;
}
示例7: run
//.........这里部分代码省略.........
}
if (isset($defs[$k]) && $defs[$k] == $data[$k]) {
unset($data[$k]);
}
}
$sites = '';
$res = \CIBlock::GetSite($id);
while ($row = $res->Fetch()) {
$sites .= $sites != '' ? ',' : '';
$sites .= "'" . $row['SITE_ID'] . "'";
}
unset($data['ELEMENTS_NAME']);
unset($data['ELEMENT_NAME']);
$sData = self::generateArrayExport($data, ' ');
$sDescription = self::generateSimpleStringFunctionText('description', $description, '');
$sDescriptionType = self::generateSimpleStringFunctionText('descriptionType', $descriptionType, 'text');
$sIsActive = self::generateSimpleStringFunctionText('isActive', $isactive, true);
$sSort = self::generateSimpleStringFunctionText('sort', $sort, '500');
$sSites = "\n\n public function sites()\n {\n return array({$sites});\n }";
$properties = array();
$result = \CIBlockProperty::GetList(array(), array('IBLOCK_ID' => $id, 'CHECK_PERMISSIONS' => 'N'));
$defs = array('VERSION' => '1', 'FILTRABLE' => 'N', 'SEARCHABLE' => 'N', 'LIST_TYPE' => 'L', 'COL_COUNT' => '30', 'ROW_COUNT' => '1', 'MULTIPLE' => 'N', 'SORT' => '500', 'IS_REQUIRED' => 'N', 'WITH_DESCRIPTION' => 'N', 'MULTIPLE_CNT' => '5');
while ($row = $result->Fetch()) {
$code = trim($row['CODE']);
if ($code == '') {
$code = 'PROP_' . $row['ID'];
}
$pid = $row['ID'];
unset($row['ID']);
unset($row['TIMESTAMP_X']);
unset($row['IBLOCK_ID']);
unset($row['ACTIVE']);
unset($row['CODE']);
foreach (array_keys($row) as $k) {
if (empty($row[$k])) {
unset($row[$k]);
}
if (isset($defs[$k]) && $defs[$k] == $row[$k]) {
unset($row[$k]);
}
}
if ($row['PROPERTY_TYPE'] == 'L') {
$items = array();
$res = \CIBlockPropertyEnum::GetList(array(), array('PROPERTY_ID' => $pid, 'CHECK_PERMISSIONS' => 'N'));
while ($lrow = $res->Fetch()) {
$iid = $lrow['ID'];
$eid = $lrow['EXTERNAL_ID'];
unset($lrow['ID']);
unset($lrow['EXTERNAL_ID']);
unset($lrow['XML_ID']);
unset($lrow['TMP_ID']);
unset($lrow['PROPERTY_ID']);
unset($lrow['PROPERTY_NAME']);
unset($lrow['PROPERTY_CODE']);
unset($lrow['PROPERTY_SORT']);
if ($lrow['SORT'] == '500') {
unset($lrow['SORT']);
}
if ($lrow['DEF'] == 'N') {
unset($lrow['DEF']);
}
if (count($lrow) == 1 && isset($lrow['VALUE'])) {
$lrow = $lrow['VALUE'];
}
$items[$eid] = $lrow;
}
$row['ITEMS'] = $items;
}
if (isset($row['LINK_IBLOCK_ID']) && !$forCache) {
$row['LINK_IBLOCK_CODE'] = \TAO::getInfoblockCode($row['LINK_IBLOCK_ID']);
unset($row['LINK_IBLOCK_ID']);
}
$properties[$code] = $row;
}
$sProperties = self::generateArrayExport($properties, ' ');
$messages = \CIBlock::GetMessages($id);
$sMessages = self::generateArrayExport($messages, ' ');
$fields = self::trimArrayValues(\CIBlock::GetFields($id));
$defFields = self::defaultFields();
foreach (array_keys($fields) as $field) {
if (isset($defFields[$field])) {
$md5 = md5(serialize($fields[$field]));
$def = md5(serialize($defFields[$field]));
if ($md5 == $def) {
//unset($fields[$field]);
} else {
//var_dump($fields[$field], $defFields[$field]);
}
}
}
$sFields = self::generateArrayExport($fields, ' ');
$permissions = \CIBlock::GetGroupPermissions($id);
$sPermissions = self::generateArrayExport($permissions, ' ');
ob_start();
include \TAO::taoDir() . '/views/template-iblock.phtml';
$content = "<?php\n" . ob_get_clean();
return $content;
}
return false;
}
示例8: GetMessage
} else {
$arResult["FatalErrorMessage"] .= GetMessage("BPWC_WRC_WRONG_IBLOCK_TYPE") . ". ";
}
}
if (strlen($arResult["FatalErrorMessage"]) <= 0) {
$arResult["Block"] = null;
$db = CIBlock::GetList(array(), array("ID" => $arParams["BLOCK_ID"], "TYPE" => $arParams["IBLOCK_TYPE"], "ACTIVE" => "Y"));
if ($ar = $db->GetNext()) {
$arResult["Block"] = $ar;
} else {
$arResult["FatalErrorMessage"] .= GetMessage("BPWC_WRC_WRONG_IBLOCK") . ". ";
}
}
if (strlen($arResult["FatalErrorMessage"]) <= 0) {
$arResult["AdminAccess"] = $USER->IsAdmin() || is_array($arParams["ADMIN_ACCESS"]) && count(array_intersect($USER->GetUserGroupArray(), $arParams["ADMIN_ACCESS"])) > 0;
$arMessagesTmp = CIBlock::GetMessages($arResult["Block"]["ID"]);
$arResult["CreateTitle"] = htmlspecialcharsbx(is_array($arMessagesTmp) && array_key_exists("ELEMENT_ADD", $arMessagesTmp) ? $arMessagesTmp["ELEMENT_ADD"] : "");
$arResult["ShowMode"] = "SelectWorkflow";
$documentType = array("bizproc", "CBPVirtualDocument", "type_" . $arParams["BLOCK_ID"]);
$arDocumentTypeStates = CBPDocument::GetDocumentStates($documentType, null);
$arCurrentUserGroups = $GLOBALS["USER"]->GetUserGroupArray();
$arCurrentUserGroups[] = "user_" . $GLOBALS["USER"]->GetID();
$ks = array_keys($arCurrentUserGroups);
foreach ($ks as $k) {
$arCurrentUserGroups[$k] = strtolower($arCurrentUserGroups[$k]);
}
$arResult["TEMPLATES"] = array();
foreach ($arDocumentTypeStates as $arState) {
$bUserCanAcess = false;
if ($arResult["AdminAccess"] || !is_array($arState["STATE_PERMISSIONS"]) || count($arState["STATE_PERMISSIONS"]) <= 0) {
$bUserCanAcess = true;
示例9: GetMessage
$data["ELEMENT_DELETE"] = $arIBlock["ELEMENT_DELETE"];
$data["SECTIONS_NAME"] = $arIBlock["SECTIONS_NAME"];
$data["SECTION_NAME"] = $arIBlock["SECTION_NAME"];
$data["SECTION_ADD"] = $arIBlock["SECTION_ADD"];
$data["SECTION_EDIT"] = $arIBlock["SECTION_EDIT"];
$data["SECTION_DELETE"] = $arIBlock["SECTION_DELETE"];
} else {
//New one
$data["ID"] = "";
$data["NAME"] = GetMessage("CC_BLLE_FIELD_NAME_DEFAULT");
$data["SORT"] = 500;
if ($bBizProc) {
$data["BIZPROC"] = "Y";
}
$data["PICTURE"] = "";
$arMessages = CIBlock::GetMessages(0, $arParams["~IBLOCK_TYPE_ID"]);
$data["ELEMENTS_NAME"] = $arMessages["ELEMENTS_NAME"];
$data["ELEMENT_NAME"] = $arMessages["ELEMENT_NAME"];
$data["ELEMENT_ADD"] = $arMessages["ELEMENT_ADD"];
$data["ELEMENT_EDIT"] = $arMessages["ELEMENT_EDIT"];
$data["ELEMENT_DELETE"] = $arMessages["ELEMENT_DELETE"];
$data["SECTIONS_NAME"] = $arMessages["SECTIONS_NAME"];
$data["SECTION_NAME"] = $arMessages["SECTION_NAME"];
$data["SECTION_ADD"] = $arMessages["SECTION_ADD"];
$data["SECTION_EDIT"] = $arMessages["SECTION_EDIT"];
$data["SECTION_DELETE"] = $arMessages["SECTION_DELETE"];
}
$arResult["FORM_DATA"] = array();
foreach ($data as $key => $value) {
$arResult["FORM_DATA"][$key] = htmlspecialcharsbx($value);
$arResult["FORM_DATA"]["~" . $key] = $value;