From c95ab9bc947c139b90466039d4a970a161e969b1 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 23 Jan 2013 18:37:40 -0800 Subject: [PATCH 01/10] Fix (?) macro list issue Summary: @chad, does this fix your issue? Test Plan: @chad pls test thx Reviewers: chad Reviewed By: chad CC: aran Maniphest Tasks: T2391 Differential Revision: https://secure.phabricator.com/D4610 --- .../macro/controller/PhabricatorMacroListController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/applications/macro/controller/PhabricatorMacroListController.php b/src/applications/macro/controller/PhabricatorMacroListController.php index 828cbf01a0..d52f52327f 100644 --- a/src/applications/macro/controller/PhabricatorMacroListController.php +++ b/src/applications/macro/controller/PhabricatorMacroListController.php @@ -64,7 +64,11 @@ final class PhabricatorMacroListController $nodata = pht('There are no image macros yet.'); } - $author_phids = array_combine($authors, $authors); + if ($authors) { + $author_phids = array_combine($authors, $authors); + } else { + $author_phids = array(); + } $file_phids = mpull($macros, 'getFilePHID'); From 62a27c1caa9c9683612ee7216cc17e5c510cf6d0 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 23 Jan 2013 18:40:19 -0800 Subject: [PATCH 02/10] Fix uri.allowed-protocols default value Summary: Fixes T2392. Test Plan: grepped for others, this is the only `set` with non-array default Reviewers: chad, starruler Reviewed By: starruler CC: aran Maniphest Tasks: T2392 Differential Revision: https://secure.phabricator.com/D4611 --- .../config/option/PhabricatorSecurityConfigOptions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/config/option/PhabricatorSecurityConfigOptions.php b/src/applications/config/option/PhabricatorSecurityConfigOptions.php index 44f4e1bb8f..5a6de619a4 100644 --- a/src/applications/config/option/PhabricatorSecurityConfigOptions.php +++ b/src/applications/config/option/PhabricatorSecurityConfigOptions.php @@ -108,7 +108,7 @@ final class PhabricatorSecurityConfigOptions "unique to your install. In particular, you will want to do ". "this if you accidentally send a bunch of mail somewhere you ". "shouldn't have, to invalidate all old reply-to addresses.")), - $this->newOption('uri.allowed-protocols', 'set', null) + $this->newOption('uri.allowed-protocols', 'set', array()) ->setSummary( pht("Determines which URI protocols are auto-linked.")) ->setDescription( From 3440892d7b5da097282f399bb8e498fe0ad4450d Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 23 Jan 2013 18:44:19 -0800 Subject: [PATCH 03/10] Allow some protocols Summary: I heard this HTTP thing is pretty good. Test Plan: @starruler did things which confirmed this is less bad than D4611. Reviewers: starruler Reviewed By: starruler CC: aran Differential Revision: https://secure.phabricator.com/D4612 --- .../config/option/PhabricatorSecurityConfigOptions.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/applications/config/option/PhabricatorSecurityConfigOptions.php b/src/applications/config/option/PhabricatorSecurityConfigOptions.php index 5a6de619a4..2ad8fe7c7d 100644 --- a/src/applications/config/option/PhabricatorSecurityConfigOptions.php +++ b/src/applications/config/option/PhabricatorSecurityConfigOptions.php @@ -108,7 +108,13 @@ final class PhabricatorSecurityConfigOptions "unique to your install. In particular, you will want to do ". "this if you accidentally send a bunch of mail somewhere you ". "shouldn't have, to invalidate all old reply-to addresses.")), - $this->newOption('uri.allowed-protocols', 'set', array()) + $this->newOption( + 'uri.allowed-protocols', + 'set', + array( + 'http' => true, + 'https' => true, + )) ->setSummary( pht("Determines which URI protocols are auto-linked.")) ->setDescription( From 99e7810572128ba1794c301b4720722842e60218 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Wed, 23 Jan 2013 19:36:23 -0800 Subject: [PATCH 04/10] PHT's on Audit and Macro Summary: Went through some files and pht'd some stuff while the kid was in the bath. LINT Test Plan: Doinked all over each of these apps, didn't spot anything out of the ordinary. Reviewers: epriestley, btrahan Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4613 --- .../PhabricatorApplicationAudit.php | 2 +- .../controller/PhabricatorAuditController.php | 2 +- .../PhabricatorAuditListController.php | 82 +++++++++---------- .../PhabricatorApplicationMacro.php | 2 +- .../controller/PhabricatorMacroController.php | 14 ++-- .../PhabricatorMacroDisableController.php | 8 +- .../PhabricatorMacroEditController.php | 29 +++---- .../PhabricatorMacroListController.php | 8 +- .../PhabricatorMacroViewController.php | 6 +- 9 files changed, 79 insertions(+), 74 deletions(-) diff --git a/src/applications/audit/application/PhabricatorApplicationAudit.php b/src/applications/audit/application/PhabricatorApplicationAudit.php index 8e050e380d..d24e3a71a0 100644 --- a/src/applications/audit/application/PhabricatorApplicationAudit.php +++ b/src/applications/audit/application/PhabricatorApplicationAudit.php @@ -3,7 +3,7 @@ final class PhabricatorApplicationAudit extends PhabricatorApplication { public function getShortDescription() { - return 'Audit Code'; + return pht('Audit Code'); } public function getBaseURI() { diff --git a/src/applications/audit/controller/PhabricatorAuditController.php b/src/applications/audit/controller/PhabricatorAuditController.php index 52bcdb7e26..0c9f4ef318 100644 --- a/src/applications/audit/controller/PhabricatorAuditController.php +++ b/src/applications/audit/controller/PhabricatorAuditController.php @@ -6,7 +6,7 @@ abstract class PhabricatorAuditController extends PhabricatorController { $page = $this->buildStandardPageView(); - $page->setApplicationName('Audit'); + $page->setApplicationName(pht('Audit')); $page->setBaseURI('/audit/'); $page->setTitle(idx($data, 'title')); $page->setGlyph("\xE2\x9C\x8D"); diff --git a/src/applications/audit/controller/PhabricatorAuditListController.php b/src/applications/audit/controller/PhabricatorAuditListController.php index 5019a95225..d858dec6bf 100644 --- a/src/applications/audit/controller/PhabricatorAuditListController.php +++ b/src/applications/audit/controller/PhabricatorAuditListController.php @@ -49,13 +49,13 @@ final class PhabricatorAuditListController extends PhabricatorAuditController { if (!$handle) { switch ($this->filter) { case 'project': - $title = 'Choose A Project'; - $message = 'Choose a project to view audits for.'; + $title = pht('Choose A Project'); + $message = pht('Choose a project to view audits for.'); break; case 'package': case 'packagecommits': - $title = 'Choose a Package'; - $message = 'Choose a package to view audits for.'; + $title = pht('Choose a Package'); + $message = pht('Choose a package to view audits for.'); break; } } @@ -73,26 +73,26 @@ final class PhabricatorAuditListController extends PhabricatorAuditController { return $this->buildStandardPageResponse( $nav, array( - 'title' => 'Audits', + 'title' => pht('Audits'), )); } private function buildNavAndSelectFilter() { $nav = new AphrontSideNavFilterView(); $nav->setBaseURI(new PhutilURI('/audit/view/')); - $nav->addLabel('Active'); - $nav->addFilter('active', 'Need Attention'); + $nav->addLabel(pht('Active')); + $nav->addFilter('active', pht('Need Attention')); - $nav->addLabel('Audits'); - $nav->addFilter('audits', 'All'); - $nav->addFilter('user', 'By User'); - $nav->addFilter('project', 'By Project'); - $nav->addFilter('package', 'By Package'); + $nav->addLabel(pht('Audits')); + $nav->addFilter('audits', pht('All')); + $nav->addFilter('user', pht('By User')); + $nav->addFilter('project', pht('By Project')); + $nav->addFilter('package', pht('By Package')); - $nav->addLabel('Commits'); - $nav->addFilter('commits', 'All'); - $nav->addFilter('author', 'By Author'); - $nav->addFilter('packagecommits', 'By Package'); + $nav->addLabel(pht('Commits')); + $nav->addFilter('commits', pht('All')); + $nav->addFilter('author', pht('By Author')); + $nav->addFilter('packagecommits', pht('By Package')); $this->filter = $nav->selectFilter($this->filter, 'active'); @@ -138,13 +138,13 @@ final class PhabricatorAuditListController extends PhabricatorAuditController { if ($show_user || $show_project || $show_package) { if ($show_user) { $uri = '/typeahead/common/users/'; - $label = 'User'; + $label = pht('User'); } else if ($show_project) { $uri = '/typeahead/common/projects/'; - $label = 'Project'; + $label = pht('Project'); } else if ($show_package) { $uri = '/typeahead/common/packages/'; - $label = 'Package'; + $label = pht('Package'); } $tok_value = null; @@ -167,19 +167,19 @@ final class PhabricatorAuditListController extends PhabricatorAuditController { $form->appendChild( id(new AphrontFormToggleButtonsControl()) ->setName('status') - ->setLabel('Status') + ->setLabel(pht('Status')) ->setBaseURI($request->getRequestURI(), 'status') ->setValue($this->filterStatus) ->setButtons( array( - 'all' => 'All', - 'open' => 'Open', + 'all' => pht('All'), + 'open' => pht('Open'), ))); } $form->appendChild( id(new AphrontFormSubmitControl()) - ->setValue('Filter Audits')); + ->setValue(pht('Filter Audits'))); $view = new AphrontListFilterView(); $view->appendChild($form); @@ -342,24 +342,24 @@ final class PhabricatorAuditListController extends PhabricatorAuditController { switch ($this->filter) { case 'active': - $header = 'Required Audits'; - $nodata = 'No commits require your audit.'; + $header = pht('Required Audits'); + $nodata = pht('No commits require your audit.'); break; case 'user': - $header = "Audits for {$handle_name}"; - $nodata = "No matching audits by {$handle_name}."; + $header = pht("Audits for %s", $handle_name); + $nodata = pht("No matching audits by %s.", $handle_name); break; case 'audits': - $header = "Audits"; - $nodata = "No matching audits."; + $header = pht('Audits'); + $nodata = pht('No matching audits.'); break; case 'project': - $header = "Audits in Project '{$handle_name}'"; - $nodata = "No matching audits in project '{$handle_name}'."; + $header = pht("Audits in Project %s", $handle_name); + $nodata = pht("No matching audits in project %s.", $handle_name); break; case 'package': - $header = "Audits for Package '{$handle_name}'"; - $nodata = "No matching audits in package '{$handle_name}'."; + $header = pht("Audits for Package %s", $handle_name); + $nodata = pht("No matching audits in package %s.", $handle_name); break; } @@ -442,20 +442,20 @@ final class PhabricatorAuditListController extends PhabricatorAuditController { switch ($this->filter) { case 'active': - $header = 'Problem Commits'; - $nodata = 'None of your commits have open concerns.'; + $header = pht('Problem Commits'); + $nodata = pht('None of your commits have open concerns.'); break; case 'author': - $header = "Commits by {$handle_name}"; - $nodata = "No matching commits by {$handle_name}."; + $header = pht("Commits by %s", $handle_name); + $nodata = pht("No matching commits by %s.", $handle_name); break; case 'commits': - $header = "Commits"; - $nodata = "No matching commits."; + $header = pht("Commits"); + $nodata = pht("No matching commits."); break; case 'packagecommits': - $header = "Commits in Package '{$handle_name}'"; - $nodata = "No matching commits in package '{$handle_name}'."; + $header = pht("Commits in Package %s", $handle_name); + $nodata = pht("No matching commits in package %s.", $handle_name); break; } diff --git a/src/applications/macro/application/PhabricatorApplicationMacro.php b/src/applications/macro/application/PhabricatorApplicationMacro.php index fea4d3a75d..1dc24aae8a 100644 --- a/src/applications/macro/application/PhabricatorApplicationMacro.php +++ b/src/applications/macro/application/PhabricatorApplicationMacro.php @@ -7,7 +7,7 @@ final class PhabricatorApplicationMacro extends PhabricatorApplication { } public function getShortDescription() { - return 'Image Macros and Memes'; + return pht('Image Macros and Memes'); } public function getIconName() { diff --git a/src/applications/macro/controller/PhabricatorMacroController.php b/src/applications/macro/controller/PhabricatorMacroController.php index 8ae3e7f1bc..7df1e98b4d 100644 --- a/src/applications/macro/controller/PhabricatorMacroController.php +++ b/src/applications/macro/controller/PhabricatorMacroController.php @@ -8,14 +8,18 @@ abstract class PhabricatorMacroController $nav->setBaseURI(new PhutilURI($this->getApplicationURI())); if ($for_app) { - $nav->addLabel('Create'); - $nav->addFilter('', 'Create Macro', $this->getApplicationURI('/create/')); + $nav->addLabel(pht('Create')); + $nav->addFilter('', + pht('Create Macro'), + $this->getApplicationURI('/create/')); } - $nav->addLabel('Macros'); - $nav->addFilter('/', 'All Macros'); + $nav->addLabel(pht('Macros')); + $nav->addFilter('/', pht('All Macros')); if ($has_search) { - $nav->addFilter('search', 'Search', $this->getRequest()->getRequestURI()); + $nav->addFilter('search', + pht('Search'), + $this->getRequest()->getRequestURI()); } diff --git a/src/applications/macro/controller/PhabricatorMacroDisableController.php b/src/applications/macro/controller/PhabricatorMacroDisableController.php index 8be2409068..3e9e44aa9e 100644 --- a/src/applications/macro/controller/PhabricatorMacroDisableController.php +++ b/src/applications/macro/controller/PhabricatorMacroDisableController.php @@ -42,13 +42,13 @@ final class PhabricatorMacroDisableController $dialog = new AphrontDialogView(); $dialog ->setUser($request->getUser()) - ->setTitle('Really disable macro?') + ->setTitle(pht('Really disable macro?')) ->appendChild( - '

