*/ class VyfukRenderer extends AbstractRenderer { public function render(string $innerHtml, string $formHtml, ModelNews $news): string { $html = '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= $innerHtml; $html .= $formHtml; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; return $html; } protected function getHeader(ModelNews $news) { return '

' . $news->title . '

' . '

' . '' . $news->getLocalDate(function ($key) { return $this->helper->getLang($key); }) . '' . '

'; } public function renderContent(ModelNews $data, array $params): string { $innerHtml = $this->getHeader($data); $innerHtml .= $this->getText($data); $innerHtml .= $this->getLink($data); $innerHtml .= $this->getSignature($data); return $innerHtml; } public function renderEditFields(array $params): string { if (auth_quickaclcheck('start') < AUTH_EDIT) { return ''; } $html = ''; $html .= ''; return $html; } protected function getModalHeader() { $html = ''; $html .= ''; return $html; } /** * @param $id * @param $streamName * @param $params * @return string */ protected function getPriorityField($id, $streamName, $params) { $html = ''; if ($params['editable'] !== 'true') { return ''; } if (!$params['stream']) { return ''; } $html .= ''; return $html; } protected function btnEditNews($id, $stream) { $html = ''; $html .= ''; return $html; } /** * @param $news ModelNews * @return null|string */ protected function getText(ModelNews $news) { return $news->renderText(); } /** * @param $news ModelNews * @return string */ protected function getSignature(ModelNews $news) { return '
' . hsc($news->authorName) . '
'; } /** * @param $news ModelNews * @return string */ protected function getLink(ModelNews $news) { if ($news->hasLink()) { if (preg_match('|^https?://|', $news->linkHref)) { $href = hsc($news->linkHref); } else { $href = wl($news->linkHref, null, true); } return '

' . $news->linkTitle . '

'; } return ''; } }