~ubuntu-branches/ubuntu/saucy/mediawiki-extensions/saucy

« back to all changes in this revision

Viewing changes to dist/mediawiki-extensions-base/usr/share/mediawiki-extensions/base/InputBox/InputBox.hooks.php

  • Committer: Bazaar Package Importer
  • Author(s): Romain Beauxis
  • Date: 2010-05-04 15:13:35 UTC
  • mfrom: (0.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100504151335-54qeucg3ec108q28
Tags: 2.2
* Added Replaces:/Conflicts: to allow a proper upgrade.
Closes: #580066
* Fixed package descriptions.
Closes: #579667
* Patched mediawiki-extensions-fckeditor to make it work with
  php 5.3. The fix may not be perfect but at least it work.
  Not closing the bug (#579822) for now..

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * Hooks for InputBox extension
 
4
 *
 
5
 * @file
 
6
 * @ingroup Extensions
 
7
 */
 
8
 
 
9
// InputBox hooks
 
10
class InputBoxHooks {
 
11
 
 
12
        /* Functions */
 
13
 
 
14
        // Initialization
 
15
        public static function register() {
 
16
                global $wgParser;
 
17
 
 
18
                // Register the hook with the parser
 
19
                $wgParser->setHook( 'inputbox', array( 'InputBoxHooks', 'render' ) );
 
20
 
 
21
                // Continue
 
22
                return true;
 
23
        }
 
24
 
 
25
        // Render the input box
 
26
        public static function render( $input, $args, $parser ) {
 
27
                // Create InputBox
 
28
                $inputBox = new InputBox( $parser );
 
29
 
 
30
                // Configure InputBox
 
31
                $inputBox->extractOptions( $parser->replaceVariables( $input ) );
 
32
 
 
33
                // Return output
 
34
                return $inputBox->render();
 
35
        }
 
36
}