r50334 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50333‎ | r50334 | r50335 >
Date:16:27, 8 May 2009
Author:jan
Status:deferred
Tags:
Comment:
Add comments
Modified paths:
  • /trunk/extensions/TSPoll/TSPoll.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TSPoll/TSPoll.php
@@ -17,7 +17,7 @@
1818 * This line must be present before any global variable is referenced.
1919 */
2020
21 -// Abbrechen des Skriptes, wenn es nicht in Mediawiki eingebunden ist
 21+// Die the extension, if not MediaWiki is used
2222 if ( !defined( 'MEDIAWIKI' ) ) {
2323 echo( "This is an extension to the MediaWiki package and cannot be run standalone.\n" );
2424 die( - 1 );
@@ -42,6 +42,7 @@
4343
4444 $wgExtensionMessagesFiles['TSPoll'] = dirname( __FILE__ ) . '/TSPoll.i18n.php';
4545
 46+//Set function fpr <tspoll ...> and <TSPoll ...> to efTSPollRender
4647 function efTSPollSetup() {
4748 global $wgParser;
4849 $wgParser->setHook( 'TSPoll', 'efTSPollRender' );
@@ -49,27 +50,32 @@
5051 return true;
5152 }
5253
 54+//Set function fpr <tspoll ...> and <TSPoll ...> to efTSPollRender
5355 function efTSPollSetupHook( &$parser ) {
5456 $parser->setHook( 'TSPoll', 'efTSPollRender' );
5557 $parser->setHook( 'tspoll', 'efTSPollRender' );
5658 return true;
5759 }
5860
 61+// Get the Output of the TSPoll-Skript and return that
5962 function efTSPollRender( $input, $args, $parser ) {
6063
61 - if ( isset( $args['id'] ) && $args['id'] != "" ) {
 64+ // Control if the "id" is set. If not, it output a error
 65+ if ( isset( $args['id'] ) && $args['id'] != "" ) {
6266 $id = wfUrlencode( $args['id'] );
6367 } else {
6468 wfLoadExtensionMessages( 'TSPoll' );
6569 return wfMsg( 'tspoll-id-error' );
6670 }
67 -
 71+
 72+ // Control if "dev" is set. If not, it use the normal skript, else, it use the dev skript
6873 if ( isset( $args['dev'] ) && $args['dev'] == "1" ) { // If the arrgument dev is given, use the TSPoll-Dev-Version
6974 $get_server = Http::get( 'http://toolserver.org/~jan/poll/dev/main.php?page=wiki_output&id='.$id );
7075 } else { // sonst die normale Version verwenden
7176 $get_server = Http::get( 'http://toolserver.org/~jan/poll/main.php?page=wiki_output&id='.$id );
7277 }
73 -
 78+
 79+ // If $get_server is empty it output a error
7480 if ( $get_server != '' ) {
7581 return $get_server;
7682 }

Status & tagging log