dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Show tags on deleted edits through the API
[lhc/web/wiklou.git]
/
includes
/
Metadata.php
diff --git
a/includes/Metadata.php
b/includes/Metadata.php
index
96d00ae
..
ea89f52
100644
(file)
--- a/
includes/Metadata.php
+++ b/
includes/Metadata.php
@@
-28,10
+28,10
@@
abstract class RdfMetaData {
/**
* Constructor
/**
* Constructor
- * @param
$article Article object
+ * @param
Page $page
*/
*/
- public function __construct( Page $
articl
e ) {
- $this->mArticle = $
articl
e;
+ public function __construct( Page $
pag
e ) {
+ $this->mArticle = $
pag
e;
}
abstract public function show();
}
abstract public function show();
@@
-40,9
+40,12
@@
abstract class RdfMetaData {
global $wgOut, $wgRequest;
$httpaccept = isset( $_SERVER['HTTP_ACCEPT'] ) ? $_SERVER['HTTP_ACCEPT'] : null;
global $wgOut, $wgRequest;
$httpaccept = isset( $_SERVER['HTTP_ACCEPT'] ) ? $_SERVER['HTTP_ACCEPT'] : null;
- $rdftype = wfNegotiateType( wfAcceptToPrefs( $httpaccept ), wfAcceptToPrefs( self::RDF_TYPE_PREFS ) );
+ $rdftype = wfNegotiateType(
+ wfAcceptToPrefs( $httpaccept ),
+ wfAcceptToPrefs( self::RDF_TYPE_PREFS )
+ );
- if( !$rdftype ) {
+ if
( !$rdftype ) {
throw new HttpError( 406, wfMessage( 'notacceptable' ) );
}
throw new HttpError( 406, wfMessage( 'notacceptable' ) );
}
@@
-70,7
+73,7
@@
abstract class RdfMetaData {
$lastEditor = User::newFromId( $this->mArticle->getUser() );
$this->person( 'creator', $lastEditor );
$lastEditor = User::newFromId( $this->mArticle->getUser() );
$this->person( 'creator', $lastEditor );
- foreach( $this->mArticle->getContributors() as $user ) {
+ foreach
( $this->mArticle->getContributors() as $user ) {
$this->person( 'contributor', $user );
}
$this->person( 'contributor', $user );
}
@@
-89,13
+92,13
@@
abstract class RdfMetaData {
}
protected function pageOrString( $name, $page, $str ) {
}
protected function pageOrString( $name, $page, $str ) {
- if( $page instanceof Title ) {
+ if
( $page instanceof Title ) {
$nt = $page;
} else {
$nt = Title::newFromText( $page );
}
$nt = $page;
} else {
$nt = Title::newFromText( $page );
}
- if( !$nt || $nt->getArticleID() == 0 ) {
+ if
( !$nt || $nt->getArticleID() == 0 ) {
$this->element( $name, $str );
} else {
$this->page( $name, $nt );
$this->element( $name, $str );
} else {
$this->page( $name, $nt );
@@
-103,8
+106,8
@@
abstract class RdfMetaData {
}
/**
}
/**
- * @param
$name string
- * @param
$title T
itle
+ * @param
string $name
+ * @param
Title $t
itle
*/
protected function page( $name, $title ) {
$this->url( $name, $title->getFullURL() );
*/
protected function page( $name, $title ) {
$this->url( $name, $title->getFullURL() );
@@
-116,11
+119,13
@@
abstract class RdfMetaData {
}
protected function person( $name, User $user ) {
}
protected function person( $name, User $user ) {
- if( $user->isAnon() ) {
+ global $wgHiddenPrefs;
+
+ if ( $user->isAnon() ) {
$this->element( $name, wfMessage( 'anonymous' )->numParams( 1 )->text() );
} else {
$real = $user->getRealName();
$this->element( $name, wfMessage( 'anonymous' )->numParams( 1 )->text() );
} else {
$real = $user->getRealName();
- if
( $real
) {
+ if
( $real && !in_array( 'realname', $wgHiddenPrefs )
) {
$this->element( $name, $real );
} else {
$userName = $user->getName();
$this->element( $name, $real );
} else {
$userName = $user->getName();
@@
-140,12
+145,12
@@
abstract class RdfMetaData {
protected function rights() {
global $wgRightsPage, $wgRightsUrl, $wgRightsText;
protected function rights() {
global $wgRightsPage, $wgRightsUrl, $wgRightsText;
- if( $wgRightsPage && ( $nt = Title::newFromText( $wgRightsPage ) )
+ if
( $wgRightsPage && ( $nt = Title::newFromText( $wgRightsPage ) )
&& ( $nt->getArticleID() != 0 ) ) {
$this->page( 'rights', $nt );
&& ( $nt->getArticleID() != 0 ) ) {
$this->page( 'rights', $nt );
- } elseif( $wgRightsUrl ) {
+ } elseif
( $wgRightsUrl ) {
$this->url( 'rights', $wgRightsUrl );
$this->url( 'rights', $wgRightsUrl );
- } elseif( $wgRightsText ) {
+ } elseif
( $wgRightsText ) {
$this->element( 'rights', $wgRightsText );
}
}
$this->element( 'rights', $wgRightsText );
}
}
@@
-153,11
+158,11
@@
abstract class RdfMetaData {
protected function getTerms( $url ) {
global $wgLicenseTerms;
protected function getTerms( $url ) {
global $wgLicenseTerms;
- if( $wgLicenseTerms ) {
+ if
( $wgLicenseTerms ) {
return $wgLicenseTerms;
} else {
$known = $this->getKnownLicenses();
return $wgLicenseTerms;
} else {
$known = $this->getKnownLicenses();
- if( isset( $known[$url] ) ) {
+ if
( isset( $known[$url] ) ) {
return $known[$url];
} else {
return array();
return $known[$url];
} else {
return array();
@@
-173,7
+178,7
@@
abstract class RdfMetaData {
foreach ( $ccVersions as $version ) {
foreach ( $ccLicenses as $license ) {
foreach ( $ccVersions as $version ) {
foreach ( $ccLicenses as $license ) {
- if( $version == '2.0' && substr( $license, 0, 2 ) != 'by' ) {
+ if
( $version == '2.0' && substr( $license, 0, 2 ) != 'by' ) {
# 2.0 dropped the non-attribs licenses
continue;
}
# 2.0 dropped the non-attribs licenses
continue;
}