37 public static function process404($message =
"", $defineConstant =
true, $setStatus =
true, $showPage =
false, $pageFile =
"")
42 $message = (string)$message;
43 $pageFile = (string)$pageFile;
46 $APPLICATION->includeComponent(
47 'bitrix:system.show_message',
50 'MESSAGE' => $message,
51 'STYLE' =>
'errortext',
60 if ($defineConstant && !defined(
'ERROR_404'))
62 define(
'ERROR_404',
'Y');
67 \CHTTP::setStatus(
'404 Not Found');
72 if ($APPLICATION->RestartWorkarea())
74 if (!defined(
'BX_URLREWRITE'))
76 define(
'BX_URLREWRITE',
true);
78 Main\Composite\Engine::setEnable(
false);
81 require Main\Application::getDocumentRoot() . rel2abs(
'/',
'/' . $pageFile);
85 require Main\Application::getDocumentRoot() .
'/404.php';
102 public static function getFieldImageData(array &$item, array $keys, $entity, $ipropertyKey =
'IPROPERTY_VALUES')
104 if (empty($item) || empty($keys))
107 $entity = (string)$entity;
108 $ipropertyKey = (string)$ipropertyKey;
109 foreach ($keys as $fieldName)
111 if (!array_key_exists($fieldName, $item) || is_array($item[$fieldName]))
114 $imageId = (int)$item[$fieldName];
116 $imageData = \CFile::getFileArray($imageId);
118 if (is_array($imageData))
120 if (isset($imageData[
'SAFE_SRC']))
122 $imageData[
'UNSAFE_SRC'] = $imageData[
'SRC'];
123 $imageData[
'SRC'] = $imageData[
'SAFE_SRC'];
127 if (!preg_match(self::WEB_PROTOCOL_MASK, $imageData[
'SRC']))
129 $imageData[
'UNSAFE_SRC'] = $imageData[
'SRC'];
130 $imageData[
'SAFE_SRC'] = Main\Web\Uri::urnEncode($imageData[
'SRC'],
'UTF-8');
131 $imageData[
'SRC'] = $imageData[
'SAFE_SRC'];
134 $imageData[
'ALT'] =
'';
135 $imageData[
'TITLE'] =
'';
136 if ($ipropertyKey !=
'' && isset($item[$ipropertyKey]) && is_array($item[$ipropertyKey]))
138 $entityPrefix = $entity.
'_'.$fieldName;
139 if (isset($item[$ipropertyKey][$entityPrefix.
'_FILE_ALT']))
140 $imageData[
'ALT'] = $item[$ipropertyKey][$entityPrefix.
'_FILE_ALT'];
141 if (isset($item[$ipropertyKey][$entityPrefix.
'_FILE_TITLE']))
142 $imageData[
'TITLE'] = $item[$ipropertyKey][$entityPrefix.
'_FILE_TITLE'];
143 unset($entityPrefix);
145 if ($imageData[
'ALT'] ==
'' && isset($item[
'NAME']))
146 $imageData[
'ALT'] = $item[
'NAME'];
147 if ($imageData[
'TITLE'] ==
'' && isset($item[
'NAME']))
148 $imageData[
'TITLE'] = $item[
'NAME'];
150 $item[$fieldName] = $imageData;
209 $propertyId = (int)($property[
'ID'] ?? 0);
210 if ($propertyId <= 0)
214 if (!isset(self::$checkboxPropertyCache[$propertyId]))
218 ($property[
'PROPERTY_TYPE'] ??
'') === PropertyTable::TYPE_LIST
219 && ($property[
'MULTIPLE'] ??
'') ===
'N'
220 && (
string)($property[
'USER_TYPE'] ??
'') ===
''
221 && ($property[
'LIST_TYPE'] ??
'') === PropertyTable::CHECKBOX
225 '=PROPERTY_ID' => $propertyId,
230 if (PropertyEnumerationTable::getCount($filter, $cache) === 1)
232 $variant = PropertyEnumerationTable::getRow([
241 if (($variant[
'VALUE'] ??
'') === self::CHECKBOX_VALUE_YES)
247 self::$checkboxPropertyCache[$propertyId] = $result;
250 return self::$checkboxPropertyCache[$propertyId];