Last modified: 2009-07-31 09:55:59 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T21433, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 19433 - add MultiBoilerplate.page.php component - list boilerplates
add MultiBoilerplate.page.php component - list boilerplates
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
MultiBoilerplate (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Robert Leverington
http://www.mediawiki.org/wiki/Extensi...
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-29 17:24 UTC by Al Maghi
Modified: 2009-07-31 09:55 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch extension and extension messages (2.66 KB, patch)
2009-06-29 17:24 UTC, Al Maghi
Details
Code of special page listing boilerplates (2.62 KB, application/octet-stream)
2009-06-29 17:25 UTC, Al Maghi
Details
no more hard-coded english (3.11 KB, patch)
2009-06-29 19:44 UTC, Al Maghi
Details
Cleaner Code for SpecialPage (2.49 KB, text/plain)
2009-06-29 19:46 UTC, Al Maghi
Details
Patch to be commited (6.88 KB, patch)
2009-07-15 00:14 UTC, Al Maghi
Details
Make the boilerplates listing includable (7.00 KB, patch)
2009-07-15 00:21 UTC, Al Maghi
Details
Clean code thanks to Niklas Laxström (6.58 KB, patch)
2009-07-16 16:35 UTC, Al Maghi
Details
parent class in constructor (6.56 KB, patch)
2009-07-16 16:45 UTC, Al Maghi
Details
cleaning .i18n (6.61 KB, patch)
2009-07-16 17:25 UTC, Al Maghi
Details
+ MediaWiki:Multiboilerplate customization (7.64 KB, patch)
2009-07-22 22:55 UTC, Al Maghi
Details

Description Al Maghi 2009-06-29 17:24:34 UTC
Created attachment 6281 [details]
Patch extension and extension messages

Addition of a parameter to display a special page listing boilerplates. Default is false i.e. no special page.
Comment 1 Al Maghi 2009-06-29 17:25:46 UTC
Created attachment 6282 [details]
Code of special page listing boilerplates
Comment 2 Al Maghi 2009-06-29 19:44:22 UTC
Created attachment 6283 [details]
no more hard-coded english

With ^demon suggest: "and youve got a bunch of hard-coded english"
Comment 3 Al Maghi 2009-06-29 19:46:19 UTC
Created attachment 6284 [details]
Cleaner Code for SpecialPage

With ^demon suggest: 
"^demon: almaghi: you dont need to pass '' and true in your SpecialPage constructor.
^demon: and you'll want newlines after "* [[$template]]" or it'll all end up on one line."
Comment 4 Al Maghi 2009-07-15 00:14:46 UTC
Created attachment 6335 [details]
Patch to be commited
Comment 5 Al Maghi 2009-07-15 00:21:31 UTC
Created attachment 6336 [details]
Make the boilerplates listing includable
Comment 6 Niklas Laxström 2009-07-15 08:26:53 UTC
(In reply to comment #5)
> Created an attachment (id=6336) [details]
> Make the boilerplates listing includable

Why $ in messages? Variables aren't parsed in single quotes.

> 'multiboilerplate-desc'   => 'Allows a [[special:boilerplates|boilerplate]] to be selected from a drop down box located above the edit form when editing pages',
> +	'description'    => 'Allows a [[special:boilerplates|boilerplate]] to be selected from a drop down box located above the edit form when editing pages.',
> + * Special:boilerplates, provides a list of MediaWiki:Multiboilerplate or $wgMultiBoilerplateOptions.
Inconsistent casing.

+if( !defined( 'MEDIAWIKI' ) ) {
+    echo( "not a valid entry point.\n" );
+    die( 1 );
+}

Unnecessary with a file which only has a class definition.

> +        IncludableSpecialPage::SpecialPage( 'Boilerplates' );
parent:: ? Can't remember right now if it was safe to call old-style construct with __construct or new style constructor with old style class name.

+        $wgOut->addWikiText( wfMsg( "multiboilerplate-special-pagetext" ) );
addWikiMsg for this and other similar instances

+		$wgOut->addHTML( '<h2>' );
+		$wgOut->addWikiText( wfMsg( "boilerplates-name" ) );
+		$wgOut->addHTML(  '</h2>' );
wrapWikiMsg perhaps?

+		if( !$this->mIncluding ) $wgOut->addWikiText( wfMsg( "multiboilerplate-special-define-on-localsettings" ) );
there is also accessor including()

+			if( $wgRequest->getVal( 'boilerplate' ) == $template ) $selected = true;
Usually constants like $wgRequest->getVal( 'boilerplate' ) are first put into variable outside of the loop.
I'd also use getText and === to be sure.

+			$options .= Xml::option( $name, $template, $selected );
Wtf are you doing here? Building Xml options and not using them for anything.

+		$things = wfMsg( 'multiboilerplate' );
Is this supposed to change with user interface language?

The patch has inconsistent spacing, possible mixing spaces and tabs for indentation.

+	if( $options == '' ) return true;	
+ 
+	}
Something tells me there is shortway way to write this.

+        global $wgOut, $wgUser, $wgLang, $wgContLang, $wgMultiBoilerplateOptions, $wgMultiBoilerplateOverwrite, $wgArticle, $wgTitle, $wgRequest;
There are unused globals in this list.

+$wgMultiBoilerplateDiplaySpecialPage = true;
What's the purpose of this? What is the purpose of the whole patch?
Comment 7 Al Maghi 2009-07-16 16:35:15 UTC
Created attachment 6343 [details]
Clean code thanks to Niklas Laxström
Comment 8 Al Maghi 2009-07-16 16:45:51 UTC
Created attachment 6344 [details]
parent class in constructor
Comment 9 Al Maghi 2009-07-16 16:51:41 UTC
(In reply to comment #6)
> (In reply to comment #5) 
> +$wgMultiBoilerplateDiplaySpecialPage = true;
> What's the purpose of this? What is the purpose of the whole patch?
> 
I had a wiki user asking me "where are located the boilerplates" and he was looking for a special page.

For wikis that don't want that extra special page, $wgMultiBoilerplateDiplaySpecialPage = False
Comment 10 Al Maghi 2009-07-16 17:25:09 UTC
Created attachment 6347 [details]
cleaning .i18n
Comment 11 Al Maghi 2009-07-22 22:55:21 UTC
Created attachment 6382 [details]
+ MediaWiki:Multiboilerplate customization

for MediaWiki:Multiboilerplate customization:

+	if (substr(ltrim($row), 0, 1)=="*")
Comment 12 Robert Leverington 2009-07-31 09:55:59 UTC
Done in r54083.  Thanks!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links