Really disable the much-beloved image macro "'. - phutil_escape_html($macro->getName()).'"? It will be sorely missed.'. + '

'.pht('Really disable the much-beloved image macro %s? '. + 'It will be sorely missed.', phutil_escape_html($macro->getName())). '

') ->setSubmitURI($this->getApplicationURI('/disable/'.$this->id.'/')) - ->addSubmitButton('Disable') + ->addSubmitButton(pht('Disable')) ->addCancelButton($view_uri); return id(new AphrontDialogResponse())->setDialog($dialog); diff --git a/src/applications/macro/controller/PhabricatorMacroEditController.php b/src/applications/macro/controller/PhabricatorMacroEditController.php index 129dd26b7e..1d4e1e0d57 100644 --- a/src/applications/macro/controller/PhabricatorMacroEditController.php +++ b/src/applications/macro/controller/PhabricatorMacroEditController.php @@ -37,13 +37,13 @@ final class PhabricatorMacroEditController $macro->setName($new_name); if (!strlen($macro->getName())) { - $errors[] = 'Macro name is required.'; - $e_name = 'Required'; + $errors[] = pht('Macro name is required.'); + $e_name = pht('Required'); } else if (!preg_match('/^[a-z0-9_-]{3,}$/', $macro->getName())) { - $errors[] = 'Macro must be at least three characters long and '. + $errors[] = pht('Macro must be at least three characters long and '. 'contain only lowercase letters, digits, hyphen and '. - 'underscore.'; - $e_name = 'Invalid'; + 'underscore.'); + $e_name = pht('Invalid'); } else { $e_name = null; } @@ -74,7 +74,7 @@ final class PhabricatorMacroEditController } if (!$macro->getID() && !$file) { - $errors[] = 'You must upload an image to create a macro.'; + $errors[] = pht('You must upload an image to create a macro.'); $e_file = pht('Required'); } @@ -110,15 +110,15 @@ final class PhabricatorMacroEditController return id(new AphrontRedirectResponse())->setURI($view_uri); } catch (AphrontQueryDuplicateKeyException $ex) { throw $ex; - $errors[] = 'Macro name is not unique!'; - $e_name = 'Duplicate'; + $errors[] = pht('Macro name is not unique!'); + $e_name = pht('Duplicate'); } } } if ($errors) { $error_view = new AphrontErrorView(); - $error_view->setTitle('Form Errors'); + $error_view->setTitle(pht('Form Errors')); $error_view->setErrors($errors); } else { $error_view = null; @@ -141,10 +141,11 @@ final class PhabricatorMacroEditController ->setEncType('multipart/form-data') ->appendChild( id(new AphrontFormTextControl()) - ->setLabel('Name') + ->setLabel(pht('Name')) ->setName('name') ->setValue($macro->getName()) - ->setCaption('This word or phrase will be replaced with the image.') + ->setCaption( + pht('This word or phrase will be replaced with the image.')) ->setError($e_name)); if (!$macro->getID()) { @@ -158,7 +159,7 @@ final class PhabricatorMacroEditController $form->addHiddenInput('phid', $current_file->getPHID()); $form->appendChild( id(new AphrontFormMarkupControl()) - ->setLabel('Selected File') + ->setLabel(pht('Selected File')) ->setValue($current_file_view)); $other_label = pht('Change File'); @@ -223,11 +224,11 @@ final class PhabricatorMacroEditController ->setUser($request->getUser()) ->appendChild( id(new AphrontFormFileControl()) - ->setLabel('File') + ->setLabel(pht('File')) ->setName('file')) ->appendChild( id(new AphrontFormSubmitControl()) - ->setValue('Upload File')); + ->setValue(pht('Upload File'))); $upload = array($upload_header, $upload_form); } diff --git a/src/applications/macro/controller/PhabricatorMacroListController.php b/src/applications/macro/controller/PhabricatorMacroListController.php index d52f52327f..3756d346a0 100644 --- a/src/applications/macro/controller/PhabricatorMacroListController.php +++ b/src/applications/macro/controller/PhabricatorMacroListController.php @@ -90,7 +90,7 @@ final class PhabricatorMacroListController ->appendChild( id(new AphrontFormTextControl()) ->setName('name') - ->setLabel('Name') + ->setLabel(pht('Name')) ->setValue($filter)) ->appendChild( id(new AphrontFormTokenizerControl()) @@ -100,7 +100,7 @@ final class PhabricatorMacroListController ->setValue(mpull($author_handles, 'getFullName'))) ->appendChild( id(new AphrontFormSubmitControl()) - ->setValue('Filter Image Macros')); + ->setValue(pht('Filter Image Macros'))); $filter_view = new AphrontListFilterView(); $filter_view->appendChild($filter_form); @@ -132,7 +132,7 @@ final class PhabricatorMacroListController phutil_render_tag( 'div', array(), - 'Created on '.$datetime)); + pht('Created on %s', $datetime))); } $item->setURI($this->getApplicationURI('/view/'.$macro->getID().'/')); $item->setHeader($macro->getName()); @@ -159,7 +159,7 @@ final class PhabricatorMacroListController $nav, array( 'device' => true, - 'title' => 'Image Macros', + 'title' => pht('Image Macros'), )); } } diff --git a/src/applications/macro/controller/PhabricatorMacroViewController.php b/src/applications/macro/controller/PhabricatorMacroViewController.php index 970d6e48da..3a0ad35e42 100644 --- a/src/applications/macro/controller/PhabricatorMacroViewController.php +++ b/src/applications/macro/controller/PhabricatorMacroViewController.php @@ -112,21 +112,21 @@ final class PhabricatorMacroViewController $view->setObject($macro); $view->addAction( id(new PhabricatorActionView()) - ->setName('Edit Macro') + ->setName(pht('Edit Macro')) ->setHref($this->getApplicationURI('/edit/'.$macro->getID().'/')) ->setIcon('edit')); if ($macro->getIsDisabled()) { $view->addAction( id(new PhabricatorActionView()) - ->setName('Restore Macro') + ->setName(pht('Restore Macro')) ->setHref($this->getApplicationURI('/disable/'.$macro->getID().'/')) ->setWorkflow(true) ->setIcon('undo')); } else { $view->addAction( id(new PhabricatorActionView()) - ->setName('Disable Macro') + ->setName(pht('Disable Macro')) ->setHref($this->getApplicationURI('/disable/'.$macro->getID().'/')) ->setWorkflow(true) ->setIcon('delete')); From cd6a4e764a772fb0ac30a9c8bce02b105f7eae54 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 24 Jan 2013 09:57:58 -0800 Subject: [PATCH 05/10] Rough implementation of the "Add Meme" button Summary: This needs some tweaks but I'll follow up with @DeedyDas in T2353. Test Plan: So many memes. Reviewers: chad, btrahan, DeedyDas Reviewed By: chad CC: aran Maniphest Tasks: T2353 Differential Revision: https://secure.phabricator.com/D4616 --- src/__phutil_library_map__.php | 2 + .../markup/PhabricatorMarkupEngine.php | 1 + .../rule/PhabricatorRemarkupRuleMeme.php | 42 +++++++++++++++++++ .../control/PhabricatorRemarkupControl.php | 6 +++ .../behavior-phabricator-remarkup-assist.js | 11 +++++ 5 files changed, 62 insertions(+) create mode 100644 src/infrastructure/markup/rule/PhabricatorRemarkupRuleMeme.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index b67f2b85ba..f12b305c9d 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1122,6 +1122,7 @@ phutil_register_library_map(array( 'PhabricatorRemarkupRuleImageMacro' => 'infrastructure/markup/rule/PhabricatorRemarkupRuleImageMacro.php', 'PhabricatorRemarkupRuleManiphest' => 'infrastructure/markup/rule/PhabricatorRemarkupRuleManiphest.php', 'PhabricatorRemarkupRuleManiphestHandle' => 'infrastructure/markup/rule/handle/PhabricatorRemarkupRuleManiphestHandle.php', + 'PhabricatorRemarkupRuleMeme' => 'infrastructure/markup/rule/PhabricatorRemarkupRuleMeme.php', 'PhabricatorRemarkupRuleMention' => 'infrastructure/markup/rule/PhabricatorRemarkupRuleMention.php', 'PhabricatorRemarkupRuleObjectHandle' => 'infrastructure/markup/rule/PhabricatorRemarkupRuleObjectHandle.php', 'PhabricatorRemarkupRuleObjectName' => 'infrastructure/markup/rule/PhabricatorRemarkupRuleObjectName.php', @@ -2499,6 +2500,7 @@ phutil_register_library_map(array( 'PhabricatorRemarkupRuleImageMacro' => 'PhutilRemarkupRule', 'PhabricatorRemarkupRuleManiphest' => 'PhabricatorRemarkupRuleObjectName', 'PhabricatorRemarkupRuleManiphestHandle' => 'PhabricatorRemarkupRuleObjectHandle', + 'PhabricatorRemarkupRuleMeme' => 'PhutilRemarkupRule', 'PhabricatorRemarkupRuleMention' => 'PhutilRemarkupRule', 'PhabricatorRemarkupRuleObjectHandle' => 'PhutilRemarkupRule', 'PhabricatorRemarkupRuleObjectName' => 'PhutilRemarkupRule', diff --git a/src/infrastructure/markup/PhabricatorMarkupEngine.php b/src/infrastructure/markup/PhabricatorMarkupEngine.php index a064f7edd6..94c55f5738 100644 --- a/src/infrastructure/markup/PhabricatorMarkupEngine.php +++ b/src/infrastructure/markup/PhabricatorMarkupEngine.php @@ -419,6 +419,7 @@ final class PhabricatorMarkupEngine { if ($options['macros']) { $rules[] = new PhabricatorRemarkupRuleImageMacro(); + $rules[] = new PhabricatorRemarkupRuleMeme(); } $rules[] = new PhabricatorRemarkupRuleMention(); diff --git a/src/infrastructure/markup/rule/PhabricatorRemarkupRuleMeme.php b/src/infrastructure/markup/rule/PhabricatorRemarkupRuleMeme.php new file mode 100644 index 0000000000..5b5135bc11 --- /dev/null +++ b/src/infrastructure/markup/rule/PhabricatorRemarkupRuleMeme.php @@ -0,0 +1,42 @@ + null, + 'above' => null, + 'below' => null, + ); + + $parser = new PhutilSimpleOptions(); + $options = $parser->parse($matches[1]) + $options; + + $uri = id(new PhutilURI('/macro/meme/')) + ->alter('macro', $options['src']) + ->alter('uppertext', $options['above']) + ->alter('lowertext', $options['below']); + + $img = phutil_render_tag( + 'img', + array( + 'src' => (string)$uri, + )); + + return $this->getEngine()->storeText($img); + } + +} diff --git a/src/view/form/control/PhabricatorRemarkupControl.php b/src/view/form/control/PhabricatorRemarkupControl.php index ac238426ec..5198c0cf8d 100644 --- a/src/view/form/control/PhabricatorRemarkupControl.php +++ b/src/view/form/control/PhabricatorRemarkupControl.php @@ -49,6 +49,12 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl { 'table' => array( 'tip' => pht('Table'), ), + array( + 'spacer' => true, + ), + 'meme' => array( + 'tip' => pht('Meme'), + ), 'help' => array( 'tip' => pht('Help'), 'align' => 'right', diff --git a/webroot/rsrc/js/application/core/behavior-phabricator-remarkup-assist.js b/webroot/rsrc/js/application/core/behavior-phabricator-remarkup-assist.js index 11db6f95ba..f6c2f38cd2 100644 --- a/webroot/rsrc/js/application/core/behavior-phabricator-remarkup-assist.js +++ b/webroot/rsrc/js/application/core/behavior-phabricator-remarkup-assist.js @@ -59,6 +59,17 @@ JX.behavior('phabricator-remarkup-assist', function(config) { case 'table': update(area, (r.start == 0 ? '' : '\n\n') + '| ', sel || 'data', ' |'); break; + case 'meme': + new JX.Workflow('/macro/meme/create/') + .setHandler(function(response) { + update( + area, + '', + sel, + (r.start == 0 ? '' : '\n\n') + response.text + '\n\n'); + }) + .start(); + break; } } From c9870b12aeeec0e5b368c2ae2057a9c34542b63c Mon Sep 17 00:00:00 2001 From: vrana Date: Wed, 23 Jan 2013 18:00:22 -0800 Subject: [PATCH 06/10] Don't add trailing slash to Search Owners link Test Plan: Clicked it. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4609 --- src/__celerity_resource_map__.php | 91 ++++++++++--------- .../controller/DiffusionController.php | 5 +- 2 files changed, 52 insertions(+), 44 deletions(-) diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index e78a5c755e..a2caa975b2 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -539,6 +539,13 @@ celerity_register_resource_map(array( 'disk' => '/rsrc/image/texture/table_header_hover.png', 'type' => 'png', ), + '/rsrc/image/texture/table_header_tall.png' => + array( + 'hash' => 'b05525601f78d759f1c5e47fd9c1a8aa', + 'uri' => '/res/b0552560/rsrc/image/texture/table_header_tall.png', + 'disk' => '/rsrc/image/texture/table_header_tall.png', + 'type' => 'png', + ), '/rsrc/swf/aphlict.swf' => array( 'hash' => '4b9a9d83bebaf254f3790e87b45c1f92', @@ -593,7 +600,7 @@ celerity_register_resource_map(array( ), 'aphront-dialog-view-css' => array( - 'uri' => '/res/0ec64c77/rsrc/css/aphront/dialog-view.css', + 'uri' => '/res/215b3ab1/rsrc/css/aphront/dialog-view.css', 'type' => 'css', 'requires' => array( @@ -602,7 +609,7 @@ celerity_register_resource_map(array( ), 'aphront-error-view-css' => array( - 'uri' => '/res/410dbe72/rsrc/css/aphront/error-view.css', + 'uri' => '/res/048ed376/rsrc/css/aphront/error-view.css', 'type' => 'css', 'requires' => array( @@ -3247,7 +3254,7 @@ celerity_register_resource_map(array( ), array( 'packages' => array( - '2b575971' => + '4dff6da8' => array( 'name' => 'core.pkg.css', 'symbols' => @@ -3291,7 +3298,7 @@ celerity_register_resource_map(array( 36 => 'phabricator-object-item-list-view-css', 37 => 'global-drag-and-drop-css', ), - 'uri' => '/res/pkg/2b575971/core.pkg.css', + 'uri' => '/res/pkg/4dff6da8/core.pkg.css', 'type' => 'css', ), 'c90b892e' => @@ -3481,19 +3488,19 @@ celerity_register_resource_map(array( 'reverse' => array( 'aphront-attached-file-view-css' => '83f07678', - 'aphront-crumbs-view-css' => '2b575971', - 'aphront-dialog-view-css' => '2b575971', - 'aphront-error-view-css' => '2b575971', - 'aphront-form-view-css' => '2b575971', + 'aphront-crumbs-view-css' => '4dff6da8', + 'aphront-dialog-view-css' => '4dff6da8', + 'aphront-error-view-css' => '4dff6da8', + 'aphront-form-view-css' => '4dff6da8', 'aphront-headsup-action-list-view-css' => 'ec01d039', - 'aphront-headsup-view-css' => '2b575971', - 'aphront-list-filter-view-css' => '2b575971', - 'aphront-pager-view-css' => '2b575971', - 'aphront-panel-view-css' => '2b575971', - 'aphront-table-view-css' => '2b575971', - 'aphront-tokenizer-control-css' => '2b575971', - 'aphront-tooltip-css' => '2b575971', - 'aphront-typeahead-control-css' => '2b575971', + 'aphront-headsup-view-css' => '4dff6da8', + 'aphront-list-filter-view-css' => '4dff6da8', + 'aphront-pager-view-css' => '4dff6da8', + 'aphront-panel-view-css' => '4dff6da8', + 'aphront-table-view-css' => '4dff6da8', + 'aphront-tokenizer-control-css' => '4dff6da8', + 'aphront-tooltip-css' => '4dff6da8', + 'aphront-typeahead-control-css' => '4dff6da8', 'differential-changeset-view-css' => 'ec01d039', 'differential-core-view-css' => 'ec01d039', 'differential-inline-comment-editor' => 'ac53d36a', @@ -3507,7 +3514,7 @@ celerity_register_resource_map(array( 'differential-table-of-contents-css' => 'ec01d039', 'diffusion-commit-view-css' => 'c8ce2d88', 'diffusion-icons-css' => 'c8ce2d88', - 'global-drag-and-drop-css' => '2b575971', + 'global-drag-and-drop-css' => '4dff6da8', 'inline-comment-summary-css' => 'ec01d039', 'javelin-aphlict' => 'c90b892e', 'javelin-behavior' => 'fbeded59', @@ -3577,48 +3584,48 @@ celerity_register_resource_map(array( 'javelin-util' => 'fbeded59', 'javelin-vector' => 'fbeded59', 'javelin-workflow' => 'fbeded59', - 'lightbox-attachment-css' => '2b575971', + 'lightbox-attachment-css' => '4dff6da8', 'maniphest-task-summary-css' => '83f07678', 'maniphest-transaction-detail-css' => '83f07678', 'phabricator-busy' => 'c90b892e', 'phabricator-content-source-view-css' => 'ec01d039', - 'phabricator-core-buttons-css' => '2b575971', - 'phabricator-core-css' => '2b575971', - 'phabricator-crumbs-view-css' => '2b575971', - 'phabricator-directory-css' => '2b575971', + 'phabricator-core-buttons-css' => '4dff6da8', + 'phabricator-core-css' => '4dff6da8', + 'phabricator-crumbs-view-css' => '4dff6da8', + 'phabricator-directory-css' => '4dff6da8', 'phabricator-drag-and-drop-file-upload' => 'ac53d36a', 'phabricator-dropdown-menu' => 'c90b892e', 'phabricator-file-upload' => 'c90b892e', - 'phabricator-filetree-view-css' => '2b575971', - 'phabricator-flag-css' => '2b575971', - 'phabricator-form-view-css' => '2b575971', - 'phabricator-header-view-css' => '2b575971', - 'phabricator-jump-nav' => '2b575971', + 'phabricator-filetree-view-css' => '4dff6da8', + 'phabricator-flag-css' => '4dff6da8', + 'phabricator-form-view-css' => '4dff6da8', + 'phabricator-header-view-css' => '4dff6da8', + 'phabricator-jump-nav' => '4dff6da8', 'phabricator-keyboard-shortcut' => 'c90b892e', 'phabricator-keyboard-shortcut-manager' => 'c90b892e', - 'phabricator-main-menu-view' => '2b575971', + 'phabricator-main-menu-view' => '4dff6da8', 'phabricator-menu-item' => 'c90b892e', - 'phabricator-nav-view-css' => '2b575971', + 'phabricator-nav-view-css' => '4dff6da8', 'phabricator-notification' => 'c90b892e', - 'phabricator-notification-css' => '2b575971', - 'phabricator-notification-menu-css' => '2b575971', - 'phabricator-object-item-list-view-css' => '2b575971', + 'phabricator-notification-css' => '4dff6da8', + 'phabricator-notification-menu-css' => '4dff6da8', + 'phabricator-object-item-list-view-css' => '4dff6da8', 'phabricator-object-selector-css' => 'ec01d039', 'phabricator-paste-file-upload' => 'c90b892e', 'phabricator-prefab' => 'c90b892e', 'phabricator-project-tag-css' => '83f07678', - 'phabricator-remarkup-css' => '2b575971', + 'phabricator-remarkup-css' => '4dff6da8', 'phabricator-shaped-request' => 'ac53d36a', - 'phabricator-side-menu-view-css' => '2b575971', - 'phabricator-standard-page-view' => '2b575971', + 'phabricator-side-menu-view-css' => '4dff6da8', + 'phabricator-standard-page-view' => '4dff6da8', 'phabricator-textareautils' => 'c90b892e', 'phabricator-tooltip' => 'c90b892e', - 'phabricator-transaction-view-css' => '2b575971', - 'phabricator-zindex-css' => '2b575971', - 'sprite-apps-large-css' => '2b575971', - 'sprite-gradient-css' => '2b575971', - 'sprite-icon-css' => '2b575971', - 'sprite-menu-css' => '2b575971', - 'syntax-highlighting-css' => '2b575971', + 'phabricator-transaction-view-css' => '4dff6da8', + 'phabricator-zindex-css' => '4dff6da8', + 'sprite-apps-large-css' => '4dff6da8', + 'sprite-gradient-css' => '4dff6da8', + 'sprite-icon-css' => '4dff6da8', + 'sprite-menu-css' => '4dff6da8', + 'syntax-highlighting-css' => '4dff6da8', ), )); diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php index 7343426a15..4178c6bd2a 100644 --- a/src/applications/diffusion/controller/DiffusionController.php +++ b/src/applications/diffusion/controller/DiffusionController.php @@ -79,10 +79,11 @@ abstract class DiffusionController extends PhabricatorController { // TODO: URI encoding might need to be sorted out for this link. $nav->addFilter( + '', + "Search Owners \xE2\x86\x97", '/owners/view/search/'. '?repository='.phutil_escape_uri($drequest->getCallsign()). - '&path='.phutil_escape_uri('/'.$drequest->getPath()), - "Search Owners \xE2\x86\x97"); + '&path='.phutil_escape_uri('/'.$drequest->getPath())); return $nav; } From 451ea2f958df81d80534a6d597996be8e14856ca Mon Sep 17 00:00:00 2001 From: vrana Date: Wed, 23 Jan 2013 16:59:14 -0800 Subject: [PATCH 07/10] Explain why we store table names in lower-case Test Plan: Read it. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4607 --- src/docs/developer/database.diviner | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/docs/developer/database.diviner b/src/docs/developer/database.diviner index d9751d41bf..027bca2db5 100644 --- a/src/docs/developer/database.diviner +++ b/src/docs/developer/database.diviner @@ -45,7 +45,9 @@ DarkConsole (see @{article:Using DarkConsole}) and other places. The exception is tables which share the same schema over different databases such as `edge`. -We use lower-case table names with words separated by underscores. +We use lower-case table names with words separated by underscores. The reason is +that MySQL can be configured (with `lower_case_table_names`) to lower-case the +table names anyway. = Column Names = @@ -152,7 +154,7 @@ add your patch to @{method@phabricator:PhabricatorBuiltinPatchList::getPatches}. # Run `bin/storage/upgrade`. It is also possible to create more complex patches in PHP for data migration -(due to schema changes or otherwise.) However, the schema changes themselves +(due to schema changes or otherwise.) However, the schema changes themselves should be done in separate `.sql` files. Order can be guaranteed by editing `src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php` appropriately. From 68affb72ec498b712596f359e23c1cf97647d921 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Thu, 24 Jan 2013 10:46:47 -0800 Subject: [PATCH 08/10] PHT's for Differential. Summary: Went through this last night, I had to remove some static vars, but didn't see that as a huge perf issue. Lint Test Plan: Tested numerous differential pages, creating a diff, commenting, editing. Reviewers: epriestley, btrahan Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4617 --- .../PhabricatorApplicationDifferential.php | 2 +- .../constants/DifferentialAction.php | 30 ++++----- .../constants/DifferentialChangeType.php | 22 +++---- .../DifferentialChangesetViewController.php | 2 +- .../DifferentialCommentSaveController.php | 8 +-- .../controller/DifferentialController.php | 4 +- .../DifferentialDiffCreateController.php | 16 ++--- .../DifferentialDiffViewController.php | 21 +++--- .../DifferentialRevisionEditController.php | 17 ++--- .../DifferentialRevisionListController.php | 65 +++++++++---------- .../DifferentialRevisionStatsController.php | 8 +-- .../DifferentialRevisionViewController.php | 24 +++---- .../DifferentialSubscribeController.php | 14 ++-- 13 files changed, 118 insertions(+), 115 deletions(-) diff --git a/src/applications/differential/application/PhabricatorApplicationDifferential.php b/src/applications/differential/application/PhabricatorApplicationDifferential.php index 197dbdf77f..c1b032e271 100644 --- a/src/applications/differential/application/PhabricatorApplicationDifferential.php +++ b/src/applications/differential/application/PhabricatorApplicationDifferential.php @@ -7,7 +7,7 @@ final class PhabricatorApplicationDifferential extends PhabricatorApplication { } public function getShortDescription() { - return 'Review Code'; + return pht('Review Code'); } public function getIconName() { diff --git a/src/applications/differential/constants/DifferentialAction.php b/src/applications/differential/constants/DifferentialAction.php index 3c9d67cf2c..89ad3a2a04 100644 --- a/src/applications/differential/constants/DifferentialAction.php +++ b/src/applications/differential/constants/DifferentialAction.php @@ -27,7 +27,7 @@ final class DifferentialAction { self::ACTION_REJECT => 'requested changes to', self::ACTION_RETHINK => 'planned changes to', self::ACTION_ABANDON => 'abandoned', - self::ACTION_CLOSE => pht('closed'), + self::ACTION_CLOSE => 'closed', self::ACTION_REQUEST => 'requested a review of', self::ACTION_RECLAIM => 'reclaimed', self::ACTION_UPDATE => 'updated', @@ -49,20 +49,20 @@ final class DifferentialAction { } public static function getActionVerb($action) { - static $verbs = array( - self::ACTION_COMMENT => 'Comment', - self::ACTION_ACCEPT => "Accept Revision \xE2\x9C\x94", - self::ACTION_REJECT => "Request Changes \xE2\x9C\x98", - self::ACTION_RETHINK => "Plan Changes \xE2\x9C\x98", - self::ACTION_ABANDON => 'Abandon Revision', - self::ACTION_REQUEST => 'Request Review', - self::ACTION_RECLAIM => 'Reclaim Revision', - self::ACTION_RESIGN => 'Resign as Reviewer', - self::ACTION_ADDREVIEWERS => 'Add Reviewers', - self::ACTION_ADDCCS => 'Add CCs', - self::ACTION_CLOSE => 'Close Revision', - self::ACTION_CLAIM => 'Commandeer Revision', - self::ACTION_REOPEN => 'Reopen', + $verbs = array( + self::ACTION_COMMENT => pht('Comment'), + self::ACTION_ACCEPT => pht("Accept Revision \xE2\x9C\x94"), + self::ACTION_REJECT => pht("Request Changes \xE2\x9C\x98"), + self::ACTION_RETHINK => pht("Plan Changes \xE2\x9C\x98"), + self::ACTION_ABANDON => pht('Abandon Revision'), + self::ACTION_REQUEST => pht('Request Review'), + self::ACTION_RECLAIM => pht('Reclaim Revision'), + self::ACTION_RESIGN => pht('Resign as Reviewer'), + self::ACTION_ADDREVIEWERS => pht('Add Reviewers'), + self::ACTION_ADDCCS => pht('Add CCs'), + self::ACTION_CLOSE => pht('Close Revision'), + self::ACTION_CLAIM => pht('Commandeer Revision'), + self::ACTION_REOPEN => pht('Reopen'), ); if (!empty($verbs[$action])) { diff --git a/src/applications/differential/constants/DifferentialChangeType.php b/src/applications/differential/constants/DifferentialChangeType.php index 078b9bd3a9..0a4f7861cc 100644 --- a/src/applications/differential/constants/DifferentialChangeType.php +++ b/src/applications/differential/constants/DifferentialChangeType.php @@ -93,17 +93,17 @@ final class DifferentialChangeType { } public static function getFullNameForChangeType($type) { - static $types = array( - self::TYPE_ADD => 'Added', - self::TYPE_CHANGE => 'Modified', - self::TYPE_DELETE => 'Deleted', - self::TYPE_MOVE_AWAY => 'Moved Away', - self::TYPE_COPY_AWAY => 'Copied Away', - self::TYPE_MOVE_HERE => 'Moved Here', - self::TYPE_COPY_HERE => 'Copied Here', - self::TYPE_MULTICOPY => 'Deleted After Multiple Copy', - self::TYPE_MESSAGE => 'Commit Message', - self::TYPE_CHILD => 'Contents Modified', + $types = array( + self::TYPE_ADD => pht('Added'), + self::TYPE_CHANGE => pht('Modified'), + self::TYPE_DELETE => pht('Deleted'), + self::TYPE_MOVE_AWAY => pht('Moved Away'), + self::TYPE_COPY_AWAY => pht('Copied Away'), + self::TYPE_MOVE_HERE => pht('Moved Here'), + self::TYPE_COPY_HERE => pht('Copied Here'), + self::TYPE_MULTICOPY => pht('Deleted After Multiple Copy'), + self::TYPE_MESSAGE => pht('Commit Message'), + self::TYPE_CHILD => pht('Contents Modified'), ); return idx($types, coalesce($type, '?'), 'Unknown'); } diff --git a/src/applications/differential/controller/DifferentialChangesetViewController.php b/src/applications/differential/controller/DifferentialChangesetViewController.php index 3a3e7883ca..dc09fd6db5 100644 --- a/src/applications/differential/controller/DifferentialChangesetViewController.php +++ b/src/applications/differential/controller/DifferentialChangesetViewController.php @@ -252,7 +252,7 @@ final class DifferentialChangesetViewController extends DifferentialController { $panel ), array( - 'title' => 'Changeset View', + 'title' => pht('Changeset View'), )); } diff --git a/src/applications/differential/controller/DifferentialCommentSaveController.php b/src/applications/differential/controller/DifferentialCommentSaveController.php index ff92e55b65..f03b26c01a 100644 --- a/src/applications/differential/controller/DifferentialCommentSaveController.php +++ b/src/applications/differential/controller/DifferentialCommentSaveController.php @@ -54,16 +54,16 @@ final class DifferentialCommentSaveController extends DifferentialController { $dialog->addHiddenInput('ccs', $ccs); $dialog->addHiddenInput('comment', $comment); - $dialog->setTitle('Action Has No Effect'); + $dialog->setTitle(pht('Action Has No Effect')); $dialog->appendChild( '

