r62317 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62316‎ | r62317 | r62318 >
Date:19:55, 11 February 2010
Author:jeroendedauw
Status:ok (Comments)
Tags:
Comment:
Added general extension structure to hold the needed features.
Modified paths:
  • /trunk/extensions/Storyboard/INSTALL (added) (history)
  • /trunk/extensions/Storyboard/RELEASE-NOTES (added) (history)
  • /trunk/extensions/Storyboard/StoryReview_body.php (deleted) (history)
  • /trunk/extensions/Storyboard/Storyboard.php (modified) (history)
  • /trunk/extensions/Storyboard/specials (added) (history)
  • /trunk/extensions/Storyboard/specials/StoryReview_body.php (added) (history)
  • /trunk/extensions/Storyboard/tags (added) (history)
  • /trunk/extensions/Storyboard/tags/Storyboard_body.php (added) (history)
  • /trunk/extensions/Storyboard/tags/Storysubmission_body.php (added) (history)

Diff [purge]

Index: trunk/extensions/Storyboard/StoryReview_body.php
@@ -1,26 +0,0 @@
2 -<?php
3 -/**
4 - * File holding the SpecialStoryReview class that allows reviewers to moderate the submitted stories.
5 - *
6 - * @file StoryReview_body.php
7 - * @ingroup Storyboard
8 - *
9 - * @author Jeroen De Dauw
10 - */
11 -
12 -if ( !defined( 'MEDIAWIKI' ) ) {
13 - die( 'Not an entry point.' );
14 -}
15 -
16 -class SpecialStoryReview extends IncludableSpecialPage {
17 -
18 - function __construct() {
19 - parent::__construct( 'StoryReview' );
20 -
21 - wfLoadExtensionMessages( 'Storyboard' );
22 - }
23 -
24 - function execute( $language ) {
25 - global $wgOut;
26 - }
27 -}
Index: trunk/extensions/Storyboard/specials/StoryReview_body.php
@@ -0,0 +1,26 @@
 2+<?php
 3+/**
 4+ * File holding the SpecialStoryReview class that allows reviewers to moderate the submitted stories.
 5+ *
 6+ * @file StoryReview_body.php
 7+ * @ingroup Storyboard
 8+ *
 9+ * @author Jeroen De Dauw
 10+ */
 11+
 12+if ( !defined( 'MEDIAWIKI' ) ) {
 13+ die( 'Not an entry point.' );
 14+}
 15+
 16+class SpecialStoryReview extends IncludableSpecialPage {
 17+
 18+ function __construct() {
 19+ parent::__construct( 'StoryReview' );
 20+
 21+ wfLoadExtensionMessages( 'Storyboard' );
 22+ }
 23+
 24+ function execute( $language ) {
 25+ global $wgOut;
 26+ }
 27+}
Index: trunk/extensions/Storyboard/INSTALL
@@ -0,0 +1,5 @@
 2+Once you have downloaded the code, place the 'Storyboard' directory within your MediaWiki 'extensions' directory.
 3+Then add the following code to your LocalSettings.php file:
 4+
 5+# Maps
 6+require_once( "$IP/extensions/Storyboard/Storyboard.php" );
\ No newline at end of file
Index: trunk/extensions/Storyboard/RELEASE-NOTES
Index: trunk/extensions/Storyboard/Storyboard.php
@@ -37,10 +37,24 @@
3838 $wgExtensionAliasesFiles['Storyboard'] = $egStoryboardDir . 'Storyboard.alias.php';
3939
4040 // Load and register the StoryReview special page and register it's group.
41 -$wgAutoloadClasses['SpecialStoryReview'] = $egStoryboardDir . 'StoryReview_body.php';
 41+$wgAutoloadClasses['SpecialStoryReview'] = $egStoryboardDir . 'specials/StoryReview_body.php';
4242 $wgSpecialPages['StoryReview'] = 'SpecialStoryReview';
4343 $wgSpecialPageGroups['StoryReview'] = 'contribution';
4444
 45+// Load the tag extension classes.
 46+$wgAutoloadClasses['TagStoryboard'] = $egStoryboardDir . 'tags/Storyboard_body.php';
 47+$wgAutoloadClasses['TagStorysubmission'] = $egStoryboardDir . 'tags/Storysubmission_body.php';
 48+
 49+// Register the tag extensions.
 50+// Avoid unstubbing $wgParser on setHook() too early on modern (1.12+) MW versions, as per r35980.
 51+if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
 52+ $wgHooks['ParserFirstCallInit'][] = 'efStoryboardStoryboardSetup';
 53+ $wgHooks['ParserFirstCallInit'][] = 'efStoryboardStorysubmissionSetup';
 54+} else { // Otherwise do things the old fashioned way.
 55+ $wgExtensionFunctions[] = 'efStoryboardStoryboardSetup';
 56+ $wgExtensionFunctions[] = 'efStoryboardStorysubmissionSetup';
 57+}
 58+
4559 /**
4660 * Initialization function for the Storyboard extension.
4761 */
@@ -59,3 +73,15 @@
6074 'descriptionmsg' => 'storyboard-desc',
6175 );
6276 }
 77+
 78+function efStoryboardStoryboardSetup() {
 79+ global $wgParser;
 80+ $wgParser->setHook( 'storyboard', array('TagStoryboard', 'render') );
 81+ return true;
 82+}
 83+
 84+function efStoryboardStorysubmissionSetup() {
 85+ global $wgParser;
 86+ $wgParser->setHook( 'storysubmission', array('TagStorysubmission', 'render') );
 87+ return true;
 88+}
Index: trunk/extensions/Storyboard/tags/Storysubmission_body.php
@@ -0,0 +1,22 @@
 2+<?php
 3+
 4+/**
 5+ * File holding the rendering function for the Storysubmission tag.
 6+ *
 7+ * @file Storysubmission_body.php
 8+ * @ingroup Storyboard
 9+ *
 10+ * @author Jeroen De Dauw
 11+ */
 12+
 13+if ( !defined( 'MEDIAWIKI' ) ) {
 14+ die( 'Not an entry point.' );
 15+}
 16+
 17+class TagStorysubmission {
 18+
 19+ public static function render( $input, $args, $parser, $frame ) {
 20+ return '';
 21+ }
 22+
 23+}
\ No newline at end of file
Index: trunk/extensions/Storyboard/tags/Storyboard_body.php
@@ -0,0 +1,25 @@
 2+<?php
 3+
 4+/**
 5+ * File holding the rendering function for the Storyboard tag.
 6+ *
 7+ * @file Storyboard_body.php
 8+ * @ingroup Storyboard
 9+ *
 10+ * @author Jeroen De Dauw
 11+ */
 12+
 13+if ( !defined( 'MEDIAWIKI' ) ) {
 14+ die( 'Not an entry point.' );
 15+}
 16+
 17+class TagStoryboard {
 18+
 19+ public static function render( $input, $args, $parser, $frame ) {
 20+ return '';
 21+ }
 22+
 23+}
 24+
 25+
 26+

Comments

#Comment by Bryan (talk | contribs)   21:45, 11 February 2010

svn:eol-style

Status & tagging log