Index: trunk/extensions/Hanp/php-utf8/utf8.inc |
— | — | @@ -209,4 +209,3 @@ |
210 | 210 | return $dest; |
211 | 211 | } |
212 | 212 | |
213 | | -?> |
Index: trunk/extensions/SlippyMap/SlippyMapExportCgiBin.class.php |
— | — | @@ -9,13 +9,13 @@ |
10 | 10 | |
11 | 11 | /** borrowed from OpenLayers.DOTS_PER_UNIT */ |
12 | 12 | private static $INCHES_PER_UNIT = array ( |
13 | | - 'dd' => 4374754, |
14 | | - 'm' => 39.3701 |
| 13 | + 'dd' => 4374754, |
| 14 | + 'm' => 39.3701 |
15 | 15 | ); |
16 | | - |
| 16 | + |
17 | 17 | /** borrowed from OpenLayers.DOTS_PER_INCH */ |
18 | 18 | private static $DOTS_PER_INCH = 72; |
19 | | - |
| 19 | + |
20 | 20 | /** pixel size in meters */ |
21 | 21 | private static $PIXEL_SIZE = 0.00028; |
22 | 22 | |
— | — | @@ -74,11 +74,11 @@ |
75 | 75 | if ( $this->options['sphericalMercator'] ) { |
76 | 76 | // Calculate bounds within a spherical mercator projection if that is what the scale is based on |
77 | 77 | $mercatorCenter = self::forwardMercator( $center ); |
78 | | - $mbounds = array( |
79 | | - $mercatorCenter[0] - $w_deg / 2, |
80 | | - $mercatorCenter[1] - $h_deg / 2, |
81 | | - $mercatorCenter[0] + $w_deg / 2, |
82 | | - $mercatorCenter[1] + $h_deg / 2 |
| 78 | + $mbounds = array( |
| 79 | + $mercatorCenter[0] - $w_deg / 2, |
| 80 | + $mercatorCenter[1] - $h_deg / 2, |
| 81 | + $mercatorCenter[0] + $w_deg / 2, |
| 82 | + $mercatorCenter[1] + $h_deg / 2 |
83 | 83 | ); |
84 | 84 | $this->bounds = self::inverseMercator( $mbounds ); |
85 | 85 | } |
— | — | @@ -94,21 +94,21 @@ |
95 | 95 | protected function getScaleFromResolution( $resolution ) { |
96 | 96 | return $resolution * self::$INCHES_PER_UNIT[$this->options['unit']] * self::$DOTS_PER_INCH; |
97 | 97 | } |
98 | | - |
| 98 | + |
99 | 99 | /** |
100 | 100 | * Determines resolutions and scales based on a maximum resolution and number of zoom levels |
101 | 101 | * Borrowed from OpenLayers.Layer.initResolutions |
102 | 102 | */ |
103 | 103 | protected function initResolutionsAndScales() { |
104 | | - $this->resolutions = array(); |
105 | | - $base = 2; |
106 | | - |
107 | | - for ( $i = 0; $i < $this->options['numZoomLevels']; $i++ ) { |
108 | | - $this->resolutions[$i] = $this->options['maxResolution'] / pow( $base, $i ); |
| 104 | + $this->resolutions = array(); |
| 105 | + $base = 2; |
| 106 | + |
| 107 | + for ( $i = 0; $i < $this->options['numZoomLevels']; $i++ ) { |
| 108 | + $this->resolutions[$i] = $this->options['maxResolution'] / pow( $base, $i ); |
109 | 109 | $this->scales[$i] = $this->getScaleFromResolution( $this->resolutions[$i] ); |
110 | 110 | } |
111 | 111 | } |
112 | | - |
| 112 | + |
113 | 113 | /** |
114 | 114 | * Convert from WGS84 to spherical mercator |
115 | 115 | */ |
— | — | @@ -116,14 +116,14 @@ |
117 | 117 | for ($i=0; $i<count($lonlat); $i+=2) { |
118 | 118 | /* lon */ |
119 | 119 | $lonlat[$i] = $lonlat[$i] * (2 * M_PI * 6378137 / 2.0) / 180.0; |
120 | | - |
| 120 | + |
121 | 121 | /* lat */ |
122 | 122 | $lonlat[$i+1] = log(tan((90 + $lonlat[$i+1]) * M_PI / 360.0)) / (M_PI / 180.0); |
123 | 123 | $lonlat[$i+1] = $lonlat[$i+1] * (2 * M_PI * 6378137 / 2.0) / 180.0; |
124 | | - } |
| 124 | + } |
125 | 125 | return $lonlat; |
126 | 126 | } |
127 | | - |
| 127 | + |
128 | 128 | /** |
129 | 129 | * Convert from spherical mercator to WGS84 |
130 | 130 | */ |
— | — | @@ -131,13 +131,12 @@ |
132 | 132 | for ($i=0; $i<count($lonlat); $i+=2) { |
133 | 133 | /* lon */ |
134 | 134 | $lonlat[$i] = $lonlat[$i] / ((2 * M_PI * 6378137 / 2.0) / 180.0); |
135 | | - |
| 135 | + |
136 | 136 | /* lat */ |
137 | 137 | $lonlat[$i+1] = $lonlat[$i+1] / ((2 * M_PI * 6378137 / 2.0) / 180.0); |
138 | 138 | $lonlat[$i+1] = 180.0 / M_PI * (2 * atan(exp($lonlat[$i+1] * M_PI / 180.0)) - M_PI / 2); |
139 | | - } |
140 | | - |
| 139 | + } |
| 140 | + |
141 | 141 | return $lonlat; |
142 | 142 | } |
143 | 143 | } |
144 | | -?> |
Index: trunk/extensions/Eval/SpecialEval.class.php |
— | — | @@ -156,4 +156,4 @@ |
157 | 157 | ); |
158 | 158 | } |
159 | 159 | } |
160 | | -?> |
| 160 | + |
Index: trunk/extensions/Eval/SpecialEval.php |
— | — | @@ -25,4 +25,3 @@ |
26 | 26 | $wgSpecialPages['Eval'] = 'SpecialEval'; |
27 | 27 | $wgAutoloadClasses['SpecialEval'] = $dir . 'SpecialEval.class.php'; |
28 | 28 | |
29 | | -?> |
Index: trunk/extensions/PlayerStatsGrabber/PlayerStatsGrabber_body.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | // print $wgRequest->getText( 'param' ); |
28 | 28 | // set the header: |
29 | 29 | $this->setHeaders(); |
30 | | - |
| 30 | + |
31 | 31 | // do the page: |
32 | 32 | switch( $this->req_param ) { |
33 | 33 | case 'Survey': |
— | — | @@ -51,7 +51,7 @@ |
52 | 52 | function do_survey_forum() { |
53 | 53 | global $wgOut, $psEmbedAry, $wgTitle, $wgUser, $wgEnableParserCache, $wgParser, $wgScript; |
54 | 54 | $wgOut->addHTML ( wfMsg( 'ps_survey_description' ) ); |
55 | | - |
| 55 | + |
56 | 56 | // select the embed ary element: |
57 | 57 | $tw = 0; |
58 | 58 | foreach ( $psEmbedAry as $embed ) { |
— | — | @@ -85,7 +85,7 @@ |
86 | 86 | // work with "embed" |
87 | 87 | $embed_key = $embed['embed_key']; |
88 | 88 | $userToken = htmlspecialchars( $wgUser->editToken() ); |
89 | | - |
| 89 | + |
90 | 90 | // output table with flash and or video embed: |
91 | 91 | $wgOut->addHTML( <<<EOT |
92 | 92 | <p> |
— | — | @@ -107,31 +107,31 @@ |
108 | 108 | $wgOut->addHTML( '<br /><input type="radio" name="ps_could_play" value="yes" |
109 | 109 | onclick="document.getElementById(\'ps_could_not_play\').style.display = \'none\';">' . |
110 | 110 | wfMsg( 'ps_play_yes' ) . '<br /> |
111 | | - <input type="radio" name="ps_could_play" value="no" |
| 111 | + <input type="radio" name="ps_could_play" value="no" |
112 | 112 | onclick="document.getElementById(\'ps_could_not_play\').style.display = \'inline\';">' . |
113 | 113 | wfMsg( 'ps_play_no' ) . '<p> |
114 | 114 | <div id="ps_could_not_play" style="display:none;"> |
115 | 115 | ' . wfMsg( 'ps_problem_checkoff' ) . ' |
116 | | - <table border="0" cellspacing="0" cellpadding="0"> |
117 | | - <tr> |
118 | | - <td><input type="checkbox" name="ps_no_video" value="1"></td> |
119 | | - <td>' . wfMsg( 'ps_no_video' ) . ' </td> |
120 | | - </tr> |
121 | | - <tr> |
122 | | - <tr> |
123 | | - <td><input type="checkbox" name="ps_jumpy_playback" value="1"></td> |
124 | | - <td>' . wfMsg( 'ps_jumpy_playback' ) . ' </td> |
125 | | - </tr> |
126 | | - <tr> |
127 | | - <td><input type="checkbox" name="ps_bad_sync" value="1"></td> |
128 | | - <td>' . wfMsg( 'ps_bad_sync' ) . ' </td> |
129 | | - </tr> |
| 116 | + <table border="0" cellspacing="0" cellpadding="0"> |
130 | 117 | <tr> |
131 | | - <td><input type="checkbox" name="ps_no_sound" value="1"></td> |
132 | | - <td>' . wfMsg( 'ps_no_sound' ) . '</td> |
133 | | - </tr> |
134 | | - </table> |
135 | | - ' . wfMsg( 'ps_problems_desc' ) . '<br /><textarea name="ps_problems_desc" rows="2" cols="40" MAXLENGTH="300"></textarea><br /> |
| 118 | + <td><input type="checkbox" name="ps_no_video" value="1"></td> |
| 119 | + <td>' . wfMsg( 'ps_no_video' ) . ' </td> |
| 120 | + </tr> |
| 121 | + <tr> |
| 122 | + <tr> |
| 123 | + <td><input type="checkbox" name="ps_jumpy_playback" value="1"></td> |
| 124 | + <td>' . wfMsg( 'ps_jumpy_playback' ) . ' </td> |
| 125 | + </tr> |
| 126 | + <tr> |
| 127 | + <td><input type="checkbox" name="ps_bad_sync" value="1"></td> |
| 128 | + <td>' . wfMsg( 'ps_bad_sync' ) . ' </td> |
| 129 | + </tr> |
| 130 | + <tr> |
| 131 | + <td><input type="checkbox" name="ps_no_sound" value="1"></td> |
| 132 | + <td>' . wfMsg( 'ps_no_sound' ) . '</td> |
| 133 | + </tr> |
| 134 | + </table> |
| 135 | + ' . wfMsg( 'ps_problems_desc' ) . '<br /><textarea name="ps_problems_desc" rows="2" cols="40" MAXLENGTH="300"></textarea><br /> |
136 | 136 | </div> |
137 | 137 | ' . wfMsg( 'ps_would_install' ) . '<br />' . |
138 | 138 | '<input type="radio" name="ps_would_install" value="yes">' . wfMsg( 'ps_yes_install' ) . '<br />' . |
— | — | @@ -160,7 +160,7 @@ |
161 | 161 | function do_submit_player_log() { |
162 | 162 | global $wgRequest, $psLogEveryPlayRequestPerUser; |
163 | 163 | // do the insert into the userPlayerStats table: |
164 | | - $dbr = wfGetDB( DB_READ ); |
| 164 | + $dbr = wfGetDB( DB_READ ); |
165 | 165 | $cs = $wgRequest->getArray( 'cs', array() ); |
166 | 166 | // set up insert array: |
167 | 167 | $insAry = array( |
— | — | @@ -185,7 +185,7 @@ |
186 | 186 | $insert_id = $dbr->selectField( 'player_stats_log', 'id', |
187 | 187 | array( 'user_hash' => $wgRequest->getVal( 'uh' ) ), |
188 | 188 | 'do_submit_player_log::Select User Hash' ); |
189 | | - // if the user_hash is not already in the db or if we are logging every request do INSERT |
| 189 | + // if the user_hash is not already in the db or if we are logging every request do INSERT |
190 | 190 | if ( !$insert_id || $psLogEveryPlayRequestPerUser ) { |
191 | 191 | $dbw = wfGetDB( DB_WRITE ); |
192 | 192 | $dbw->insert( 'player_stats_log', $insAry, 'mw_push_player_stats::Insert' ); |
— | — | @@ -213,29 +213,29 @@ |
214 | 214 | $wgOut->addHTML ( wfMsg( 'token_suffix_mismatch' ) ); |
215 | 215 | return false; |
216 | 216 | } |
217 | | - |
| 217 | + |
218 | 218 | // print "NO VIDEO: " |
219 | 219 | $dbr = wfGetDB( DB_READ ); |
220 | 220 | $insAry = array( |
221 | | - 'user_hash' => $wgRequest->getVal( 'uh' ), |
| 221 | + 'user_hash' => $wgRequest->getVal( 'uh' ), |
222 | 222 | 'embed_key' => $wgRequest->getVal( 'embed_key' ), |
223 | 223 | 'player_stats_log_id' => $wgRequest->getVal( 'player_stats_log_id' ), |
224 | | - |
225 | | - 'ps_jumpy_playback' => ( $wgRequest->getVal( 'ps_jumpy_playback' ) == '' ) ? 0:1, |
226 | | - 'ps_no_video' => ( $wgRequest->getVal( 'ps_no_video' ) == '' ) ? 0:1, |
227 | | - 'ps_bad_sync' => ( $wgRequest->getVal( 'ps_bad_sync' ) == '' ) ? 0:1, |
228 | | - 'ps_no_sound' => ( $wgRequest->getVal( 'ps_no_sound' ) == '' ) ? 0:1, |
229 | 224 | |
230 | | - 'ps_your_email' => htmlspecialchars( $wgRequest->getVal( 'ps_your_email' ) ), |
231 | | - 'ps_problems_desc' => htmlspecialchars( $wgRequest->getVal( 'ps_problems_desc' ) ) |
| 225 | + 'ps_jumpy_playback' => ( $wgRequest->getVal( 'ps_jumpy_playback' ) == '' ) ? 0:1, |
| 226 | + 'ps_no_video' => ( $wgRequest->getVal( 'ps_no_video' ) == '' ) ? 0:1, |
| 227 | + 'ps_bad_sync' => ( $wgRequest->getVal( 'ps_bad_sync' ) == '' ) ? 0:1, |
| 228 | + 'ps_no_sound' => ( $wgRequest->getVal( 'ps_no_sound' ) == '' ) ? 0:1, |
| 229 | + |
| 230 | + 'ps_your_email' => htmlspecialchars( $wgRequest->getVal( 'ps_your_email' ) ), |
| 231 | + 'ps_problems_desc' => htmlspecialchars( $wgRequest->getVal( 'ps_problems_desc' ) ) |
232 | 232 | ); |
233 | 233 | // leave NULL if un-answered for all yes no questions: : |
234 | 234 | if ( $wgRequest->getVal( 'ps_could_play' ) != '' ) |
235 | 235 | $insAry['ps_could_play'] = ( $wgRequest->getVal( 'ps_could_play' ) == 'yes' ) ? 1:0; |
236 | | - |
| 236 | + |
237 | 237 | if ( $wgRequest->getVal( 'ps_would_install' ) != '' ) |
238 | 238 | $insAry['ps_would_install'] = ( $wgRequest->getVal( 'ps_would_install' ) == 'yes' ) ? 1:0; |
239 | | - |
| 239 | + |
240 | 240 | if ( $wgRequest->getVal( 'ps_would_switch' ) != '' ) |
241 | 241 | $insAry['ps_would_switch'] = ( $wgRequest->getVal( 'ps_would_switch' ) == 'yes' ) ? 1:0; |
242 | 242 | |
— | — | @@ -261,17 +261,15 @@ |
262 | 262 | global $wgOut, $wgScriptPath, $wgUser , $wgProxyKey; |
263 | 263 | $scriptPath = OggHandler::getMyScriptPath(); |
264 | 264 | // include the javascript and do the stats |
265 | | - $jsUserHash = sha1( $wgUser->getName() . $wgProxyKey ); |
| 265 | + $jsUserHash = sha1( $wgUser->getName() . $wgProxyKey ); |
266 | 266 | $wgOut->addHTML( ' |
267 | 267 | <script type="text/javascript" src="'. htmlspecialchars( $scriptPath ) .'/OggPlayer.js"></script> |
268 | 268 | <script type="text/javascript" src="'. htmlspecialchars( $wgScriptPath ) . '/extensions/PlayerStatsGrabber/playerStats.js"></script> |
269 | | - <script type="text/javascript"> |
270 | | - wgOggPlayer.userHash = '. Xml::encodeJsVar( $jsUserHash ) .'; |
271 | | - wgOggPlayer.videoUrl='. Xml::encodeJsVar( $vid_url ) . '; |
272 | | - wgOggPlayer.doStats(); |
273 | | - </script>' |
| 269 | + <script type="text/javascript"> |
| 270 | + wgOggPlayer.userHash = '. Xml::encodeJsVar( $jsUserHash ) .'; |
| 271 | + wgOggPlayer.videoUrl='. Xml::encodeJsVar( $vid_url ) . '; |
| 272 | + wgOggPlayer.doStats(); |
| 273 | + </script>' |
274 | 274 | ); |
275 | 275 | } |
276 | 276 | } |
277 | | - |
278 | | -?> |
Index: trunk/extensions/PlayerStatsGrabber/PlayerStatsGrabber.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * simple stats output and gather for oggPlay and a "sample page" |
| 4 | + * simple stats output and gather for oggPlay and a "sample page" |
5 | 5 | */ |
6 | 6 | |
7 | 7 | # Alert the user that this is not a valid entry point to MediaWiki if they try to access the special pages file directly. |
— | — | @@ -17,8 +17,8 @@ |
18 | 18 | * config values |
19 | 19 | */ |
20 | 20 | |
21 | | -// $psLogEveryPlayRequestPerUser |
22 | | -// true we log every play request |
| 21 | +// $psLogEveryPlayRequestPerUser |
| 22 | +// true we log every play request |
23 | 23 | // false we only log play request from different users |
24 | 24 | $psLogEveryPlayRequestPerUser = true; |
25 | 25 | |
— | — | @@ -30,30 +30,30 @@ |
31 | 31 | $wgPlayerStatsDB=''; |
32 | 32 | //$psCentralDB = wfGetDB( DB_MASTER, array(), $wgPlayerStatsDB ); |
33 | 33 | |
34 | | -// embed code and "weight" (ie weight of 3 is 3x more likely than weight of 1) |
| 34 | +// embed code and "weight" (ie weight of 3 is 3x more likely than weight of 1) |
35 | 35 | // flash embed code (the raw html that gets outputted to the browsers)) |
36 | | -// embed key gets recorded to the database to identify what player was sent to the client in the survey |
37 | | -// (you need to add it as an ENUM option) |
| 36 | +// embed key gets recorded to the database to identify what player was sent to the client in the survey |
| 37 | +// (you need to add it as an ENUM option) |
38 | 38 | $flowFLVurl = $psScriptPath .'sample_media/sample_barney.flv'; |
39 | 39 | $flowEmbedCode = <<<EOT |
40 | 40 | <script type="text/javascript" src="{$psScriptPath}/flow_player/flashembed.min.js"></script> |
41 | 41 | <script type="text/javascript"> |
42 | | - flashembed("example", |
| 42 | + flashembed("example", |
43 | 43 | { |
44 | 44 | src:'{$psScriptPath}/flow_player/FlowPlayerDark.swf', |
45 | | - width: 400, |
| 45 | + width: 400, |
46 | 46 | height: 320, |
47 | 47 | id:'myflash_id', |
48 | 48 | }, |
49 | 49 | { |
50 | | - config: { |
| 50 | + config: { |
51 | 51 | autoPlay: false, |
52 | 52 | id: 'myflash_id', |
53 | 53 | autoBuffering: true, |
54 | 54 | controlBarBackgroundColor:'0x2e8860', |
55 | 55 | initialScale: 'scale', |
56 | 56 | videoFile: '{$flowFLVurl}' |
57 | | - }} |
| 57 | + }} |
58 | 58 | ); |
59 | 59 | </script> |
60 | 60 | |
— | — | @@ -86,13 +86,13 @@ |
87 | 87 | /* |
88 | 88 | * end config |
89 | 89 | */ |
90 | | -$wgExtensionMessagesFiles['PlayerStatsGrabber'] = dirname( __FILE__ ) . '/PlayerStatsGrabber.i18n.php'; |
91 | | -$wgAutoloadClasses['SpecialPlayerStatsGrabber'] = dirname( __FILE__ ) . '/PlayerStatsGrabber_body.php'; |
92 | | -$wgSpecialPages['PlayerStatsGrabber'] = array( 'SpecialPlayerStatsGrabber' ); |
93 | | - |
| 90 | +$wgExtensionMessagesFiles['PlayerStatsGrabber'] = dirname( __FILE__ ) . '/PlayerStatsGrabber.i18n.php'; |
| 91 | +$wgAutoloadClasses['SpecialPlayerStatsGrabber'] = dirname( __FILE__ ) . '/PlayerStatsGrabber_body.php'; |
| 92 | +$wgSpecialPages['PlayerStatsGrabber'] = array( 'SpecialPlayerStatsGrabber' ); |
| 93 | + |
94 | 94 | $wgSpecialPageGroups['PlayerStatsGrabber'] = 'wiki'; // like Special:Statistics |
95 | 95 | |
96 | | -// add ajax hook to accept the status input: |
| 96 | +// add ajax hook to accept the status input: |
97 | 97 | $wgAjaxExportList[] = 'mw_push_player_stats'; |
98 | 98 | |
99 | 99 | $wgExtensionCredits['media'][] = array( |
— | — | @@ -106,9 +106,9 @@ |
107 | 107 | |
108 | 108 | /* |
109 | 109 | * does a player stats request.. returns the "db key" |
110 | | - * (lets people fill out survey after playing clip) |
111 | | - * or |
112 | | - * (ties survey page data to detection) |
| 110 | + * (lets people fill out survey after playing clip) |
| 111 | + * or |
| 112 | + * (ties survey page data to detection) |
113 | 113 | */ |
114 | 114 | function mw_push_player_stats() { |
115 | 115 | return SpecialPlayerStatsGrabber::do_submit_player_log(); |
— | — | @@ -165,5 +165,3 @@ |
166 | 166 | $val ); |
167 | 167 | } |
168 | 168 | } |
169 | | - |
170 | | -?> |