'.phutil_escape_html($no_effect->getMessage()).'

'); if (strlen($comment) || $has_inlines) { - $dialog->addSubmitButton('Post as Comment'); + $dialog->addSubmitButton(pht('Post as Comment')); $dialog->appendChild('
'); $dialog->appendChild( - '

Do you want to post your feedback anyway, as a normal '. - 'comment?

'); + '

'.pht('Do you want to post your feedback anyway, as a normal '. + 'comment?').'

'); } return id(new AphrontDialogResponse())->setDialog($dialog); diff --git a/src/applications/differential/controller/DifferentialController.php b/src/applications/differential/controller/DifferentialController.php index cdcbb10c34..9d79c82f14 100644 --- a/src/applications/differential/controller/DifferentialController.php +++ b/src/applications/differential/controller/DifferentialController.php @@ -13,7 +13,7 @@ abstract class DifferentialController extends PhabricatorController { $viewer_is_anonymous = !$this->getRequest()->getUser()->isLoggedIn(); $page = $this->buildStandardPageView(); - $page->setApplicationName('Differential'); + $page->setApplicationName(pht('Differential')); $page->setBaseURI('/differential/'); $page->setTitle(idx($data, 'title')); $page->setGlyph("\xE2\x9A\x99"); @@ -31,7 +31,7 @@ abstract class DifferentialController extends PhabricatorController { $crumbs->addAction( id(new PhabricatorMenuItemView()) ->setHref($this->getApplicationURI('/diff/create/')) - ->setName('Create Diff') + ->setName(pht('Create Diff')) ->setIcon('create')); return $crumbs; diff --git a/src/applications/differential/controller/DifferentialDiffCreateController.php b/src/applications/differential/controller/DifferentialDiffCreateController.php index 69e8faf8c8..76fc629dbd 100644 --- a/src/applications/differential/controller/DifferentialDiffCreateController.php +++ b/src/applications/differential/controller/DifferentialDiffCreateController.php @@ -42,33 +42,33 @@ final class DifferentialDiffCreateController extends DifferentialController { ->setEncType('multipart/form-data') ->setUser($request->getUser()) ->appendChild( - '

