Skip to content

Commit

Permalink
Merge pull request #10 from toniher/master
Browse files Browse the repository at this point in the history
Extension check for SF and adding SF JS checks in form
  • Loading branch information
mwjames committed Feb 4, 2015
2 parents ccb68c8 + 6b9dba3 commit 539bf71
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions SemanticSignup.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
die( '<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticSignup/">SemanticSignup</a> is only compatible with MediaWiki 1.19 or above. You need to upgrade MediaWiki first.' );
}

if ( !defined( 'SF_VERSION' ) || version_compare( SF_VERSION, '2.8', 'lt' ) ) {
die( '<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticSignup/">SemanticSignup</a> is only compatible with Semantic Forms 2.8 or above. You need to upgrade <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms">Semantic Forms</a> first.' );
}

if ( defined( 'SES_VERSION' ) ) {
// Do not initialize more than once.
return 1;
Expand Down
12 changes: 8 additions & 4 deletions src/UserFieldsCreateTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,21 @@ function addInputItem( $name, $value, $type, $msg ) {

function execute() {
global $sfgTabIndex;

if ( !$this->haveData( 'header' ) ) {
return '';

if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.25', 'lt' ) ) {
/* In versions lower than MW 1.25, no other way http://www.mediawiki.org/wiki/Manual:$wgOut */
global $wgOut;
} else {
$wgOut = $this->getSkin()->getOutput();
}

$wgOut->addModules( 'ext.semanticforms.main' );

?>
<div id="userlogin" style="float:none;">

<h2><?php $this->msg( 'createaccount' ) ?></h2>
<p id="userloginlink"><?php $this->html( 'link' ) ?></p>
<?php $this->html( 'header' ); /* pre-table point for form plugins... */ ?>
<?php if ( @$this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?>
<table>
<tr>
Expand Down

0 comments on commit 539bf71

Please sign in to comment.