forked from Cavemanon/cavepaintings
More comments, removing dead code, fixing small bugs.
This commit is contained in:
@@ -18,8 +18,12 @@ class CommentListTheme extends Themelet {
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a page with a list of images, and for each image,
|
||||
* the image's comments
|
||||
* Display a page with a list of images, and for each image, the image's comments.
|
||||
*
|
||||
* @param array $images
|
||||
* @param int $page_number
|
||||
* @param int $total_pages
|
||||
* @param bool $can_post
|
||||
*/
|
||||
public function display_comment_list($images, $page_number, $total_pages, $can_post) {
|
||||
global $config, $page, $user;
|
||||
@@ -119,9 +123,9 @@ class CommentListTheme extends Themelet {
|
||||
|
||||
|
||||
/**
|
||||
* Add some comments to the page, probably in a sidebar
|
||||
* Add some comments to the page, probably in a sidebar.
|
||||
*
|
||||
* $comments = an array of Comment objects to be shown
|
||||
* @param \Comment[] $comments An array of Comment objects to be shown
|
||||
*/
|
||||
public function display_recent_comments($comments) {
|
||||
global $page;
|
||||
@@ -136,7 +140,11 @@ class CommentListTheme extends Themelet {
|
||||
|
||||
|
||||
/**
|
||||
* Show comments for an image
|
||||
* Show comments for an image.
|
||||
*
|
||||
* @param Image $image
|
||||
* @param \Comment[] $comments
|
||||
* @param bool $postbox
|
||||
*/
|
||||
public function display_image_comments(Image $image, $comments, $postbox) {
|
||||
global $page;
|
||||
@@ -153,9 +161,12 @@ class CommentListTheme extends Themelet {
|
||||
|
||||
|
||||
/**
|
||||
* Show comments made by a user
|
||||
* Show comments made by a user.
|
||||
*
|
||||
* @param \Comment[] $comments
|
||||
* @param \User $user
|
||||
*/
|
||||
public function display_recent_user_comments($comments, $user) {
|
||||
public function display_recent_user_comments($comments, User $user) {
|
||||
global $page;
|
||||
$html = "";
|
||||
foreach($comments as $comment) {
|
||||
@@ -170,7 +181,13 @@ class CommentListTheme extends Themelet {
|
||||
$page->add_block(new Block("Comments", $html, "left", 70, "comment-list-user"));
|
||||
}
|
||||
|
||||
public function display_all_user_comments($comments, $page_number, $total_pages, $user) {
|
||||
/**
|
||||
* @param \Comment[] $comments
|
||||
* @param int $page_number
|
||||
* @param int $total_pages
|
||||
* @param \User $user
|
||||
*/
|
||||
public function display_all_user_comments($comments, $page_number, $total_pages, User $user) {
|
||||
global $page;
|
||||
|
||||
assert(is_numeric($page_number));
|
||||
@@ -203,7 +220,12 @@ class CommentListTheme extends Themelet {
|
||||
$this->display_paginator($page, "comment/beta-search/{$user->name}", null, $page_number, $total_pages);
|
||||
}
|
||||
|
||||
protected function comment_to_html($comment, $trim=false) {
|
||||
/**
|
||||
* @param \Comment $comment
|
||||
* @param bool $trim
|
||||
* @return string
|
||||
*/
|
||||
protected function comment_to_html(Comment $comment, $trim=false) {
|
||||
global $config, $user;
|
||||
|
||||
$tfe = new TextFormattingEvent($comment->comment);
|
||||
@@ -276,6 +298,10 @@ class CommentListTheme extends Themelet {
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $image_id
|
||||
* @return string
|
||||
*/
|
||||
protected function build_postbox(/*int*/ $image_id) {
|
||||
global $config;
|
||||
|
||||
|
Reference in New Issue
Block a user