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

Add a UIExamples page for new project image builtins

Summary: Adds a page to view all and their path in UIExamples.

Test Plan: Review page in UIExamples, hover over image for path.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

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

+73
+2
src/__phutil_library_map__.php
··· 3612 3612 'PhabricatorProjectBoardManageController' => 'applications/project/controller/PhabricatorProjectBoardManageController.php', 3613 3613 'PhabricatorProjectBoardReorderController' => 'applications/project/controller/PhabricatorProjectBoardReorderController.php', 3614 3614 'PhabricatorProjectBoardViewController' => 'applications/project/controller/PhabricatorProjectBoardViewController.php', 3615 + 'PhabricatorProjectBuiltinsExample' => 'applications/uiexample/examples/PhabricatorProjectBuiltinsExample.php', 3615 3616 'PhabricatorProjectCardView' => 'applications/project/view/PhabricatorProjectCardView.php', 3616 3617 'PhabricatorProjectColorTransaction' => 'applications/project/xaction/PhabricatorProjectColorTransaction.php', 3617 3618 'PhabricatorProjectColorsConfigType' => 'applications/project/config/PhabricatorProjectColorsConfigType.php', ··· 9063 9064 'PhabricatorProjectBoardManageController' => 'PhabricatorProjectBoardController', 9064 9065 'PhabricatorProjectBoardReorderController' => 'PhabricatorProjectBoardController', 9065 9066 'PhabricatorProjectBoardViewController' => 'PhabricatorProjectBoardController', 9067 + 'PhabricatorProjectBuiltinsExample' => 'PhabricatorUIExample', 9066 9068 'PhabricatorProjectCardView' => 'AphrontTagView', 9067 9069 'PhabricatorProjectColorTransaction' => 'PhabricatorProjectTransactionType', 9068 9070 'PhabricatorProjectColorsConfigType' => 'PhabricatorJSONConfigType',
+71
src/applications/uiexample/examples/PhabricatorProjectBuiltinsExample.php
··· 1 + <?php 2 + 3 + final class PhabricatorProjectBuiltinsExample extends PhabricatorUIExample { 4 + 5 + public function getName() { 6 + return pht('Project Builtin Images'); 7 + } 8 + 9 + public function getDescription() { 10 + return pht('Builtin Project Images that ship with Phabricator.'); 11 + } 12 + 13 + public function getCategory() { 14 + return pht('Catalogs'); 15 + } 16 + 17 + public function renderExample() { 18 + $viewer = $this->getRequest()->getUser(); 19 + 20 + $root = dirname(phutil_get_library_root('phabricator')); 21 + $root = $root.'/resources/builtin/projects/v3/'; 22 + 23 + Javelin::initBehavior('phabricator-tooltips', array()); 24 + 25 + $map = array(); 26 + $builtin_map = id(new FileFinder($root)) 27 + ->withType('f') 28 + ->withFollowSymlinks(true) 29 + ->find(); 30 + 31 + $images = array(); 32 + foreach ($builtin_map as $image) { 33 + $file = PhabricatorFile::loadBuiltin($viewer, 'projects/v3/'.$image); 34 + $images[$file->getPHID()] = array( 35 + 'uri' => $file->getBestURI(), 36 + 'tip' => 'v3/'.$image, 37 + ); 38 + } 39 + 40 + $buttons = array(); 41 + foreach ($images as $phid => $spec) { 42 + $button = javelin_tag( 43 + 'img', 44 + array( 45 + 'height' => 100, 46 + 'width' => 100, 47 + 'src' => $spec['uri'], 48 + 'style' => 'float: left; padding: 4px;', 49 + 'sigil' => 'has-tooltip', 50 + 'meta' => array( 51 + 'tip' => $spec['tip'], 52 + 'size' => 300, 53 + ), 54 + )); 55 + 56 + $buttons[] = $button; 57 + } 58 + 59 + $wrap1 = id(new PHUIObjectBoxView()) 60 + ->setHeaderText(pht('Images')) 61 + ->appendChild($buttons) 62 + ->addClass('grouped'); 63 + 64 + return phutil_tag( 65 + 'div', 66 + array(), 67 + array( 68 + $wrap1, 69 + )); 70 + } 71 + }