The best way to create a '. - "Differential diff is by using $arcanist_link, but you ". + '

'.pht('The best way to create '. + 'a Differential diff is by using %s, but you '. 'can also just paste a diff (e.g., from svn diff or '. 'git diff) into this box or upload it as a file if you '. - 'really want.

') + 'really want.', $arcanist_link).'

') ->appendChild( id(new AphrontFormTextAreaControl()) - ->setLabel('Raw Diff') + ->setLabel(pht('Raw Diff')) ->setName('diff') ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL)) ->appendChild( id(new AphrontFormFileControl()) - ->setLabel('Raw Diff from file') + ->setLabel(pht('Raw Diff from file')) ->setName('diff-file')) ->appendChild( id(new AphrontFormSubmitControl()) - ->setValue("Create Diff \xC2\xBB")); + ->setValue(pht("Create Diff \xC2\xBB"))); $panel = new AphrontPanelView(); - $panel->setHeader('Create New Diff'); + $panel->setHeader(pht('Create New Diff')); $panel->appendChild($form); $panel->setWidth(AphrontPanelView::WIDTH_FORM); return $this->buildStandardPageResponse( $panel, array( - 'title' => 'Create Diff', + 'title' => pht('Create Diff'), )); } diff --git a/src/applications/differential/controller/DifferentialDiffViewController.php b/src/applications/differential/controller/DifferentialDiffViewController.php index 7cc4a4bcb9..b212c20293 100644 --- a/src/applications/differential/controller/DifferentialDiffViewController.php +++ b/src/applications/differential/controller/DifferentialDiffViewController.php @@ -25,20 +25,23 @@ final class DifferentialDiffViewController extends DifferentialController { 'href' => PhabricatorEnv::getURI('/D'.$diff->getRevisionID()), ), phutil_escape_html('D'.$diff->getRevisionID())); - $top_panel->appendChild("

