function Display() { $sDefAction = $sDefTitle = ""; if(!$this->bEditMode) { if(!empty($this->link)) { $sDefAction = "BX.adminPanel.Redirect([], '".CUtil::JSEscape($this->link)."', event);"; $sDefTitle = $this->title; } else { $this->aActions = array_values($this->aActions); foreach($this->aActions as $action) { if($action["DEFAULT"] == true) { $sDefAction = $action["ACTION"] ? htmlspecialcharsbx($action["ACTION"]) : "BX.adminPanel.Redirect([], '".CUtil::JSEscape($action["LINK"])."', event)" ; $sDefTitle = (!empty($action["TITLE"])? $action["TITLE"]:$action["TEXT"]); break; } } } } $sMenuItems = ""; if(!empty($this->aActions)) $sMenuItems = htmlspecialcharsbx(CAdminPopup::PhpToJavaScript($this->aActions)); ?> <tr class="adm-list-table-row<?php echo isset($this->aFeatures["footer"]) && $this->aFeatures["footer"] == true ? ' footer' : ''; echo $this->bEditMode ? ' adm-table-row-active' : ''; ?> "<?php echo $sMenuItems != "" ? ' oncontextmenu="return ' . $sMenuItems . ';"' : ''; echo $sDefAction != "" ? ' ondblclick="' . $sDefAction . '"' . (!empty($sDefTitle) ? ' title="' . GetMessage("admin_lib_list_double_click") . ' ' . $sDefTitle . '"' : '') : ''; ?> > <? if(count($this->pList->arActions)>0 || $this->pList->bCanBeEdited): $check_id = RandString(5); ?> <td class="adm-list-table-cell adm-list-table-checkbox adm-list-table-checkbox-hover<?php echo $this->bReadOnly ? ' adm-list-table-checkbox-disabled' : ''; ?> "><input type="checkbox" class="adm-checkbox adm-designed-checkbox" name="ID[]" id="<?php echo $this->table_id . "_" . $this->id . "_" . $check_id; ?> " value="<?php echo $this->id; ?> " autocomplete="off" title="<?php echo GetMessage("admin_lib_list_check"); ?> "<?php echo $this->bReadOnly ? ' disabled="disabled"' : ''; echo $this->bEditMode ? ' checked="checked" disabled="disabled"' : ''; ?> /><label class="adm-designed-checkbox-label adm-checkbox" for="<?php echo $this->table_id . "_" . $this->id . "_" . $check_id; ?> "></label></td> <? endif; if($this->pList->bShowActions): if(!empty($this->aActions)): ?> <td class="adm-list-table-cell adm-list-table-popup-block" onclick="BX.adminList.ShowMenu(this.firstChild, this.parentNode.oncontextmenu(), this.parentNode);"><div class="adm-list-table-popup" title="<?php echo GetMessage("admin_lib_list_actions_title"); ?> "></div></td> <? else: ?> <td class="adm-list-table-cell"></td> <? endif; endif; end($this->pList->aVisibleHeaders); $last_id = key($this->pList->aVisibleHeaders); reset($this->pList->aVisibleHeaders); $bVarsFromForm = ($this->bEditMode && is_array($this->pList->arUpdateErrorIDs) && in_array($this->id, $this->pList->arUpdateErrorIDs)); foreach($this->pList->aVisibleHeaders as $id=>$header_props) { $field = $this->aFields[$id]; if($this->bEditMode && isset($field["edit"])) { if($bVarsFromForm && $_REQUEST["FIELDS"]) $val = $_REQUEST["FIELDS"][$this->id][$id]; else $val = $this->arRes[$id]; $val_old = $this->arRes[$id]; echo '<td class="adm-list-table-cell', (isset($header_props['align']) && $header_props['align']? ' align-'.$header_props['align']: ''), (isset($header_props['valign']) && $header_props['valign']? ' valign-'.$header_props['valign']: ''), ($id === $last_id? ' adm-list-table-cell-last': ''), '">'; if(is_array($val_old)) { foreach($val_old as $k=>$v) echo '<input type="hidden" name="FIELDS_OLD['.htmlspecialcharsbx($this->id).']['.htmlspecialcharsbx($id).']['.htmlspecialcharsbx($k).']" value="'.htmlspecialcharsbx($v).'">'; } else { echo '<input type="hidden" name="FIELDS_OLD['.htmlspecialcharsbx($this->id).']['.htmlspecialcharsbx($id).']" value="'.htmlspecialcharsbx($val_old).'">'; } switch($field["edit"]["type"]) { case "checkbox": echo '<input type="hidden" name="FIELDS['.htmlspecialcharsbx($this->id).']['.htmlspecialcharsbx($id).']" value="N">'; echo '<input type="checkbox" name="FIELDS['.htmlspecialcharsbx($this->id).']['.htmlspecialcharsbx($id).']" value="Y"'.($val=='Y'?' checked':'').'>'; break; case "select": echo '<select name="FIELDS['.htmlspecialcharsbx($this->id).']['.htmlspecialcharsbx($id).']"'.$this->__AttrGen($field["edit"]["attributes"]).'>'; foreach($field["edit"]["values"] as $k=>$v) echo '<option value="'.htmlspecialcharsbx($k).'" '.($k==$val?' selected':'').'>'.htmlspecialcharsbx($v).'</option>'; echo '</select>'; break; case "input": if(!$field["edit"]["attributes"]["size"]) $field["edit"]["attributes"]["size"] = "10"; echo '<input type="text" '.$this->__AttrGen($field["edit"]["attributes"]).' name="FIELDS['.htmlspecialcharsbx($this->id).']['.htmlspecialcharsbx($id).']" value="'.htmlspecialcharsbx($val).'">'; break; case "calendar": if(!$field["edit"]["attributes"]["size"]) $field["edit"]["attributes"]["size"] = "10"; echo '<span style="white-space:nowrap;"><input type="text" '.$this->__AttrGen($field["edit"]["attributes"]).' name="FIELDS['.htmlspecialcharsbx($this->id).']['.htmlspecialcharsbx($id).']" value="'.htmlspecialcharsbx($val).'">'; echo CAdminCalendar::Calendar('FIELDS['.htmlspecialcharsbx($this->id).']['.htmlspecialcharsbx($id).']').'</span>'; break; case "file": echo CFileInput::Show( 'FIELDS['.htmlspecialcharsbx($this->id).']['.htmlspecialcharsbx($id).']', $val, $field["edit"]["showInfo"], $field["edit"]["inputs"] ); break; default: echo $field["edit"]['value']; } echo '</td>'; } else { if(!is_array($this->arRes[$id])) $val = trim($this->arRes[$id]); else $val = $this->arRes[$id]; if(isset($field["view"])) { switch($field["view"]["type"]) { case "checkbox": if($val=='Y') $val = htmlspecialcharsex(GetMessage("admin_lib_list_yes")); else $val = htmlspecialcharsex(GetMessage("admin_lib_list_no")); break; case "select": if($field["edit"]["values"][$val]) $val = htmlspecialcharsex($field["edit"]["values"][$val]); break; case "file": if ($val > 0) $val = CFileInput::Show( 'NO_FIELDS['.htmlspecialcharsbx($this->id).']['.htmlspecialcharsbx($id).']', $val, $field["view"]["showInfo"], $field["view"]["inputs"] ); else $val = ''; break; case "html": $val = $field["view"]['value']; break; default: $val = htmlspecialcharsex($val); break; } } else { $val = htmlspecialcharsex($val); } echo '<td class="adm-list-table-cell', (isset($header_props['align']) && $header_props['align']? ' align-'.$header_props['align']: ''), (isset($header_props['valign']) && $header_props['valign']? ' valign-'.$header_props['valign']: ''), ($id === $last_id? ' adm-list-table-cell-last': ''), '">'; echo ((string)$val <> ""? $val: ' '); if(isset($field["edit"]) && $field["edit"]["type"] == "calendar") CAdminCalendar::ShowScript(); echo '</td>'; } } ?> </tr> <? }
$lAdmin->AddGroupError(GetMessage("IBLIST_A_SAVE_ERROR", array("#ID#" => $ID, "#ERROR_MESSAGE#" => $obE->LAST_ERROR)), $TYPE.$ID); } else { $lAdmin->AddGroupError(GetMessage("IBLIST_A_UPDERR_ACCESS", array("#ID#" => $ID)), $TYPE.$ID); } } break; } } if(isset($return_url) && strlen($return_url)>0) LocalRedirect($return_url); } $CAdminCalendar_ShowScript = CAdminCalendar::ShowScript(); // List header $arHeader = array(); if ($bCatalog) { $arHeader[] = array( "id" => "CATALOG_TYPE", "content" => GetMessage("IBLIST_A_CATALOG_TYPE"), "title" => GetMessage('IBLIST_A_CATALOG_TYPE_TITLE'), "align" => "right", "default" => true, ); } //Common
echo $i; ?> " value="<?php echo htmlspecialcharsbx((string) $arCurrentValues["variable_condition_value_" . $i]); ?> "> </td> </tr> <?php } ?> <tr id="bwfvc_addrow_tr"> <td class="adm-detail-content-cell-l"></td> <td class="adm-detail-content-cell-r"> <?php echo CAdminCalendar::ShowScript(); ?> <script language="JavaScript"> var bwfvc_arFieldTypes = {<?php $fl = false; foreach ($arProperties as $key => $value) { if ($fl) { echo ","; } echo "'" . CUtil::JSEscape($key) . "':'" . CUtil::JSEscape($value["Type"]) . "'"; $fl = true; } foreach ($arVariables as $key => $value) { if ($fl) { echo ","; }
public function GetJSFunctionsForFields($documentType, $objectName, $arDocumentFields = array(), $arDocumentFieldTypes = array()) { $iblockId = intval(substr($documentType, strlen("type_"))); if ($iblockId <= 0) { return ""; } ob_start(); echo CAdminCalendar::ShowScript(); ?> <script type="text/javascript"> <?php echo $objectName; ?> .GetGUIFieldEdit = function(field, value, showAddButton, inputName) { alert("Deprecated method GetGUIFieldEdit used"); if (!this.arDocumentFields[field]) return ""; if (typeof showAddButton == "undefined") showAddButton = false; if (typeof inputName == "undefined") inputName = field; var type = this.arDocumentFields[field]["Type"]; var bAddSelection = false; var bAddButton = true; s = ""; if (type == "N") { s += '<input type="text" size="10" id="id_' + field + '" name="' + inputName + '" value="' + this.HtmlSpecialChars(value) + '">'; } else if (type == "L") { s += '<select name="' + inputName + '_1">'; s += '<option value=""></option>'; for (k in this.arDocumentFields[field]["Options"]) { s += '<option value="' + this.arDocumentFields[field]["Options"][k][0] + '"' + (value == this.arDocumentFields[field]["Options"][k][0] ? " selected" : "") + '>' + this.arDocumentFields[field]["Options"][k][1] + '</option>'; if (value == this.arDocumentFields[field]["Options"][k][0]) value = ""; } s += '</select>'; bAddSelection = true; } else if (type == "F") { s += '<input type="file" id="id_' + field + '_1" name="' + inputName + '">'; bAddSelection = true; bAddButton = true; } else if (type == "B") { s += '<select name="' + inputName + '_1" id="id_' + name + '">'; s += '<option value=""></option>'; s += '<option value="Y"' + (value == "Y" ? " selected" : "") + '><?php echo GetMessage("BPVDX_YES"); ?> </option>'; s += '<option value="N"' + (value == "N" ? " selected" : "") + '><?php echo GetMessage("BPVDX_NO"); ?> </option>'; s += '</select>'; bAddSelection = true; if (value == "Y" || value == "N") value = ""; } else if (type == "S:DateTime") { s += '<span style="white-space:nowrap;">'; s += '<input type="text" name="' + inputName + '" id="id_' + field + '" size="10" value="' + this.HtmlSpecialChars(value) + '">'; s += '<a href="javascript:void(0);" title="<?php echo GetMessage("BPVDX_CALENDAR"); ?> ">'; s += '<img src="<?php echo ADMIN_THEMES_PATH; ?> /<?php echo ADMIN_THEME_ID; ?> /images/calendar/icon.gif" alt="<?php echo GetMessage("BPVDX_CALENDAR"); ?> " class="calendar-icon" onclick="jsAdminCalendar.Show(this, \'' + inputName + '\', \'\', \'\', ' + ((type == "datetime") ? 'true' : 'false') + ', <?php echo time() + date("Z") + CTimeZone::GetOffset(); ?> );" onmouseover="this.className+=\' calendar-icon-hover\';" onmouseout="this.className = this.className.replace(/\s*calendar-icon-hover/ig, \'\');">'; s += '</a></span>'; } //else if (type.substr(0, 2) == "S:" && this.arUserTypes[type.substr(2)]) //{ // s += eval(this.arUserTypes[type.substr(2)] + "(\"" + field + "\", \"" + value + "\")"); //} else // type == "S" { s += '<input type="text" size="40" id="id_' + field + '" name="' + inputName + '" value="' + this.HtmlSpecialChars(value) + '">'; } if (bAddSelection) s += '<br /><input type="text" id="id_' + field + '" name="' + inputName + '" value="' + this.HtmlSpecialChars(value) + '">'; if (bAddButton && showAddButton) s += '<input type="button" value="..." onclick="BPAShowSelector(\'id_' + field + '\', \'' + type + '\');">'; return s; } <?php echo $objectName; ?> .SetGUIFieldEdit = function(field) { alert("Deprecated method SetGUIFieldEdit used"); } <?php echo $objectName; ?> .GetGUIFieldEditSimple = function(type, value, name) { alert("Deprecated method GetGUIFieldEditSimple used"); if (typeof name == "undefined" || name.length <= 0) name = "BPVDDefaultValue"; if (typeof value == "undefined") { value = ""; var obj = document.getElementById('id_' + name); if (obj) { if (obj.type.substr(0, "select".length) == "select") value = obj.options[obj.selectedIndex].value; else value = obj.value; } } s = ""; if (type == "F") { s += ''; } else if (type == "B") { s += '<select name="' + name + '" id="id_' + name + '">'; s += '<option value=""></option>'; s += '<option value="Y"' + (value == "Y" ? " selected" : "") + '><?php echo GetMessage("BPVDX_YES"); ?> </option>'; s += '<option value="N"' + (value == "N" ? " selected" : "") + '><?php echo GetMessage("BPVDX_NO"); ?> </option>'; s += '</select>'; } else if (type == "S:UserID") { s += '<input type="text" size="10" id="id_' + name + '" name="' + name + '" value="' + this.HtmlSpecialChars(value) + '">'; s += '<input type="button" value="..." onclick="BPAShowSelector(\'id_' + name + '\', \'user\')">'; } else { s += '<input type="text" size="10" id="id_' + name + '" name="' + name + '" value="' + this.HtmlSpecialChars(value) + '">'; } return s; } <?php echo $objectName; ?> .SetGUIFieldEditSimple = function(type, name) { alert("Deprecated method SetGUIFieldEditSimple used"); if (typeof name == "undefined" || name.length <= 0) name = "BPVDDefaultValue"; s = ""; if (type != "F") { var obj = document.getElementById('id_' + name); if (obj) { if (obj.type.substr(0, "select".length) == "select") s = obj.options[obj.selectedIndex].value; else s = obj.value; } } return s; } </script> <?php $str = ob_get_contents(); ob_end_clean(); return $str; }
/** * @param $arUserField * @param $value * @param CAdminListRow $row */ function AddUserField($arUserField, $value, &$row) { if($arUserField["USER_TYPE"]) { $js = $this->ShowScript(); if(is_callable(array($arUserField["USER_TYPE"]["CLASS_NAME"], "getadminlistviewhtml"))) { if($arUserField["MULTIPLE"] == "N") { $html = call_user_func_array( array($arUserField["USER_TYPE"]["CLASS_NAME"], "getadminlistviewhtml"), array( $arUserField, array( "NAME" => "FIELDS[".$row->id."][".$arUserField["FIELD_NAME"]."]", "VALUE" => htmlspecialcharsbx($value), ), ) ); if($html == '') $html = ' '; $row->AddViewField($arUserField["FIELD_NAME"], $html.$js.CAdminCalendar::ShowScript()); } elseif(is_callable(array($arUserField["USER_TYPE"]["CLASS_NAME"], "getadminlistviewhtmlmulty"))) { if(is_array($value)) $form_value = $value; else $form_value = unserialize($value); if(!is_array($form_value)) $form_value = array(); foreach($form_value as $key=>$val) $form_value[$key] = htmlspecialcharsbx($val); $html = call_user_func_array( array($arUserField["USER_TYPE"]["CLASS_NAME"], "getadminlistviewhtmlmulty"), array( $arUserField, array( "NAME" => "FIELDS[".$row->id."][".$arUserField["FIELD_NAME"]."]"."[]", "VALUE" => $form_value, ), ) ); if($html == '') $html = ' '; $row->AddViewField($arUserField["FIELD_NAME"], $html.$js.CAdminCalendar::ShowScript()); } else { $html = ""; if(is_array($value)) $form_value = $value; else $form_value = strlen($value) > 0? unserialize($value): false; if(!is_array($form_value)) $form_value = array(); foreach($form_value as $i=>$val) { if($html!="") $html .= " / "; $html .= call_user_func_array( array($arUserField["USER_TYPE"]["CLASS_NAME"], "getadminlistviewhtml"), array( $arUserField, array( "NAME" => "FIELDS[".$row->id."][".$arUserField["FIELD_NAME"]."]"."[".$i."]", "VALUE" => htmlspecialcharsbx($val), ), ) ); } if($html == '') $html = ' '; $row->AddViewField($arUserField["FIELD_NAME"], $html.$js.CAdminCalendar::ShowScript()); } } if($arUserField["EDIT_IN_LIST"]=="Y" && is_callable(array($arUserField["USER_TYPE"]["CLASS_NAME"], "getadminlistedithtml"))) { if($arUserField["MULTIPLE"] == "N") { $html = call_user_func_array( array($arUserField["USER_TYPE"]["CLASS_NAME"], "getadminlistedithtml"), array( $arUserField, array( "NAME" => "FIELDS[".$row->id."][".$arUserField["FIELD_NAME"]."]", "VALUE" => htmlspecialcharsbx($value), ), ) ); if($html == '') $html = ' '; $row->AddEditField($arUserField["FIELD_NAME"], $html.$js.CAdminCalendar::ShowScript()); } elseif(is_callable(array($arUserField["USER_TYPE"]["CLASS_NAME"], "getadminlistedithtmlmulty"))) { if(is_array($value)) $form_value = $value; else $form_value = strlen($value) > 0? unserialize($value): false; if(!is_array($form_value)) $form_value = array(); foreach($form_value as $key=>$val) $form_value[$key] = htmlspecialcharsbx($val); $html = call_user_func_array( array($arUserField["USER_TYPE"]["CLASS_NAME"], "getadminlistedithtmlmulty"), array( $arUserField, array( "NAME" => "FIELDS[".$row->id."][".$arUserField["FIELD_NAME"]."][]", "VALUE" => $form_value, ), ) ); if($html == '') $html = ' '; $row->AddEditField($arUserField["FIELD_NAME"], $html.$js.CAdminCalendar::ShowScript()); } else { $html = "<table id=\"table_".$arUserField["FIELD_NAME"]."_".$row->id."\">"; if(is_array($value)) $form_value = $value; else $form_value = unserialize($value); if(!is_array($form_value)) $form_value = array(); $i = -1; foreach($form_value as $i=>$val) { $html .= '<tr><td>'.call_user_func_array( array($arUserField["USER_TYPE"]["CLASS_NAME"], "getadminlistedithtml"), array( $arUserField, array( "NAME" => "FIELDS[".$row->id."][".$arUserField["FIELD_NAME"]."]"."[".$i."]", "VALUE" => htmlspecialcharsbx($val), ), ) ).'</td></tr>'; } $html .= '<tr><td>'.call_user_func_array( array($arUserField["USER_TYPE"]["CLASS_NAME"], "getadminlistedithtml"), array( $arUserField, array( "NAME" => "FIELDS[".$row->id."][".$arUserField["FIELD_NAME"]."]"."[".($i+1)."]", "VALUE" => "", ), ) ).'</td></tr>'; $html .= '<tr><td><input type="button" value="'.GetMessage("USER_TYPE_PROP_ADD").'" onClick="addNewRow(\'table_'.$arUserField["FIELD_NAME"].'_'.$row->id.'\', /'.'FIELDS\['.$row->id.'\]\['.$arUserField["FIELD_NAME"].'\]'.'\[([0-9]*)\]/g, 1)"></td></tr>'. '</table>'; $row->AddEditField($arUserField["FIELD_NAME"], $html.$js.CAdminCalendar::ShowScript()); } } } }
function Display() { $sDefAction = $sDefTitle = ""; if (!$this->bEditMode) { if (!empty($this->link)) { if (true == $this->boolBX) { $sDefAction = "(new BX.CAdminDialog({\n\t\t\t\t\t\t'content_url': '" . $this->link . (!(defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1) ? '&bxsku=Y' : '') . "&bxpublic=Y&" . bitrix_sessid_get() . "',\n\t\t\t\t\t\t'content_post': 'from_module=iblock',\n\t\t\t\t\t\t'draggable': true,\n\t\t\t\t\t\t'resizable': true,\n\t\t\t\t\t\t'buttons': [BX.CAdminDialog.btnSave, BX.CAdminDialog.btnCancel]\n\t\t\t\t\t})).Show();"; } else { $sDefAction = "BX.adminPanel.Redirect([], '" . CUtil::JSEscape($this->link) . "', event);"; } $sDefTitle = $this->title; } else { foreach ($this->aActions as $action) { if ($action["DEFAULT"] == true) { if (true == $this->boolBX) { $sDefAction = "(new BX.CAdminDialog({\n\t\t\t\t\t\t'content_url': '" . CUtil::addslashes($action["ACTION"]) . "',\n\t\t\t\t\t\t'content_post': '" . (!(defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1) ? '&bxsku=Y' : '') . "&bxpublic=Y&from_module=iblock&" . bitrix_sessid_get() . "',\n\t\t\t\t\t\t'draggable': true,\n\t\t\t\t\t\t'resizable': true,\n\t\t\t\t\t\t'buttons': [BX.CAdminDialog.btnSave, BX.CAdminDialog.btnCancel]\n\t\t\t\t\t})).Show();"; } else { $sDefAction = $action["ACTION"] ? htmlspecialcharsbx($action["ACTION"]) : "BX.adminPanel.Redirect([], '" . CUtil::JSEscape($action["LINK"]) . "', event)"; } $sDefTitle = !empty($action["TITLE"]) ? $action["TITLE"] : $action["TEXT"]; break; } } } } $sMenuItems = ""; if (!empty($this->aActions)) { $sMenuItems = htmlspecialcharsbx(CAdminPopup::PhpToJavaScript($this->aActions)); } $aUserOpt = CUserOptions::GetOption("global", "settings"); ?> <tr class="adm-list-table-row<?php echo isset($this->aFeatures["footer"]) && $this->aFeatures["footer"] == true ? ' footer' : ''; echo $this->bEditMode ? ' adm-table-row-active' : ''; ?> "<?php echo $sMenuItems != "" && $aUserOpt["context_menu"] != "N" ? ' oncontextmenu="return ' . $sMenuItems . ';"' : ''; echo $sDefAction != "" ? ' ondblclick="' . $sDefAction . '"' . (!empty($sDefTitle) ? ' title="' . GetMessage("admin_lib_list_double_click") . ' ' . $sDefTitle . '"' : '') : ''; ?> > <?php if (count($this->pList->arActions) > 0 || $this->pList->bCanBeEdited) { $check_id = RandString(5); ?> <td class="adm-list-table-cell adm-list-table-checkbox adm-list-table-checkbox-hover<?php echo $this->bReadOnly ? ' adm-list-table-checkbox-disabled' : ''; ?> "><input type="checkbox" class="adm-checkbox adm-designed-checkbox" name="SUB_ID[]" id="<?php echo $this->table_id . "_" . $this->id . "_" . $check_id; ?> " value="<?php echo $this->id; ?> " autocomplete="off" title="<?php echo GetMessage("admin_lib_list_check"); ?> "<?php echo $this->bReadOnly ? ' disabled="disabled"' : ''; echo $this->bEditMode ? ' checked="checked" disabled="disabled"' : ''; ?> /><label class="adm-designed-checkbox-label adm-checkbox" for="<?php echo $this->table_id . "_" . $this->id . "_" . $check_id; ?> "></label></td> <?php } if ($this->pList->bShowActions) { if (!empty($this->aActions)) { ?> <td class="adm-list-table-cell adm-list-table-popup-block" onclick="BX.adminSubList.ShowMenu(this.firstChild, this.parentNode.oncontextmenu(), this.parentNode);"><div class="adm-list-table-popup" title="<?php echo GetMessage("admin_lib_list_actions_title"); ?> "></div></td> <?php } else { ?> <td class="adm-list-table-cell"></td> <?php } } $bVarsFromForm = $this->bEditMode && is_array($this->pList->arUpdateErrorIDs) && in_array($this->id, $this->pList->arUpdateErrorIDs); foreach ($this->aHeaders as $id => $header_props) { if (!in_array($id, $this->pList->arVisibleColumns)) { continue; } $field = $this->aFields[$id]; if ($this->bEditMode && isset($field["edit"])) { if ($bVarsFromForm && $_REQUEST["FIELDS"]) { $val = $_REQUEST["FIELDS"][$this->id][$id]; } else { $val = $this->arRes[$id]; } $val_old = $this->arRes[$id]; echo '<td class="adm-list-table-cell' . ($header_props['align'] ? ' align-' . $header_props['align'] : '') . ' ' . ($header_props['valign'] ? ' valign-' . $header_props['valign'] : '') . '">'; if (is_array($val_old)) { foreach ($val_old as $k => $v) { echo '<input type="hidden" name="FIELDS_OLD[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . '][' . htmlspecialcharsbx($k) . ']" value="' . htmlspecialcharsbx($v) . '">'; } } else { echo '<input type="hidden" name="FIELDS_OLD[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']" value="' . htmlspecialcharsbx($val_old) . '">'; } switch ($field["edit"]["type"]) { case "checkbox": echo '<input type="hidden" name="FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']" value="N">'; echo '<input type="checkbox" name="FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']" value="Y"' . ($val == 'Y' ? ' checked' : '') . '>'; break; case "select": echo '<select name="FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']"' . $this->__AttrGen($field["edit"]["attributes"]) . '>'; foreach ($field["edit"]["values"] as $k => $v) { echo '<option value="' . htmlspecialcharsbx($k) . '" ' . ($k == $val ? ' selected' : '') . '>' . htmlspecialcharsex($v) . '</option>'; } echo '</select>'; break; case "input": if (!$field["edit"]["attributes"]["size"]) { $field["edit"]["attributes"]["size"] = "10"; } echo '<input type="text" ' . $this->__AttrGen($field["edit"]["attributes"]) . ' name="FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']" value="' . htmlspecialcharsbx($val) . '">'; break; case "calendar": if (!$field["edit"]["attributes"]["size"]) { $field["edit"]["attributes"]["size"] = "10"; } echo '<span style="white-space:nowrap;"><input type="text" ' . $this->__AttrGen($field["edit"]["attributes"]) . ' name="FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']" value="' . htmlspecialcharsbx($val) . '">'; echo CAdminCalendar::Calendar('FIELDS[' . htmlspecialcharsbx($this->id) . '][' . htmlspecialcharsbx($id) . ']') . '</span>'; break; default: echo $field["edit"]['value']; } echo '</td>'; } else { if (!is_array($this->arRes[$id])) { $val = trim($this->arRes[$id]); } else { $val = $this->arRes[$id]; } switch ($field["view"]["type"]) { case "checkbox": if ($val == 'Y') { $val = GetMessage("admin_lib_list_yes"); } else { $val = GetMessage("admin_lib_list_no"); } break; case "select": if ($field["edit"]["values"][$val]) { $val = $field["edit"]["values"][$val]; } break; } if ($field["view"]['type'] == 'html') { $val = $field["view"]['value']; } else { $val = htmlspecialcharsex($val); } echo '<td class="adm-list-table-cell' . ($header_props['align'] ? ' align-' . $header_props['align'] : '') . ' ' . ($header_props['valign'] ? ' valign-' . $header_props['valign'] : '') . '">'; echo (string) $val != "" ? $val : ' '; if ($field["edit"]["type"] == "calendar") { echo CAdminCalendar::ShowScript(); } echo '</td>'; } } echo '</tr>'; }