r28423 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r28422‎ | r28423 | r28424 >
Date:23:46, 12 December 2007
Author:david
Status:old
Tags:
Comment:
Stern warning when editing talkpage header.
Modified paths:
  • /trunk/extensions/LiquidThreads/Lqt.i18n.php (modified) (history)
  • /trunk/extensions/LiquidThreads/LqtPages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/Lqt.i18n.php
@@ -85,6 +85,11 @@
8686 'lqt_delete_return_link' => 'the talkpage', // subst above
8787 'lqt_delete_unallowed' => 'You are not allowed to delete threads.',
8888 'lqt_talkpage_autocreate_summary' => 'Talkpage autocreated when first thread was posted.',
 89+ 'lqt_header_warning_before_big' => '',
 90+ 'lqt_header_warning_big' => 'You are editing a $1. ',
 91+ 'lqt_header_warning_after_big' => 'You might instead want to $2.',
 92+ 'lqt_header_warning_bold' => 'talkpage header',
 93+ 'lqt_header_warning_new_discussion' => 'start a new discussion',
8994 );
9095
9196 $messages['ar'] = array(
Index: trunk/extensions/LiquidThreads/LqtPages.php
@@ -556,7 +556,7 @@
557557 * Cheap views that just pass through to MW functions.
558558 */
559559
560 -class TalkpageHeaderView {
 560+class TalkpageHeaderView extends LqtView {
561561 function customizeTabs( $skintemplate, $content_actions ) {
562562 unset($content_actions['edit']);
563563 unset($content_actions['addsection']);
@@ -573,8 +573,20 @@
574574 }
575575
576576 function show() {
577 - global $wgHooks;
 577+ global $wgHooks, $wgOut, $wgTitle, $wgRequest;
578578 $wgHooks['SkinTemplateTabs'][] = array($this, 'customizeTabs');
 579+
 580+ if( $wgRequest->getVal('action') === 'edit' ) {
 581+ $warn_bold = '<strong>' . wfMsg('lqt_header_warning_bold') . '</strong>';
 582+ $warn_link = '<a href="'.$this->talkpageUrl($wgTitle, 'talkpage_new_thread').'">'.
 583+ wfMsg('lqt_header_warning_new_discussion').'</a>';
 584+ $wgOut->addHTML('<p class="lqt_header_warning">' .
 585+ wfMsg('lqt_header_warning_before_big', $warn_bold, $warn_link) .
 586+ '<big>' . wfMsg('lqt_header_warning_big', $warn_bold, $warn_link) . '</big>' .
 587+ wfMsg('lqt_header_warning_after_big', $warn_bold, $warn_link) .
 588+ '</p>');
 589+ }
 590+
579591 return true;
580592 }
581593 }

Status & tagging log