1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-04 08:29:18 +01:00
phorge-phorge/src/view/layout/PhabricatorHeaderView.php
vrana 9670f0c636 Convert phutil_render_tag(X, Y, phutil_render_tag(...)) to phutil_render_html
Summary:
Created with spatch:

  lang=diff
  - phutil_render_tag
  + phutil_render_html
    (X, Y, phutil_render_tag(...))

  - phutil_render_tag
  + phutil_render_html
    (X, Y, phutil_render_html(...))

Test Plan: Loaded homepage

Reviewers: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4502
2013-01-24 19:35:51 -08:00

64 lines
1.2 KiB
PHP

<?php
final class PhabricatorHeaderView extends AphrontView {
private $objectName;
private $header;
private $tags = array();
public function setHeader($header) {
$this->header = $header;
return $this;
}
public function setObjectName($object_name) {
$this->objectName = $object_name;
return $this;
}
public function addTag(PhabricatorTagView $tag) {
$this->tags[] = $tag;
return $this;
}
public function render() {
require_celerity_resource('phabricator-header-view-css');
$header = array($this->header);
if ($this->objectName) {
array_unshift(
$header,
phutil_tag(
'a',
array(
'href' => '/'.$this->objectName,
),
$this->objectName),
' ');
}
if ($this->tags) {
$header[] = phutil_render_tag(
'span',
array(
'class' => 'phabricator-header-tags',
),
self::renderSingleView($this->tags));
}
return phutil_tag(
'div',
array(
'class' => 'phabricator-header-shell',
),
phutil_tag(
'h1',
array(
'class' => 'phabricator-header-view',
),
$header));
}
}