Changeset View
Changeset View
Standalone View
Standalone View
src/applications/pholio/storage/PholioImage.php
<?php | <?php | ||||
final class PholioImage extends PholioDAO | final class PholioImage extends PholioDAO | ||||
implements | implements | ||||
PhabricatorMarkupInterface, | |||||
PhabricatorPolicyInterface { | PhabricatorPolicyInterface { | ||||
const MARKUP_FIELD_DESCRIPTION = 'markup:description'; | |||||
protected $mockID; | protected $mockID; | ||||
protected $filePHID; | protected $filePHID; | ||||
protected $name; | protected $name; | ||||
protected $description; | protected $description; | ||||
protected $sequence; | protected $sequence; | ||||
protected $isObsolete; | protected $isObsolete; | ||||
protected $replacesImagePHID = null; | protected $replacesImagePHID = null; | ||||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | final class PholioImage extends PholioDAO | ||||
} | } | ||||
public function getInlineComments() { | public function getInlineComments() { | ||||
$this->assertAttached($this->inlineComments); | $this->assertAttached($this->inlineComments); | ||||
return $this->inlineComments; | return $this->inlineComments; | ||||
} | } | ||||
/* -( PhabricatorMarkupInterface )----------------------------------------- */ | |||||
public function getMarkupFieldKey($field) { | |||||
$content = $this->getMarkupText($field); | |||||
return PhabricatorMarkupEngine::digestRemarkupContent($this, $content); | |||||
} | |||||
public function newMarkupEngine($field) { | |||||
return PhabricatorMarkupEngine::newMarkupEngine(array()); | |||||
} | |||||
public function getMarkupText($field) { | |||||
return $this->getDescription(); | |||||
} | |||||
public function didMarkupText($field, $output, PhutilMarkupEngine $engine) { | |||||
return $output; | |||||
} | |||||
public function shouldUseMarkupCache($field) { | |||||
return (bool)$this->getID(); | |||||
} | |||||
/* -( PhabricatorPolicyInterface Implementation )-------------------------- */ | /* -( PhabricatorPolicyInterface Implementation )-------------------------- */ | ||||
public function getCapabilities() { | public function getCapabilities() { | ||||
return $this->getMock()->getCapabilities(); | return $this->getMock()->getCapabilities(); | ||||
} | } | ||||
public function getPolicy($capability) { | public function getPolicy($capability) { | ||||
return $this->getMock()->getPolicy($capability); | return $this->getMock()->getPolicy($capability); | ||||
} | } | ||||
// really the *mock* controls who can see an image | // really the *mock* controls who can see an image | ||||
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { | public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { | ||||
return $this->getMock()->hasAutomaticCapability($capability, $viewer); | return $this->getMock()->hasAutomaticCapability($capability, $viewer); | ||||
} | } | ||||
} | } |