Differential D18162 Diff 43694 src/applications/project/controller/PhabricatorProjectEditPictureController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/controller/PhabricatorProjectEditPictureController.php
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | if ($current) { | ||||
$images[$current] = array( | $images[$current] = array( | ||||
'uri' => $file->getBestURI(), | 'uri' => $file->getBestURI(), | ||||
'tip' => pht('Current Picture'), | 'tip' => pht('Current Picture'), | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
$builtins = array( | |||||
'projects/v3/bug.png', | |||||
'projects/v3/calendar.png', | |||||
'projects/v3/cloud.png', | |||||
'projects/v3/creditcard.png', | |||||
'projects/v3/database.png', | |||||
'projects/v3/desktop.png', | |||||
'projects/v3/experimental.png', | |||||
'projects/v3/flag.png', | |||||
'projects/v3/folder.png', | |||||
'projects/v3/lock.png', | |||||
'projects/v3/mail.png', | |||||
'projects/v3/mobile.png', | |||||
'projects/v3/organization.png', | |||||
'projects/v3/people.png', | |||||
'projects/v3/servers.png', | |||||
'projects/v3/tag.png', | |||||
'projects/v3/trash.png', | |||||
'projects/v3/truck.png', | |||||
'projects/v3/umbrella.png', | |||||
); | |||||
foreach ($builtins as $builtin) { | |||||
$file = PhabricatorFile::loadBuiltin($viewer, $builtin); | |||||
$images[$file->getPHID()] = array( | |||||
'uri' => $file->getBestURI(), | |||||
'tip' => pht('Builtin Image'), | |||||
); | |||||
} | |||||
$images[PhabricatorPHIDConstants::PHID_VOID] = array( | $images[PhabricatorPHIDConstants::PHID_VOID] = array( | ||||
'uri' => $default_image->getBestURI(), | 'uri' => $default_image->getBestURI(), | ||||
'tip' => pht('No Picture'), | 'tip' => pht('Default Picture'), | ||||
); | ); | ||||
require_celerity_resource('people-profile-css'); | require_celerity_resource('people-profile-css'); | ||||
Javelin::initBehavior('phabricator-tooltips', array()); | Javelin::initBehavior('phabricator-tooltips', array()); | ||||
$buttons = array(); | $buttons = array(); | ||||
foreach ($images as $phid => $spec) { | foreach ($images as $phid => $spec) { | ||||
$button = javelin_tag( | $button = javelin_tag( | ||||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | Javelin::initBehavior( | ||||
array( | array( | ||||
'launchID' => $launch_id, | 'launchID' => $launch_id, | ||||
'inputID' => $input_id, | 'inputID' => $input_id, | ||||
)); | )); | ||||
$compose_button = javelin_tag( | $compose_button = javelin_tag( | ||||
'button', | 'button', | ||||
array( | array( | ||||
'class' => 'grey', | 'class' => 'button-grey', | ||||
'id' => $launch_id, | 'id' => $launch_id, | ||||
'sigil' => 'icon-composer', | 'sigil' => 'icon-composer', | ||||
), | ), | ||||
pht('Choose Icon and Color...')); | pht('Choose Icon and Color...')); | ||||
$compose_input = javelin_tag( | $compose_input = javelin_tag( | ||||
'input', | 'input', | ||||
array( | array( | ||||
Show All 10 Lines | $compose_form = phabricator_form( | ||||
), | ), | ||||
array( | array( | ||||
$compose_input, | $compose_input, | ||||
$compose_button, | $compose_button, | ||||
)); | )); | ||||
$form->appendChild( | $form->appendChild( | ||||
id(new AphrontFormMarkupControl()) | id(new AphrontFormMarkupControl()) | ||||
->setLabel(pht('Quick Create')) | ->setLabel(pht('Custom')) | ||||
->setValue($compose_form)); | ->setValue($compose_form)); | ||||
$upload_form = id(new AphrontFormView()) | $upload_form = id(new AphrontFormView()) | ||||
->setUser($viewer) | ->setUser($viewer) | ||||
->setEncType('multipart/form-data') | ->setEncType('multipart/form-data') | ||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormFileControl()) | id(new AphrontFormFileControl()) | ||||
->setName('picture') | ->setName('picture') | ||||
▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines |