r113516 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113515‎ | r113516 | r113517 >
Date:20:01, 9 March 2012
Author:wikinaut
Status:new (Comments)
Tags:
Comment:
add tracking category feature (enabled by default). Each page using this extensions get automatically the tracking category with MediaWiki:Etherpadlite-tracking-category name (= Etherpad). Tracking-Cat-Feature can be disabled, or a different MediaWiki message text can be assigned. Documentation of the switch is inline and follows on MediaWiki.
Modified paths:
  • /trunk/extensions/EtherpadLite/EtherpadLite.i18n.php (modified) (history)
  • /trunk/extensions/EtherpadLite/EtherpadLite.php (modified) (history)
  • /trunk/extensions/EtherpadLite/EtherpadLite_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EtherpadLite/EtherpadLite.php
@@ -64,7 +64,7 @@
6565 'path' => __FILE__,
6666 'name' => 'EtherpadLite',
6767 'author' => array( 'Thomas Gries' ),
68 - 'version' => '1.11 20120219',
 68+ 'version' => '1.12 20120309',
6969 'url' => 'https://www.mediawiki.org/wiki/Extension:EtherpadLite',
7070 'descriptionmsg' => 'etherpadlite-desc',
7171 );
@@ -104,3 +104,20 @@
105105
106106 # include "*" if you expressly want to allow all urls (you should not do this)
107107 # $wgEtherpadLiteUrlWhitelist = array( "*" );
 108+
 109+// If you want to see images in feed items, then you need to globally allow
 110+// image tags in your wiki by using the MediaWiki parameter; default: false
 111+// $wgAllowImageTag = true;
 112+
 113+// Parameter to enable the automatic tracking category
 114+// for all pages using this parser extension
 115+//
 116+// Category name [[MediaWiki:etherpadlite-tracking-category]] (default)
 117+// $wgEtherpadLiteTrackingCategory = true;
 118+//
 119+// you can assign a specific category name [[MediaWiki:Etherpadlite-mycategory]]
 120+// $wgEtherpadLiteTrackingCategory = 'etherpadlite-mycategory';
 121+//
 122+// you can disable the use of a tracking category
 123+// $wgEtherpadLiteTrackingCategory = false;
 124+$wgEtherpadLiteTrackingCategory = true;
Index: trunk/extensions/EtherpadLite/EtherpadLite_body.php
@@ -39,7 +39,7 @@
4040 global $wgEtherpadLiteDefaultPadUrl, $wgEtherpadLiteDefaultWidth, $wgEtherpadLiteDefaultHeight,
4141 $wgEtherpadLiteMonospacedFont, $wgEtherpadLiteShowControls, $wgEtherpadLiteShowLineNumbers,
4242 $wgEtherpadLiteShowChat, $wgEtherpadLiteShowAuthorColors, $wgEtherpadLiteUrlWhitelist,
43 - $wgEtherpadLitePadsOnThisPage;
 43+ $wgEtherpadLitePadsOnThisPage, $wgEtherpadLiteTrackingCategory;
4444
4545 # check the user input
4646
@@ -168,24 +168,30 @@
169169
170170 wfDebug( "EtherpadLite::EtherpadLiteRender $output\n" );
171171
 172+ if ( $wgEtherpadLiteTrackingCategory === true ) {
 173+ $parser->addTrackingCategory( 'etherpadlite-tracking-category' );
 174+ } elseif ( is_string( $wgEtherpadLiteTrackingCategory ) ) {
 175+ $parser->addTrackingCategory( $wgEtherpadLiteTrackingCategory );
 176+ }
 177+
172178 return $output;
173179
174180 }
175181
176182 /**
177183 * Output an error message, all wraped up nicely.
178 - * @param String $errorName The system message that this error is
 184+ * @param String $errorMessageName The system message that this error is
179185 * @param String|Array $param Error parameter (or parameters)
180186 * @return String Html that is the error.
181187 */
182 - private static function EtherpadLiteError( $errorName, $param ) {
 188+ private static function EtherpadLiteError( $errorMessageName, $param ) {
183189
184190 // Anything from a parser tag should use Content lang for message,
185191 // since the cache doesn't vary by user language: do not use wfMsgForContent but wfMsgForContent
186192 // The ->parse() part makes everything safe from an escaping standpoint.
187193
188194 return Html::rawElement( 'span', array( 'class' => 'error' ),
189 - wfMessage( $errorName )->inContentLanguage()->params( $param )->parse()
 195+ "Extension:EtherpadLite: -- Error: " . wfMessage( $errorMessageName )->inContentLanguage()->params( $param )->parse()
190196 );
191197
192198 }
Index: trunk/extensions/EtherpadLite/EtherpadLite.i18n.php
@@ -13,6 +13,7 @@
1414 */
1515 $messages['en'] = array(
1616 'etherpadlite-desc' => 'Adds <eplite> parser tag to embed one or many Etherpad Lite pads (which are hosted on local or external Etherpad Lite server/s) on pages',
 17+ 'etherpadlite-tracking-category' => 'Etherpad',
1718 'etherpadlite-invalid-pad-url' => '"$1" is not a valid Etherpad Lite URL or pad name.',
1819 'etherpadlite-url-is-not-whitelisted' => '"$1" is not in the whitelist of allowed Etherpad Lite servers. {{PLURAL:$3|$2 is the only allowed server|The allowed servers are as follows: $2}}.',
1920 'etherpadlite-empty-whitelist' => '"$1" is not in the whitelist of allowed Etherpad Lite servers. There are no allowed servers in the whitelist.',
@@ -32,6 +33,7 @@
3334 * $1 is a URL not in the whitelist for Etherpad Lite servers.',
3435 'etherpadlite-pad-used-more-than-once' => 'Error if users try to show multiple frames of the very same pad. Each pad must be unique on a wiki page. Parameters:
3536 * $1 is a full pad URL (server/padid).',
 37+ 'etherpadlite-tracking-category' => 'The name of a category for all pages which use the <eplite> parser extension tag. The category is automatically added unless the feature is disabled.',
3638 );
3739
3840 /** Belarusian (Taraškievica orthography) (‪Беларуская (тарашкевіца)‬)

Follow-up revisions

RevisionCommit summaryAuthorDate
r113523beautifying the tracking category namewikinaut21:02, 9 March 2012
r114171removed the redundant code for handling tracking categories. By using '-' for...wikinaut19:05, 19 March 2012

Comments

#Comment by MaxSem (talk | contribs)   20:48, 9 March 2012

Tracking category name should be something like "Paged using Etherpad" or something, current name is unclear.

#Comment by Wikinaut (talk | contribs)   23:18, 9 March 2012

fixed in r113523

#Comment by Wikinaut (talk | contribs)   06:56, 21 March 2012

Info: tracking category _parameter_ removed in r114171 .

Status & tagging log