@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make some remarkup handling in Config cleaner, fixing {{other.option} links

Summary:
Depends on D19609. Ref T13189. At some point, we switched from RemarkupEngine to RemarkupView and lost this piece of hack-magic.

Restore the hack-magic. It's still hack-magic instead of a real rule, but things are at least cleaner than they were before.

Test Plan: Viewed `auth.require-approval`, etc. Saw references to other config options linked properly.

Reviewers: amckinley

Maniphest Tasks: T13189

Differential Revision: https://secure.phabricator.com/D19610

+16 -58
+1 -4
src/__phutil_library_map__.php
··· 8290 8290 'PhabricatorConfigManualActivity' => 'PhabricatorConfigEntryDAO', 8291 8291 'PhabricatorConfigModule' => 'Phobject', 8292 8292 'PhabricatorConfigModuleController' => 'PhabricatorConfigController', 8293 - 'PhabricatorConfigOption' => array( 8294 - 'Phobject', 8295 - 'PhabricatorMarkupInterface', 8296 - ), 8293 + 'PhabricatorConfigOption' => 'Phobject', 8297 8294 'PhabricatorConfigOptionType' => 'Phobject', 8298 8295 'PhabricatorConfigPHIDModule' => 'PhabricatorConfigModule', 8299 8296 'PhabricatorConfigProxySource' => 'PhabricatorConfigSource',
+6 -20
src/applications/config/controller/PhabricatorConfigEditController.php
··· 153 153 $e_value); 154 154 } 155 155 156 - $engine = new PhabricatorMarkupEngine(); 157 - $engine->setViewer($viewer); 158 - $engine->addObject($option, 'description'); 159 - $engine->process(); 160 - $description = phutil_tag( 161 - 'div', 162 - array( 163 - 'class' => 'phabricator-remarkup', 164 - ), 165 - $engine->getOutput($option, 'description')); 166 - 167 156 $form 168 157 ->setUser($viewer) 169 158 ->addHiddenInput('issue', $request->getStr('issue')); 170 159 171 - $description = $option->getDescription(); 172 - if (strlen($description)) { 173 - $description_view = new PHUIRemarkupView($viewer, $description); 174 - 175 - $form 176 - ->appendChild( 177 - id(new AphrontFormMarkupControl()) 178 - ->setLabel(pht('Description')) 179 - ->setValue($description_view)); 160 + $description = $option->newDescriptionRemarkupView($viewer); 161 + if ($description) { 162 + $form->appendChild( 163 + id(new AphrontFormMarkupControl()) 164 + ->setLabel(pht('Description')) 165 + ->setValue($description)); 180 166 } 181 167 182 168 if ($group) {
+9 -34
src/applications/config/option/PhabricatorConfigOption.php
··· 1 1 <?php 2 2 3 3 final class PhabricatorConfigOption 4 - extends Phobject 5 - implements PhabricatorMarkupInterface { 4 + extends Phobject { 6 5 7 6 private $key; 8 7 private $default; ··· 204 203 return $this; 205 204 } 206 205 207 - /* -( PhabricatorMarkupInterface )----------------------------------------- */ 208 - 209 - public function getMarkupFieldKey($field) { 210 - return $this->getKey().':'.$field; 211 - } 212 - 213 - public function newMarkupEngine($field) { 214 - return PhabricatorMarkupEngine::newMarkupEngine(array()); 215 - } 216 - 217 - public function getMarkupText($field) { 218 - switch ($field) { 219 - case 'description': 220 - $text = $this->getDescription(); 221 - break; 222 - case 'summary': 223 - $text = $this->getSummary(); 224 - break; 206 + public function newDescriptionRemarkupView(PhabricatorUser $viewer) { 207 + $description = $this->getDescription(); 208 + if (!strlen($description)) { 209 + return null; 225 210 } 226 211 227 - // TODO: We should probably implement this as a real Markup rule, but 228 - // markup rules are a bit of a mess right now and it doesn't hurt us to 229 - // fake this. 230 - $text = preg_replace( 212 + // TODO: Some day, we should probably implement this as a real rule. 213 + $description = preg_replace( 231 214 '/{{([^}]+)}}/', 232 215 '[[/config/edit/\\1/ | \\1]]', 233 - $text); 234 - 235 - return $text; 236 - } 237 - 238 - public function didMarkupText($field, $output, PhutilMarkupEngine $engine) { 239 - return $output; 240 - } 216 + $description); 241 217 242 - public function shouldUseMarkupCache($field) { 243 - return false; 218 + return new PHUIRemarkupView($viewer, $description); 244 219 } 245 220 246 221 }