/** * Генерирует HTML для поля в списке * @see AdminListHelper::addRowCell(); * @param CAdminListRow $row * @param array $data - данные текущей строки * @return mixed */ public function genListHTML(&$row, $data) { $urlText = htmlspecialchars($data[$this->getCode()]); if (strlen($urlText) > $this->getSettings('MAX_URL_LEN')) { $urlText = substr($urlText, 0, $this->getSettings('MAX_URL_LEN')); } $href = '<a href="' . $data[$this->getCode()] . '" target="_blank">' . $urlText . '</a>'; if ($this->getSettings('EDIT_IN_LIST') and !$this->getSettings('READONLY')) { $row->AddInputField($this->getCode(), ['style' => 'width:90%']); } $row->AddViewField($this->getCode(), $href); }
/** * Генерирует HTML для поля в списке * @see AdminListHelper::addRowCell(); * @param CAdminListRow $row * @param array $data - данные текущей строки * @return mixed */ public function genListHTML(&$row, $data) { if ($this->settings['EDIT_IN_LIST'] and !$this->settings['READONLY']) { $row->AddInputField($this->getCode(), ['style' => 'width:90%']); } else { $row->AddViewField($this->getCode(), $this->getValueReadonly()); } }
/** * Генерирует HTML для поля в списке * @see AdminListHelper::addRowCell(); * @param \CAdminListRow $row * @param array $data - данные текущей строки */ public function generateRow(&$row, $data) { if ($this->getSettings('MULTIPLE')) { } else { if ($this->getSettings('EDIT_LINK') || $this->getSettings('SECTION_LINK')) { $entityClass = $this->entityName; $pk = $entityClass::getEntity()->getPrimary(); if ($this->getSettings('SECTION_LINK')) { $params = $this->helper->isPopup() ? $_GET : array(); $params['ID'] = $this->data[$pk]; $listHelper = $this->helper->getHelperClass($this->helper->isPopup() ? AdminSectionListHelper::className() : AdminListHelper::className()); $pageUrl = $listHelper::getUrl($params); $value = '<span class="adm-submenu-item-link-icon adm-list-table-icon iblock-section-icon"></span>'; } else { $editHelper = $this->helper->getHelperClass(AdminEditHelper::className()); $pageUrl = $editHelper::getUrl(array('ID' => $this->data[$pk])); } $value .= '<a href="' . $pageUrl . '">' . static::prepareToOutput($this->getValue()) . '</a>'; } else { $value = static::prepareToOutput($this->getValue()); } if ($this->getSettings('EDIT_IN_LIST') and !$this->getSettings('READONLY')) { $row->AddInputField($this->getCode(), array('style' => 'width:90%')); } $row->AddViewField($this->getCode(), $value); } }
/** * Генерирует HTML для поля в списке * @see AdminListHelper::addRowCell(); * @param \CAdminListRow $row * @param array $data - данные текущей строки */ public function genListHTML(&$row, $data) { if ($this->getSettings('MULTIPLE')) { } else { if ($this->getSettings('EDIT_LINK')) { $entityClass = $this->entityName; $pk = $entityClass::getEntity()->getPrimary(); $editPageUrl = $this->helper->getEditPageURL(['ID' => $this->data[$pk]]); $value = '<a href="' . $editPageUrl . '">' . $this->getValue() . '</a>'; } else { $value = $this->getValue(); } if ($this->getSettings('EDIT_IN_LIST') and !$this->getSettings('READONLY')) { $row->AddInputField($this->getCode(), array('style' => 'width:90%')); } $row->AddViewField($this->getCode(), $value); } }