}
return $this->url;
}
+
+ /**
+ * Return a fully-qualified URL to the file.
+ * Upload URL paths _may or may not_ be fully qualified, so
+ * we check. Local paths are assumed to belong on $wgServer.
+ * @return string
+ */
+ public function getFullUrl() {
+ $url = $this->getUrl();
+ if( substr( $url, 0, 1 ) == '/' ) {
+ global $wgServer;
+ return $wgServer . $url;
+ }
+ return $url;
+ }
function getViewURL() {
if( $this->mustRender()) {
$path = '/common/images/icons/' . $icon;
$filepath = $wgStyleDirectory . $path;
if( file_exists( $filepath ) ) {
- return new ThumbnailImage( $wgStylePath . $path, 120, 120 );
+ return new ThumbnailImage( $this, $wgStylePath . $path, 120, 120 );
}
}
return null;
}
/**
- * Get an associative array containing information about a file in the local filesystem\
+ * Get an associative array containing information about a file in the local filesystem.
*
* @param string $path Absolute local filesystem path
* @param mixed $ext The file extension, or true to extract it from the filename.