r103754 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103753‎ | r103754 | r103755 >
Date:13:36, 20 November 2011
Author:jeroendedauw
Status:reverted
Tags:
Comment:
added fields to classes and some docs
Modified paths:
  • /trunk/extensions/Reviews/includes/Review.php (modified) (history)
  • /trunk/extensions/Reviews/includes/ReviewRating.php (modified) (history)
  • /trunk/extensions/Reviews/resources/jquery.reviewControl.css (modified) (history)
  • /trunk/extensions/Reviews/resources/jquery.reviewControl.js (modified) (history)
  • /trunk/extensions/Reviews/resources/reviews.review.control.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Reviews/includes/Review.php
@@ -58,8 +58,14 @@
5959 protected static function getFieldTypes() {
6060 return array(
6161 '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',
6470 );
6571 }
6672
@@ -75,8 +81,24 @@
7682 );
7783 }
7884
 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+ */
7993 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;
81103 }
82104
83105 }
Index: trunk/extensions/Reviews/includes/ReviewRating.php
@@ -45,7 +45,9 @@
4646 protected static function getFieldTypes() {
4747 return array(
4848 'id' => 'id',
49 -
 49+ 'review_id' => 'int',
 50+
 51+ 'type' => 'int',
5052 );
5153 }
5254
@@ -61,6 +63,15 @@
6264 );
6365 }
6466
 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+ */
6576 public static function getTypesForContext( ContextSource $context ) {
6677 $ratingsPerCat = ReviewsSettings::get( 'categoryRatings' );
6778 $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 @@
22 /**
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 @@
22 /**
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 );

Status & tagging log