$CommentList = new CommentList2($Blog); // Filter list: $CommentList->set_filters(array('types' => array('comment', 'trackback', 'pingback'), 'statuses' => $user_modeartion_statuses, 'user_perm' => 'moderate', 'post_statuses' => array('published', 'community', 'protected'), 'order' => 'DESC', 'comments' => 30)); // Set param prefix for URLs $param_prefix = 'cmnt_fullview_'; if (!empty($CommentList->param_prefix)) { $param_prefix = $CommentList->param_prefix; } // Get ready for display (runs the query): $CommentList->display_init(); } if ($user_perm_moderate_cmt && $CommentList->result_num_rows) { // We have comments awaiting moderation load_funcs('comments/model/_comment_js.funcs.php'); $nb_blocks_displayed++; $opentrash_link = get_opentrash_link(true, false, array('class' => 'btn btn-default')); $refresh_link = '<span class="floatright">' . action_icon(T_('Refresh comment list'), 'refresh', $admin_url . '?blog=' . $blog, ' ' . T_('Refresh'), 3, 4, array('onclick' => 'startRefreshComments( \'' . request_from() . '\' ); return false;', 'class' => 'btn btn-default')) . '</span> '; $show_statuses_param = $param_prefix . 'show_statuses[]=' . implode('&' . $param_prefix . 'show_statuses[]=', $user_modeartion_statuses); $block_item_Widget->title = $refresh_link . $opentrash_link . T_('Comments awaiting moderation') . ' <a href="' . $admin_url . '?ctrl=comments&blog=' . $Blog->ID . '&' . $show_statuses_param . '" style="text-decoration:none">' . '<span id="badge" class="badge badge-important">' . $CommentList->get_total_rows() . '</span></a>' . get_manual_link('collection-dashboard'); echo '<div class="evo_content_block">'; echo '<div id="comments_block" class="dashboard_comments_block">'; $block_item_Widget->disp_template_replaced('block_start'); echo '<div id="comments_container">'; // GET COMMENTS AWAITING MODERATION (the code generation is shared with the AJAX callback): show_comments_awaiting_moderation($Blog->ID, $CommentList); echo '</div>'; $block_item_Widget->disp_template_raw('block_end'); echo '</div>'; echo '</div>'; } /*
$CommentList->set_filters(array('types' => array('comment', 'trackback', 'pingback'), 'statuses' => $statuses, 'order' => 'ASC', 'post_ID' => $Item->ID, 'comments' => 20, 'expiry_statuses' => $expiry_statuses)); $CommentList->query(); // We do not want to comment actions use new redirect param('save_context', 'boolean', false); param('redirect_to', 'url', url_add_param($admin_url, 'ctrl=items&blog=' . $blog . '&p=' . $Item->ID, '&'), false, true); param('item_id', 'integer', $Item->ID); param('currentpage', 'integer', 1); param('show_comments', 'string', $show_comments, false, true); // display status filter ?> <div class="bFeedback"> <a id="comments"></a> <h4> <?php echo T_('Comments'), ', ', T_('Trackbacks'), ', ', T_('Pingbacks') . ' (' . generic_ctp_number($Item->ID, 'feedbacks', 'total') . ')'; $opentrash_link = get_opentrash_link(); $refresh_link = '<span class="floatright">' . action_icon(T_('Refresh comment list'), 'refresh', 'javascript:startRefreshComments(' . $Item->ID . ')') . '</span> '; echo $refresh_link . $opentrash_link; ?> :</h4> <?php if ($display_params['disp_rating_summary']) { // Display a ratings summary echo '<h3>' . $Item->get_feedback_title('comments', '#', '#', '#', 'total') . '</h3>'; echo $Item->get_rating_summary(); echo '<br />'; } ?> <div class="tile"><label><?php echo T_('Show') . ':'; ?>
if (check_comment_mass_delete($CommentList)) { // A form for mass deleting is availabl, Display link $block_item_Widget->global_icon(T_('Delete all comments!'), 'delete', regenerate_url('action', 'action=mass_delete'), T_('Mass delete...'), 3, 3); } if ($CommentList->is_filtered()) { // List is filtered, offer option to reset filters: $block_item_Widget->global_icon(T_('Reset all filters!'), 'reset_filters', '?ctrl=comments&blog=' . $Blog->ID . '&filter=reset', T_('Reset filters'), 3, 3); } $emptytrash_link = ''; // Display recycle bin placeholder, because users may have rights to recycle particular comments $opentrash_link = '<span id="recycle_bin" class="floatright"></span>'; if ($current_User->check_perm('blogs', 'editall')) { if ($CommentList->is_trashfilter()) { $emptytrash_link = '<span class="floatright">' . action_icon(T_('Empty recycle bin'), 'recycle_empty', $admin_url . '?ctrl=comments&blog=' . $CommentList->Blog->ID . '&action=emptytrash', T_('Empty recycle bin...'), 5, 3) . '</span> '; } else { $opentrash_link = get_opentrash_link(false); } } $block_item_Widget->title = $opentrash_link . $emptytrash_link . T_('Feedback (Comments, Trackbacks...)'); $block_item_Widget->disp_template_replaced('block_start'); // Display filters title echo $CommentList->get_filter_title('<h3>', '</h3>', '<br />', NULL, 'htmlbody'); $display_params = array('header_start' => '<div class="NavBar center">', 'header_text' => '<strong>' . T_('Pages') . '</strong>: $prev$ $first$ $list_prev$ $list$ $list_next$ $last$ $next$', 'header_text_single' => T_('1 page'), 'header_end' => '</div>', 'footer_start' => '', 'footer_text' => '<div class="NavBar center"><strong>' . T_('Pages') . '</strong>: $prev$ $first$ $list_prev$ $list$ $list_next$ $last$ $next$<br />$page_size$</div>', 'footer_text_single' => '<div class="NavBar center">$page_size$</div>', 'prev_text' => T_('Previous'), 'next_text' => T_('Next'), 'list_prev_text' => T_('...'), 'list_next_text' => T_('...'), 'list_span' => 11, 'scroll_list_range' => 5, 'footer_end' => ''); $CommentList->display_if_empty(); $CommentList->display_init($display_params); // Display navigation: $CommentList->display_nav('header'); load_funcs('comments/model/_comment_js.funcs.php'); // Display list of comments: // comments_container value is -1, because in this case we have to show all comments in current blog (Not just one item comments) echo '<div id="comments_container" value="-1">';
case 'cancel': // The changes were canceled, Display old content $edited_Comment->content('htmlbody', 'true'); break; } break; case 'get_opentrash_link': // Used to get a link 'Open recycle bin' in order to show it in the header of comments list // Check that this action request is not a CSRF hacked request: $Session->assert_received_crumb('comment'); // Set admin skin, used for buttons, @see button_class() $admin_skin = $UserSettings->get('admin_skin', $current_User->ID); require_once $adminskins_path . $admin_skin . '/_adminUI.class.php'; $AdminUI = new AdminUI(); param('blog', 'integer', 0); echo get_opentrash_link(true, true, array('before' => ' <span id="recycle_bin">', 'after' => '</span>', 'class' => 'btn btn-default')); break; case 'delete_comment': // Delete a comment from the list on dashboard, on comments full text view screen or on a view item screen // Check that this action request is not a CSRF hacked request: $Session->assert_received_crumb('comment'); $result_success = false; // Set admin skin, used for buttons, @see button_class() $admin_skin = $UserSettings->get('admin_skin', $current_User->ID); require_once $adminskins_path . $admin_skin . '/_adminUI.class.php'; $AdminUI = new AdminUI(); // Check comment moderate permission below after we have the $edited_Comment objects $is_admin_page = true; $blog = param('blogid', 'integer'); $comment_ID = param('commentid', 'integer'); $statuses = param('statuses', 'string', NULL);
$SQL = new SQL(); $SQL->SELECT('user_login'); $SQL->FROM('T_users'); $SQL->WHERE('user_login LIKE "' . $DB->escape($text) . '%"'); $SQL->LIMIT('10'); $SQL->ORDER_BY('user_login'); echo implode("\n", $DB->get_col($SQL->get())); } // don't show ajax response end comment, because the result will be processed with jquery hintbox $add_response_end_comment = false; break; case 'get_opentrash_link': // Used to get a link 'Open recycle bin' in order to show it in the header of comments list // Check that this action request is not a CSRF hacked request: $Session->assert_received_crumb('comment'); echo get_opentrash_link(true, true); break; case 'set_comment_status': // Used for quick moderation of comments in dashboard, item list full view and comment list screens // Check that this action request is not a CSRF hacked request: $Session->assert_received_crumb('comment'); // Check comment moderate permission below after we have the $edited_Comment object $is_admin_page = true; $blog = param('blogid', 'integer'); $moderation = param('moderation', 'string', NULL); $status = param('status', 'string'); $expiry_status = param('expiry_status', 'string', 'active'); $limit = param('limit', 'integer', 0); $edited_Comment =& Comment_get_by_ID(param('commentid', 'integer'), false); if ($edited_Comment !== false) { // The comment still exists