From 97fbc54d0bc788c938ca13d22fc9c51131381f44 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Tue, 12 May 2015 06:55:46 -0700 Subject: [PATCH] Implement PHUIHeaderView from AphrontTagView Summary: Looking at implementing ManiphestTaskListView as standard components, need to add this functionality for Headers. Test Plan: Browsed various pages, couldn't spot any regressions offhand. Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Differential Revision: https://secure.phabricator.com/D12802 --- src/__phutil_library_map__.php | 4 +-- src/view/phui/PHUIHeaderView.php | 42 +++++++++++++++++++------------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 3b422cc6d3..7056c0a3a3 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1495,7 +1495,6 @@ phutil_register_library_map(array( 'PhabricatorCacheTTLGarbageCollector' => 'applications/cache/garbagecollector/PhabricatorCacheTTLGarbageCollector.php', 'PhabricatorCaches' => 'applications/cache/PhabricatorCaches.php', 'PhabricatorCalendarApplication' => 'applications/calendar/application/PhabricatorCalendarApplication.php', - 'PhabricatorCalendarBrowseController' => 'applications/calendar/controller/PhabricatorCalendarBrowseController.php', 'PhabricatorCalendarController' => 'applications/calendar/controller/PhabricatorCalendarController.php', 'PhabricatorCalendarDAO' => 'applications/calendar/storage/PhabricatorCalendarDAO.php', 'PhabricatorCalendarEvent' => 'applications/calendar/storage/PhabricatorCalendarEvent.php', @@ -4520,7 +4519,7 @@ phutil_register_library_map(array( 'PHUIHandleListView' => 'AphrontTagView', 'PHUIHandleTagListView' => 'AphrontTagView', 'PHUIHandleView' => 'AphrontView', - 'PHUIHeaderView' => 'AphrontView', + 'PHUIHeaderView' => 'AphrontTagView', 'PHUIIconExample' => 'PhabricatorUIExample', 'PHUIIconView' => 'AphrontTagView', 'PHUIImageMaskExample' => 'PhabricatorUIExample', @@ -4839,7 +4838,6 @@ phutil_register_library_map(array( 'PhabricatorCacheSpec' => 'Phobject', 'PhabricatorCacheTTLGarbageCollector' => 'PhabricatorGarbageCollector', 'PhabricatorCalendarApplication' => 'PhabricatorApplication', - 'PhabricatorCalendarBrowseController' => 'PhabricatorCalendarController', 'PhabricatorCalendarController' => 'PhabricatorController', 'PhabricatorCalendarDAO' => 'PhabricatorLiskDAO', 'PhabricatorCalendarEvent' => array( diff --git a/src/view/phui/PHUIHeaderView.php b/src/view/phui/PHUIHeaderView.php index ad3561d930..14159e500c 100644 --- a/src/view/phui/PHUIHeaderView.php +++ b/src/view/phui/PHUIHeaderView.php @@ -1,6 +1,6 @@ image) { + $classes[] = 'phui-header-has-image'; + } + + return array( + 'class' => $classes, + ); + } + + protected function getTagContent() { $image = null; if ($this->image) { $image = phutil_tag( @@ -156,7 +170,6 @@ final class PHUIHeaderView extends AphrontView { 'style' => 'background-image: url('.$this->image.')', ), ' '); - $classes[] = 'phui-header-has-image'; } $header = array(); @@ -243,20 +256,15 @@ final class PHUIHeaderView extends AphrontView { $property_list); } - return phutil_tag( - 'div', - array( - 'class' => implode(' ', $classes), - ), - array( - $image, - phutil_tag( - 'h1', - array( - 'class' => 'phui-header-view grouped', - ), - $header), - )); + return array( + $image, + phutil_tag( + 'h1', + array( + 'class' => 'phui-header-view grouped', + ), + $header), + ); } private function renderPolicyProperty(PhabricatorPolicyInterface $object) {