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
Merge "rdbms: add "use" statement for UnexpectedValueExcetion in Database"
[lhc/web/wiklou.git]
/
includes
/
diff
/
DifferenceEngine.php
diff --git
a/includes/diff/DifferenceEngine.php
b/includes/diff/DifferenceEngine.php
index
51b9f15
..
037a80f
100644
(file)
--- a/
includes/diff/DifferenceEngine.php
+++ b/
includes/diff/DifferenceEngine.php
@@
-634,7
+634,10
@@
class DifferenceEngine extends ContextSource {
if ( Hooks::run( 'DifferenceEngineRenderRevisionAddParserOutput',
[ $this, $out, $parserOutput, $wikiPage ] )
) {
if ( Hooks::run( 'DifferenceEngineRenderRevisionAddParserOutput',
[ $this, $out, $parserOutput, $wikiPage ] )
) {
- $out->addParserOutput( $parserOutput );
+ $out->addParserOutput( $parserOutput, [
+ 'enableSectionEditLinks' => $this->mNewRev->isCurrent()
+ && $this->mNewRev->getTitle()->quickUserCan( 'edit', $this->getUser() ),
+ ] );
}
}
}
}
}
}
@@
-647,13
+650,14
@@
class DifferenceEngine extends ContextSource {
}
}
}
}
+ /**
+ * @param WikiPage $page
+ * @param Revision $rev
+ *
+ * @return ParserOutput|bool False if the revision was not found
+ */
protected function getParserOutput( WikiPage $page, Revision $rev ) {
$parserOptions = $page->makeParserOptions( $this->getContext() );
protected function getParserOutput( WikiPage $page, Revision $rev ) {
$parserOptions = $page->makeParserOptions( $this->getContext() );
-
- if ( !$rev->isCurrent() || !$rev->getTitle()->quickUserCan( 'edit', $this->getUser() ) ) {
- $parserOptions->setEditSection( false );
- }
-
$parserOutput = $page->getParserOutput( $parserOptions, $rev->getId() );
return $parserOutput;
$parserOutput = $page->getParserOutput( $parserOptions, $rev->getId() );
return $parserOutput;
@@
-1290,7
+1294,7
@@
class DifferenceEngine extends ContextSource {
if ( !$diff && !$otitle ) {
$header .= "
if ( !$diff && !$otitle ) {
$header .= "
- <tr
style=\"vertical-align: top;
\" lang=\"{$userLang}\">
+ <tr
class=\"diff-title
\" lang=\"{$userLang}\">
<td class=\"diff-ntitle\">{$ntitle}</td>
</tr>";
$multiColspan = 1;
<td class=\"diff-ntitle\">{$ntitle}</td>
</tr>";
$multiColspan = 1;
@@
-1309,7
+1313,7
@@
class DifferenceEngine extends ContextSource {
}
if ( $otitle || $ntitle ) {
$header .= "
}
if ( $otitle || $ntitle ) {
$header .= "
- <tr
style=\"vertical-align: top;
\" lang=\"{$userLang}\">
+ <tr
class=\"diff-title
\" lang=\"{$userLang}\">
<td colspan=\"$colspan\" class=\"diff-otitle\">{$otitle}</td>
<td colspan=\"$colspan\" class=\"diff-ntitle\">{$ntitle}</td>
</tr>";
<td colspan=\"$colspan\" class=\"diff-otitle\">{$otitle}</td>
<td colspan=\"$colspan\" class=\"diff-ntitle\">{$ntitle}</td>
</tr>";
@@
-1317,12
+1321,12
@@
class DifferenceEngine extends ContextSource {
}
if ( $multi != '' ) {
}
if ( $multi != '' ) {
- $header .= "<tr><td colspan=\"{$multiColspan}\"
style=\"text-align: center;\"
" .
+ $header .= "<tr><td colspan=\"{$multiColspan}\" " .
"class=\"diff-multi\" lang=\"{$userLang}\">{$multi}</td></tr>";
}
if ( $notice != '' ) {
"class=\"diff-multi\" lang=\"{$userLang}\">{$multi}</td></tr>";
}
if ( $notice != '' ) {
- $header .= "<tr><td colspan=\"{$multiColspan}\"
style=\"text-align: center;\"
" .
- "lang=\"{$userLang}\">{$notice}</td></tr>";
+ $header .= "<tr><td colspan=\"{$multiColspan}\" " .
+ "
class=\"diff-notice\"
lang=\"{$userLang}\">{$notice}</td></tr>";
}
return $header . $diff . "</table>";
}
return $header . $diff . "</table>";