2012-08-15 19:45:06 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorHeaderView extends AphrontView {
|
|
|
|
|
|
|
|
private $objectName;
|
|
|
|
private $header;
|
Modernize Macro application
Summary: Adds feed, email, notifications, comments, partial editing, subscriptions, enable/disable, flags and crumbs to Macro.
Test Plan:
{F26839}
{F26840}
{F26841}
{F26842}
{F26843}
{F26844}
{F26845}
Reviewers: vrana, btrahan, chad
Reviewed By: vrana
CC: aran
Maniphest Tasks: T2157, T175, T2104
Differential Revision: https://secure.phabricator.com/D4141
2012-12-11 23:01:03 +01:00
|
|
|
private $tags = array();
|
2012-08-15 19:45:06 +02:00
|
|
|
|
|
|
|
public function setHeader($header) {
|
|
|
|
$this->header = $header;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setObjectName($object_name) {
|
|
|
|
$this->objectName = $object_name;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
Modernize Macro application
Summary: Adds feed, email, notifications, comments, partial editing, subscriptions, enable/disable, flags and crumbs to Macro.
Test Plan:
{F26839}
{F26840}
{F26841}
{F26842}
{F26843}
{F26844}
{F26845}
Reviewers: vrana, btrahan, chad
Reviewed By: vrana
CC: aran
Maniphest Tasks: T2157, T175, T2104
Differential Revision: https://secure.phabricator.com/D4141
2012-12-11 23:01:03 +01:00
|
|
|
public function addTag(PhabricatorTagView $tag) {
|
|
|
|
$this->tags[] = $tag;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2012-08-15 19:45:06 +02:00
|
|
|
public function render() {
|
|
|
|
require_celerity_resource('phabricator-header-view-css');
|
|
|
|
|
2013-01-18 09:32:58 +01:00
|
|
|
$header = array($this->header);
|
2012-08-15 19:45:06 +02:00
|
|
|
|
|
|
|
if ($this->objectName) {
|
2013-01-18 09:32:58 +01:00
|
|
|
array_unshift(
|
|
|
|
$header,
|
|
|
|
phutil_tag(
|
|
|
|
'a',
|
|
|
|
array(
|
|
|
|
'href' => '/'.$this->objectName,
|
|
|
|
),
|
|
|
|
$this->objectName),
|
|
|
|
' ');
|
2012-08-15 19:45:06 +02:00
|
|
|
}
|
|
|
|
|
Modernize Macro application
Summary: Adds feed, email, notifications, comments, partial editing, subscriptions, enable/disable, flags and crumbs to Macro.
Test Plan:
{F26839}
{F26840}
{F26841}
{F26842}
{F26843}
{F26844}
{F26845}
Reviewers: vrana, btrahan, chad
Reviewed By: vrana
CC: aran
Maniphest Tasks: T2157, T175, T2104
Differential Revision: https://secure.phabricator.com/D4141
2012-12-11 23:01:03 +01:00
|
|
|
if ($this->tags) {
|
2013-01-25 21:57:47 +01:00
|
|
|
$header[] = phutil_tag(
|
2012-12-11 23:01:35 +01:00
|
|
|
'span',
|
Modernize Macro application
Summary: Adds feed, email, notifications, comments, partial editing, subscriptions, enable/disable, flags and crumbs to Macro.
Test Plan:
{F26839}
{F26840}
{F26841}
{F26842}
{F26843}
{F26844}
{F26845}
Reviewers: vrana, btrahan, chad
Reviewed By: vrana
CC: aran
Maniphest Tasks: T2157, T175, T2104
Differential Revision: https://secure.phabricator.com/D4141
2012-12-11 23:01:03 +01:00
|
|
|
array(
|
|
|
|
'class' => 'phabricator-header-tags',
|
|
|
|
),
|
2013-02-13 23:08:57 +01:00
|
|
|
$this->renderHTMLView($this->tags));
|
Modernize Macro application
Summary: Adds feed, email, notifications, comments, partial editing, subscriptions, enable/disable, flags and crumbs to Macro.
Test Plan:
{F26839}
{F26840}
{F26841}
{F26842}
{F26843}
{F26844}
{F26845}
Reviewers: vrana, btrahan, chad
Reviewed By: vrana
CC: aran
Maniphest Tasks: T2157, T175, T2104
Differential Revision: https://secure.phabricator.com/D4141
2012-12-11 23:01:03 +01:00
|
|
|
}
|
|
|
|
|
2013-01-18 03:47:13 +01:00
|
|
|
return phutil_tag(
|
2012-12-11 23:01:35 +01:00
|
|
|
'div',
|
2012-08-15 19:45:06 +02:00
|
|
|
array(
|
2012-12-11 23:01:35 +01:00
|
|
|
'class' => 'phabricator-header-shell',
|
2012-08-15 19:45:06 +02:00
|
|
|
),
|
2013-01-18 09:32:58 +01:00
|
|
|
phutil_tag(
|
2012-12-11 23:01:35 +01:00
|
|
|
'h1',
|
|
|
|
array(
|
|
|
|
'class' => 'phabricator-header-view',
|
|
|
|
),
|
|
|
|
$header));
|
2012-08-15 19:45:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|