public function getOptions() { $manifest = PHUIIconView::getSheetManifest('main-header'); $options = array(); foreach (array_keys($manifest) as $sprite_name) { $key = substr($sprite_name, strlen('main-header-')); $options[$key] = $key; } $example = <<<EOJSON [ { "name" : "Copyright 2199 Examplecorp" }, { "name" : "Privacy Policy", "href" : "http://www.example.org/privacy/" }, { "name" : "Terms and Conditions", "href" : "http://www.example.org/terms/" } ] EOJSON; return array($this->newOption('ui.header-color', 'enum', 'dark')->setDescription(pht('Sets the color of the main header.'))->setEnumOptions($options), $this->newOption('ui.footer-items', 'list<wild>', array())->setSummary(pht('Allows you to add footer links on most pages.'))->setDescription(pht("Allows you to add a footer with links in it to most " . "pages. You might want to use these links to point at legal " . "information or an about page.\n\n" . "Specify a list of dictionaries. Each dictionary describes " . "a footer item. These keys are supported:\n\n" . " - `name` The name of the item.\n" . " - `href` Optionally, the link target of the item. You can " . " omit this if you just want a piece of text, like a copyright " . " notice."))->addExample($example, pht('Basic Example'))); }
public function getOptions() { $manifest = PHUIIconView::getSheetManifest('main-header'); $custom_header_example = PhabricatorCustomHeaderConfigType::getExampleConfig(); $experimental_link = 'https://secure.phabricator.com/T4214'; $options = array(); foreach (array_keys($manifest) as $sprite_name) { $key = substr($sprite_name, strlen('main-header-')); $options[$key] = $key; } $example = <<<EOJSON [ { "name" : "Copyright 2199 Examplecorp" }, { "name" : "Privacy Policy", "href" : "http://www.example.org/privacy/" }, { "name" : "Terms and Conditions", "href" : "http://www.example.org/terms/" } ] EOJSON; return array($this->newOption('ui.header-color', 'enum', 'blindigo')->setDescription(pht('Sets the color of the main header.'))->setEnumOptions($options), $this->newOption('ui.footer-items', 'list<wild>', array())->setSummary(pht('Allows you to add footer links on most pages.'))->setDescription(pht("Allows you to add a footer with links in it to most " . "pages. You might want to use these links to point at legal " . "information or an about page.\n\n" . "Specify a list of dictionaries. Each dictionary describes " . "a footer item. These keys are supported:\n\n" . " - `name` The name of the item.\n" . " - `href` Optionally, the link target of the item. You can " . " omit this if you just want a piece of text, like a copyright " . " notice."))->addExample($example, pht('Basic Example')), $this->newOption('ui.custom-header', 'custom:PhabricatorCustomHeaderConfigType', null)->setSummary(pht('Customize the Phabricator logo.'))->setDescription(pht('You can customize the Phabricator logo by specifying the ' . 'phid for a viewable image you have uploaded to Phabricator ' . 'via the [[ /file/ | Files application]]. This image should ' . 'be:' . "\n" . ' - 192px X 80px; while not enforced, images with these ' . 'dimensions will look best across devices.' . "\n" . ' - have view policy public if [[ ' . '/config/edit/policy.allow-public | `policy.allow-public`]] ' . 'is true and otherwise view policy user; mismatches in these ' . 'policy settings will result in a broken logo for some users.' . "\n\n" . 'You should restart your webserver after updating this value ' . 'to see this change take effect.' . "\n\n" . 'As this feature is experimental, please read [[ %s | T4214 ]] ' . 'for up to date information.', $experimental_link))->addExample($custom_header_example, pht('Valid Config'))); }
public function markupNavigation(array $matches) { if (!$this->isFlatText($matches[0])) { return $matches[0]; } $elements = ltrim($matches[1], ", \n"); $elements = explode('>', $elements); $defaults = array('name' => null, 'type' => 'link', 'href' => null, 'icon' => null); $sequence = array(); $parser = new PhutilSimpleOptions(); foreach ($elements as $element) { if (strpos($element, '=') === false) { $sequence[] = array('name' => trim($element)) + $defaults; } else { $sequence[] = $parser->parse($element) + $defaults; } } if ($this->getEngine()->isTextMode()) { return implode(' > ', ipull($sequence, 'name')); } static $icon_names; if (!$icon_names) { $icon_names = array_fuse(PHUIIconView::getIcons()); } $out = array(); foreach ($sequence as $item) { $item_name = $item['name']; $item_color = PHUITagView::COLOR_GREY; if ($item['type'] == 'instructions') { $item_name = phutil_tag('em', array(), $item_name); $item_color = PHUITagView::COLOR_INDIGO; } $tag = id(new PHUITagView())->setType(PHUITagView::TYPE_SHADE)->setShade($item_color)->setName($item_name); if ($item['icon']) { $icon_name = 'fa-' . $item['icon']; if (isset($icon_names[$icon_name])) { $tag->setIcon($icon_name); } } if ($item['href'] !== null) { if (PhabricatorEnv::isValidRemoteURIForLink($item['href'])) { $tag->setHref($item['href']); $tag->setExternal(true); } } $out[] = $tag; } if ($this->getEngine()->isHTMLMailMode()) { $arrow_attr = array('style' => 'color: #92969D;'); $nav_attr = array(); } else { $arrow_attr = array('class' => 'remarkup-nav-sequence-arrow'); $nav_attr = array('class' => 'remarkup-nav-sequence'); } $joiner = phutil_tag('span', $arrow_attr, " → "); $out = phutil_implode_html($joiner, $out); $out = phutil_tag('span', $nav_attr, $out); return $this->getEngine()->storeText($out); }
protected function getStateIcon() { $icon = new PHUIIconView(); switch ($this->state) { case self::STATE_WARN: $icon->setIconFont('fa-exclamation-circle msr'); break; case self::STATE_INFO: $icon->setIconFont('fa-info-circle msr'); break; case self::STATE_ERROR: $icon->setIconFont('fa-exclamation-triangle msr'); break; case self::STATE_PROGRESS: $icon->setIconFont('fa-refresh ph-spin msr'); break; case self::STATE_SUCCESS: $icon->setIconFont('fa-check msr'); break; case self::STATE_NONE: return null; break; } return $icon; }
public function getOptions() { $manifest = PHUIIconView::getSheetManifest('main-header'); $options = array(); foreach (array_keys($manifest) as $sprite_name) { $key = substr($sprite_name, strlen('main-header-')); $options[$key] = $key; } return array($this->newOption('ui.header-color', 'enum', 'dark')->setDescription(pht('Sets the color of the main header.'))->setEnumOptions($options)); }
public function markupIcon(array $matches) { $engine = $this->getEngine(); $text_mode = $engine->isTextMode(); $mail_mode = $engine->isHTMLMailMode(); if (!$this->isFlatText($matches[0]) || $text_mode || $mail_mode) { return $matches[0]; } $extra = idx($matches, 1); // We allow various forms, like these: // // {icon} // {icon camera} // {icon,camera} // {icon camera color=red} // {icon, camera, color=red} $extra = ltrim($extra, ", \n"); $extra = preg_split('/[\\s,]+/', $extra, 2); // Choose some arbitrary default icon so that previews render in a mostly // reasonable way as you're typing the syntax. $icon = idx($extra, 0, 'paw'); $defaults = array('color' => null, 'spin' => false); $options = idx($extra, 1, ''); $parser = new PhutilSimpleOptions(); $options = $parser->parse($options) + $defaults; // NOTE: We're validating icon and color names to prevent users from // adding arbitrary CSS classes to the document. Although this probably // isn't dangerous, it's safer to validate. static $icon_names; if (!$icon_names) { $icon_names = array_fuse(PHUIIconView::getFontIcons()); } static $color_names; if (!$color_names) { $color_names = array_fuse(PHUIIconView::getFontIconColors()); } if (empty($icon_names['fa-' . $icon])) { $icon = 'paw'; } $color = $options['color']; if (empty($color_names[$color])) { $color = null; } $classes = array(); $classes[] = $color; $spin = $options['spin']; if ($spin) { $classes[] = 'ph-spin'; } $icon_view = id(new PHUIIconView())->setIconFont('fa-' . $icon, implode(' ', $classes)); return $this->getEngine()->storeText($icon_view); }
public function processRequest() { $request = $this->getRequest(); $viewer = $request->getUser(); $colors = array('red' => pht('Verbillion'), 'orange' => pht('Navel Orange'), 'yellow' => pht('Prim Goldenrod'), 'green' => pht('Lustrous Verdant'), 'blue' => pht('Tropical Deep'), 'sky' => pht('Wide Open Sky'), 'indigo' => pht('Pleated Khaki'), 'violet' => pht('Aged Merlot'), 'charcoal' => pht('Gemstone'), 'backdrop' => pht('Driven Snow')); $manifest = PHUIIconView::getSheetManifest(PHUIIconView::SPRITE_PROJECTS); if ($request->isFormPost()) { $icon = $request->getStr('icon'); $color = $request->getStr('color'); if (isset($colors[$color]) && isset($manifest['projects-' . $icon])) { $root = dirname(phutil_get_library_root('phabricator')); $icon_file = $root . '/resources/sprite/projects_1x/' . $icon . '.png'; $icon_data = Filesystem::readFile($icon_file); $data = $this->composeImage($color, $icon_data); $file = PhabricatorFile::buildFromFileDataOrHash($data, array('name' => 'project.png', 'canCDN' => true)); $content = array('phid' => $file->getPHID()); return id(new AphrontAjaxResponse())->setContent($content); } } $value_color = head_key($colors); $value_icon = head_key($manifest); $value_icon = substr($value_icon, strlen('projects-')); require_celerity_resource('people-profile-css'); $buttons = array(); foreach ($colors as $color => $name) { $buttons[] = javelin_tag('button', array('class' => 'grey profile-image-button', 'sigil' => 'has-tooltip compose-select-color', 'style' => 'margin: 0 8px 8px 0', 'meta' => array('color' => $color, 'tip' => $name)), id(new PHUIIconView())->addClass('compose-background-' . $color)); } $icons = array(); $icon_quips = array('8ball' => pht('Take a Risk'), 'alien' => pht('Foreign Interface'), 'announce' => pht('Louder is Better'), 'art' => pht('Unique Snowflake'), 'award' => pht('Shooting Star'), 'bacon' => pht('Healthy Vegetables'), 'bandaid' => pht('Durable Infrastructure'), 'beer' => pht('Healthy Vegetable Juice'), 'bomb' => pht('Imminent Success'), 'briefcase' => pht('Adventure Pack'), 'bug' => pht('Costumed Egg'), 'calendar' => pht('Everyone Loves Meetings'), 'cloud' => pht('Water Cycle'), 'coffee' => pht('Half-Whip Nonfat Soy Latte'), 'creditcard' => pht('Expense It'), 'death' => pht('Calcium Promotes Bone Health'), 'desktop' => pht('Magical Portal'), 'dropbox' => pht('Cardboard Box'), 'education' => pht('Debt'), 'experimental' => pht('CAUTION: Dangerous Chemicals'), 'facebook' => pht('Popular Social Network'), 'facility' => pht('Pollution Solves Problems'), 'film' => pht('Actual Physical Film'), 'forked' => pht('You Can\'t Eat Soup'), 'games' => pht('Serious Business'), 'ghost' => pht('Haunted'), 'gift' => pht('Surprise!'), 'globe' => pht('Scanner Sweep'), 'golf' => pht('Business Meeting'), 'heart' => pht('Undergoing a Major Surgery'), 'intergalactic' => pht('Jupiter'), 'lock' => pht('Extremely Secret'), 'mail' => pht('Oragami'), 'martini' => pht('Healthy Olive Drink'), 'medical' => pht('Medic!'), 'mobile' => pht('Cellular Telephone'), 'music' => pht("♫"), 'news' => pht('Actual Physical Newspaper'), 'orgchart' => pht('It\'s Good to be King'), 'peoples' => pht('Angel and Devil'), 'piechart' => pht('Actual Physical Pie'), 'poison' => pht('Healthy Bone Juice'), 'putabirdonit' => pht('Put a Bird On It'), 'radiate' => pht('Radiant Beauty'), 'savings' => pht('Oink Oink'), 'search' => pht('Sleuthing'), 'shield' => pht('Royal Crest'), 'speed' => pht('Slow and Steady'), 'sprint' => pht('Fire Exit'), 'star' => pht('The More You Know'), 'storage' => pht('Stack of Pancakes'), 'tablet' => pht('Cellular Telephone For Giants'), 'travel' => pht('Pretty Clearly an Airplane'), 'twitter' => pht('Bird Stencil'), 'warning' => pht('No Caution Required, Everything Looks Safe'), 'whale' => pht('Friendly Walrus')); foreach ($manifest as $icon => $spec) { $icon = substr($icon, strlen('projects-')); $icons[] = javelin_tag('button', array('class' => 'grey profile-image-button', 'sigil' => 'has-tooltip compose-select-icon', 'style' => 'margin: 0 8px 8px 0', 'meta' => array('icon' => $icon, 'tip' => idx($icon_quips, $icon, $icon))), id(new PHUIIconView())->setSpriteIcon($icon)->setSpriteSheet(PHUIIconView::SPRITE_PROJECTS)); } $dialog_id = celerity_generate_unique_node_id(); $color_input_id = celerity_generate_unique_node_id(); $icon_input_id = celerity_generate_unique_node_id(); $preview_id = celerity_generate_unique_node_id(); $preview = id(new PHUIIconView())->setID($preview_id)->addClass('compose-background-' . $value_color)->setSpriteIcon($value_icon)->setSpriteSheet(PHUIIconView::SPRITE_PROJECTS); $color_input = javelin_tag('input', array('type' => 'hidden', 'name' => 'color', 'value' => $value_color, 'id' => $color_input_id)); $icon_input = javelin_tag('input', array('type' => 'hidden', 'name' => 'icon', 'value' => $value_icon, 'id' => $icon_input_id)); Javelin::initBehavior('phabricator-tooltips'); Javelin::initBehavior('icon-composer', array('dialogID' => $dialog_id, 'colorInputID' => $color_input_id, 'iconInputID' => $icon_input_id, 'previewID' => $preview_id, 'defaultColor' => $value_color, 'defaultIcon' => $value_icon)); $dialog = id(new AphrontDialogView())->setUser($viewer)->setFormID($dialog_id)->setClass('compose-dialog')->setTitle(pht('Compose Image'))->appendChild(phutil_tag('div', array('class' => 'compose-header'), pht('Choose Background Color')))->appendChild($buttons)->appendChild(phutil_tag('div', array('class' => 'compose-header'), pht('Choose Icon')))->appendChild($icons)->appendChild(phutil_tag('div', array('class' => 'compose-header'), pht('Preview')))->appendChild($preview)->appendChild($color_input)->appendChild($icon_input)->addCancelButton('/')->addSubmitButton(pht('Save Image')); return id(new AphrontDialogResponse())->setDialog($dialog); }
public function renderExample() { $colors = PHUIIconView::getFontIconColors(); $colors = array_merge(array(null), $colors); $fas = PHUIIconView::getFontIcons(); $trans = $this->listTransforms(); $cicons = array(); foreach ($colors as $color) { $cicons[] = id(new PHUIIconView())->addClass('phui-example-icon-transform')->setIcon('fa-tag ' . $color)->setText(pht('fa-tag %s', $color)); } $ficons = array(); sort($fas); foreach ($fas as $fa) { $ficons[] = id(new PHUIIconView())->addClass('phui-example-icon-name')->setIcon($fa)->setText($fa); } $person1 = new PHUIIconView(); $person1->setHeadSize(PHUIIconView::HEAD_MEDIUM); $person1->setHref('http://en.wikipedia.org/wiki/George_Washington'); $person1->setImage(celerity_get_resource_uri('/rsrc/image/people/washington.png')); $person2 = new PHUIIconView(); $person2->setHeadSize(PHUIIconView::HEAD_MEDIUM); $person2->setHref('http://en.wikipedia.org/wiki/Warren_G._Harding'); $person2->setImage(celerity_get_resource_uri('/rsrc/image/people/harding.png')); $person3 = new PHUIIconView(); $person3->setHeadSize(PHUIIconView::HEAD_MEDIUM); $person3->setHref('http://en.wikipedia.org/wiki/William_Howard_Taft'); $person3->setImage(celerity_get_resource_uri('/rsrc/image/people/taft.png')); $person4 = new PHUIIconView(); $person4->setHeadSize(PHUIIconView::HEAD_SMALL); $person4->setHref('http://en.wikipedia.org/wiki/George_Washington'); $person4->setImage(celerity_get_resource_uri('/rsrc/image/people/washington.png')); $person5 = new PHUIIconView(); $person5->setHeadSize(PHUIIconView::HEAD_SMALL); $person5->setHref('http://en.wikipedia.org/wiki/Warren_G._Harding'); $person5->setImage(celerity_get_resource_uri('/rsrc/image/people/harding.png')); $person6 = new PHUIIconView(); $person6->setHeadSize(PHUIIconView::HEAD_SMALL); $person6->setHref('http://en.wikipedia.org/wiki/William_Howard_Taft'); $person6->setImage(celerity_get_resource_uri('/rsrc/image/people/taft.png')); $tokens = array('like-1', 'like-2', 'heart-1', 'heart-2'); $tokenview = array(); foreach ($tokens as $token) { $tokenview[] = id(new PHUIIconView())->setSpriteSheet(PHUIIconView::SPRITE_TOKENS)->setSpriteIcon($token); } $logins = array('Asana', 'Dropbox', 'Google', 'Github'); $loginview = array(); foreach ($logins as $login) { $loginview[] = id(new PHUIIconView())->setSpriteSheet(PHUIIconView::SPRITE_LOGIN)->setSpriteIcon($login)->addClass(PHUI::MARGIN_SMALL_RIGHT); } $circles = array('fa-pencil', 'fa-chevron-left', 'fa-chevron-right'); $circleview = array(); foreach ($circles as $circle) { $circleview[] = id(new PHUIIconCircleView())->setIcon($circle)->setHref('#')->addClass('mmr'); } $circles = array('fa-plus', 'fa-bars', 'fa-paw'); foreach ($circles as $circle) { $circleview[] = id(new PHUIIconCircleView())->setIcon($circle)->setSize(PHUIIconCircleView::MEDIUM)->setHref('#')->addClass('mmr'); } $layout_cicons = id(new PHUIBoxView())->appendChild($cicons)->addMargin(PHUI::MARGIN_LARGE); $layout_fa = id(new PHUIBoxView())->appendChild($ficons)->addMargin(PHUI::MARGIN_LARGE); $layout2 = id(new PHUIBoxView())->appendChild(array($person1, $person2, $person3))->addMargin(PHUI::MARGIN_MEDIUM); $layout2a = id(new PHUIBoxView())->appendChild(array($person4, $person5, $person6))->addMargin(PHUI::MARGIN_MEDIUM); $layout3 = id(new PHUIBoxView())->appendChild($tokenview)->addMargin(PHUI::MARGIN_MEDIUM); $layout4 = id(new PHUIBoxView())->appendChild($circleview)->addMargin(PHUI::MARGIN_MEDIUM); $layout5 = id(new PHUIBoxView())->appendChild($loginview)->addMargin(PHUI::MARGIN_MEDIUM); $fa_link = phutil_tag('a', array('href' => 'http://fontawesome.io'), 'http://fontawesome.io'); $fa_text = pht('Font Awesome by Dave Gandy - %s', $fa_link); $fontawesome = id(new PHUIObjectBoxView())->setHeaderText($fa_text)->appendChild($layout_fa); $transforms = id(new PHUIObjectBoxView())->setHeaderText(pht('Colors and Transforms'))->appendChild($layout_cicons); $wrap2 = id(new PHUIObjectBoxView())->setHeaderText(pht('People!'))->appendChild(array($layout2, $layout2a)); $wrap3 = id(new PHUIObjectBoxView())->setHeaderText(pht('Tokens'))->appendChild($layout3); $wrap4 = id(new PHUIObjectBoxView())->setHeaderText(pht('Circles'))->appendChild($layout4); $wrap5 = id(new PHUIObjectBoxView())->setHeaderText(pht('Authentication'))->appendChild($layout5); return phutil_tag('div', array('class' => 'phui-icon-example'), array($fontawesome, $transforms, $wrap2, $wrap3, $wrap4, $wrap5)); }
public function render() { require_celerity_resource('phui-feed-story-css'); Javelin::initBehavior('phabricator-hovercards'); $body = null; $foot = null; $image_style = null; $actor = ''; if ($this->image) { $actor = new PHUIIconView(); $actor->setImage($this->image); $actor->addClass('phui-feed-story-actor-image'); if ($this->imageHref) { $actor->setHref($this->imageHref); } } if ($this->epoch) { // TODO: This is really bad; when rendering through Conduit and via // renderText() we don't have a user. if ($this->user) { $foot = phabricator_datetime($this->epoch, $this->user); } else { $foot = null; } } else { $foot = pht('No time specified.'); } if ($this->chronologicalKey) { $foot = phutil_tag('a', array('href' => '/feed/' . $this->chronologicalKey . '/'), $foot); } $icon = null; if ($this->appIcon) { $icon = id(new PHUIIconView())->setIconFont($this->appIcon); } $action_list = array(); $icons = null; foreach ($this->actions as $action) { $action_list[] = phutil_tag('li', array('class' => 'phui-feed-story-action-item'), $action); } if (!empty($action_list)) { $icons = phutil_tag('ul', array('class' => 'phui-feed-story-action-list'), $action_list); } $head = phutil_tag('div', array('class' => 'phui-feed-story-head'), array($actor, nonempty($this->title, pht('Untitled Story')), $icons)); if (!empty($this->tokenBar)) { $tokenview = phutil_tag('div', array('class' => 'phui-feed-token-bar'), $this->tokenBar); $this->appendChild($tokenview); } $body_content = $this->renderChildren(); if ($body_content) { $body = phutil_tag('div', array('class' => 'phui-feed-story-body phabricator-remarkup'), $body_content); } $tags = null; if ($this->tags) { $tags = array(" · ", $this->tags); } $foot = phutil_tag('div', array('class' => 'phui-feed-story-foot'), array($icon, $foot, $tags)); $classes = array('phui-feed-story'); return id(new PHUIBoxView())->addClass(implode(' ', $classes))->setBorder(true)->addMargin(PHUI::MARGIN_MEDIUM_BOTTOM)->appendChild(array($head, $body, $foot)); }
public function renderExample() { /* Colors */ $title1 = id(new PHUIHeaderView())->setHeader(pht('Header Plain')); $header1 = id(new PHUIActionHeaderView())->setHeaderTitle('Colorless'); $header2 = id(new PHUIActionHeaderView())->setHeaderTitle('Light Grey')->setHeaderColor(PHUIActionHeaderView::HEADER_GREY); $header3 = id(new PHUIActionHeaderView())->setHeaderTitle('Light Blue')->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTBLUE); $header4 = id(new PHUIActionHeaderView())->setHeaderTitle('Light Green')->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTGREEN); $header5 = id(new PHUIActionHeaderView())->setHeaderTitle('Light Red')->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTRED); $header6 = id(new PHUIActionHeaderView())->setHeaderTitle('Light Violet')->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTVIOLET); $layout1 = id(new AphrontMultiColumnView())->addColumn($header1)->addColumn($header2)->addColumn($header3)->addColumn($header4)->addColumn($header5)->addColumn($header6)->setFluidLayout(true)->setGutter(AphrontMultiColumnView::GUTTER_SMALL); $wrap1 = id(new PHUIBoxView())->appendChild($layout1)->addMargin(PHUI::MARGIN_LARGE); /* Policy Icons */ $title2 = id(new PHUIHeaderView())->setHeader(pht('With Icons')); $header1 = id(new PHUIActionHeaderView())->setHeaderTitle('Quack')->setHeaderIcon(id(new PHUIIconView())->setIconFont('fa-coffee')); $header2 = id(new PHUIActionHeaderView())->setHeaderTitle('Moo')->setHeaderColor(PHUIActionHeaderView::HEADER_GREY)->setHeaderIcon(id(new PHUIIconView())->setIconFont('fa-magic')); $header3 = id(new PHUIActionHeaderView())->setHeaderTitle('Woof')->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTBLUE)->setHeaderIcon(id(new PHUIIconView())->setIconFont('fa-fighter-jet')); $header4 = id(new PHUIActionHeaderView())->setHeaderTitle('Buzz')->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTGREEN)->setHeaderIcon(id(new PHUIIconView())->setIconFont('fa-child')); $header5 = id(new PHUIActionHeaderView())->setHeaderTitle('Fizz')->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTRED)->setHeaderIcon(id(new PHUIIconView())->setIconFont('fa-car')); $header6 = id(new PHUIActionHeaderView())->setHeaderTitle('Blarp')->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTVIOLET)->setHeaderIcon(id(new PHUIIconView())->setIconFont('fa-truck')); $layout2 = id(new AphrontMultiColumnView())->addColumn($header1)->addColumn($header2)->addColumn($header3)->addColumn($header4)->addColumn($header5)->addColumn($header6)->setFluidLayout(true)->setGutter(AphrontMultiColumnView::GUTTER_SMALL); $wrap2 = id(new PHUIBoxView())->appendChild($layout2)->addMargin(PHUI::MARGIN_LARGE); /* Action Icons */ $title3 = id(new PHUIHeaderView())->setHeader(pht('With Action Icons')); $action1 = new PHUIIconView(); $action1->setIconFont('fa-cog'); $action1->setHref('#'); $action2 = new PHUIIconView(); $action2->setIconFont('fa-heart'); $action2->setHref('#'); $action3 = new PHUIIconView(); $action3->setIconFont('fa-tag'); $action3->setHref('#'); $action4 = new PHUIIconView(); $action4->setIconFont('fa-plus'); $action4->setHref('#'); $action5 = new PHUIIconView(); $action5->setIconFont('fa-search'); $action5->setHref('#'); $action6 = new PHUIIconView(); $action6->setIconFont('fa-arrows'); $action6->setHref('#'); $header1 = id(new PHUIActionHeaderView())->setHeaderTitle('Company')->setHeaderHref('http://example.com/')->addAction($action1); $header2 = id(new PHUIActionHeaderView())->setHeaderTitle('Public')->setHeaderHref('http://example.com/')->setHeaderColor(PHUIActionHeaderView::HEADER_GREY)->addAction($action1); $header3 = id(new PHUIActionHeaderView())->setHeaderTitle('Restricted')->setHeaderHref('http://example.com/')->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTBLUE)->addAction($action2); $header4 = id(new PHUIActionHeaderView())->setHeaderTitle('Company')->setHeaderHref('http://example.com/')->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTGREEN)->addAction($action3); $header5 = id(new PHUIActionHeaderView())->setHeaderTitle('Public')->setHeaderHref('http://example.com/')->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTRED)->addAction($action4)->addAction($action5); $header6 = id(new PHUIActionHeaderView())->setHeaderTitle('Restricted')->setHeaderHref('http://example.com/')->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTVIOLET)->addAction($action6); $layout3 = id(new AphrontMultiColumnView())->addColumn($header1)->addColumn($header2)->addColumn($header3)->addColumn($header4)->addColumn($header5)->addColumn($header6)->setFluidLayout(true)->setGutter(AphrontMultiColumnView::GUTTER_SMALL); $wrap3 = id(new PHUIBoxView())->appendChild($layout3)->addMargin(PHUI::MARGIN_LARGE); /* Action Icons */ $title4 = id(new PHUIHeaderView())->setHeader(pht('With Tags')); $tag1 = id(new PHUITagView())->setType(PHUITagView::TYPE_STATE)->setBackgroundColor(PHUITagView::COLOR_RED)->setName('Open'); $tag2 = id(new PHUITagView())->setType(PHUITagView::TYPE_STATE)->setBackgroundColor(PHUITagView::COLOR_BLUE)->setName('Closed'); $action1 = new PHUIIconView(); $action1->setIconFont('fa-flag'); $action1->setHref('#'); $header1 = id(new PHUIActionHeaderView())->setHeaderTitle('Company')->setTag($tag2); $header2 = id(new PHUIActionHeaderView())->setHeaderTitle('Public')->setHeaderColor(PHUIActionHeaderView::HEADER_GREY)->addAction($action1)->setTag($tag1); $header3 = id(new PHUIActionHeaderView())->setHeaderTitle('Restricted')->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTBLUE)->setTag($tag2); $header4 = id(new PHUIActionHeaderView())->setHeaderTitle('Company')->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTGREEN)->setTag($tag1); $header5 = id(new PHUIActionHeaderView())->setHeaderTitle('Public')->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTRED)->setTag($tag2); $header6 = id(new PHUIActionHeaderView())->setHeaderTitle('Restricted')->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTVIOLET)->setTag($tag1); $layout4 = id(new AphrontMultiColumnView())->addColumn($header1)->addColumn($header2)->addColumn($header3)->addColumn($header4)->addColumn($header5)->addColumn($header6)->setFluidLayout(true)->setGutter(AphrontMultiColumnView::GUTTER_SMALL); $wrap4 = id(new PHUIBoxView())->appendChild($layout4)->addMargin(PHUI::MARGIN_LARGE); return phutil_tag('div', array(), array($title1, $wrap1, $title2, $wrap2, $title3, $wrap3, $title4, $wrap4)); }