r63723 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63722‎ | r63723 | r63724 >
Date:01:38, 14 March 2010
Author:jeroendedauw
Status:ok
Tags:
Comment:
Stylized with Stylize.php to conform with MW's spacing conventions
Modified paths:
  • /trunk/extensions/Storyboard/Storyboard.i18n.php (modified) (history)
  • /trunk/extensions/Storyboard/api/ApiQueryStories.php (modified) (history)
  • /trunk/extensions/Storyboard/api/ApiStoryReview.php (modified) (history)
  • /trunk/extensions/Storyboard/specials/Story/Story_body.php (modified) (history)
  • /trunk/extensions/Storyboard/specials/StoryReview/StoryReview_body.php (modified) (history)
  • /trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Storyboard/specials/Story/Story_body.php
@@ -22,8 +22,8 @@
2323 public function execute( $identifier ) {
2424 wfProfileIn( __METHOD__ );
2525
26 - if ( trim($identifier) == '' ) {
27 - global $wgOut;
 26+ if ( trim( $identifier ) == '' ) {
 27+ global $wgOut;
2828 $wgOut->addHTML( wfMsg( 'storyboard-nostorytitle' ) );
2929 return;
3030 }
@@ -37,10 +37,10 @@
3838 } else {
3939 $conds = array(
4040 'story_title' => str_replace( '_', ' ', $identifier ) // TODO: escaping required?
41 - );
 41+ );
4242 }
4343
44 - $stories = $dbr->Select(
 44+ $stories = $dbr->Select(
4545 'storyboard',
4646 array(
4747 'story_id',
@@ -48,7 +48,7 @@
4949 'story_title',
5050 'story_text',
5151 'story_created',
52 - 'story_is_published',
 52+ 'story_is_published',
5353 ),
5454 $conds
5555 );
@@ -61,7 +61,7 @@
6262 }
6363 else {
6464 $wgOut->addHTML( wfMsg( 'storyboard-unpublished' ) );
65 - }
 65+ }
6666 }
6767 else {
6868 global $wgOut;
Index: trunk/extensions/Storyboard/specials/StoryReview/StoryReview_body.php
@@ -23,7 +23,7 @@
2424 wfProfileIn( __METHOD__ );
2525
2626 global $wgUser;
27 - if( $this->userCanExecute( $wgUser ) ){
 27+ if ( $this->userCanExecute( $wgUser ) ) {
2828 // If the user has the storyreview permission and is not blocked, show the regular output.
2929 $this->addOutput();
3030 } else {
@@ -52,7 +52,7 @@
5353 'story_author_name',
5454 'story_title',
5555 'story_text',
56 - 'story_is_published'
 56+ 'story_is_published'
5757 ),
5858 array( 'story_is_hidden' => 0 )
5959 );
@@ -75,7 +75,7 @@
7676 $revMsg = wfMsg( 'storyboard-reviewed' );
7777
7878 // Output the html for the stories.
79 - $wgOut->addHTML(<<<EOT
 79+ $wgOut->addHTML( <<<EOT
8080 <h2>$unrevMsg</h2>
8181 <table width="100%">
8282 $unreviewed
Index: trunk/extensions/Storyboard/api/ApiStoryReview.php
@@ -44,7 +44,7 @@
4545
4646 if ( !$wgUser->isAllowed( 'storyreview' ) || $wgUser->isBlocked() ) {
4747 $this->dieUsageMsg( array( 'storyreview' ) );
48 - }
 48+ }
4949
5050 $params = $this->extractRequestParams();
5151
@@ -82,11 +82,11 @@
8383 $values = array(
8484 'story_is_published' => 1
8585 );
86 - break;
 86+ break;
8787 case 'unpublish' :
8888 $values = array(
8989 'story_is_published' => 0
90 - );
 90+ );
9191 break;
9292 case 'hideimage' :
9393 $values = array(
@@ -102,7 +102,7 @@
103103 $values = array(
104104 'story_author_image' => ''
105105 );
106 - break;
 106+ break;
107107 }
108108
109109 $dbw->update( 'storyboard', $values, $conds );
@@ -112,16 +112,16 @@
113113 public function getAllowedParams() {
114114 return array(
115115 'storyid' => array(
116 - ApiBase :: PARAM_TYPE => 'integer',
 116+ ApiBase :: PARAM_TYPE => 'integer',
117117 ),
118 - 'storyaction' => null,
 118+ 'storyaction' => null,
119119 );
120 - }
 120+ }
