Index: trunk/extensions/Spark/Spark.php |
— | — | @@ -45,4 +45,18 @@ |
46 | 46 | |
47 | 47 | $wgExtensionMessagesFiles['Spark'] = dirname( __FILE__ ) . '/Spark.i18n.php'; |
48 | 48 | |
| 49 | +$wgAutoloadClasses['SparkHooks'] = dirname( __FILE__ ) . '/Spark.hooks.php'; |
| 50 | +$wgAutoloadClasses['SparkTag'] = dirname( __FILE__ ) . '/Spark.class.php'; |
| 51 | + |
| 52 | +$wgResourceModules['ext.spark'] = array( |
| 53 | + 'localBasePath' => dirname( __FILE__ ), |
| 54 | + 'remoteBasePath' => $egSparkScriptPath, |
| 55 | + 'styles' => array(), |
| 56 | + 'scripts' => array( 'rdf-spark/jquery.spark.js' ), |
| 57 | + 'dependencies' => array(), |
| 58 | + 'messages' => array() |
| 59 | +); |
| 60 | + |
| 61 | +$wgHooks['ParserFirstCallInit'][] = 'SparkHooks::onParserFirstCallInit'; |
| 62 | + |
49 | 63 | require_once 'Spark.settings.php'; |
\ No newline at end of file |
Index: trunk/extensions/Spark/Spark.hooks.php |
— | — | @@ -0,0 +1,43 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Static class for hooks handled by the Spark extension. |
| 6 | + * |
| 7 | + * @since 0.1 |
| 8 | + * |
| 9 | + * @file Spark.hooks.php |
| 10 | + * @ingroup Spark |
| 11 | + * |
| 12 | + * @licence GNU GPL v3+ |
| 13 | + * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
| 14 | + */ |
| 15 | +final class SparkHooks { |
| 16 | + |
| 17 | + /** |
| 18 | + * Register the spark tag extension when the parser initializes. |
| 19 | + * |
| 20 | + * @since 0.1 |
| 21 | + * |
| 22 | + * @param Parser $parser |
| 23 | + * |
| 24 | + * @return true |
| 25 | + */ |
| 26 | + public static function onParserFirstCallInit( Parser &$parser ) { |
| 27 | + $parser->setHook( 'spark', __CLASS__ . '::onSparkRender' ); |
| 28 | + return true; |
| 29 | + } |
| 30 | + |
| 31 | + /** |
| 32 | + * @since 0.1 |
| 33 | + * |
| 34 | + * @param mixed $input |
| 35 | + * @param array $args |
| 36 | + * @param Parser $parser |
| 37 | + * @param PPFrame $frame |
| 38 | + */ |
| 39 | + public static function onSparkRender( $input, array $args, Parser $parser, PPFrame $frame ) { |
| 40 | + $tag = new SparkTag( $args, $input ); |
| 41 | + return $tag->render(); |
| 42 | + } |
| 43 | + |
| 44 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/Spark/Spark.hooks.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 45 | + native |
Index: trunk/extensions/Spark/Spark.class.php |
— | — | @@ -0,0 +1,24 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Static class for hooks handled by the Spark extension. |
| 6 | + * |
| 7 | + * @since 0.1 |
| 8 | + * |
| 9 | + * @file Spark.hooks.php |
| 10 | + * @ingroup Spark |
| 11 | + * |
| 12 | + * @licence GNU GPL v3+ |
| 13 | + * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
| 14 | + */ |
| 15 | +final class SparkTag { |
| 16 | + |
| 17 | + public function __construct( array $args, $input ) { |
| 18 | + // TODO |
| 19 | + } |
| 20 | + |
| 21 | + public function render() { |
| 22 | + return ''; // TODO |
| 23 | + } |
| 24 | + |
| 25 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/Spark/Spark.class.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 26 | + native |