Index: trunk/extensions/Reviews/includes/Review.php |
— | — | @@ -58,8 +58,14 @@ |
59 | 59 | protected static function getFieldTypes() { |
60 | 60 | return array( |
61 | 61 | 'id' => 'id', |
62 | | - 'time' => 'str', // TS_MW |
63 | | - |
| 62 | + 'page_id' => 'int', |
| 63 | + 'user_id' => 'int', |
| 64 | + |
| 65 | + 'text' => 'str', |
| 66 | + 'post_time' => 'str', // TS_MW |
| 67 | + 'edit_time' => 'str', // TS_MW |
| 68 | + 'state' => 'int', |
| 69 | + 'rating' => 'int', |
64 | 70 | ); |
65 | 71 | } |
66 | 72 | |
— | — | @@ -75,8 +81,24 @@ |
76 | 82 | ); |
77 | 83 | } |
78 | 84 | |
| 85 | + /** |
| 86 | + * Remove the review and all it's linked data, such as ratings, |
| 87 | + * from the database. |
| 88 | + * |
| 89 | + * @since 0.1 |
| 90 | + * |
| 91 | + * @return boolean Success indicator |
| 92 | + */ |
79 | 93 | public function removeAllFromDB() { |
80 | | - |
| 94 | + $id = $this->getId(); |
| 95 | + |
| 96 | + $success = $this->removeFromDB(); |
| 97 | + |
| 98 | + if ( $success ) { |
| 99 | + $success = ReviewRating::delete( array( 'review_id' => $id ) ) && $success; |
| 100 | + } |
| 101 | + |
| 102 | + return $success; |
81 | 103 | } |
82 | 104 | |
83 | 105 | } |
Index: trunk/extensions/Reviews/includes/ReviewRating.php |
— | — | @@ -45,7 +45,9 @@ |
46 | 46 | protected static function getFieldTypes() { |
47 | 47 | return array( |
48 | 48 | 'id' => 'id', |
49 | | - |
| 49 | + 'review_id' => 'int', |
| 50 | + |
| 51 | + 'type' => 'int', |
50 | 52 | ); |
51 | 53 | } |
52 | 54 | |
— | — | @@ -61,6 +63,15 @@ |
62 | 64 | ); |
63 | 65 | } |
64 | 66 | |
| 67 | + /** |
| 68 | + * Gets a list of the types of ratings that should show up for the context. |
| 69 | + * |
| 70 | + * @since 0.1 |
| 71 | + * |
| 72 | + * @param ContextSource $context |
| 73 | + * |
| 74 | + * @return array |
| 75 | + */ |
65 | 76 | public static function getTypesForContext( ContextSource $context ) { |
66 | 77 | $ratingsPerCat = ReviewsSettings::get( 'categoryRatings' ); |
67 | 78 | $ratings = array(); |
Index: trunk/extensions/Reviews/resources/jquery.reviewControl.css |
— | — | @@ -1 +1,7 @@ |
2 | | -@CHARSET "UTF-8"; |
\ No newline at end of file |
| 2 | +/** |
| 3 | + * CSS for the Reviews MediaWiki extension. |
| 4 | + * @see https://www.mediawiki.org/wiki/Extension:Reviews |
| 5 | + * |
| 6 | + * @licence GNU GPL v3 or later |
| 7 | + * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
| 8 | + */ |
\ No newline at end of file |
Index: trunk/extensions/Reviews/resources/jquery.reviewControl.js |
— | — | @@ -1,3 +1,24 @@ |
2 | 2 | /** |
3 | | - * |
4 | | - */ |
\ No newline at end of file |
| 3 | + * JavasSript for the Reviews MediaWiki extension. |
| 4 | + * @see https://www.mediawiki.org/wiki/Extension:Reviews |
| 5 | + * |
| 6 | + * @licence GNU GPL v3 or later |
| 7 | + * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
| 8 | + */ |
| 9 | + |
| 10 | +(function( $, mw ) { |
| 11 | + |
| 12 | + $.fn.reviewControl = function() { |
| 13 | + var _this = this; |
| 14 | + var $this = $( this ); |
| 15 | + |
| 16 | + this.setup = function() { |
| 17 | + |
| 18 | + }; |
| 19 | + |
| 20 | + this.setup(); |
| 21 | + |
| 22 | + return this; |
| 23 | + }; |
| 24 | + |
| 25 | +})( window.jQuery, window.mediaWiki ); |
Index: trunk/extensions/Reviews/resources/reviews.review.control.js |
— | — | @@ -1,3 +1,15 @@ |
2 | 2 | /** |
3 | | - * |
4 | | - */ |
\ No newline at end of file |
| 3 | + * JavasSript for the Reviews MediaWiki extension. |
| 4 | + * @see https://www.mediawiki.org/wiki/Extension:Reviews |
| 5 | + * |
| 6 | + * @licence GNU GPL v3 or later |
| 7 | + * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
| 8 | + */ |
| 9 | + |
| 10 | +(function( $, mw ) { $( document ).ready( function() { |
| 11 | + |
| 12 | + var _this = this; |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | +} ); })( window.jQuery, window.mediaWiki ); |