r82289 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82288‎ | r82289 | r82290 >
Date:20:09, 16 February 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Follow up to r82288
Modified paths:
  • /trunk/extensions/Maps/includes/manipulations/Maps_ParamImageFull.php (added) (history)

Diff [purge]

Index: trunk/extensions/Maps/includes/manipulations/Maps_ParamImageFull.php
@@ -0,0 +1,41 @@
 2+<?php
 3+
 4+/**
 5+ * Parameter manipulation ensuring the value is an image url.
 6+ *
 7+ * @since 0.7.1
 8+ *
 9+ * @file Maps_ParamImage.php
 10+ * @ingroup Maps
 11+ * @ingroup ParameterManipulations
 12+ *
 13+ * @author Jeroen De Dauw
 14+ */
 15+class MapsParamImageFull extends ItemParameterManipulation {
 16+
 17+ /**
 18+ * Constructor.
 19+ *
 20+ * @since 0.7
 21+ */
 22+ public function __construct() {
 23+ parent::__construct();
 24+ }
 25+
 26+ /**
 27+ * @see ItemParameterManipulation::doManipulation
 28+ *
 29+ * @since 0.7
 30+ */
 31+ public function doManipulation( &$value, Parameter $parameter, array &$parameters ) {
 32+ $image = $value;
 33+ $title = Title::newFromText( $image, NS_FILE );
 34+
 35+ if ( !is_null( $title ) && $title->getNamespace() == NS_FILE && $title->exists() ) {
 36+ $imagePage = new ImagePage( $title );
 37+ $image = $imagePage->getDisplayedFile()->getFullUrl();
 38+ }
 39+ $value = $image;
 40+ }
 41+
 42+}
\ No newline at end of file
Property changes on: trunk/extensions/Maps/includes/manipulations/Maps_ParamImageFull.php
___________________________________________________________________
Added: svn:eol-style
143 + native

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r82288Comitting KML patch by Benedikt Kämpgenjeroendedauw20:08, 16 February 2011

Status & tagging log