Index: trunk/extensions/Reviews/Reviews.i18n.php |
— | — | @@ -68,6 +68,9 @@ |
69 | 69 | 'reviews-myreviews-editheader' => 'On this page you can edit your review. You can also view a list of [[Special:MyReviews|reviews you posted]].', |
70 | 70 | |
71 | 71 | // Special:Reviews |
| 72 | + 'reviews-reviews-header' => 'This page lists all reviews posted on this wiki', |
| 73 | + 'reviews-reviews-nosuchreview' => 'You do not have a review with the provided ID, it might have been deleted. All reviews are listed below.', |
| 74 | + 'reviews-reviews-editheader' => 'On this page you can manage this review. You can also view a list of [[Special:Reviews|all reviews]].', |
72 | 75 | |
73 | 76 | // Review pager |
74 | 77 | 'reviews-pager-no-results' => 'There are no reviews to list.', |
— | — | @@ -77,6 +80,7 @@ |
78 | 81 | 'reviews-pager-user' => 'User', |
79 | 82 | 'reviews-pager-page' => 'For page', |
80 | 83 | 'reviews-pager-rating' => 'Rating', |
| 84 | + 'reviews-pager-deleted' => 'The page was deleted', |
81 | 85 | ); |
82 | 86 | |
83 | 87 | /** Message documentation (Message documentation) |
Index: trunk/extensions/Reviews/specials/SpecialMyReviews.php |
— | — | @@ -61,7 +61,7 @@ |
62 | 62 | else { |
63 | 63 | $review = Review::selectRow( null, array( 'id' => $subPage, 'user_id' => $this->getUser()->getId() ) ); |
64 | 64 | |
65 | | - if ( $review == false ) { |
| 65 | + if ( $review === false ) { |
66 | 66 | $this->getOutput()->addWikiMsg( 'reviews-myreviews-nosuchreview' ); |
67 | 67 | $this->displayReviewList(); |
68 | 68 | } |
Index: trunk/extensions/Reviews/specials/SpecialReviews.php |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | * @since 0.1 |
23 | 23 | */ |
24 | 24 | public function __construct() { |
25 | | - parent::__construct( 'Reviews', 'postreview' ); |
| 25 | + parent::__construct( 'Reviews', 'reviewsadmin' ); |
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
— | — | @@ -54,19 +54,29 @@ |
55 | 55 | return false; |
56 | 56 | } |
57 | 57 | |
58 | | - if ( $this->getRequest()->wasPosted() ) { |
59 | | - |
| 58 | + if ( $subPage === '' ) { |
| 59 | + $this->getOutput()->addWikiMsg( 'reviews-reviews-header' ); |
| 60 | + $this->displayReviewList(); |
60 | 61 | } |
61 | 62 | else { |
62 | | - if ( $subPage === '' ) { |
| 63 | + $review = Review::selectRow( null, array( 'id' => $subPage ) ); |
| 64 | + |
| 65 | + if ( $review === false ) { |
| 66 | + $this->getOutput()->addWikiMsg( 'reviews-reviews-nosuchreview' ); |
63 | 67 | $this->displayReviewList(); |
64 | 68 | } |
65 | 69 | else { |
66 | | - // TODO |
| 70 | + $this->getOutput()->addWikiMsg( 'reviews-reviews-editheader' ); |
| 71 | + $this->displayEditControl( $review ); |
67 | 72 | } |
68 | 73 | } |
69 | 74 | } |
70 | 75 | |
| 76 | + /** |
| 77 | + * Display the list of reviews. |
| 78 | + * |
| 79 | + * @since 0.1 |
| 80 | + */ |
71 | 81 | protected function displayReviewList() { |
72 | 82 | $reviewPager = new ReviewPager( array() ); |
73 | 83 | |
Index: trunk/extensions/Reviews/includes/ReviewPager.php |
— | — | @@ -113,19 +113,12 @@ |
114 | 114 | break; |
115 | 115 | case 'review_page_id': |
116 | 116 | $title = Title::newFromID( $value ); |
117 | | - $value = Html::element( |
118 | | - 'a', |
119 | | - array( 'href' => $title->getLocalURL() ), |
120 | | - $title->getFullText() |
121 | | - ); |
| 117 | + $value = is_null( $title ) ? wfMsg( 'reviews-pager-deleted' ) : Linker::link( $title ); |
122 | 118 | break; |
123 | 119 | case 'review_user_id': |
124 | | - $title = User::newFromId( $value )->getUserPage(); |
125 | | - $value = Html::element( |
126 | | - 'a', |
127 | | - array( 'href' => $title->getLocalURL() ), |
128 | | - $title->getFullText() |
129 | | - ); |
| 120 | + $user = User::newFromId( $value ); |
| 121 | + $value = Linker::userLink( $user->getId(), $user->getName() ) . |
| 122 | + Linker::userToolLinks( $user->getId(), $user->getName() ); |
130 | 123 | break; |
131 | 124 | case 'review_title': |
132 | 125 | if ( $this->editPage !== false ) { |