public function Widget($id, array $attr = array('class' => 'form-control')) { if (in_array($id, $this->printedFields)) { return false; } $question = $this->getQuestion($id); $formInfo = $this->getFormInfo(); $field = $formInfo['FIELDS'][$id]; $id = $field['NAME']; if ($attr['id']) { $id = $attr['id']; unset($attr['id']); } unset($attr['name']); if ($question['REQUIRED'] == 'Y') { $attr['required'] = 'required'; } $widget = $question['HTML_CODE']; $widget = preg_replace('(class="(.+?)")', '', $widget); $widget = preg_replace('(size="(.+?)")', '', $widget); if (array_key_exists('value', $attr)) { if (empty($this->formArray['arrVALUES']) == true) { $widget = preg_replace('/value="(.*?)"/iu', '', $widget); } else { unset($attr['value']); } } $attrText = Utils::getAttrText($attr); $widget = str_replace('<input ', '<input id="' . $id . '" ' . $attrText, $widget); $widget = str_replace('<textarea ', '<textarea id="' . $id . '" ' . $attrText, $widget); if ($question['STRUCTURE'][0]['FIELD_TYPE'] == 'email') { $widget = str_replace('type="text" ', 'type="email"' . $attrText, $widget); } $this->printedFields[] = $id; return $widget; }
* Изменение значения свойства элемента */ \CIBlockElement::SetPropertyValuesEx($item['ID'], false, array('QUANTITY' => $item['PROPERTY_QUANTITY_VALUE'] + 1, 'NAME' => $_POST['name'], 'ELEMENT' => $_POST['element'], 'PRICE' => $_POST['price'])); /** * Получение списка разделов */ $arFilter = array('IBLOCK_ID' => $arParams['IBLOCK_ID'], 'ID' => $arResult['SECTION']['IBLOCK_SECTION_ID']); // выберет потомков без учета активности $arSelect = array('UF_*'); $rsSect = CIBlockSection::GetList(array('left_margin' => 'asc'), $arFilter, false, $arSelect); while ($arSect = $rsSect->GetNext()) { \BitrixHelper\Utils::Message($arSect); } /** * Подключение модулей */ CModule::IncludeModule("iblock"); // подключение информационных блоков /** * Список пользователей */ $rsUsers = CUser::GetList($by = "LAST_NAME", $order = "asc", $filter = array()); while ($arUser = $rsUsers->GetNext()) { \BitrixHelper\Utils::Message($arUser); } /** * Изменение информации о пользователе */ $user = new CUser(); $fields = array("EMAIL" => '*****@*****.**'); $user->Update($arUser['ID'], $fields);