Skip to content
This repository has been archived by the owner on Jan 29, 2019. It is now read-only.

Commit

Permalink
moved condition
Browse files Browse the repository at this point in the history
  • Loading branch information
WMDE-Fisch committed Sep 1, 2015
1 parent 627e269 commit 916059d
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions SpecialContentStaging.php
Expand Up @@ -82,7 +82,7 @@ public function execute( $par ) {
$resultTable .= "| [[" . $this->mwNamespace . $this->pagePrefix . "/test/" . $title . " | " . $title . "]]\n";

foreach ( array_keys( $this->stages ) as $stage ) {
if ( $stages[$stage] !== 0 ) {
if ( $this->wikiPageExists( $stages[$stage] ) ) {
$currStage = $stage;
$targetStage = '';

Expand All @@ -92,19 +92,17 @@ public function execute( $par ) {
$targetStage = $keys[$element + 1];
}

$stagingStatus = '';
if ( $this->wikiPageExists( $stages[$stage] ) ) {
$currPage = $stages[$stage];
$targetPage = $stages[$targetStage];

$stagingStatus = '<span style="color: green">&#10003;</span>';
if ( $stage !== "production" && ( !$this->wikiPageExists( $targetPage ) || $this->stageContentDiffers( $currPage, $targetPage, $currStage, $targetStage ) ) ) {
$stagingStatus = '<html><a href="' . $baseUrl .
'&action=copy&page=' . $currPage->getId() .
'&source=' . $currStage .
'&target=' . $targetStage . '" style="color: red;">&#10007;</a></html>';
}
$currPage = $stages[$stage];
$targetPage = $stages[$targetStage];

$stagingStatus = '<span style="color: green">&#10003;</span>';
if ( $stage !== "production" && ( !$this->wikiPageExists( $targetPage ) || $this->stageContentDiffers( $currPage, $targetPage, $currStage, $targetStage ) ) ) {
$stagingStatus = '<html><a href="' . $baseUrl .
'&action=copy&page=' . $currPage->getId() .
'&source=' . $currStage .
'&target=' . $targetStage . '" style="color: red;">&#10007;</a></html>';
}

$resultTable .= "| style='text-align: center;' | " . $stagingStatus . "\n";
} else {
$resultTable .= "| \n";
Expand Down

0 comments on commit 916059d

Please sign in to comment.