121121
122122 public function getParamDescription() {
123123 return array(
124124 'storyid' => '',
125 - 'storyaction' => '',
 125+ 'storyaction' => '',
126126 );
127127 }
128128
@@ -134,7 +134,7 @@
135135 public function getPossibleErrors() {
136136 return array_merge( parent::getPossibleErrors(), array(
137137 array( 'missingparam', 'storyid' ),
138 - array( 'missingparam', 'storyaction' ),
 138+ array( 'missingparam', 'storyaction' ),
139139 ) );
140140 }
141141
@@ -148,5 +148,5 @@
149149
150150 public function getVersion() {
151151 return __CLASS__ . ': $Id$';
152 - }
 152+ }
153153 }
\ No newline at end of file
Index: trunk/extensions/Storyboard/api/ApiQueryStories.php
@@ -89,7 +89,7 @@
9090 ApiBase :: PARAM_MAX => ApiBase :: LIMIT_BIG1,
9191 ApiBase :: PARAM_MAX2 => ApiBase :: LIMIT_BIG2
9292 ),
93 - 'continue' => null,
 93+ 'continue' => null,
9494 );
9595 }
9696
@@ -126,6 +126,6 @@
127127
128128 public function getVersion() {
129129 return __CLASS__ . ': $Id$';
130 - }
 130+ }
131131
132132 }
\ No newline at end of file
Index: trunk/extensions/Storyboard/Storyboard.i18n.php
@@ -23,10 +23,10 @@
2424 // Special:Story
2525 'storyboard-nosuchstory' => 'The story you requested does not exist. It might have been removed.',
2626 'storyboard-unpublished' => 'The story you requested has not been published yet.',
27 - 'storyboard-nostorytitle' => 'You need to specify the title or id of the story you want to view.',
 27+ 'storyboard-nostorytitle' => 'You need to specify the title or id of the story you want to view.',
2828
2929 // Story review
30 - 'storyboard-storyreview' => 'Story review',
 30+ 'storyboard-storyreview' => 'Story review',
3131 'storyboard-publish' => 'Publish',
3232 'storyboard-unpublish' => 'Unpublish',
3333 'storyboard-reviewed' => 'Reviewed',
Index: trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php
@@ -52,8 +52,8 @@
5353 $fieldSize = 50;
5454
5555 $width = StoryboardUtils::getDimension( $args, 'width', $egStorysubmissionWidth );
56 - $maxLen = array_key_exists('maxlength', $args) && is_numeric($args['maxlength']) ? $args['maxlength'] : $egStoryboardMaxStoryLen;
57 - $minLen = array_key_exists('minlength', $args) && is_numeric($args['minlength']) ? $args['minlength'] : $egStoryboardMinStoryLen;
 56+ $maxLen = array_key_exists( 'maxlength', $args ) && is_numeric( $args['maxlength'] ) ? $args['maxlength'] : $egStoryboardMaxStoryLen;
 57+ $minLen = array_key_exists( 'minlength', $args ) && is_numeric( $args['minlength'] ) ? $args['minlength'] : $egStoryboardMinStoryLen;
