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

PHUIButtonBarView

Summary: Adds a handy bar full of tiny buttons. Use only when directed. Ref: T4394

Test Plan: View UI Examples.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: Korvin, epriestley, aran

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

+134 -8
+5 -5
resources/celerity/map.php
··· 7 7 return array( 8 8 'names' => 9 9 array( 10 - 'core.pkg.css' => '882662b1', 10 + 'core.pkg.css' => '71e0a12a', 11 11 'core.pkg.js' => 'c7854cc5', 12 12 'darkconsole.pkg.js' => 'ca8671ce', 13 13 'differential.pkg.css' => '5a65a762', ··· 127 127 'rsrc/css/layout/phabricator-source-code-view.css' => '62a99814', 128 128 'rsrc/css/layout/phabricator-timeline-view.css' => 'f4f846c4', 129 129 'rsrc/css/phui/phui-box.css' => '21da4d8c', 130 - 'rsrc/css/phui/phui-button.css' => '8106a67a', 130 + 'rsrc/css/phui/phui-button.css' => '8784a966', 131 131 'rsrc/css/phui/phui-document.css' => '143b2ac8', 132 132 'rsrc/css/phui/phui-feed-story.css' => '3a59c2cf', 133 133 'rsrc/css/phui/phui-form-view.css' => '0efd3326', 134 134 'rsrc/css/phui/phui-form.css' => 'b78ec020', 135 135 'rsrc/css/phui/phui-header-view.css' => '472a6003', 136 - 'rsrc/css/phui/phui-icon.css' => '29e83226', 136 + 'rsrc/css/phui/phui-icon.css' => 'fcb145a7', 137 137 'rsrc/css/phui/phui-info-panel.css' => '27ea50a1', 138 138 'rsrc/css/phui/phui-list.css' => '2edb76cf', 139 139 'rsrc/css/phui/phui-object-box.css' => '4f916b80', ··· 738 738 'phrequent-css' => 'ffc185ad', 739 739 'phriction-document-css' => 'b0309d8e', 740 740 'phui-box-css' => '21da4d8c', 741 - 'phui-button-css' => '8106a67a', 741 + 'phui-button-css' => '8784a966', 742 742 'phui-document-view-css' => '143b2ac8', 743 743 'phui-feed-story-css' => '3a59c2cf', 744 744 'phui-form-css' => 'b78ec020', 745 745 'phui-form-view-css' => '0efd3326', 746 746 'phui-header-view-css' => '472a6003', 747 - 'phui-icon-view-css' => '29e83226', 747 + 'phui-icon-view-css' => 'fcb145a7', 748 748 'phui-info-panel-css' => '27ea50a1', 749 749 'phui-list-view-css' => '2edb76cf', 750 750 'phui-object-box-css' => '4f916b80',
+4
src/__phutil_library_map__.php
··· 979 979 'PHUI' => 'view/phui/PHUI.php', 980 980 'PHUIBoxExample' => 'applications/uiexample/examples/PHUIBoxExample.php', 981 981 'PHUIBoxView' => 'view/phui/PHUIBoxView.php', 982 + 'PHUIButtonBarExample' => 'applications/uiexample/examples/PHUIButtonBarExample.php', 983 + 'PHUIButtonBarView' => 'view/phui/PHUIButtonBarView.php', 982 984 'PHUIButtonExample' => 'applications/uiexample/examples/PHUIButtonExample.php', 983 985 'PHUIButtonView' => 'view/phui/PHUIButtonView.php', 984 986 'PHUIColorPalletteExample' => 'applications/uiexample/examples/PHUIColorPalletteExample.php', ··· 3599 3601 'OwnersPackageReplyHandler' => 'PhabricatorMailReplyHandler', 3600 3602 'PHUIBoxExample' => 'PhabricatorUIExample', 3601 3603 'PHUIBoxView' => 'AphrontTagView', 3604 + 'PHUIButtonBarExample' => 'PhabricatorUIExample', 3605 + 'PHUIButtonBarView' => 'AphrontTagView', 3602 3606 'PHUIButtonExample' => 'PhabricatorUIExample', 3603 3607 'PHUIButtonView' => 'AphrontTagView', 3604 3608 'PHUIColorPalletteExample' => 'PhabricatorUIExample',
+47
src/applications/uiexample/examples/PHUIButtonBarExample.php
··· 1 + <?php 2 + 3 + final class PHUIButtonBarExample extends PhabricatorUIExample { 4 + 5 + public function getName() { 6 + return pht('Button Bar'); 7 + } 8 + 9 + public function getDescription() { 10 + return pht('A minimal UI for Buttons'); 11 + } 12 + 13 + public function renderExample() { 14 + $request = $this->getRequest(); 15 + $user = $request->getUser(); 16 + 17 + // Icon Buttons 18 + $icons = array( 19 + 'Go Back' => 'chevron-left', 20 + 'Choose Date' => 'calendar', 21 + 'Edit View' => 'pencil', 22 + 'Go Forward' => 'chevron-right'); 23 + $button_bar = new PHUIButtonBarView(); 24 + foreach ($icons as $text => $icon) { 25 + $image = id(new PHUIIconView()) 26 + ->setSpriteSheet(PHUIIconView::SPRITE_BUTTONBAR) 27 + ->setSpriteIcon($icon); 28 + $button = id(new PHUIButtonView()) 29 + ->setTag('a') 30 + ->setColor(PHUIButtonView::GREY) 31 + ->setTitle($text) 32 + ->setIcon($image); 33 + 34 + $button_bar->addButton($button); 35 + } 36 + 37 + $layout = id(new PHUIBoxView()) 38 + ->appendChild($button_bar) 39 + ->addPadding(PHUI::PADDING_LARGE); 40 + 41 + $wrap1 = id(new PHUIObjectBoxView()) 42 + ->setHeaderText('Button Bar Example') 43 + ->appendChild($layout); 44 + 45 + return array($wrap1); 46 + } 47 + }
+42
src/view/phui/PHUIButtonBarView.php
··· 1 + <?php 2 + 3 + final class PHUIButtonBarView extends AphrontTagView { 4 + 5 + private $buttons = array(); 6 + 7 + public function addButton($button) { 8 + $this->buttons[] = $button; 9 + return $this; 10 + } 11 + 12 + protected function getTagAttributes() { 13 + return array('class' => 'phui-button-bar'); 14 + } 15 + 16 + public function getTagName() { 17 + return 'div'; 18 + } 19 + 20 + public function getTagContent() { 21 + require_celerity_resource('phui-button-css'); 22 + 23 + $i = 1; 24 + $j = count($this->buttons); 25 + foreach ($this->buttons as $button) { 26 + // LeeLoo Dallas Multi-Pass 27 + if ($j > 1) { 28 + if ($i == 1) { 29 + $button->addClass('phui-button-bar-first'); 30 + } elseif ($i == $j) { 31 + $button->addClass('phui-button-bar-last'); 32 + } elseif ($j > 1) { 33 + $button->addClass('phui-button-bar-middle'); 34 + } 35 + } 36 + $this->appendChild($button); 37 + $i++; 38 + } 39 + 40 + return $this->renderChildren(); 41 + } 42 + }
+9 -2
src/view/phui/PHUIButtonView.php
··· 19 19 private $dropdown; 20 20 private $icon; 21 21 private $href = null; 22 + private $title = null; 22 23 23 24 public function setText($text) { 24 25 $this->text = $text; ··· 27 28 28 29 public function setHref($href) { 29 30 $this->href = $href; 31 + return $this; 32 + } 33 + 34 + public function setTitle($title) { 35 + $this->title = $title; 30 36 return $this; 31 37 } 32 38 ··· 87 93 $classes[] = 'has-icon'; 88 94 } 89 95 90 - return array('class' => $classes, 91 - 'href' => $this->href); 96 + return array('class' => $classes, 97 + 'href' => $this->href, 98 + 'title' => $this->title); 92 99 } 93 100 94 101 protected function getTagContent() {
+1
src/view/phui/PHUIIconView.php
··· 11 11 const SPRITE_LOGIN = 'login'; 12 12 const SPRITE_STATUS = 'status'; 13 13 const SPRITE_PROJECTS = 'projects'; 14 + const SPRITE_BUTTONBAR = 'buttonbar'; 14 15 15 16 const HEAD_SMALL = 'phuihead-small'; 16 17 const HEAD_MEDIUM = 'phuihead-medium';
+24
webroot/rsrc/css/phui/phui-button.css
··· 338 338 line-height: 15px; 339 339 font-weight: normal; 340 340 } 341 + 342 + /* PHUI Button Bar */ 343 + 344 + .phui-button-bar a.button { 345 + display: inline-block; 346 + height: 16px; 347 + width: 12px; 348 + } 349 + 350 + .phui-button-bar .phui-button-bar-first { 351 + border-top-right-radius: 0px; 352 + border-bottom-right-radius: 0px; 353 + } 354 + 355 + .phui-button-bar .phui-button-bar-middle { 356 + border-radius: 0; 357 + border-left: none; 358 + } 359 + 360 + .phui-button-bar .phui-button-bar-last { 361 + border-left: none; 362 + border-top-left-radius: 0px; 363 + border-bottom-left-radius: 0px; 364 + }
+2 -1
webroot/rsrc/css/phui/phui-icon.css
··· 19 19 20 20 .phui-icon-view.sprite-apps, 21 21 .phui-icon-view.sprite-icons, 22 - .phui-icon-view.sprite-status { 22 + .phui-icon-view.sprite-status, 23 + .phui-icon-view.sprite-buttonbar { 23 24 height: 14px; 24 25 width: 14px; 25 26 }