r79922 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79921‎ | r79922 | r79923 >
Date:23:37, 9 January 2011
Author:hartman
Status:ok
Tags:
Comment:
More URL patch work for LQT. Someone who has the time needs to clean this up.

Follow up of r79417
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/View.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/View.php
@@ -60,14 +60,18 @@
6161 }
6262
6363 static function permalinkUrl( $thread, $method = null, $operand = null,
64 - $uquery = array() ) {
 64+ $uquery = array(), $relative = true ) {
6565 list ( $title, $query ) = self::permalinkData( $thread, $method, $operand );
6666
6767 $query = array_merge( $query, $uquery );
6868
6969 $queryString = wfArrayToCGI( $query );
7070
71 - return $title->getLocalUrl( $queryString );
 71+ if( $relative ) {
 72+ return $title->getLocalUrl( $queryString );
 73+ } else {
 74+ return $title->getFullUrl( $queryString );
 75+ }
7276 }
7377
7478 /** Gets an array of (title, query-parameters) for a permalink **/
@@ -90,12 +94,12 @@
9195
9296 /* This is used for action=history so that the history tab works, which is
9397 why we break the lqt_method paradigm. */
94 - static function permalinkUrlWithQuery( $thread, $query ) {
 98+ static function permalinkUrlWithQuery( $thread, $query, $relative = true ) {
9599 if ( !is_array( $query ) ) {
96100 $query = wfCGIToArray( $query );
97101 }
98102
99 - return self::permalinkUrl( $thread, null, null, $query );
 103+ return self::permalinkUrl( $thread, null, null, $query, $relative );
100104 }
101105
102106 static function permalink( $thread, $text = null, $method = null, $operand = null,
@@ -181,7 +185,7 @@
182186
183187 static function diffPermalinkURL( $thread, $revision ) {
184188 $query = self::diffQuery( $thread, $revision );
185 - return self::permalinkUrl( $thread, null, null, $query );
 189+ return self::permalinkUrl( $thread, null, null, $query, false );
186190 }
187191
188192 static function diffPermalink( $thread, $text, $revision ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r79417Make LiquidThreads use relative URLs instead of absolute URLs....hartman12:30, 1 January 2011

Status & tagging log