1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-15 11:22:40 +01:00
phorge-phorge/src/view/layout/PhabricatorCrumbsView.php
epriestley 4c914a5c49 Remove all calls to renderSingleView() and deprecate it
Summary: After D5305, this method does nothing since we automatically figure out what we need to do.

Test Plan:
- Viewed a page with the main menu on it (MainMenuView).
- Viewed a revision with transactions on it (TransactionView).
- Viewed timeline UIExample (TimelineView, TimelineEventView).
- Viewed a revision (PropertyListView).
- Viewed a profile (ProfileHeaderView).
- Viewed Pholio list (PinboardView, PinboardItemView).
- Viewed Config (ObjectItemView, ObjectItemListView).
- Viewed Home (MenuView).
- Viewed a revision (HeaderView, CrumbsView, ActionListView).
- Viewed a revision with an inline comment (anchorview).
- Viewed a Phriction diff page (AphrontCrumbsView).
  - Filed T2721 to get rid of this.
- Looked at Pholio and made inlines and comments (mockimages, pholioinlinecomment/save/edit).
- Looked at conpherences.
- Browsed around.

Reviewers: chad, vrana

Reviewed By: chad

CC: edward, aran

Differential Revision: https://secure.phabricator.com/D5307
2013-03-09 13:52:41 -08:00

77 lines
1.6 KiB
PHP

<?php
final class PhabricatorCrumbsView extends AphrontView {
private $crumbs = array();
private $actions = array();
protected function canAppendChild() {
return false;
}
public function addCrumb(PhabricatorCrumbView $crumb) {
$this->crumbs[] = $crumb;
return $this;
}
public function addAction(PhabricatorMenuItemView $action) {
$this->actions[] = $action;
return $this;
}
public function render() {
require_celerity_resource('phabricator-crumbs-view-css');
$action_view = null;
if ($this->actions) {
$actions = array();
foreach ($this->actions as $action) {
$icon = null;
if ($action->getIcon()) {
$icon = phutil_tag(
'span',
array(
'class' => 'sprite-icon action-'.$action->getIcon(),
),
'');
}
$actions[] = javelin_tag(
'a',
array(
'href' => $action->getHref(),
'class' => 'phabricator-crumbs-action',
'sigil' => $action->getWorkflow() ? 'workflow' : null,
),
array(
$icon,
$action->getName(),
));
}
$action_view = phutil_tag(
'div',
array(
'class' => 'phabricator-crumbs-actions',
),
$actions);
}
if ($this->crumbs) {
last($this->crumbs)->setIsLastCrumb(true);
}
return phutil_tag(
'div',
array(
'class' => 'phabricator-crumbs-view '.
'sprite-gradient gradient-breadcrumbs',
),
array(
$action_view,
$this->crumbs,
));
}
}