r90401 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90400‎ | r90401 | r90402 >
Date:16:56, 19 June 2011
Author:yaron
Status:deferred
Tags:
Comment:
Improved some formatting and comments
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormEditTab.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormEditTab.php
@@ -33,6 +33,7 @@
3434 if ( count( $form_names ) == 0 ) {
3535 return true;
3636 }
 37+
3738 global $wgRequest, $wgUser;
3839 global $sfgRenameEditTabs, $sfgRenameMainEditTab;
3940
@@ -108,8 +109,9 @@
109110 }
110111
111112 /**
112 - * Function currently called only for the 'Vector' skin - will
113 - * possibly be called for additional skins later.
 113+ * Like displayTab(), but called with a different hook - this one is
 114+ * called for the 'Vector' skin in MW 1.16, as well as all skins
 115+ * starting with MW 1.17 (?).
114116 */
115117 static function displayTab2( $obj, &$links ) {
116118 // the old '$content_actions' array is thankfully just a
@@ -143,7 +145,7 @@
144146 }
145147 if ( count( $form_names ) > 1 ) {
146148 SFUtils::loadMessages();
147 - $warning_text = ' <div class="warningMessage">' . wfMsg( 'sf_formedit_morethanoneform' ) . "</div>\n";
 149+ $warning_text = "\t" . '<div class="warningMessage">' . wfMsg( 'sf_formedit_morethanoneform' ) . "</div>\n";
148150 $wgOut->addHTML( $warning_text );
149151 }
150152 $form_name = $form_names[0];
@@ -161,15 +163,13 @@
162164 $msg = SFFormEdit::printForm( $form_name, $page_name );
163165
164166 if ( $msg ) {
165 - // some error occurred
166 -
 167+ // Some error occurred - display it.
167168 $msgdata = null;
168 -
169169 if ( is_array( $msg ) ) {
170170 if ( count( $msg ) > 1 ) {
171 - $msgdata = $msg[ 1 ];
 171+ $msgdata = $msg[1];
172172 }
173 - $msg = $msg[ 0 ];
 173+ $msg = $msg[0];
174174 }
175175
176176 $wgOut->addHTML( Xml::element( 'p', array( 'class' => 'error' ), wfMsg( $msg, $msgdata ) ) );