5858
5959 $submissionUrl = $parser->getTitle()->getLocalURL( 'action=purge' );
6060
@@ -64,39 +64,39 @@
6565 $defaultName = $wgUser->getRealName() !== '' ? $wgUser->getRealName() : $wgUser->getName();
6666 }
6767 $formBody .= '<tr>' .
68 - Html::element( 'td', array('width' => '100%'), wfMsg( 'storyboard-yourname' ) ) .
69 - '<td>' .
70 - Html::input('name', $defaultName, 'text', array( 'size' => $fieldSize )
 68+ Html::element( 'td', array( 'width' => '100%' ), wfMsg( 'storyboard-yourname' ) ) .
 69+ '<td>' .
 70+ Html::input( 'name', $defaultName, 'text', array( 'size' => $fieldSize )
7171 ) . '</td></tr>';
7272
7373 $formBody .= '<tr>' .
74 - Html::element( 'td', array('width' => '100%'), wfMsg( 'storyboard-location' ) ) .
75 - '<td>' . Html::input('location', '', 'text', array( 'size' => $fieldSize )
 74+ Html::element( 'td', array( 'width' => '100%' ), wfMsg( 'storyboard-location' ) ) .
 75+ '<td>' . Html::input( 'location', '', 'text', array( 'size' => $fieldSize )
7676 ) . '</td></tr>';
7777
7878 $formBody .= '<tr>' .
79 - Html::element( 'td', array('width' => '100%'), wfMsg( 'storyboard-occupation' ) ) .
80 - '<td>' . Html::input('occupation', '', 'text', array( 'size' => $fieldSize )
 79+ Html::element( 'td', array( 'width' => '100%' ), wfMsg( 'storyboard-occupation' ) ) .
 80+ '<td>' . Html::input( 'occupation', '', 'text', array( 'size' => $fieldSize )
8181 ) . '</td></tr>';
8282
8383 $formBody .= '<tr>' .
84 - Html::element( 'td', array('width' => '100%'), wfMsg( 'storyboard-contact' ) ) .
85 - '<td>' . Html::input('contact', '', 'text', array( 'size' => $fieldSize )
 84+ Html::element( 'td', array( 'width' => '100%' ), wfMsg( 'storyboard-contact' ) ) .
 85+ '<td>' . Html::input( 'contact', '', 'text', array( 'size' => $fieldSize )
8686 ) . '</td></tr>';
8787
8888 $formBody .= '<tr>' .
89 - Html::element( 'td', array('width' => '100%'), wfMsg( 'storyboard-storytitle' ) ) .
90 - '<td>' . Html::input('storytitle', '', 'text', array( 'size' => $fieldSize )
91 - ) . '</td></tr>';
 89+ Html::element( 'td', array( 'width' => '100%' ), wfMsg( 'storyboard-storytitle' ) ) .
 90+ '<td>' . Html::input( 'storytitle', '', 'text', array( 'size' => $fieldSize )
 91+ ) . '</td></tr>';
9292
9393 $formBody .= '<tr><td colspan="2">' .
9494 wfMsg( 'storyboard-story' ) .
9595 Html::element(
9696 'div',
97 - array('class' => 'storysubmission-charcount', 'id' => 'storysubmission-charlimitinfo'),
 97+ array( 'class' => 'storysubmission-charcount', 'id' => 'storysubmission-charlimitinfo' ),
9898 wfMsgExt( 'storyboard-charsneeded', 'parsemag', $minLen )
9999 ) .
100 - '<br />' .
 100+ '<br />' .
101101 Html::element(
102102 'textarea',
103103 array(
@@ -110,13 +110,13 @@
111111 '</td></tr>';
112112
113113 // TODO: add upload functionality
114 -
 114+
115115 $formBody .= '<tr><td colspan="2"><input type="checkbox" id="storyboard-agreement" />&nbsp;' .
116116 htmlspecialchars( wfMsg( 'storyboard-agreement' ) ) .
117117 '</td></tr>';
118118
119 - $formBody .= '<tr><td colspan="2">' .
120 - Html::input( '', wfMsg( 'htmlform-submit' ), 'submit', array('id' => 'storysubmission-button') ) .
 119+ $formBody .= '<tr><td colspan="2">' .
 120+ Html::input( '', wfMsg( 'htmlform-submit' ), 'submit', array( 'id' => 'storysubmission-button' ) ) .
121121 '</td></tr>';
122122
123123 $formBody .= '</table>';
@@ -145,7 +145,7 @@
146146 $dbw = wfGetDB( DB_MASTER );
147147
148148 // TODO: some sort of validation?
149 -
 149+
150150 $story = array(
151151 'story_author_name' => $wgRequest->getText( 'name' ),
152152 'story_author_location' => $wgRequest->getText( 'location' ),
@@ -164,7 +164,7 @@
165165 $dbw->insert( 'storyboard', $story );
166166
167167 $responseHtml = ''; // TODO: create html response
168 -
 168+
169169 return $responseHtml;
170170 }
171171

Status & tagging log