2011-06-27 08:57:43 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @group markup
|
|
|
|
*/
|
2013-02-26 23:57:41 +01:00
|
|
|
final class PhabricatorPasteRemarkupRule
|
2013-02-27 16:18:30 +01:00
|
|
|
extends PhabricatorRemarkupRuleObject {
|
2011-06-27 08:57:43 +02:00
|
|
|
|
|
|
|
protected function getObjectNamePrefix() {
|
|
|
|
return 'P';
|
|
|
|
}
|
|
|
|
|
2013-02-27 16:18:30 +01:00
|
|
|
protected function loadObjects(array $ids) {
|
|
|
|
$viewer = $this->getEngine()->getConfig('viewer');
|
|
|
|
|
|
|
|
return id(new PhabricatorPasteQuery())
|
|
|
|
->setViewer($viewer)
|
|
|
|
->withIDs($ids)
|
2013-03-13 14:44:27 +01:00
|
|
|
->needContent(true)
|
2013-02-27 16:18:30 +01:00
|
|
|
->execute();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-03-13 14:44:27 +01:00
|
|
|
protected function renderObjectEmbed($object, $handle, $options) {
|
|
|
|
$embed_paste = id(new PasteEmbedView())
|
|
|
|
->setPaste($object)
|
|
|
|
->setHandle($handle);
|
|
|
|
|
|
|
|
return $embed_paste->render();
|
|
|
|
|
|
|
|
}
|
2011-06-27 08:57:43 +02:00
|
|
|
}
|