@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.

Fix object ObjectItemListView attributes

Summary: This works after pht() + html got sorted out.

Test Plan: Looked at some object attribute lists.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2432

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

+36 -16
+1 -2
src/applications/calendar/controller/PhabricatorCalendarViewStatusController.php
··· 79 79 ->setBarColor($color) 80 80 ->addAttribute(pht('From %s to %s', $from, $to)) 81 81 ->addAttribute( 82 - phutil_escape_html( 83 - phutil_utf8_shorten($status->getDescription(), 64))); 82 + phutil_utf8_shorten($status->getDescription(), 64)); 84 83 85 84 $list->addItem($item); 86 85 }
+1 -1
src/applications/config/controller/PhabricatorConfigListController.php
··· 52 52 $item = id(new PhabricatorObjectItemView()) 53 53 ->setHeader($group->getName()) 54 54 ->setHref('/config/group/'.$group->getKey().'/') 55 - ->addAttribute(phutil_escape_html($group->getDescription())); 55 + ->addAttribute($group->getDescription()); 56 56 $list->addItem($item); 57 57 } 58 58
+1 -1
src/applications/drydock/controller/DrydockController.php
··· 105 105 } 106 106 107 107 $status = DrydockLeaseStatus::getNameForStatus($lease->getStatus()); 108 - $item->addAttribute(phutil_escape_html($status)); 108 + $item->addAttribute($status); 109 109 110 110 $date_created = phabricator_date($lease->getDateCreated(), $user); 111 111 $item->addAttribute(pht('Created on %s', $date_created));
+1 -2
src/applications/meta/controller/PhabricatorApplicationsListController.php
··· 51 51 $item = id(new PhabricatorObjectItemView()) 52 52 ->setHeader($application->getName()) 53 53 ->setHref('/applications/view/'.get_class($application).'/') 54 - ->addAttribute( 55 - phutil_escape_html($application->getShortDescription())); 54 + ->addAttribute($application->getShortDescription()); 56 55 $list->addItem($item); 57 56 } 58 57 return $list;
+2 -1
src/applications/paste/controller/PhabricatorPasteListController.php
··· 85 85 $created = phabricator_date($paste->getDateCreated(), $user); 86 86 $author = $this->getHandle($paste->getAuthorPHID())->renderLink(); 87 87 $source_code = $this->buildSourceCodeView($paste, 5)->render(); 88 - $source_code = phutil_render_tag( 88 + 89 + $source_code = phutil_tag( 89 90 'div', 90 91 array( 91 92 'class' => 'phabricator-source-code-summary',
+1 -1
src/applications/ponder/view/PonderUserProfileView.php
··· 84 84 array( 85 85 'href' => '/Q'.$question->getID(), 86 86 ), 87 - phutil_escape_html(self::abbreviate($question->getTitle()))))); 87 + self::abbreviate($question->getTitle())))); 88 88 89 89 $view->addItem($item); 90 90 }
+8
src/view/AphrontView.php
··· 36 36 return implode('', $out); 37 37 } 38 38 39 + final protected function renderHTMLChildren() { 40 + $out = array(); 41 + foreach ($this->children as $child) { 42 + $out[] = $this->renderHTMLView($child); 43 + } 44 + return $out; 45 + } 46 + 39 47 final protected function renderSingleView($child) { 40 48 if ($child instanceof AphrontView) { 41 49 return $child->render();
+9 -4
src/view/layout/PhabricatorObjectItemListView.php
··· 48 48 } 49 49 50 50 if ($this->items) { 51 - $items = $this->renderSingleView($this->items); 51 + $items = $this->renderHTMLView($this->items); 52 52 } else { 53 53 $string = nonempty($this->noDataString, pht('No data.')); 54 54 $items = id(new AphrontErrorView()) ··· 59 59 60 60 $pager = null; 61 61 if ($this->pager) { 62 - $pager = $this->renderSingleView($this->pager); 62 + $pager = $this->renderHTMLView($this->pager); 63 63 } 64 64 65 65 $classes[] = 'phabricator-object-item-list-view'; ··· 67 67 $classes[] = 'phabricator-object-list-stackable'; 68 68 } 69 69 70 - return phutil_render_tag( 70 + return phutil_tag( 71 71 'ul', 72 72 array( 73 73 'class' => implode(' ', $classes), 74 74 ), 75 - $header.$items.$pager); 75 + $this->renderHTMLView( 76 + array( 77 + $header, 78 + $items, 79 + $pager, 80 + ))); 76 81 } 77 82 78 83 }
+12 -4
src/view/layout/PhabricatorObjectItemView.php
··· 127 127 "\xC2\xB7"); 128 128 $first = true; 129 129 foreach ($this->attributes as $attribute) { 130 - $attrs[] = phutil_render_tag( 130 + $attrs[] = phutil_tag( 131 131 'li', 132 132 array( 133 133 'class' => 'phabricator-object-item-attribute', 134 134 ), 135 - ($first ? null : $spacer).$attribute); 135 + array( 136 + ($first ? null : $spacer), 137 + $attribute, 138 + )); 136 139 $first = false; 137 140 } 138 141 $attrs = phutil_tag( ··· 158 161 throw new Exception("Invalid effect!"); 159 162 } 160 163 161 - $content = phutil_render_tag( 164 + $content = phutil_tag( 162 165 'div', 163 166 array( 164 167 'class' => 'phabricator-object-item-content', 165 168 ), 166 - $header.$attrs.$this->renderChildren()); 169 + $this->renderHTMLView( 170 + array( 171 + $header, 172 + $attrs, 173 + $this->renderHTMLChildren(), 174 + ))); 167 175 168 176 return phutil_tag( 169 177 'li',