mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-04 20:52:43 +01:00
c7408f2797
Summary: Depends on D19198. Ref T13101. Ref T5258. Pull compositing logic out of the `Controller`. This is moving toward fixing memes in email. Test Plan: Used new and old memes. Used API memes. Maniphest Tasks: T13101, T5258 Differential Revision: https://secure.phabricator.com/D19200
30 lines
755 B
PHP
30 lines
755 B
PHP
<?php
|
|
|
|
final class PhabricatorMacroMemeController
|
|
extends PhabricatorMacroController {
|
|
|
|
public function shouldAllowPublic() {
|
|
return true;
|
|
}
|
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
$macro_name = $request->getStr('macro');
|
|
$upper_text = $request->getStr('uppertext');
|
|
$lower_text = $request->getStr('lowertext');
|
|
$viewer = $request->getViewer();
|
|
|
|
$file = id(new PhabricatorMemeEngine())
|
|
->setViewer($viewer)
|
|
->setTemplate($macro_name)
|
|
->setAboveText($request->getStr('above'))
|
|
->setBelowText($request->getStr('below'))
|
|
->newAsset();
|
|
|
|
$content = array(
|
|
'imageURI' => $file->getViewURI(),
|
|
);
|
|
|
|
return id(new AphrontAjaxResponse())->setContent($content);
|
|
}
|
|
|
|
}
|