Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15417137
D18196.id43771.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D18196.id43771.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -3612,6 +3612,7 @@
'PhabricatorProjectBoardManageController' => 'applications/project/controller/PhabricatorProjectBoardManageController.php',
'PhabricatorProjectBoardReorderController' => 'applications/project/controller/PhabricatorProjectBoardReorderController.php',
'PhabricatorProjectBoardViewController' => 'applications/project/controller/PhabricatorProjectBoardViewController.php',
+ 'PhabricatorProjectBuiltinsExample' => 'applications/uiexample/examples/PhabricatorProjectBuiltinsExample.php',
'PhabricatorProjectCardView' => 'applications/project/view/PhabricatorProjectCardView.php',
'PhabricatorProjectColorTransaction' => 'applications/project/xaction/PhabricatorProjectColorTransaction.php',
'PhabricatorProjectColorsConfigType' => 'applications/project/config/PhabricatorProjectColorsConfigType.php',
@@ -9063,6 +9064,7 @@
'PhabricatorProjectBoardManageController' => 'PhabricatorProjectBoardController',
'PhabricatorProjectBoardReorderController' => 'PhabricatorProjectBoardController',
'PhabricatorProjectBoardViewController' => 'PhabricatorProjectBoardController',
+ 'PhabricatorProjectBuiltinsExample' => 'PhabricatorUIExample',
'PhabricatorProjectCardView' => 'AphrontTagView',
'PhabricatorProjectColorTransaction' => 'PhabricatorProjectTransactionType',
'PhabricatorProjectColorsConfigType' => 'PhabricatorJSONConfigType',
diff --git a/src/applications/uiexample/examples/PhabricatorProjectBuiltinsExample.php b/src/applications/uiexample/examples/PhabricatorProjectBuiltinsExample.php
new file mode 100644
--- /dev/null
+++ b/src/applications/uiexample/examples/PhabricatorProjectBuiltinsExample.php
@@ -0,0 +1,71 @@
+<?php
+
+final class PhabricatorProjectBuiltinsExample extends PhabricatorUIExample {
+
+ public function getName() {
+ return pht('Project Builtin Images');
+ }
+
+ public function getDescription() {
+ return pht('Builtin Project Images that ship with Phabricator.');
+ }
+
+ public function getCategory() {
+ return pht('Catalogs');
+ }
+
+ public function renderExample() {
+ $viewer = $this->getRequest()->getUser();
+
+ $root = dirname(phutil_get_library_root('phabricator'));
+ $root = $root.'/resources/builtin/projects/v3/';
+
+ Javelin::initBehavior('phabricator-tooltips', array());
+
+ $map = array();
+ $builtin_map = id(new FileFinder($root))
+ ->withType('f')
+ ->withFollowSymlinks(true)
+ ->find();
+
+ $images = array();
+ foreach ($builtin_map as $image) {
+ $file = PhabricatorFile::loadBuiltin($viewer, 'projects/v3/'.$image);
+ $images[$file->getPHID()] = array(
+ 'uri' => $file->getBestURI(),
+ 'tip' => 'v3/'.$image,
+ );
+ }
+
+ $buttons = array();
+ foreach ($images as $phid => $spec) {
+ $button = javelin_tag(
+ 'img',
+ array(
+ 'height' => 100,
+ 'width' => 100,
+ 'src' => $spec['uri'],
+ 'style' => 'float: left; padding: 4px;',
+ 'sigil' => 'has-tooltip',
+ 'meta' => array(
+ 'tip' => $spec['tip'],
+ 'size' => 300,
+ ),
+ ));
+
+ $buttons[] = $button;
+ }
+
+ $wrap1 = id(new PHUIObjectBoxView())
+ ->setHeaderText(pht('Images'))
+ ->appendChild($buttons)
+ ->addClass('grouped');
+
+ return phutil_tag(
+ 'div',
+ array(),
+ array(
+ $wrap1,
+ ));
+ }
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 21, 3:34 PM (2 d, 14 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7699239
Default Alt Text
D18196.id43771.diff (3 KB)
Attached To
Mode
D18196: Add a UIExamples page for new project image builtins
Attached
Detach File
Event Timeline
Log In to Comment