r50355 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50354‎ | r50355 | r50356 >
Date:00:38, 9 May 2009
Author:charlie
Status:deferred
Tags:
Comment:
* $wgAlwaysShowIntroSection to force editor to show intro section.
* Added a RELEASE-NOTES file to track updates to the Uniwiki extensions.
Modified paths:
  • /trunk/extensions/uniwiki/GenericEditPage/GenericEditPage.php (modified) (history)
  • /trunk/extensions/uniwiki/RELEASE-NOTES (added) (history)

Diff [purge]

Index: trunk/extensions/uniwiki/GenericEditPage/GenericEditPage.php
@@ -27,6 +27,7 @@
2828 $wgSuggestCategoryRecipient = $wgEmergencyContact;
2929 $wgUseCategoryPage = false;
3030 $wgRequireCategory = false;
 31+$wgAlwaysShowIntroSection = false;
3132 $wgGenericEditPageWhiteList = array( NS_MAIN );
3233 $wgAllowSimilarTitles = true;
3334
@@ -343,6 +344,7 @@
344345 function UW_GenericEditPage_displayEditPage ( $editor, $out ) {
345346 global $wgHooks, $wgParser, $wgTitle, $wgRequest, $wgUser, $wgCategoryBox, $wgSectionBox, $wgRequireCategory;
346347 global $wgGenericEditPageClass, $wgSwitchMode, $wgGenericEditPageWhiteList, $wgAllowSimilarTitles;
 348+ global $wgAlwaysShowIntroSection;
347349
348350 // disable this whole thing on conflict and comment pages
349351 if ( $editor->section == "new" || $editor->isConflict )
@@ -441,9 +443,9 @@
442444 * but not in the page, copy it. otherwise, use the page text (even if empty) */
443445 $result[] = ( !empty($layout[0]) && $layout[0]['text'] && !$page[0]['text'] ) ? $layout[0] : $page[0];
444446
445 - /* only show the un-named section if it is being used. as
446 - * default, do not encourage people to use it by showing it */
447 - $result[0]['in-use'] = ( $result[0]['text'] != "" );
 447+ /* decide whether or not to show the introduction section.
 448+ * if configured to do so, it won't appear if there isn't any text in it already */
 449+ $result[0]['in-use'] = $wgAlwaysShowIntroSection ? true : ( $result[0]['text'] != '' );
448450
449451 // get sections that are in the layout
450452 for ( $i = 2; $i < count ( $layout ); $i++ ) {
Index: trunk/extensions/uniwiki/RELEASE-NOTES
@@ -0,0 +1,5 @@
 2+= Uniwiki Release Notes =
 3+
 4+== GenericEditPage ==
 5+* Added $wgAlwaysShowIntroSection to force the editor to always show the
 6+ introduction section, even if there is no content inside of it already.

Status & tagging log