Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phame/editor/PhamePostEditor.php
| Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | switch ($xaction->getTransactionType()) { | ||||
| return $object->setTitle($xaction->getNewValue()); | return $object->setTitle($xaction->getNewValue()); | ||||
| case PhamePostTransaction::TYPE_BODY: | case PhamePostTransaction::TYPE_BODY: | ||||
| return $object->setBody($xaction->getNewValue()); | return $object->setBody($xaction->getNewValue()); | ||||
| case PhamePostTransaction::TYPE_BLOG: | case PhamePostTransaction::TYPE_BLOG: | ||||
| return $object->setBlogPHID($xaction->getNewValue()); | return $object->setBlogPHID($xaction->getNewValue()); | ||||
| case PhamePostTransaction::TYPE_VISIBILITY: | case PhamePostTransaction::TYPE_VISIBILITY: | ||||
| if ($xaction->getNewValue() == PhameConstants::VISIBILITY_DRAFT) { | if ($xaction->getNewValue() == PhameConstants::VISIBILITY_DRAFT) { | ||||
| $object->setDatePublished(0); | $object->setDatePublished(0); | ||||
| } else if ($xaction->getNewValue() == | |||||
| PhameConstants::VISIBILITY_ARCHIVED) { | |||||
| $object->setDatePublished(0); | |||||
| } else { | } else { | ||||
| $object->setDatePublished(PhabricatorTime::getNow()); | $object->setDatePublished(PhabricatorTime::getNow()); | ||||
| } | } | ||||
| return $object->setVisibility($xaction->getNewValue()); | return $object->setVisibility($xaction->getNewValue()); | ||||
| } | } | ||||
| return parent::applyCustomInternalTransaction($object, $xaction); | return parent::applyCustomInternalTransaction($object, $xaction); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 205 Lines • Show Last 20 Lines | |||||