Index: trunk/extensions/UsabilityInitiative/OptIn/SpecialOptIn.php |
— | — | @@ -289,7 +289,6 @@ |
290 | 290 | $attrs['class'] = 'optin-need-other'; |
291 | 291 | } |
292 | 292 | $retval .= Xml::openElement( 'select', $attrs ); |
293 | | - $retval .= Xml::option( '', '' ); |
294 | 293 | foreach ( $question['answers'] as $aid => $answer ) { |
295 | 294 | $retval .= Xml::option( |
296 | 295 | wfMsg( $answer ), $aid, |
Index: trunk/extensions/UsabilityInitiative/OptIn/OptIn.i18n.php |
— | — | @@ -104,11 +104,6 @@ |
105 | 105 | ;Edit toolbar improvements |
106 | 106 | New-and-improved icons make it clearer what action each tool performs. Expandable sections reduce clutter while keeping infrequently used tools just a click away. |
107 | 107 | The help section provides quick access to a reference for common uses of wiki-markup. |
108 | | -<div style=\"clear:both;\"></div> |
109 | | - |
110 | | -[[File:UsabilitySearch.png|left]] |
111 | | -;Improved search interface |
112 | | -When using search, title matches are shown first, helping you to find the most relevant articles quickly. Search profiles make searching for different kinds of content easier, while the new advanced search interface makes light work of complex searches. |
113 | 108 | <div style=\"clear:both;\"></div>", |
114 | 109 | ); |
115 | 110 | |
Index: trunk/extensions/UsabilityInitiative/PrefStats/PrefStats.i18n.php |
— | — | @@ -18,6 +18,7 @@ |
19 | 19 | 'prefstats-list-intro' => 'Currently, the following preferences are being tracked. |
20 | 20 | Click on one to view statistics about it.', |
21 | 21 | 'prefstats-list-elem' => '$1 = $2', |
| 22 | + 'prefstats-noprefs' => 'No preferences are currently being tracked. Configure $wgPrefStatsTrackPrefs to track preferences.', |
22 | 23 | ); |
23 | 24 | |
24 | 25 | /** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца)) |
Index: trunk/extensions/UsabilityInitiative/PrefStats/PrefStats.php |
— | — | @@ -18,7 +18,10 @@ |
19 | 19 | |
20 | 20 | /* Configuration */ |
21 | 21 | |
22 | | -// .Set to false to disable tracking |
| 22 | +// For this extension to actually do anything, you need to configure |
| 23 | +// $wgPrefStatsTrackPrefs yourself. |
| 24 | + |
| 25 | +// Set to false to disable tracking |
23 | 26 | $wgPrefStatsEnable = true; |
24 | 27 | |
25 | 28 | // array('prefname' => 'value') |
— | — | @@ -34,6 +37,9 @@ |
35 | 38 | |
36 | 39 | /* Setup */ |
37 | 40 | |
| 41 | +// Right required to view Special:PrefStats |
| 42 | +$wgAvailableRights[] = 'prefstats'; |
| 43 | + |
38 | 44 | // Credits |
39 | 45 | $wgExtensionCredits['other'][] = array( |
40 | 46 | 'path' => __FILE__, |
Index: trunk/extensions/UsabilityInitiative/PrefStats/SpecialPrefStats.php |
— | — | @@ -34,6 +34,10 @@ |
35 | 35 | |
36 | 36 | function displayTrackedPrefs() { |
37 | 37 | global $wgOut, $wgUser, $wgPrefStatsTrackPrefs; |
| 38 | + if ( !count( $wgPrefStatsTrackPrefs ) ) { |
| 39 | + $wgOut->addWikiMsg( 'prefstats-noprefs' ); |
| 40 | + return; |
| 41 | + } |
38 | 42 | $wgOut->addWikiMsg( 'prefstats-list-intro' ); |
39 | 43 | $wgOut->addHTML( Xml::openElement( 'ul' ) ); |
40 | 44 | foreach ( $wgPrefStatsTrackPrefs as $pref => $value ) { |
— | — | @@ -116,8 +120,8 @@ |
117 | 121 | $count2 = $dbr->selectField( 'prefstats', 'COUNT(*)', array( |
118 | 122 | 'ps_pref' => $pref, |
119 | 123 | 'ps_duration IS NULL', |
120 | | - 'ps_start <' . $dbr->timestamp( $maxTS ), |
121 | | - 'ps_start >=' . $dbr->timestamp( $minTS ) |
| 124 | + 'ps_start <' . $dbr->addQuotes( $dbr->timestamp( $maxTS ) ), |
| 125 | + 'ps_start >=' . $dbr->addQuotes( $dbr->timestamp( $minTS ) ) |
122 | 126 | ), __METHOD__ ); |
123 | 127 | return $count1 + $count2; |
124 | 128 | } |
Index: trunk/extensions/UsabilityInitiative/PrefStats/populatePrefStats.php |
— | — | @@ -0,0 +1,26 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | + * This script populates the prefstats table
|
| 5 | + *
|
| 6 | + * @file
|
| 7 | + * @ingroup Extensions
|
| 8 | + */
|
| 9 | +
|
| 10 | +require_once( '../../../maintenance/commandLine.inc' );
|
| 11 | +
|
| 12 | +$dbw = wfGetDb( DB_MASTER );
|
| 13 | +foreach ( $wgPrefStatsTrackPrefs as $pref => $value ) {
|
| 14 | + echo "Populating $pref=$value ... ";
|
| 15 | + $dbw->insertSelect( 'prefstats', 'user_properties', array(
|
| 16 | + 'ps_user' => 'up_user',
|
| 17 | + 'ps_pref' => 'up_property',
|
| 18 | + 'ps_value' => 'up_value',
|
| 19 | + 'ps_start' => $dbw->addQuotes( $dbw->timestamp( wfTimestamp() ) ),
|
| 20 | + 'ps_duration' => 0
|
| 21 | + ), array(
|
| 22 | + 'up_property' => $pref,
|
| 23 | + 'up_value' => $value
|
| 24 | + ), __METHOD__, array( 'IGNORE' )
|
| 25 | + );
|
| 26 | + echo "done\n";
|
| 27 | +}
|