r110902 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110901‎ | r110902 | r110903 >
Date:00:14, 8 February 2012
Author:werdna
Status:ok
Tags:
Comment:
Two more fixes:
1. Issue with lack of e.preventDefault()
2. I forgot that not everybody stops anons from creating pages
Modified paths:
  • /trunk/extensions/ArticleCreationWorkflow/includes/ArticleCreationTemplates.php (modified) (history)
  • /trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.user/ext.articleCreation.user.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleCreationWorkflow/includes/ArticleCreationTemplates.php
@@ -7,11 +7,12 @@
88
99 public static function getLandingPage( $page ) {
1010 $action = wfMessage( 'ac-action-indicator' )->escaped();
11 -
1211 global $wgUser, $wgArticleCreationButtons;
1312
 13+ $title = Title::newFromText( $page );
 14+
1415 $buttons = array();
15 - if ( $wgUser->isAnon() ) {
 16+ if ( ! $title->userCan('create') || ! $title->userCan('edit') ) {
1617 $buttons = $wgArticleCreationButtons['anonymous'];
1718 } else {
1819 $buttons = $wgArticleCreationButtons['logged-in'];
Index: trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.user/ext.articleCreation.user.js
@@ -48,7 +48,8 @@
4949 ac.panel
5050 .find('.ac-article-button')
5151 .click (function () {
52 -
 52+ e.preventDefault();
 53+
5354 $('.ac-article-button')
5455 //remove green states and hide their tooltips
5556 .removeClass('ac-button-green')

Status & tagging log