Differential D19668 Diff 47006 src/applications/phriction/controller/PhrictionDocumentController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phriction/controller/PhrictionDocumentController.php
Show First 20 Lines • Show All 470 Lines • ▼ Show 20 Lines | if ($content) { | ||||
$current_version = $document->getContent()->getVersion(); | $current_version = $document->getContent()->getVersion(); | ||||
$is_draft = ($content->getVersion() >= $current_version); | $is_draft = ($content->getVersion() >= $current_version); | ||||
} | } | ||||
$can_publish = ($can_edit && $content && !$is_current); | $can_publish = ($can_edit && $content && !$is_current); | ||||
if ($is_draft) { | if ($is_draft) { | ||||
$publish_name = pht('Publish Draft'); | $publish_name = pht('Publish Draft'); | ||||
} else { | } else { | ||||
$publish_name = pht('Publish Revert'); | $publish_name = pht('Publish Older Version'); | ||||
} | } | ||||
// If you're looking at the current version; and it's an unpublished | // If you're looking at the current version; and it's an unpublished | ||||
// draft; and you can publish it, add a UI hint that this might be an | // draft; and you can publish it, add a UI hint that this might be an | ||||
// interesting action to take. | // interesting action to take. | ||||
$hint_publish = false; | $hint_publish = false; | ||||
if ($is_draft) { | if ($is_draft) { | ||||
if ($can_publish) { | if ($can_publish) { | ||||
▲ Show 20 Lines • Show All 211 Lines • Show Last 20 Lines |