diff --git a/src/applications/phame/controller/blog/PhameBlogEditController.php b/src/applications/phame/controller/blog/PhameBlogEditController.php index d043b147a2..6a9f952726 100644 --- a/src/applications/phame/controller/blog/PhameBlogEditController.php +++ b/src/applications/phame/controller/blog/PhameBlogEditController.php @@ -122,7 +122,8 @@ final class PhameBlogEditController ->setName('description') ->setValue($blog->getDescription()) ->setID('blog-description') - ->setUser($user)) + ->setUser($user) + ->setDisableMacros(true)) ->appendChild( id(new AphrontFormPolicyControl()) ->setUser($user) diff --git a/src/applications/phame/controller/post/PhamePostEditController.php b/src/applications/phame/controller/post/PhamePostEditController.php index 2f16595716..20217edc51 100644 --- a/src/applications/phame/controller/post/PhamePostEditController.php +++ b/src/applications/phame/controller/post/PhamePostEditController.php @@ -133,6 +133,7 @@ final class PhamePostEditController ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL) ->setID('post-body') ->setUser($user) + ->setDisableMacros(true) ) ->appendChild( id(new AphrontFormSelectControl()) diff --git a/src/view/form/control/PhabricatorRemarkupControl.php b/src/view/form/control/PhabricatorRemarkupControl.php index 5198c0cf8d..5520a7f5fe 100644 --- a/src/view/form/control/PhabricatorRemarkupControl.php +++ b/src/view/form/control/PhabricatorRemarkupControl.php @@ -1,7 +1,11 @@ disableMacro = $disable; + return $this; + } protected function renderInput() { $id = $this->getID(); if (!$id) { @@ -48,20 +52,22 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl { ), 'table' => array( 'tip' => pht('Table'), - ), - array( + ) + ); + if (!$this->disableMacro and function_exists('imagettftext')) { + $actions[] = array( 'spacer' => true, - ), - 'meme' => array( + ); + $actions['meme'] = array( 'tip' => pht('Meme'), - ), - 'help' => array( + ); + } + $actions['help'] = array( 'tip' => pht('Help'), 'align' => 'right', 'href' => PhabricatorEnv::getDoclink( 'article/Remarkup_Reference.html'), - ), - ); + ); $buttons = array(); foreach ($actions as $action => $spec) { @@ -74,7 +80,6 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl { ''); continue; } - $classes = array(); $classes[] = 'remarkup-assist-button'; if (idx($spec, 'align') == 'right') {