This diff belongs to revision {$link}

"); + $top_panel->appendChild( + "

".pht('This diff belongs to revision %s', $link)."

"); } else { $action_panel = new AphrontPanelView(); $action_panel->setHeader('Preview Diff'); $action_panel->setWidth(AphrontPanelView::WIDTH_WIDE); $action_panel->appendChild( - '

Review the diff for '. + '

'.pht('Review the diff for '. 'correctness. When you are satisfied, either create a new '. - 'revision or update an existing revision.'); + 'revision or update an existing revision.')); // TODO: implmenent optgroup support in AphrontFormSelectControl? $select = array(); $select[] = ''; - $select[] = ''; + $select[] = ''; $select[] = ''; $revision_data = new DifferentialRevisionListData( @@ -47,7 +50,7 @@ final class DifferentialDiffViewController extends DifferentialController { $revisions = $revision_data->loadRevisions(); if ($revisions) { - $select[] = ''; + $select[] = ''; foreach ($revisions as $revision) { $select[] = phutil_render_tag( 'option', @@ -72,11 +75,11 @@ final class DifferentialDiffViewController extends DifferentialController { ->addHiddenInput('viaDiffView', 1) ->appendChild( id(new AphrontFormMarkupControl()) - ->setLabel('Attach To') + ->setLabel(pht('Attach To')) ->setValue($select)) ->appendChild( id(new AphrontFormSubmitControl()) - ->setValue('Continue')); + ->setValue(pht('Continue'))); $action_panel->appendChild($action_form); @@ -133,7 +136,7 @@ final class DifferentialDiffViewController extends DifferentialController { ->setRenderingReferences($refs) ->setStandaloneURI('/differential/changeset/') ->setDiff($diff) - ->setTitle('Diff '.$diff->getID()) + ->setTitle(pht('Diff %d', $diff->getID())) ->setUser($request->getUser()); return $this->buildStandardPageResponse( @@ -146,7 +149,7 @@ final class DifferentialDiffViewController extends DifferentialController { $details->render(), )), array( - 'title' => 'Diff View', + 'title' => pht('Diff View'), )); } diff --git a/src/applications/differential/controller/DifferentialRevisionEditController.php b/src/applications/differential/controller/DifferentialRevisionEditController.php index e94ddb866a..3dcc0f4542 100644 --- a/src/applications/differential/controller/DifferentialRevisionEditController.php +++ b/src/applications/differential/controller/DifferentialRevisionEditController.php @@ -95,7 +95,7 @@ final class DifferentialRevisionEditController extends DifferentialController { $error_view = null; if ($errors) { $error_view = id(new AphrontErrorView()) - ->setTitle('Form Errors') + ->setTitle(pht('Form Errors')) ->setErrors($errors); } @@ -103,13 +103,13 @@ final class DifferentialRevisionEditController extends DifferentialController { $form ->appendChild( id(new AphrontFormTextAreaControl()) - ->setLabel('Comments') + ->setLabel(pht('Comments')) ->setName('comments') - ->setCaption("Explain what's new in this diff.") + ->setCaption(pht("Explain what's new in this diff.")) ->setValue($request->getStr('comments'))) ->appendChild( id(new AphrontFormSubmitControl()) - ->setValue('Save')) + ->setValue(pht('Save'))) ->appendChild( id(new AphrontFormDividerControl())); } @@ -134,21 +134,22 @@ final class DifferentialRevisionEditController extends DifferentialController { $panel = new AphrontPanelView(); if ($revision->getID()) { if ($diff) { - $panel->setHeader('Update Differential Revision'); + $panel->setHeader(pht('Update Differential Revision')); } else { - $panel->setHeader('Edit Differential Revision'); + $panel->setHeader(pht('Edit Differential Revision')); } } else { - $panel->setHeader('Create New Differential Revision'); + $panel->setHeader(pht('Create New Differential Revision')); } $panel->appendChild($form); $panel->setWidth(AphrontPanelView::WIDTH_FORM); + $panel->setNoBackground(); return $this->buildStandardPageResponse( array($error_view, $panel), array( - 'title' => 'Edit Differential Revision', + 'title' => pht('Edit Differential Revision'), )); } diff --git a/src/applications/differential/controller/DifferentialRevisionListController.php b/src/applications/differential/controller/DifferentialRevisionListController.php index 191bf8043c..8e7972c6df 100644 --- a/src/applications/differential/controller/DifferentialRevisionListController.php +++ b/src/applications/differential/controller/DifferentialRevisionListController.php @@ -101,9 +101,9 @@ final class DifferentialRevisionListController extends DifferentialController { // the viewing user's). Show a warning instead. $warning = new AphrontErrorView(); $warning->setSeverity(AphrontErrorView::SEVERITY_WARNING); - $warning->setTitle('User Required'); + $warning->setTitle(pht('User Required')); $warning->appendChild( - 'This filter requires that a user be specified above.'); + pht('This filter requires that a user be specified above.')); $panels[] = $warning; } else { $query = $this->buildQuery($this->filter, $params); @@ -173,7 +173,7 @@ final class DifferentialRevisionListController extends DifferentialController { ->addHiddenInput('order', $params['order']) ->appendChild( id(new AphrontFormSubmitControl()) - ->setValue('Filter Revisions')); + ->setValue(pht('Filter Revisions'))); $filter_view = new AphrontListFilterView(); $filter_view->appendChild($filter_form); @@ -198,20 +198,20 @@ final class DifferentialRevisionListController extends DifferentialController { return $this->buildApplicationPage( $side_nav, array( - 'title' => 'Differential Home', + 'title' => pht('Differential Home'), )); } private function getFilters() { return array( - array(null, 'User Revisions'), - array('active', 'Active'), - array('revisions', 'Revisions'), - array('reviews', 'Reviews'), - array('subscribed', 'Subscribed'), - array('drafts', 'Draft Reviews'), - array(null, 'All Revisions'), - array('all', 'All'), + array(null, pht('User Revisions')), + array('active', pht('Active')), + array('revisions', pht('Revisions')), + array('reviews', pht('Reviews')), + array('subscribed', pht('Subscribed')), + array('drafts', pht('Draft Reviews')), + array(null, pht('All Revisions')), + array('all', pht('All')), ); } @@ -328,18 +328,18 @@ final class DifferentialRevisionListController extends DifferentialController { if ($control == 'subscriber') { $source = '/typeahead/common/allmailable/'; - $label = 'View Subscribers'; + $label = pht('View Subscribers'); } else { $source = '/typeahead/common/accounts/'; switch ($this->filter) { case 'revisions': - $label = 'Authors'; + $label = pht('Authors'); break; case 'reviews': - $label = 'Reviewers'; + $label = pht('Reviewers'); break; default: - $label = 'View Users'; + $label = pht('View Users'); break; } } @@ -353,10 +353,10 @@ final class DifferentialRevisionListController extends DifferentialController { case 'participants': switch ($this->filter) { case 'revisions': - $label = 'Reviewers'; + $label = pht('Reviewers'); break; case 'reviews': - $label = 'Authors'; + $label = pht('Authors'); break; } $value = mpull( @@ -370,26 +370,26 @@ final class DifferentialRevisionListController extends DifferentialController { case 'status': return id(new AphrontFormToggleButtonsControl()) - ->setLabel('Status') + ->setLabel(pht('Status')) ->setValue($params['status']) ->setBaseURI($uri, 'status') ->setButtons( array( - 'all' => 'All', - 'open' => 'Open', + 'all' => pht('All'), + 'open' => pht('Open'), 'closed' => pht('Closed'), - 'abandoned' => 'Abandoned', + 'abandoned' => pht('Abandoned'), )); case 'order': return id(new AphrontFormToggleButtonsControl()) - ->setLabel('Order') + ->setLabel(pht('Order')) ->setValue($params['order']) ->setBaseURI($uri, 'order') ->setButtons( array( - 'modified' => 'Updated', - 'created' => 'Created', + 'modified' => pht('Updated'), + 'created' => pht('Created'), )); default: @@ -444,7 +444,7 @@ final class DifferentialRevisionListController extends DifferentialController { ->setRevisions($active) ->loadAssets(); $views[] = array( - 'title' => 'Action Required', + 'title' => pht('Action Required'), 'view' => $view, ); @@ -463,7 +463,7 @@ final class DifferentialRevisionListController extends DifferentialController { ->setUser($user); $views[] = array( - 'title' => 'Flagged Revisions', + 'title' => pht('Flagged Revisions'), 'view' => $view, 'special' => true, ); @@ -474,7 +474,7 @@ final class DifferentialRevisionListController extends DifferentialController { ->setRevisions($waiting) ->loadAssets(); $views[] = array( - 'title' => 'Waiting On Others', + 'title' => pht('Waiting On Others'), 'view' => $view, ); break; @@ -484,10 +484,10 @@ final class DifferentialRevisionListController extends DifferentialController { case 'drafts': case 'all': $titles = array( - 'revisions' => 'Revisions by Author', - 'reviews' => 'Revisions by Reviewer', - 'subscribed' => 'Revisions by Subscriber', - 'all' => 'Revisions', + 'revisions' => pht('Revisions by Author'), + 'reviews' => pht('Revisions by Reviewer'), + 'subscribed' => pht('Revisions by Subscriber'), + 'all' => pht('Revisions'), ); $view = id(clone $template) ->setRevisions($revisions) @@ -504,5 +504,4 @@ final class DifferentialRevisionListController extends DifferentialController { return $views; } - } diff --git a/src/applications/differential/controller/DifferentialRevisionStatsController.php b/src/applications/differential/controller/DifferentialRevisionStatsController.php index cb2a470a2c..37249d0168 100644 --- a/src/applications/differential/controller/DifferentialRevisionStatsController.php +++ b/src/applications/differential/controller/DifferentialRevisionStatsController.php @@ -118,7 +118,7 @@ final class DifferentialRevisionStatsController extends DifferentialController { $filter_form->appendChild( $this->renderControl($params['phid'], $handles)); $filter_form->appendChild(id(new AphrontFormSubmitControl()) - ->setValue('Filter Revisions')); + ->setValue(pht('Filter Revisions'))); $side_nav->appendChild($filter_form); @@ -127,7 +127,7 @@ final class DifferentialRevisionStatsController extends DifferentialController { $diffs = $this->loadDiffs($revisions); $panel = new AphrontPanelView(); - $panel->setHeader('Differential rate analysis'); + $panel->setHeader(pht('Differential rate analysis')); $panel->appendChild( id(new DifferentialRevisionStatsView()) ->setComments($comments) @@ -144,7 +144,7 @@ final class DifferentialRevisionStatsController extends DifferentialController { return $this->buildStandardPageResponse( $side_nav, array( - 'title' => 'Differential statistics', + 'title' => pht('Differential Statistics'), )); } @@ -157,7 +157,7 @@ final class DifferentialRevisionStatsController extends DifferentialController { } return id(new AphrontFormTokenizerControl()) ->setDatasource('/typeahead/common/users/') - ->setLabel('View User') + ->setLabel(pht('View User')) ->setName('view_user') ->setValue($value) ->setLimit(1); diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php index 2845d0f42b..9cbead02b4 100644 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -150,7 +150,7 @@ final class DifferentialRevisionViewController extends DifferentialController { if (!$has_live_reviewer) { $reviewer_warning = new AphrontErrorView(); $reviewer_warning->setSeverity(AphrontErrorView::SEVERITY_WARNING); - $reviewer_warning->setTitle('No Active Reviewers'); + $reviewer_warning->setTitle(pht('No Active Reviewers')); if ($revision->getReviewers()) { $reviewer_warning->appendChild( phutil_render_tag( @@ -181,8 +181,8 @@ final class DifferentialRevisionViewController extends DifferentialController { $warning->setTitle('Very Large Diff'); $warning->setSeverity(AphrontErrorView::SEVERITY_WARNING); $warning->appendChild( - "

This diff is very large and affects {$count} files. Load ". - "each file individually. ". + '

'.pht('This diff is very large and affects %d files. Load '. + 'each file individually. ', $count). "". phutil_render_tag( 'a', @@ -191,7 +191,7 @@ final class DifferentialRevisionViewController extends DifferentialController { ->alter('large', 'true') ->setFragment('toc'), ), - 'Show All Files Inline'). + pht('Show All Files Inline')). ""); $warning = $warning->render(); @@ -483,7 +483,7 @@ final class DifferentialRevisionViewController extends DifferentialController { $links[] = array( 'icon' => 'edit', 'href' => "/differential/revision/edit/{$revision_id}/", - 'name' => 'Edit Revision', + 'name' => pht('Edit Revision'), ); } @@ -494,14 +494,14 @@ final class DifferentialRevisionViewController extends DifferentialController { $links[] = array( 'icon' => $viewer_is_cc ? 'subscribe-delete' : 'subscribe-add', 'href' => "/differential/subscribe/{$action}/{$revision_id}/", - 'name' => $viewer_is_cc ? 'Unsubscribe' : 'Subscribe', + 'name' => $viewer_is_cc ? pht('Unsubscribe') : pht('Subscribe'), 'instant' => true, 'sigil' => 'workflow', ); } else { $links[] = array( 'icon' => 'subscribe-auto', - 'name' => 'Automatically Subscribed', + 'name' => pht('Automatically Subscribed'), 'disabled' => true, ); } @@ -511,7 +511,7 @@ final class DifferentialRevisionViewController extends DifferentialController { $links[] = array( 'icon' => 'link', - 'name' => 'Edit Dependencies', + 'name' => pht('Edit Dependencies'), 'href' => "/search/attach/{$revision_phid}/DREV/dependencies/", 'sigil' => 'workflow', ); @@ -519,7 +519,7 @@ final class DifferentialRevisionViewController extends DifferentialController { if (PhabricatorEnv::getEnvConfig('maniphest.enabled')) { $links[] = array( 'icon' => 'attach', - 'name' => 'Edit Maniphest Tasks', + 'name' => pht('Edit Maniphest Tasks'), 'href' => "/search/attach/{$revision_phid}/TASK/", 'sigil' => 'workflow', ); @@ -528,14 +528,14 @@ final class DifferentialRevisionViewController extends DifferentialController { if ($user->getIsAdmin()) { $links[] = array( 'icon' => 'file', - 'name' => 'MetaMTA Transcripts', + 'name' => pht('MetaMTA Transcripts'), 'href' => "/mail/?phid={$revision_phid}", ); } $links[] = array( 'icon' => 'file', - 'name' => 'Herald Transcripts', + 'name' => pht('Herald Transcripts'), 'href' => "/herald/transcript/?phid={$revision_phid}", ); } @@ -543,7 +543,7 @@ final class DifferentialRevisionViewController extends DifferentialController { $request_uri = $this->getRequest()->getRequestURI(); $links[] = array( 'icon' => 'download', - 'name' => 'Download Raw Diff', + 'name' => pht('Download Raw Diff'), 'href' => $request_uri->alter('download', 'true') ); diff --git a/src/applications/differential/controller/DifferentialSubscribeController.php b/src/applications/differential/controller/DifferentialSubscribeController.php index 32ce5cecef..bc3e0630af 100644 --- a/src/applications/differential/controller/DifferentialSubscribeController.php +++ b/src/applications/differential/controller/DifferentialSubscribeController.php @@ -25,16 +25,16 @@ final class DifferentialSubscribeController extends DifferentialController { switch ($this->action) { case 'add': - $button = 'Subscribe'; - $title = 'Subscribe to Revision'; - $prompt = 'Really subscribe to this revision?'; + $button = pht('Subscribe'); + $title = pht('Subscribe to Revision'); + $prompt = pht('Really subscribe to this revision?'); break; case 'rem': - $button = 'Unsubscribe'; - $title = 'Unsubscribe from Revision'; - $prompt = 'Really unsubscribe from this revision? Herald will '. + $button = pht('Unsubscribe'); + $title = pht('Unsubscribe from Revision'); + $prompt = pht('Really unsubscribe from this revision? Herald will '. 'not resubscribe you to a revision you unsubscribe '. - 'from.'; + 'from.'); break; default: return new Aphront400Response(); From e99048888927adc86c0239e691c369ad69a6b451 Mon Sep 17 00:00:00 2001 From: Ricky Elrod Date: Thu, 24 Jan 2013 12:05:29 -0800 Subject: [PATCH 09/10] Set some defaults back to correctness. Summary: There were a few defaults that got changed when porting to PHP. Most of them seem to be accidental, so this diff sets them back to correctness. Test Plan: php> require '../libphutil/src/__phutil_library_init__.php'; php> require 'src/__phutil_library_init__.php' php> $a = PhabricatorApplicationConfigOptions::loadAllOptions() php> $b = require 'conf/default.conf.php'; php> $x = array(); php> foreach($a as $key => $obj) { $x[$key] = $obj->getDefault(); } php> foreach($x as $key => $default) { if ($b[$key] != $default) { echo "$key has different default.\n"; } } log.access.format has different default. (seems to be intentional) PHP Notice: Undefined index: phabricator.env in /usr/lib/python2.7/site-packages/phpsh/phpsh.php(577) : eval()'d code on line 1 (no longer in config file) PHP Notice: Undefined index: test.value in /usr/lib/python2.7/site-packages/phpsh/phpsh.php(577) : eval()'d code on line 1 (not in config file) metamta.default-address has different default. (intentional) metamta.domain has different default. (intentional) PHP Notice: Undefined index: phid.external-loaders in /usr/lib/python2.7/site-packages/phpsh/phpsh.php(577) : eval()'d code on line 1 (no longer in config file) phame.skins has different default. (fixed in D4618) Reviewers: epriestley, btrahan Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2255 Differential Revision: https://secure.phabricator.com/D4621 --- .../option/PhabricatorGarbageCollectorConfigOptions.php | 2 +- .../config/option/PhabricatorNotificationConfigOptions.php | 4 ++-- .../config/PhabricatorDifferentialConfigOptions.php | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/applications/config/option/PhabricatorGarbageCollectorConfigOptions.php b/src/applications/config/option/PhabricatorGarbageCollectorConfigOptions.php index 75a6ae4dc5..2bacb46857 100644 --- a/src/applications/config/option/PhabricatorGarbageCollectorConfigOptions.php +++ b/src/applications/config/option/PhabricatorGarbageCollectorConfigOptions.php @@ -18,7 +18,7 @@ final class PhabricatorGarbageCollectorConfigOptions 30, pht('Number of seconds to retain Herald transcripts for.')), 'gcdaemon.ttl.daemon-logs' => array( - 14, + 7, pht('Number of seconds to retain Daemon logs for.')), 'gcdaemon.ttl.differential-parse-cache' => array( 14, diff --git a/src/applications/config/option/PhabricatorNotificationConfigOptions.php b/src/applications/config/option/PhabricatorNotificationConfigOptions.php index 80e974a4cc..bb8f2c70b5 100644 --- a/src/applications/config/option/PhabricatorNotificationConfigOptions.php +++ b/src/applications/config/option/PhabricatorNotificationConfigOptions.php @@ -29,12 +29,12 @@ final class PhabricatorNotificationConfigOptions $this->newOption( 'notification.client-uri', 'string', - 'http://localhost:22280') + 'http://localhost:22280/') ->setDescription(pht('Location of the client server.')), $this->newOption( 'notification.server-uri', 'string', - 'http://localhost:22281') + 'http://localhost:22281/') ->setDescription(pht('Location of the notification receiver server.')), $this->newOption('notification.user', 'string', null) ->setSummary(pht('Drop permissions to a less-privileged user.')) diff --git a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php index a483a20f75..9f077e1c85 100644 --- a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php +++ b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php @@ -41,7 +41,10 @@ final class PhabricatorDifferentialConfigOptions $this->newOption( 'differential.whitespace-matters', 'list', - array()) + array( + '/\.py$/', + '/\.l?hs$/', + )) ->setDescription( pht( "List of file regexps where whitespace is meaningful and should ". From 5660c901ef556b8538a9936fc155f903f307aa0e Mon Sep 17 00:00:00 2001 From: Afaque Hussain Date: Thu, 24 Jan 2013 12:13:31 -0800 Subject: [PATCH 10/10] Application Detail View Summary: Added Applications Details View Applications Detail View Test Plan: In "Applications" application, clicked on each application to check whether the each application detail view is displayed. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4615 --- src/__phutil_library_map__.php | 2 + .../PhabricatorApplicationApplications.php | 2 + ...ricatorApplicationDetailViewController.php | 77 +++++++++++++++++++ .../PhabricatorApplicationsListController.php | 10 +-- 4 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 src/applications/meta/controller/PhabricatorApplicationDetailViewController.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index f12b305c9d..6201530b3e 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -603,6 +603,7 @@ phutil_register_library_map(array( 'PhabricatorApplicationConfigOptions' => 'applications/config/option/PhabricatorApplicationConfigOptions.php', 'PhabricatorApplicationCountdown' => 'applications/countdown/application/PhabricatorApplicationCountdown.php', 'PhabricatorApplicationDaemons' => 'applications/daemon/application/PhabricatorApplicationDaemons.php', + 'PhabricatorApplicationDetailViewController' => 'applications/meta/controller/PhabricatorApplicationDetailViewController.php', 'PhabricatorApplicationDifferential' => 'applications/differential/application/PhabricatorApplicationDifferential.php', 'PhabricatorApplicationDiffusion' => 'applications/diffusion/application/PhabricatorApplicationDiffusion.php', 'PhabricatorApplicationDiviner' => 'applications/diviner/application/PhabricatorApplicationDiviner.php', @@ -1997,6 +1998,7 @@ phutil_register_library_map(array( 'PhabricatorApplicationConfigOptions' => 'Phobject', 'PhabricatorApplicationCountdown' => 'PhabricatorApplication', 'PhabricatorApplicationDaemons' => 'PhabricatorApplication', + 'PhabricatorApplicationDetailViewController' => 'PhabricatorApplicationsController', 'PhabricatorApplicationDifferential' => 'PhabricatorApplication', 'PhabricatorApplicationDiffusion' => 'PhabricatorApplication', 'PhabricatorApplicationDiviner' => 'PhabricatorApplication', diff --git a/src/applications/meta/application/PhabricatorApplicationApplications.php b/src/applications/meta/application/PhabricatorApplicationApplications.php index 488b385b88..6139945b6f 100644 --- a/src/applications/meta/application/PhabricatorApplicationApplications.php +++ b/src/applications/meta/application/PhabricatorApplicationApplications.php @@ -26,6 +26,8 @@ final class PhabricatorApplicationApplications extends PhabricatorApplication { return array( '/applications/' => array( '' => 'PhabricatorApplicationsListController', + 'view/(?P\w+)/' => + 'PhabricatorApplicationDetailViewController', ), diff --git a/src/applications/meta/controller/PhabricatorApplicationDetailViewController.php b/src/applications/meta/controller/PhabricatorApplicationDetailViewController.php new file mode 100644 index 0000000000..db9cd66199 --- /dev/null +++ b/src/applications/meta/controller/PhabricatorApplicationDetailViewController.php @@ -0,0 +1,77 @@ +application = $data['application']; + } + + public function processRequest() { + $request = $this->getRequest(); + $user = $request->getUser(); + + $selected = null; + $applications = PhabricatorApplication::getAllInstalledApplications(); + + foreach ($applications as $application) { + if (get_class($application) == $this->application) { + $selected = $application; + break; + } + } + + if (!$selected) { + return new Aphront404Response(); + } + + $title = $selected->getName(); + + $crumbs = $this->buildApplicationCrumbs(); + $crumbs->addCrumb( + id(new PhabricatorCrumbView()) + ->setName(pht('Applications')) + ->setHref($this->getApplicationURI())); + + $properties = $this->buildPropertyView($selected); + $actions = $this->buildActionView($user); + + return $this->buildApplicationPage( + array( + $crumbs, + id(new PhabricatorHeaderView())->setHeader($title), + $actions, + $properties, + ), + array( + 'title' => $title, + 'device' => true, + )); + } + + private function buildPropertyView(PhabricatorApplication $selected) { + $properties = new PhabricatorPropertyListView(); + + $properties->addProperty( + pht('Status'), pht('Installed')); + + $properties->addProperty( + pht('Description'), $selected->getShortDescription()); + + return $properties; + } + + private function buildActionView(PhabricatorUser $user) { + + return id(new PhabricatorActionListView()) + ->setUser($user) + ->addAction( + id(new PhabricatorActionView()) + ->setName(pht('Uninstall')) + ->setIcon('delete') + ); + } + +} diff --git a/src/applications/meta/controller/PhabricatorApplicationsListController.php b/src/applications/meta/controller/PhabricatorApplicationsListController.php index 36809159e6..3ef64b24bd 100644 --- a/src/applications/meta/controller/PhabricatorApplicationsListController.php +++ b/src/applications/meta/controller/PhabricatorApplicationsListController.php @@ -45,16 +45,16 @@ final class PhabricatorApplicationsListController private function buildInstalledApplicationsList(array $applications) { + $list = new PhabricatorObjectItemListView(); - $list = new PhabricatorObjectItemListView(); - foreach ($applications as $applications) { + foreach ($applications as $application) { $item = id(new PhabricatorObjectItemView()) - ->setHeader($applications->getName()) + ->setHeader($application->getName()) + ->setHref('/applications/view/'.get_class($application).'/') ->addAttribute( - phutil_escape_html($applications->getShortDescription())); + phutil_escape_html($application->getShortDescription())); $list->addItem($item); } - return $list; }