Index: trunk/extensions/Review/Review.php |
— | — | @@ -92,16 +92,16 @@ |
93 | 93 | foreach ( $s AS $v ) { |
94 | 94 | $v = explode ( ':' , trim ( $v ) ) ; |
95 | 95 | if ( count ( $v ) != 5 ) continue ; # Some other line, ignore it |
96 | | - $x = "" ; |
97 | | - $x->key = (int) trim ( array_shift ( $v ) ) ; |
98 | | - $x->name = trim ( array_shift ( $v ) ) ; |
99 | | - $x->range = (int) trim ( array_shift ( $v ) ) ; |
100 | | - $x->left = trim ( array_shift ( $v ) ) ; |
101 | | - $x->right = trim ( array_shift ( $v ) ) ; |
102 | | - if ( $x->key == 0 ) continue ; # Paranoia |
103 | | - if ( $x->range < 2 ) continue ; # Paranoia |
104 | | - if ( $x->name == "" ) continue ; # Paranoia |
105 | | - $wgReviewExtensionTopics[$x->key] = $x ; |
| 96 | + $x = array(); |
| 97 | + $x['key'] = (int) trim ( array_shift ( $v ) ) ; |
| 98 | + $x['name'] = trim ( array_shift ( $v ) ) ; |
| 99 | + $x['range'] = (int) trim ( array_shift ( $v ) ) ; |
| 100 | + $x['left'] = trim ( array_shift ( $v ) ) ; |
| 101 | + $x['right'] = trim ( array_shift ( $v ) ) ; |
| 102 | + if ( $x['key'] == 0 ) continue ; # Paranoia |
| 103 | + if ( $x['range'] < 2 ) continue ; # Paranoia |
| 104 | + if ( $x['name'] == "" ) continue ; # Paranoia |
| 105 | + $wgReviewExtensionTopics[$x['key']] = $x ; |
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
— | — | @@ -115,7 +115,7 @@ |
116 | 116 | if ( !isset ( $topic->value ) ) |
117 | 117 | $topic->value = 0 ; |
118 | 118 | |
119 | | - $tkey = "review_topic[" . $topic->key . "]" ; |
| 119 | + $tkey = "review_topic[" . $topic['key'] . "]" ; |
120 | 120 | $ret = "" ; |
121 | 121 | if ( $fullpage ) |
122 | 122 | $ret .= "<td align='center'>" ; |
— | — | @@ -125,31 +125,31 @@ |
126 | 126 | $ret .= "/></td>" ; |
127 | 127 | else |
128 | 128 | $ret .= '/> ' ; |
129 | | - if ( $topic->range == 2 ) { # Yes/No |
| 129 | + if ( $topic['range'] == 2 ) { # Yes/No |
130 | 130 | if ( $fullpage ) |
131 | 131 | $ret .= "<td/><td nowrap>" ; |
132 | 132 | $ret .= '<input type="radio" name="' . $tkey . '" value="1" id="review_radio_1_of_2"' ; |
133 | 133 | $ret .= $topic->value == 1 ? " checked" : "" ; |
134 | | - $ret .= '></input>' . $topic->left . ' ' ; |
| 134 | + $ret .= '></input>' . $topic['left'] . ' ' ; |
135 | 135 | $ret .= '<input type="radio" name="' . $tkey . '" value="2" id="review_radio_2_of_2"' ; |
136 | 136 | $ret .= $topic->value == 2 ? " checked" : "" ; |
137 | | - $ret .= '/>' . $topic->right ; |
| 137 | + $ret .= '/>' . $topic['right'] ; |
138 | 138 | if ( $fullpage ) |
139 | 139 | $ret .= "</td><td/><td>" ; |
140 | 140 | } else { # Range |
141 | 141 | if ( $fullpage ) |
142 | | - $ret .= "<td align='right' nowrap>" . $topic->left . "</td><td nowrap>" ; |
143 | | - for ( $a = 1 ; $a <= $topic->range ; $a++ ) { |
| 142 | + $ret .= "<td align='right' nowrap>" . $topic['left'] . "</td><td nowrap>" ; |
| 143 | + for ( $a = 1 ; $a <= $topic['range'] ; $a++ ) { |
144 | 144 | $ret .= '<input type="radio" name="' . $tkey . '" value="' . $a . '"' ; |
145 | | - $ret .= " id='review_radio_" . $a . "_of_" . $topic->range . "'" ; # This doesn't show for some weird reason... |
| 145 | + $ret .= " id='review_radio_" . $a . "_of_" . $topic['range'] . "'" ; # This doesn't show for some weird reason... |
146 | 146 | $ret .= $topic->value == $a ? " checked" : "" ; |
147 | 147 | $ret .= '/>' ; |
148 | 148 | } |
149 | 149 | if ( $fullpage ) |
150 | | - $ret .= "</td><td nowrap>" . $topic->right . "</td><td width='100%'>" ; |
| 150 | + $ret .= "</td><td nowrap>" . $topic['right'] . "</td><td width='100%'>" ; |
151 | 151 | } |
152 | 152 | if ( $fullpage ) { |
153 | | - $ret .= "<input type='text' style='width:100%' name='review_comment[" . $topic->key . "]' value='" . htmlentities ( $topic->comment ) . "'/>" ; |
| 153 | + $ret .= "<input type='text' style='width:100%' name='review_comment[" . $topic['key'] . "]' value='" . htmlentities ( $topic->comment ) . "'/>" ; |
154 | 154 | $ret .= "</td>\n" ; |
155 | 155 | } |
156 | 156 | return $ret ; |
— | — | @@ -378,17 +378,17 @@ |
379 | 379 | ?> |
380 | 380 | <a id="review_sidebar_link" href=" |
381 | 381 | <?php |
382 | | - $topic_title = Title::makeTitleSafe( NS_MEDIAWIKI, wfMsgForContent('review_topic_page').'#'.$topic->name ); |
| 382 | + $topic_title = Title::makeTitleSafe( NS_MEDIAWIKI, wfMsgForContent('review_topic_page').'#'.$topic['name'] ); |
383 | 383 | print $topic_title->escapeLocalURL(); |
384 | 384 | ?> |
385 | 385 | "> |
386 | 386 | <?php |
387 | | - echo $topic->name ; |
| 387 | + echo $topic['name'] ; |
388 | 388 | ?> |
389 | 389 | </a> |
390 | 390 | <?php |
391 | | - if ( $topic->range > 2 ) |
392 | | - print "<small> (" . $topic->left . "→" . $topic->right . ")</small><br />" ; |
| 391 | + if ( $topic['range'] > 2 ) |
| 392 | + print "<small> (" . $topic['left'] . "→" . $topic['right'] . ")</small><br />" ; |
393 | 393 | echo "<div id='review_sidebar_range'>" . wfReviewExtensionGetTopicForm ( $topic ) . "</div>" ; |
394 | 394 | ?> |
395 | 395 | <?php |
— | — | @@ -517,7 +517,7 @@ |
518 | 518 | $data[$type]->total_count = 0 ; |
519 | 519 | $data[$type]->anon_count = 0 ; |
520 | 520 | $data[$type]->sum = 0 ; |
521 | | - $data[$type]->max = $wgReviewExtensionTopics[$type]->range ; |
| 521 | + $data[$type]->max = $wgReviewExtensionTopics[$type]['range'] ; |
522 | 522 | } |
523 | 523 | $data[$type]->total_count++ ; |
524 | 524 | if ( $review->val_user == 0 ) |
— | — | @@ -598,14 +598,14 @@ |
599 | 599 | foreach ( $wgReviewExtensionTopics AS $type => $topic ) { |
600 | 600 | if ( $revision < 0 ) { |
601 | 601 | # Table header row |
602 | | - $ret .= "<th id='review_statistics_table_header'>{$topic->name}</th>" ; |
| 602 | + $ret .= "<th id='review_statistics_table_header'>{$topic['name']}</th>" ; |
603 | 603 | } else if ( $revision_mode ) { |
604 | 604 | $ret .= "<td id='review_statistics_table_cell'>" ; |
605 | 605 | if ( isset ( $data[$type] ) ) { |
606 | 606 | $ret .= "<div id='" ; |
607 | | - $ret .= "review_radio_" . $data[$type]->val_value . "_of_" . $topic->range ; |
| 607 | + $ret .= "review_radio_" . $data[$type]->val_value . "_of_" . $topic['range'] ; |
608 | 608 | $ret .= "'>" ; |
609 | | - $ret .= wfMsgForContent ( 'review_version_statistic_cell' , $data[$type]->val_value , $topic->range ) ; |
| 609 | + $ret .= wfMsgForContent ( 'review_version_statistic_cell' , $data[$type]->val_value , $topic['range'] ) ; |
610 | 610 | $ret .= "</div>" ; |
611 | 611 | } else { |
612 | 612 | $ret .= "—" ; |
— | — | @@ -723,8 +723,8 @@ |
724 | 724 | $out .= "</th><th colspan='3'>" . wfMsg('review_rating') . "</th><th>" ; |
725 | 725 | $out .= wfMsg('review_comment') . "</th></tr>" ; |
726 | 726 | foreach( $wgReviewExtensionTopics as $topic ) { |
727 | | - $topic_title = Title::makeTitleSafe( NS_MEDIAWIKI, wfMsgForContent('review_topic_page').'#'.$topic->name ); |
728 | | - $link = $skin->makeLinkObj( $topic_title,$topic->name ); |
| 727 | + $topic_title = Title::makeTitleSafe( NS_MEDIAWIKI, wfMsgForContent('review_topic_page').'#'.$topic['name'] ); |
| 728 | + $link = $skin->makeLinkObj( $topic_title,$topic['name'] ); |
729 | 729 | $out .= "<tr><th align='left' nowrap>{$link}</th>" ; |
730 | 730 | $out .= wfReviewExtensionGetTopicForm ( $topic , true ) . "</tr>" ; |
731 | 731 | |
— | — | @@ -748,7 +748,7 @@ |
749 | 749 | /** |
750 | 750 | * Special page main function |
751 | 751 | */ |
752 | | - function execute( $par = null ) { |
| 752 | + function execute( $par ) { |
753 | 753 | global $wgRequest , $wgOut , $wgUser , $wgTitle ; |
754 | 754 | wfReviewExtensionInitMessages () ; |
755 | 755 | |
— | — | @@ -772,7 +772,7 @@ |
773 | 773 | } |
774 | 774 | |
775 | 775 | if ( $page_id == 0 ) { |
776 | | - if( $par != null){ |
| 776 | + if( $par != ''){ |
777 | 777 | $title = Title::newFromUrl($par); |
778 | 778 | $page_id = $title->getArticleID(); |
779 | 779 | } |