/** * Отдает HTML для комментариев к статьям * * @param object $objResponse xajaxResponse * @param string $rec_id идентификатор записи * @param string $rec_type тип записи * @param array $aParams массив дополнительных параметров * @return string */ function _admEditArtComParseForm(&$objResponse, $rec_id = '', $rec_type = '', $aParams = array()) { require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/attachedfiles.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/comments/CommentsArticles.php'; // получение данных комментария $oComments = new CommentsArticles(); $mess = $oComments->getData($rec_id); $aModel = $oComments->model(); ob_start(); include_once $_SERVER['DOCUMENT_ROOT'] . '/user/adm_edit_tpl/comments.php'; $sHtml = ob_get_contents(); ob_end_clean(); // аттачи $aAttach = _getCommentFilesIds($mess, $aModel); $sAttach = getAttachedFilesJs($aAttach, TComments::MAX_FILE_COUNT, TComments::MAX_FILE_SIZE, 'commune'); $objResponse->assign('h4_adm_edit', 'innerHTML', 'Редактировать комментарий'); $objResponse->assign('div_adm_edit', 'innerHTML', $sHtml); $objResponse->script("\$('div_adm_reason').setStyle('display', 'none');"); $objResponse->script("adm_edit_content.editMenuItems = ['', 'Файлы'];"); $objResponse->script('adm_edit_content.edit();'); $objResponse->script($sAttach); $objResponse->script('xajax_getAdmEditReasons(' . admin_log::ACT_ID_EDIT_ART_COM . ');'); }
if ($uid && $article['approved'] == 't') { articles::setArticleLVT($uid, $article); } $dt = $article['approved'] == 't' ? $article['approve_date'] : $article['post_time']; $nav = articles::getNavigation($dt, $article['approved'] == 't'); $navigation = array(); if ($nav[1]['pos'] == 1) { $navigation['next'] = $nav[1]; } else { $navigation['prev'] = $nav[1]; } if (isset($nav[2])) { $navigation['prev'] = $nav[2]; } require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/comments/CommentsArticles.php'; $comments = new CommentsArticles($article['id'], $article['lastviewtime'], array('hidden_threads' => $article['hidden_threads'])); $comments->tpl_path = $_SERVER['DOCUMENT_ROOT'] . '/classes/comments/'; $comments_html = $comments->render(); // echo $comments_html; // die(); break; case 'declined': if (!$uid || !hasPermissions('articles')) { header('Location: /fbd.php'); exit; } $content = 'content_declined.php'; $_uid = hasPermissions('articles') ? null : $uid; $articles = articles::getArticles($page, $msgs_on_page, $uid, 0, false, $_uid, null, true); $articles_count = articles::ArticlesCount(false, $_uid, 0, true); $pages = ceil($articles_count / $msgs_on_page);