From 3093d1663de4f5b03f99e27848444d12946d21f1 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 25 Jan 2013 12:57:17 -0800 Subject: [PATCH] Add javelin_tag(), convert easy callsites Summary: - Implements `javelin_tag()`, which is `javelin_render_tag()` on top of `phutil_tag()` instead of `phutil_render_tag()`. - Manually converts all or almost all of the trivial callsites. Test Plan: - Site does not seem any more broken than before. Reviewers: vrana Reviewed By: vrana CC: aran Differential Revision: https://secure.phabricator.com/D4639 --- src/aphront/console/DarkConsoleCore.php | 4 +- .../view/AphrontCalendarMonthView.php | 6 +-- .../controller/ConpherenceViewController.php | 44 ++++++++++--------- .../PhabricatorCountdownListController.php | 2 +- .../PhabricatorCountdownViewController.php | 8 ++-- ...ifferentialReviewersFieldSpecification.php | 2 +- .../DifferentialChangesetHTMLRenderer.php | 2 +- .../DifferentialChangesetTwoUpRenderer.php | 10 ++--- ...rentialChangesetFileTreeSideNavBuilder.php | 4 +- .../view/DifferentialChangesetListView.php | 12 ++--- .../DifferentialDiffTableOfContentsView.php | 10 ++--- .../DifferentialInlineCommentEditView.php | 2 +- .../view/DifferentialInlineCommentView.php | 14 +++--- .../DifferentialRevisionCommentListView.php | 2 +- .../view/DifferentialRevisionListView.php | 2 +- .../DifferentialRevisionUpdateHistoryView.php | 2 +- .../DiffusionBrowseFileController.php | 10 ++--- .../DiffusionCommitEditController.php | 6 +-- .../view/DiffusionCommitChangeTableView.php | 4 +- .../view/DiffusionHistoryTableView.php | 2 +- .../diffusion/view/DiffusionView.php | 4 +- .../controller/HeraldRuleController.php | 10 ++--- .../herald/view/HeraldRuleListView.php | 2 +- .../ManiphestBatchEditController.php | 4 +- .../controller/ManiphestReportController.php | 10 ++--- .../ManiphestSavedQueryListController.php | 2 +- .../ManiphestTaskEditController.php | 2 +- .../ManiphestTaskListController.php | 6 +-- .../view/ManiphestTaskProjectsView.php | 4 +- .../view/ManiphestTaskSummaryView.php | 7 ++- .../view/ManiphestTransactionDetailView.php | 2 +- .../PhabricatorNotificationListController.php | 2 +- .../PhabricatorOwnersDetailController.php | 2 +- .../PhabricatorOwnersEditController.php | 4 +- .../view/PhortuneStripePaymentFormView.php | 6 +-- .../ponder/view/PonderVotableView.php | 8 ++-- ...habricatorProjectMembersEditController.php | 2 +- .../PhabricatorProjectProfileController.php | 2 +- .../PhabricatorRepositoryListController.php | 2 +- ...PhabricatorSettingsPanelEmailAddresses.php | 8 ++-- .../panel/PhabricatorSettingsPanelSSHKeys.php | 2 +- .../uiexample/examples/JavelinUIExample.php | 4 +- .../PhabricatorUINotificationExample.php | 2 +- .../examples/PhabricatorUITooltipExample.php | 4 +- .../PhabricatorXHProfProfileTopLevelView.php | 4 +- .../PhabricatorInlineCommentController.php | 4 +- src/infrastructure/javelin/markup.php | 16 ++++++- .../rule/PhabricatorRemarkupRuleCountdown.php | 8 ++-- .../rule/PhabricatorRemarkupRuleEmbedFile.php | 2 +- src/view/AphrontDialogView.php | 10 ++--- src/view/control/AphrontAttachedFileView.php | 2 +- .../control/AphrontTokenizerTemplateView.php | 2 +- .../control/AphrontTypeaheadTemplateView.php | 10 +++-- .../form/control/AphrontFormDateControl.php | 2 +- .../form/control/AphrontFormTextControl.php | 2 +- .../control/PhabricatorRemarkupControl.php | 2 +- src/view/layout/AphrontMoreView.php | 2 +- src/view/layout/PhabricatorActionView.php | 8 ++-- src/view/layout/PhabricatorAnchorView.php | 2 +- src/view/layout/PhabricatorCrumbsView.php | 7 ++- src/view/layout/PhabricatorFileLinkView.php | 5 +-- .../layout/PhabricatorTimelineEventView.php | 4 +- .../headsup/AphrontHeadsupActionView.php | 4 +- .../page/menu/PhabricatorMainMenuIconView.php | 6 +-- .../menu/PhabricatorMainMenuSearchView.php | 2 +- .../page/menu/PhabricatorMainMenuView.php | 6 +-- 66 files changed, 188 insertions(+), 171 deletions(-) diff --git a/src/aphront/console/DarkConsoleCore.php b/src/aphront/console/DarkConsoleCore.php index 3a886a7a80..2a60c24bd1 100644 --- a/src/aphront/console/DarkConsoleCore.php +++ b/src/aphront/console/DarkConsoleCore.php @@ -97,7 +97,7 @@ final class DarkConsoleCore { $tabclass = null; } - $tabs_markup[] = javelin_render_tag( + $tabs_markup[] = javelin_tag( 'a', array( 'class' => "dark-console-tab {$tabclass}", @@ -173,7 +173,7 @@ final class DarkConsoleCore { ), ''. ''. - javelin_render_tag( + phutil_tag( 'a', array( 'class' => 'dark-console-tab dark-console-tab-selected', diff --git a/src/applications/calendar/view/AphrontCalendarMonthView.php b/src/applications/calendar/view/AphrontCalendarMonthView.php index 5d175e7594..3367c01d88 100644 --- a/src/applications/calendar/view/AphrontCalendarMonthView.php +++ b/src/applications/calendar/view/AphrontCalendarMonthView.php @@ -291,7 +291,7 @@ final class AphrontCalendarMonthView extends AphrontView { $href = null; } - $text_div = javelin_render_tag( + $text_div = javelin_tag( $tag, array( 'sigil' => 'has-tooltip', @@ -302,9 +302,9 @@ final class AphrontCalendarMonthView extends AphrontView { 'class' => 'aphront-calendar-event-text', 'href' => $href, ), - phutil_escape_html(phutil_utf8_shorten($event->getName(), 32))); + phutil_utf8_shorten($event->getName(), 32)); - return javelin_render_tag( + return javelin_tag( 'div', array( 'class' => implode(' ', $classes), diff --git a/src/applications/conpherence/controller/ConpherenceViewController.php b/src/applications/conpherence/controller/ConpherenceViewController.php index 925843c45c..a36e1ab766 100644 --- a/src/applications/conpherence/controller/ConpherenceViewController.php +++ b/src/applications/conpherence/controller/ConpherenceViewController.php @@ -163,29 +163,33 @@ final class ConpherenceViewController extends array( 'class' => 'widgets-header' ), - javelin_render_tag( - 'a', - array( - 'sigil' => 'conpherence-change-widget', - 'meta' => array('widget' => 'widgets-files') + array( + javelin_tag( + 'a', + array( + 'sigil' => 'conpherence-change-widget', + 'meta' => array('widget' => 'widgets-files') + ), + pht('Files') ), - pht('Files') - ).' | '. - javelin_render_tag( - 'a', - array( - 'sigil' => 'conpherence-change-widget', - 'meta' => array('widget' => 'widgets-tasks') + ' | ', + javelin_tag( + 'a', + array( + 'sigil' => 'conpherence-change-widget', + 'meta' => array('widget' => 'widgets-tasks') + ), + pht('Tasks') ), - pht('Tasks') - ).' | '. - javelin_render_tag( - 'a', - array( - 'sigil' => 'conpherence-change-widget', - 'meta' => array('widget' => 'widgets-calendar') + ' | ', + javelin_tag( + 'a', + array( + 'sigil' => 'conpherence-change-widget', + 'meta' => array('widget' => 'widgets-calendar') + ), + pht('Calendar') ), - pht('Calendar') ) ). phutil_render_tag( diff --git a/src/applications/countdown/controller/PhabricatorCountdownListController.php b/src/applications/countdown/controller/PhabricatorCountdownListController.php index b015eb602f..93e4a916b7 100644 --- a/src/applications/countdown/controller/PhabricatorCountdownListController.php +++ b/src/applications/countdown/controller/PhabricatorCountdownListController.php @@ -36,7 +36,7 @@ final class PhabricatorCountdownListController ), 'Edit'); - $delete_button = javelin_render_tag( + $delete_button = javelin_tag( 'a', array( 'class' => 'small button grey', diff --git a/src/applications/countdown/controller/PhabricatorCountdownViewController.php b/src/applications/countdown/controller/PhabricatorCountdownViewController.php index 494f918308..6e084a3835 100644 --- a/src/applications/countdown/controller/PhabricatorCountdownViewController.php +++ b/src/applications/countdown/controller/PhabricatorCountdownViewController.php @@ -47,13 +47,13 @@ final class PhabricatorCountdownViewController Seconds '. - javelin_render_tag('td', + javelin_tag('td', array('sigil' => 'phabricator-timer-days'), ''). - javelin_render_tag('td', + javelin_tag('td', array('sigil' => 'phabricator-timer-hours'), ''). - javelin_render_tag('td', + javelin_tag('td', array('sigil' => 'phabricator-timer-minutes'), ''). - javelin_render_tag('td', + javelin_tag('td', array('sigil' => 'phabricator-timer-seconds'), ''). ' diff --git a/src/applications/differential/field/specification/DifferentialReviewersFieldSpecification.php b/src/applications/differential/field/specification/DifferentialReviewersFieldSpecification.php index 98ec21feb3..b519c3e955 100644 --- a/src/applications/differential/field/specification/DifferentialReviewersFieldSpecification.php +++ b/src/applications/differential/field/specification/DifferentialReviewersFieldSpecification.php @@ -146,7 +146,7 @@ final class DifferentialReviewersFieldSpecification $names[] = phutil_escape_html( $this->getHandle($reviewer)->getLinkName()); } - $suffix = ' '.javelin_render_tag( + $suffix = ' '.javelin_tag( 'abbr', array( 'sigil' => 'has-tooltip', diff --git a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php index 22bdc721e3..1a60831ac9 100644 --- a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php @@ -321,7 +321,7 @@ abstract class DifferentialChangesetHTMLRenderer $more = null; if ($force !== 'none') { - $more = ' '.javelin_render_tag( + $more = ' '.javelin_tag( 'a', array( 'mustcapture' => true, diff --git a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php index 20c2920e6e..cb22b44341 100644 --- a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php @@ -16,7 +16,7 @@ final class DifferentialChangesetTwoUpRenderer $context_not_available = null; if ($hunk_starts) { - $context_not_available = javelin_render_tag( + $context_not_available = javelin_tag( 'tr', array( 'sigil' => 'context-target', @@ -83,7 +83,7 @@ final class DifferentialChangesetTwoUpRenderer $is_first_block = true; } - $contents[] = javelin_render_tag( + $contents[] = javelin_tag( 'a', array( 'href' => '#', @@ -99,7 +99,7 @@ final class DifferentialChangesetTwoUpRenderer : pht("\xE2\x96\xB2 Show 20 Lines")); } - $contents[] = javelin_render_tag( + $contents[] = javelin_tag( 'a', array( 'href' => '#', @@ -119,7 +119,7 @@ final class DifferentialChangesetTwoUpRenderer } if ($len > 40) { - $contents[] = javelin_render_tag( + $contents[] = javelin_tag( 'a', array( 'href' => '#', @@ -235,7 +235,7 @@ final class DifferentialChangesetTwoUpRenderer dirname('/'.$orig_file); } $class = ($orig_type == '-' ? 'new-move' : 'new-copy'); - $n_copy = javelin_render_tag( + $n_copy = javelin_tag( 'td', array( 'meta' => array( diff --git a/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php b/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php index 1d5be8e265..6ee62cc218 100644 --- a/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php +++ b/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php @@ -104,7 +104,7 @@ final class DifferentialChangesetFileTreeSideNavBuilder { ), $name); - $filetree[] = javelin_render_tag( + $filetree[] = javelin_tag( $href ? 'a' : 'span', array( 'href' => $href, @@ -112,7 +112,7 @@ final class DifferentialChangesetFileTreeSideNavBuilder { 'title' => $title, 'class' => 'phabricator-filetree-item', ), - $icon.$name_element); + array($icon, $name_element)); } $tree->destroy(); diff --git a/src/applications/differential/view/DifferentialChangesetListView.php b/src/applications/differential/view/DifferentialChangesetListView.php index acea5b060d..abbca39906 100644 --- a/src/applications/differential/view/DifferentialChangesetListView.php +++ b/src/applications/differential/view/DifferentialChangesetListView.php @@ -143,7 +143,7 @@ final class DifferentialChangesetListView extends AphrontView { $load = 'Loading...'; $mapping[$uniq_id] = $ref; } else { - $load = javelin_render_tag( + $load = javelin_tag( 'a', array( 'href' => '#'.$uniq_id, @@ -155,7 +155,7 @@ final class DifferentialChangesetListView extends AphrontView { 'sigil' => 'differential-load', 'mustcapture' => true, ), - 'Load'); + pht('Load')); } $detail->appendChild( phutil_tag( @@ -209,13 +209,13 @@ final class DifferentialChangesetListView extends AphrontView { * Render the "Undo" markup for the inline comment undo feature. */ private function renderUndoTemplates() { - $link = javelin_render_tag( + $link = javelin_tag( 'a', array( 'href' => '#', 'sigil' => 'differential-inline-comment-undo', ), - 'Undo'); + pht('Undo')); $div = phutil_tag( 'div', @@ -302,7 +302,7 @@ final class DifferentialChangesetListView extends AphrontView { 'differential-dropdown-menus', array()); - return javelin_render_tag( + return javelin_tag( 'a', array( 'class' => 'button small grey', @@ -311,7 +311,7 @@ final class DifferentialChangesetListView extends AphrontView { 'target' => '_blank', 'sigil' => 'differential-view-options', ), - "View Options \xE2\x96\xBC"); + pht("View Options \xE2\x96\xBC")); } } diff --git a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php index 818522b2ba..75de304237 100644 --- a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php +++ b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php @@ -192,16 +192,14 @@ final class DifferentialDiffTableOfContentsView extends AphrontView { } } - $reveal_link = - javelin_render_tag( + $reveal_link = javelin_tag( 'a', array( 'sigil' => 'differential-reveal-all', 'mustcapture' => true, 'class' => 'button differential-toc-reveal-all', ), - pht('Show All Context') - ); + pht('Show All Context')); $buttons = ''. @@ -256,7 +254,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView { private function renderChangesetLink(DifferentialChangeset $changeset, $ref) { $display_file = $changeset->getDisplayFilename(); - return javelin_render_tag( + return javelin_tag( 'a', array( 'href' => '#'.$changeset->getAnchorName(), @@ -266,7 +264,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView { ), 'sigil' => 'differential-load', ), - phutil_escape_html($display_file)); + $display_file); } } diff --git a/src/applications/differential/view/DifferentialInlineCommentEditView.php b/src/applications/differential/view/DifferentialInlineCommentEditView.php index 86a2706ce6..9471325c34 100644 --- a/src/applications/differential/view/DifferentialInlineCommentEditView.php +++ b/src/applications/differential/view/DifferentialInlineCommentEditView.php @@ -94,7 +94,7 @@ final class DifferentialInlineCommentEditView extends AphrontView { $buttons = array(); $buttons[] = ''; - $buttons[] = javelin_render_tag( + $buttons[] = javelin_tag( 'button', array( 'sigil' => 'inline-edit-cancel', diff --git a/src/applications/differential/view/DifferentialInlineCommentView.php b/src/applications/differential/view/DifferentialInlineCommentView.php index 09ac5a906b..0340d3287a 100644 --- a/src/applications/differential/view/DifferentialInlineCommentView.php +++ b/src/applications/differential/view/DifferentialInlineCommentView.php @@ -95,7 +95,7 @@ final class DifferentialInlineCommentView extends AphrontView { } if (!$this->preview) { - $links[] = javelin_render_tag( + $links[] = javelin_tag( 'a', array( 'href' => '#', @@ -104,7 +104,7 @@ final class DifferentialInlineCommentView extends AphrontView { ), pht('Previous')); - $links[] = javelin_render_tag( + $links[] = javelin_tag( 'a', array( 'href' => '#', @@ -122,7 +122,7 @@ final class DifferentialInlineCommentView extends AphrontView { // file/line information, and synthetic comments don't have an inline // comment ID. - $links[] = javelin_render_tag( + $links[] = javelin_tag( 'a', array( 'href' => '#', @@ -138,7 +138,7 @@ final class DifferentialInlineCommentView extends AphrontView { $anchor_name = 'inline-'.$inline->getID(); if ($this->editable && !$this->preview) { - $links[] = javelin_render_tag( + $links[] = javelin_tag( 'a', array( 'href' => '#', @@ -146,7 +146,7 @@ final class DifferentialInlineCommentView extends AphrontView { 'sigil' => 'differential-inline-edit', ), pht('Edit')); - $links[] = javelin_render_tag( + $links[] = javelin_tag( 'a', array( 'href' => '#', @@ -155,7 +155,7 @@ final class DifferentialInlineCommentView extends AphrontView { ), pht('Delete')); } else if ($this->preview) { - $links[] = javelin_render_tag( + $links[] = javelin_tag( 'a', array( 'meta' => array( @@ -164,7 +164,7 @@ final class DifferentialInlineCommentView extends AphrontView { 'sigil' => 'differential-inline-preview-jump', ), pht('Not Visible')); - $links[] = javelin_render_tag( + $links[] = javelin_tag( 'a', array( 'href' => '#', diff --git a/src/applications/differential/view/DifferentialRevisionCommentListView.php b/src/applications/differential/view/DifferentialRevisionCommentListView.php index 48d085a75d..8edeaeea81 100644 --- a/src/applications/differential/view/DifferentialRevisionCommentListView.php +++ b/src/applications/differential/view/DifferentialRevisionCommentListView.php @@ -166,7 +166,7 @@ final class DifferentialRevisionCommentListView extends AphrontView { ), '
'. pht('%d older comments are hidden. ', number_format(count($hidden))). - javelin_render_tag( + javelin_tag( 'a', array( 'href' => '#', diff --git a/src/applications/differential/view/DifferentialRevisionListView.php b/src/applications/differential/view/DifferentialRevisionListView.php index 3d8a9cb89a..b0306deec5 100644 --- a/src/applications/differential/view/DifferentialRevisionListView.php +++ b/src/applications/differential/view/DifferentialRevisionListView.php @@ -111,7 +111,7 @@ final class DifferentialRevisionListView extends AphrontView { if (isset($flagged[$phid])) { $class = PhabricatorFlagColor::getCSSClass($flagged[$phid]->getColor()); $note = $flagged[$phid]->getNote(); - $flag = javelin_render_tag( + $flag = javelin_tag( 'div', $note ? array( 'class' => 'phabricator-flag-icon '.$class, diff --git a/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php b/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php index 8e7e9f926c..718d837f53 100644 --- a/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php +++ b/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php @@ -72,7 +72,7 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView { if ($id) { $new_checked = ($this->selectedDiffID == $id); - $new = javelin_render_tag( + $new = javelin_tag( 'input', array( 'type' => 'radio', diff --git a/src/applications/diffusion/controller/DiffusionBrowseFileController.php b/src/applications/diffusion/controller/DiffusionBrowseFileController.php index 36bc8443a3..624dbdb9ac 100644 --- a/src/applications/diffusion/controller/DiffusionBrowseFileController.php +++ b/src/applications/diffusion/controller/DiffusionBrowseFileController.php @@ -605,7 +605,7 @@ final class DiffusionBrowseFileController extends DiffusionController { Javelin::initBehavior('phabricator-tooltips', array()); require_celerity_resource('aphront-tooltip-css'); - $commit_link = javelin_render_tag( + $commit_link = javelin_tag( 'a', array( 'href' => $drequest->generateURI( @@ -620,7 +620,7 @@ final class DiffusionBrowseFileController extends DiffusionController { 'size' => 600, ), ), - phutil_escape_html(phutil_utf8_shorten($line['commit'], 9, ''))); + phutil_utf8_shorten($line['commit'], 9, '')); $revision_id = null; if (idx($commits, $commit)) { @@ -637,7 +637,7 @@ final class DiffusionBrowseFileController extends DiffusionController { " \xC2\xB7 ". $revision->getTitle(); } - $revision_link = javelin_render_tag( + $revision_link = javelin_tag( 'a', array( 'href' => '/D'.$revision_id, @@ -652,7 +652,7 @@ final class DiffusionBrowseFileController extends DiffusionController { } $uri = $line_href->alter('before', $commit); - $before_link = javelin_render_tag( + $before_link = javelin_tag( 'a', array( 'href' => $uri->setQueryParam('view', 'blame'), @@ -706,7 +706,7 @@ final class DiffusionBrowseFileController extends DiffusionController { ), $line['line']); - $blame[] = javelin_render_tag( + $blame[] = javelin_tag( 'th', array( 'class' => 'diffusion-line-link', diff --git a/src/applications/diffusion/controller/DiffusionCommitEditController.php b/src/applications/diffusion/controller/DiffusionCommitEditController.php index fcfb0cd42e..c70b47260d 100644 --- a/src/applications/diffusion/controller/DiffusionCommitEditController.php +++ b/src/applications/diffusion/controller/DiffusionCommitEditController.php @@ -62,15 +62,15 @@ final class DiffusionCommitEditController extends DiffusionController { ->setValue($proj_t_values) ->setID($tokenizer_id) ->setCaption( - javelin_render_tag( + javelin_tag( 'a', array( 'href' => '/project/create/', 'mustcapture' => true, 'sigil' => 'project-create', ), - 'Create New Project')) - ->setDatasource('/typeahead/common/projects/'));; + pht('Create New Project'))) + ->setDatasource('/typeahead/common/projects/'));; Javelin::initBehavior('project-create', array( 'tokenizerID' => $tokenizer_id, diff --git a/src/applications/diffusion/view/DiffusionCommitChangeTableView.php b/src/applications/diffusion/view/DiffusionCommitChangeTableView.php index c3ec644cd7..3d6d5eb7b1 100644 --- a/src/applications/diffusion/view/DiffusionCommitChangeTableView.php +++ b/src/applications/diffusion/view/DiffusionCommitChangeTableView.php @@ -39,7 +39,7 @@ final class DiffusionCommitChangeTableView extends DiffusionView { } if (isset($this->renderingReferences[$id])) { - $path_column = javelin_render_tag( + $path_column = javelin_tag( 'a', array( 'href' => '#'.$hash, @@ -49,7 +49,7 @@ final class DiffusionCommitChangeTableView extends DiffusionView { ), 'sigil' => 'differential-load', ), - phutil_escape_html($path)); + $path); } else { $path_column = phutil_escape_html($path); } diff --git a/src/applications/diffusion/view/DiffusionHistoryTableView.php b/src/applications/diffusion/view/DiffusionHistoryTableView.php index 73dd317a3d..08784f71f7 100644 --- a/src/applications/diffusion/view/DiffusionHistoryTableView.php +++ b/src/applications/diffusion/view/DiffusionHistoryTableView.php @@ -312,7 +312,7 @@ final class DiffusionHistoryTableView extends DiffusionView { // Render into tags for the behavior. foreach ($graph as $k => $meta) { - $graph[$k] = javelin_render_tag( + $graph[$k] = javelin_tag( 'div', array( 'sigil' => 'commit-graph', diff --git a/src/applications/diffusion/view/DiffusionView.php b/src/applications/diffusion/view/DiffusionView.php index 83dff57748..c36ddc1c46 100644 --- a/src/applications/diffusion/view/DiffusionView.php +++ b/src/applications/diffusion/view/DiffusionView.php @@ -144,7 +144,7 @@ abstract class DiffusionView extends AphrontView { if ($email->getDisplayName() && $email->getDomainName()) { Javelin::initBehavior('phabricator-tooltips', array()); require_celerity_resource('aphront-tooltip-css'); - return javelin_render_tag( + return javelin_tag( 'span', array( 'sigil' => 'has-tooltip', @@ -154,7 +154,7 @@ abstract class DiffusionView extends AphrontView { 'size' => 'auto', ), ), - phutil_escape_html($email->getDisplayName())); + $email->getDisplayName()); } return phutil_escape_html($name); } diff --git a/src/applications/herald/controller/HeraldRuleController.php b/src/applications/herald/controller/HeraldRuleController.php index 998e31cca7..8b32bd6ae7 100644 --- a/src/applications/herald/controller/HeraldRuleController.php +++ b/src/applications/herald/controller/HeraldRuleController.php @@ -100,7 +100,7 @@ final class HeraldRuleController extends HeraldController { ->appendChild( // Build this explicitly (instead of using addHiddenInput()) // so we can add a sigil to it. - javelin_render_tag( + javelin_tag( 'input', array( 'type' => 'hidden', @@ -123,7 +123,7 @@ final class HeraldRuleController extends HeraldController { ->appendChild( id(new AphrontFormInsetView()) ->setTitle('Conditions') - ->setRightButton(javelin_render_tag( + ->setRightButton(javelin_tag( 'a', array( 'href' => '#', @@ -135,7 +135,7 @@ final class HeraldRuleController extends HeraldController { ->setDescription( 'When '.$must_match_selector . ' these conditions are met:') - ->setContent(javelin_render_tag( + ->setContent(javelin_tag( 'table', array( 'sigil' => 'rule-conditions', @@ -145,7 +145,7 @@ final class HeraldRuleController extends HeraldController { ->appendChild( id(new AphrontFormInsetView()) ->setTitle('Action') - ->setRightButton(javelin_render_tag( + ->setRightButton(javelin_tag( 'a', array( 'href' => '#', @@ -156,7 +156,7 @@ final class HeraldRuleController extends HeraldController { 'Create New Action')) ->setDescription('Take these actions '.$repetition_selector. ' this rule matches:') - ->setContent(javelin_render_tag( + ->setContent(javelin_tag( 'table', array( 'sigil' => 'rule-actions', diff --git a/src/applications/herald/view/HeraldRuleListView.php b/src/applications/herald/view/HeraldRuleListView.php index 18aa093b61..d95765ecd7 100644 --- a/src/applications/herald/view/HeraldRuleListView.php +++ b/src/applications/herald/view/HeraldRuleListView.php @@ -58,7 +58,7 @@ final class HeraldRuleListView extends AphrontView { ), 'View Edit Log'); - $delete = javelin_render_tag( + $delete = javelin_tag( 'a', array( 'href' => '/herald/delete/'.$rule->getID().'/', diff --git a/src/applications/maniphest/controller/ManiphestBatchEditController.php b/src/applications/maniphest/controller/ManiphestBatchEditController.php index 01b656539b..6e1b533e45 100644 --- a/src/applications/maniphest/controller/ManiphestBatchEditController.php +++ b/src/applications/maniphest/controller/ManiphestBatchEditController.php @@ -101,7 +101,7 @@ final class ManiphestBatchEditController extends ManiphestController { $form->appendChild( id(new AphrontFormInsetView()) ->setTitle('Actions') - ->setRightButton(javelin_render_tag( + ->setRightButton(javelin_tag( 'a', array( 'href' => '#', @@ -110,7 +110,7 @@ final class ManiphestBatchEditController extends ManiphestController { 'mustcapture' => true, ), 'Add Another Action')) - ->setContent(javelin_render_tag( + ->setContent(javelin_tag( 'table', array( 'sigil' => 'maniphest-batch-actions', diff --git a/src/applications/maniphest/controller/ManiphestReportController.php b/src/applications/maniphest/controller/ManiphestReportController.php index 4b1bf10775..b8ce9c7e5d 100644 --- a/src/applications/maniphest/controller/ManiphestReportController.php +++ b/src/applications/maniphest/controller/ManiphestReportController.php @@ -574,7 +574,7 @@ final class ManiphestReportController extends ManiphestController { } $cname[] = 'Total'; $cclass[] = 'n'; - $cname[] = javelin_render_tag( + $cname[] = javelin_tag( 'span', array( 'sigil' => 'has-tooltip', @@ -585,7 +585,7 @@ final class ManiphestReportController extends ManiphestController { ), 'Oldest (All)'); $cclass[] = 'n'; - $cname[] = javelin_render_tag( + $cname[] = javelin_tag( 'span', array( 'sigil' => 'has-tooltip', @@ -599,7 +599,7 @@ final class ManiphestReportController extends ManiphestController { $cclass[] = 'n'; list($ignored, $window_epoch) = $this->getWindow(); - $cname[] = javelin_render_tag( + $cname[] = javelin_tag( 'span', array( 'sigil' => 'has-tooltip', @@ -745,7 +745,7 @@ final class ManiphestReportController extends ManiphestController { $raw_age = (time() - $oldest->getDateCreated()); $age = number_format($raw_age / (24 * 60 * 60)).' d'; - $link = javelin_render_tag( + $link = javelin_tag( 'a', array( 'href' => '/T'.$oldest->getID(), @@ -755,7 +755,7 @@ final class ManiphestReportController extends ManiphestController { ), 'target' => '_blank', ), - phutil_escape_html($age)); + $age); return array($link, $raw_age); } diff --git a/src/applications/maniphest/controller/ManiphestSavedQueryListController.php b/src/applications/maniphest/controller/ManiphestSavedQueryListController.php index ba8fcb1e85..d6377c10b7 100644 --- a/src/applications/maniphest/controller/ManiphestSavedQueryListController.php +++ b/src/applications/maniphest/controller/ManiphestSavedQueryListController.php @@ -61,7 +61,7 @@ final class ManiphestSavedQueryListController extends ManiphestController { 'class' => 'grey small button', ), 'Edit'), - javelin_render_tag( + javelin_tag( 'a', array( 'href' => '/maniphest/custom/delete/'.$query->getID().'/', diff --git a/src/applications/maniphest/controller/ManiphestTaskEditController.php b/src/applications/maniphest/controller/ManiphestTaskEditController.php index b2b8fc8f0c..103e342842 100644 --- a/src/applications/maniphest/controller/ManiphestTaskEditController.php +++ b/src/applications/maniphest/controller/ManiphestTaskEditController.php @@ -425,7 +425,7 @@ final class ManiphestTaskEditController extends ManiphestController { ->setValue($projects_value) ->setID($project_tokenizer_id) ->setCaption( - javelin_render_tag( + javelin_tag( 'a', array( 'href' => '/project/create/', diff --git a/src/applications/maniphest/controller/ManiphestTaskListController.php b/src/applications/maniphest/controller/ManiphestTaskListController.php index 1508690729..32952ce5af 100644 --- a/src/applications/maniphest/controller/ManiphestTaskListController.php +++ b/src/applications/maniphest/controller/ManiphestTaskListController.php @@ -641,7 +641,7 @@ final class ManiphestTaskListController extends ManiphestController { 'status' => 'batch-select-status-cell', )); - $select_all = javelin_render_tag( + $select_all = javelin_tag( 'a', array( 'href' => '#', @@ -651,7 +651,7 @@ final class ManiphestTaskListController extends ManiphestController { ), 'Select All'); - $select_none = javelin_render_tag( + $select_none = javelin_tag( 'a', array( 'href' => '#', @@ -670,7 +670,7 @@ final class ManiphestTaskListController extends ManiphestController { ), "Batch Edit Selected Tasks \xC2\xBB"); - $export = javelin_render_tag( + $export = javelin_tag( 'a', array( 'href' => '/maniphest/export/'.$search_query->getQueryKey().'/', diff --git a/src/applications/maniphest/view/ManiphestTaskProjectsView.php b/src/applications/maniphest/view/ManiphestTaskProjectsView.php index 5e63043238..358d3145bc 100644 --- a/src/applications/maniphest/view/ManiphestTaskProjectsView.php +++ b/src/applications/maniphest/view/ManiphestTaskProjectsView.php @@ -27,7 +27,7 @@ final class ManiphestTaskProjectsView extends ManiphestView { 'href' => $handle->getURI(), 'class' => 'phabricator-project-tag', ), - phutil_utf8_shorten($handle->getName(), 24)); + phutil_utf8_shorten($handle->getName(), 24)); } if (count($this->handles) > 2) { @@ -39,7 +39,7 @@ final class ManiphestTaskProjectsView extends ManiphestView { $all[] = $handle->getName(); } - $tags[] = javelin_render_tag( + $tags[] = javelin_tag( 'span', array( 'class' => 'phabricator-project-tag', diff --git a/src/applications/maniphest/view/ManiphestTaskSummaryView.php b/src/applications/maniphest/view/ManiphestTaskSummaryView.php index 075bee78dd..20c03b9fe0 100644 --- a/src/applications/maniphest/view/ManiphestTaskSummaryView.php +++ b/src/applications/maniphest/view/ManiphestTaskSummaryView.php @@ -62,15 +62,14 @@ final class ManiphestTaskSummaryView extends ManiphestView { if ($this->showBatchControls) { $batch = ''. - javelin_render_tag( + javelin_tag( 'input', array( 'type' => 'checkbox', 'name' => 'batch[]', 'value' => $task->getID(), 'sigil' => 'maniphest-batch', - ), - null). + )). ''; } @@ -87,7 +86,7 @@ final class ManiphestTaskSummaryView extends ManiphestView { $control_sigil = 'maniphest-task-handle'; } - $handle = javelin_render_tag( + $handle = javelin_tag( 'td', array( 'class' => 'maniphest-task-handle '.$pri_class.' '.$control_class, diff --git a/src/applications/maniphest/view/ManiphestTransactionDetailView.php b/src/applications/maniphest/view/ManiphestTransactionDetailView.php index 320b577c04..99d5aac688 100644 --- a/src/applications/maniphest/view/ManiphestTransactionDetailView.php +++ b/src/applications/maniphest/view/ManiphestTransactionDetailView.php @@ -590,7 +590,7 @@ final class ManiphestTransactionDetailView extends ManiphestView { Javelin::initBehavior('maniphest-transaction-expand'); - return javelin_render_tag( + return javelin_tag( 'a', array( 'href' => '/maniphest/task/descriptionchange/'.$id.'/', diff --git a/src/applications/notification/controller/PhabricatorNotificationListController.php b/src/applications/notification/controller/PhabricatorNotificationListController.php index 3c1bfeedf6..739a70f3ae 100644 --- a/src/applications/notification/controller/PhabricatorNotificationListController.php +++ b/src/applications/notification/controller/PhabricatorNotificationListController.php @@ -61,7 +61,7 @@ final class PhabricatorNotificationListController $panel->setHeader($header); $panel->setWidth(AphrontPanelView::WIDTH_FORM); $panel->addButton( - javelin_render_tag( + javelin_tag( 'a', array( 'href' => '/notification/clear/', diff --git a/src/applications/owners/controller/PhabricatorOwnersDetailController.php b/src/applications/owners/controller/PhabricatorOwnersDetailController.php index 5046a740b7..fe07e5767d 100644 --- a/src/applications/owners/controller/PhabricatorOwnersDetailController.php +++ b/src/applications/owners/controller/PhabricatorOwnersDetailController.php @@ -120,7 +120,7 @@ final class PhabricatorOwnersDetailController $panel->setHeader( 'Package Details for "'.phutil_escape_html($package->getName()).'"'); $panel->addButton( - javelin_render_tag( + javelin_tag( 'a', array( 'href' => '/owners/delete/'.$package->getID().'/', diff --git a/src/applications/owners/controller/PhabricatorOwnersEditController.php b/src/applications/owners/controller/PhabricatorOwnersEditController.php index 9e953d6933..a5aece08d1 100644 --- a/src/applications/owners/controller/PhabricatorOwnersEditController.php +++ b/src/applications/owners/controller/PhabricatorOwnersEditController.php @@ -218,7 +218,7 @@ final class PhabricatorOwnersEditController id(new AphrontFormInsetView()) ->setTitle('Paths') ->addDivAttributes(array('id' => 'path-editor')) - ->setRightButton(javelin_render_tag( + ->setRightButton(javelin_tag( 'a', array( 'href' => '#', @@ -229,7 +229,7 @@ final class PhabricatorOwnersEditController 'Add New Path')) ->setDescription('Specify the files and directories which comprise '. 'this package.') - ->setContent(javelin_render_tag( + ->setContent(javelin_tag( 'table', array( 'class' => 'owners-path-editor-table', diff --git a/src/applications/phortune/stripe/view/PhortuneStripePaymentFormView.php b/src/applications/phortune/stripe/view/PhortuneStripePaymentFormView.php index 569f7db994..c77b5b623f 100644 --- a/src/applications/phortune/stripe/view/PhortuneStripePaymentFormView.php +++ b/src/applications/phortune/stripe/view/PhortuneStripePaymentFormView.php @@ -51,7 +51,7 @@ final class PhortuneStripePaymentFormView extends AphrontView { id(new AphrontFormMarkupControl()) ->setLabel('') ->setValue( - javelin_render_tag( + javelin_tag( 'div', array( 'class' => 'credit-card-logos', @@ -86,7 +86,7 @@ final class PhortuneStripePaymentFormView extends AphrontView { ->setError($this->getCardExpirationError()) ) ->appendChild( - javelin_render_tag( + javelin_tag( 'input', array( 'hidden' => true, @@ -96,7 +96,7 @@ final class PhortuneStripePaymentFormView extends AphrontView { ) ) ->appendChild( - javelin_render_tag( + javelin_tag( 'input', array( 'hidden' => true, diff --git a/src/applications/ponder/view/PonderVotableView.php b/src/applications/ponder/view/PonderVotableView.php index a921a79d11..c4bb4ab726 100644 --- a/src/applications/ponder/view/PonderVotableView.php +++ b/src/applications/ponder/view/PonderVotableView.php @@ -35,7 +35,7 @@ final class PonderVotableView extends AphrontView { $uri = id(new PhutilURI($this->uri))->alter('phid', $this->phid); - $up = javelin_render_tag( + $up = javelin_tag( 'a', array( 'href' => (string)$uri, @@ -45,7 +45,7 @@ final class PonderVotableView extends AphrontView { ), "\xE2\x96\xB2"); - $down = javelin_render_tag( + $down = javelin_tag( 'a', array( 'href' => (string)$uri, @@ -55,13 +55,13 @@ final class PonderVotableView extends AphrontView { ), "\xE2\x96\xBC"); - $count = javelin_render_tag( + $count = javelin_tag( 'div', array( 'class' => 'ponder-vote-count', 'sigil' => 'ponder-vote-count', ), - phutil_escape_html($this->count)); + $this->count); return javelin_render_tag( 'div', diff --git a/src/applications/project/controller/PhabricatorProjectMembersEditController.php b/src/applications/project/controller/PhabricatorProjectMembersEditController.php index ae4adba176..1e89cb307f 100644 --- a/src/applications/project/controller/PhabricatorProjectMembersEditController.php +++ b/src/applications/project/controller/PhabricatorProjectMembersEditController.php @@ -142,7 +142,7 @@ final class PhabricatorProjectMembersEditController ), ''); - $button = javelin_render_tag( + $button = javelin_tag( 'button', array( 'class' => 'grey', diff --git a/src/applications/project/controller/PhabricatorProjectProfileController.php b/src/applications/project/controller/PhabricatorProjectProfileController.php index d843874993..4d6e4b8eee 100644 --- a/src/applications/project/controller/PhabricatorProjectProfileController.php +++ b/src/applications/project/controller/PhabricatorProjectProfileController.php @@ -98,7 +98,7 @@ final class PhabricatorProjectProfileController ), 'Join Project')); } else { - $action = javelin_render_tag( + $action = javelin_tag( 'a', array( 'href' => '/project/update/'.$project->getID().'/leave/', diff --git a/src/applications/repository/controller/PhabricatorRepositoryListController.php b/src/applications/repository/controller/PhabricatorRepositoryListController.php index fd4b6fb37c..8c4baea1d0 100644 --- a/src/applications/repository/controller/PhabricatorRepositoryListController.php +++ b/src/applications/repository/controller/PhabricatorRepositoryListController.php @@ -43,7 +43,7 @@ final class PhabricatorRepositoryListController 'href' => '/repository/edit/'.$repo->getID().'/', ), 'Edit'), - javelin_render_tag( + javelin_tag( 'a', array( 'class' => 'button small grey', diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php b/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php index 057ac4436d..9ad348ed6b 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php @@ -52,7 +52,7 @@ final class PhabricatorSettingsPanelEmailAddresses $rows = array(); foreach ($emails as $email) { - $button_verify = javelin_render_tag( + $button_verify = javelin_tag( 'a', array( 'class' => 'button small grey', @@ -61,7 +61,7 @@ final class PhabricatorSettingsPanelEmailAddresses ), 'Verify'); - $button_make_primary = javelin_render_tag( + $button_make_primary = javelin_tag( 'a', array( 'class' => 'button small grey', @@ -70,7 +70,7 @@ final class PhabricatorSettingsPanelEmailAddresses ), 'Make Primary'); - $button_remove = javelin_render_tag( + $button_remove = javelin_tag( 'a', array( 'class' => 'button small grey', @@ -133,7 +133,7 @@ final class PhabricatorSettingsPanelEmailAddresses $view = new AphrontPanelView(); if ($editable) { $view->addButton( - javelin_render_tag( + javelin_tag( 'a', array( 'href' => $uri->alter('new', 'true'), diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php b/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php index a0b6b06616..133c45ec9c 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php @@ -186,7 +186,7 @@ final class PhabricatorSettingsPanelSSHKeys phutil_escape_html($key->getKeyType()), phabricator_date($key->getDateCreated(), $user), phabricator_time($key->getDateCreated(), $user), - javelin_render_tag( + javelin_tag( 'a', array( 'href' => $this->getPanelURI('?delete='.$key->getID()), diff --git a/src/applications/uiexample/examples/JavelinUIExample.php b/src/applications/uiexample/examples/JavelinUIExample.php index 5c9096d1e8..5976066bd2 100644 --- a/src/applications/uiexample/examples/JavelinUIExample.php +++ b/src/applications/uiexample/examples/JavelinUIExample.php @@ -20,7 +20,7 @@ final class JavelinUIExample extends PhabricatorUIExample { $button_red_id = celerity_generate_unique_node_id(); $button_blue_id = celerity_generate_unique_node_id(); - $button_red = javelin_render_tag( + $button_red = javelin_tag( 'a', array( 'class' => 'button', @@ -36,7 +36,7 @@ final class JavelinUIExample extends PhabricatorUIExample { ), 'Toggle Red Border'); - $button_blue = javelin_render_tag( + $button_blue = javelin_tag( 'a', array( 'class' => 'button jxui-active', diff --git a/src/applications/uiexample/examples/PhabricatorUINotificationExample.php b/src/applications/uiexample/examples/PhabricatorUINotificationExample.php index c112a33fcd..031bb42c30 100644 --- a/src/applications/uiexample/examples/PhabricatorUINotificationExample.php +++ b/src/applications/uiexample/examples/PhabricatorUINotificationExample.php @@ -15,7 +15,7 @@ final class PhabricatorUINotificationExample extends PhabricatorUIExample { require_celerity_resource('phabricator-notification-css'); Javelin::initBehavior('phabricator-notification-example'); - $content = javelin_render_tag( + $content = javelin_tag( 'a', array( 'sigil' => 'notification-example', diff --git a/src/applications/uiexample/examples/PhabricatorUITooltipExample.php b/src/applications/uiexample/examples/PhabricatorUITooltipExample.php index 77a346510b..9f806e3516 100644 --- a/src/applications/uiexample/examples/PhabricatorUITooltipExample.php +++ b/src/applications/uiexample/examples/PhabricatorUITooltipExample.php @@ -89,14 +89,14 @@ EOTEXT; $content = array(); foreach ($metas as $key => $meta) { - $content[] = javelin_render_tag( + $content[] = javelin_tag( 'div', array( 'sigil' => 'has-tooltip', 'meta' => $meta, 'style' => $style, ), - phutil_escape_html($key)); + $key); } return $content; diff --git a/src/applications/xhprof/view/PhabricatorXHProfProfileTopLevelView.php b/src/applications/xhprof/view/PhabricatorXHProfProfileTopLevelView.php index cd20ac4f39..12326bb16d 100644 --- a/src/applications/xhprof/view/PhabricatorXHProfProfileTopLevelView.php +++ b/src/applications/xhprof/view/PhabricatorXHProfProfileTopLevelView.php @@ -84,7 +84,7 @@ final class PhabricatorXHProfProfileTopLevelView array( 'Symbol', 'Count', - javelin_render_tag( + javelin_tag( 'span', array( 'sigil' => 'has-tooltip', @@ -97,7 +97,7 @@ final class PhabricatorXHProfProfileTopLevelView ), 'Wall Time (Inclusive)'), '%', - javelin_render_tag( + javelin_tag( 'span', array( 'sigil' => 'has-tooltip', diff --git a/src/infrastructure/diff/PhabricatorInlineCommentController.php b/src/infrastructure/diff/PhabricatorInlineCommentController.php index 8b7b91f191..99fe0b70da 100644 --- a/src/infrastructure/diff/PhabricatorInlineCommentController.php +++ b/src/infrastructure/diff/PhabricatorInlineCommentController.php @@ -234,14 +234,14 @@ abstract class PhabricatorInlineCommentController } private function renderTextArea($text) { - return javelin_render_tag( + return javelin_tag( 'textarea', array( 'class' => 'differential-inline-comment-edit-textarea', 'sigil' => 'differential-inline-comment-edit-textarea', 'name' => 'text', ), - phutil_escape_html($text)); + $text); } } diff --git a/src/infrastructure/javelin/markup.php b/src/infrastructure/javelin/markup.php index cff2e68d97..8c22002fe8 100644 --- a/src/infrastructure/javelin/markup.php +++ b/src/infrastructure/javelin/markup.php @@ -5,6 +5,19 @@ function javelin_render_tag( array $attributes = array(), $content = null) { + if (is_array($content)) { + $content = implode('', $content); + } + + $html = javelin_tag($tag, $attributes, phutil_safe_html($content)); + return $html->getHTMLContent(); +} + +function javelin_tag( + $tag, + array $attributes = array(), + $content = null) { + if (isset($attributes['sigil']) || isset($attributes['meta']) || isset($attributes['mustcapture'])) { @@ -32,10 +45,9 @@ function javelin_render_tag( } } - return phutil_render_tag($tag, $attributes, $content); + return phutil_tag($tag, $attributes, $content); } - function phabricator_render_form(PhabricatorUser $user, $attributes, $content) { if (strcasecmp(idx($attributes, 'method'), 'POST') == 0 && !preg_match('#^(https?:|//)#', idx($attributes, 'action'))) { diff --git a/src/infrastructure/markup/rule/PhabricatorRemarkupRuleCountdown.php b/src/infrastructure/markup/rule/PhabricatorRemarkupRuleCountdown.php index b2219ad428..548a2b1d64 100644 --- a/src/infrastructure/markup/rule/PhabricatorRemarkupRuleCountdown.php +++ b/src/infrastructure/markup/rule/PhabricatorRemarkupRuleCountdown.php @@ -52,13 +52,13 @@ final class PhabricatorRemarkupRuleCountdown extends PhutilRemarkupRule { 'id' => $id, ), array( - javelin_render_tag('span', + javelin_tag('span', array('sigil' => 'phabricator-timer-days'), '').'d', - javelin_render_tag('span', + javelin_tag('span', array('sigil' => 'phabricator-timer-hours'), '').'h', - javelin_render_tag('span', + javelin_tag('span', array('sigil' => 'phabricator-timer-minutes'), '').'m', - javelin_render_tag('span', + javelin_tag('span', array('sigil' => 'phabricator-timer-seconds'), '').'s', )); Javelin::initBehavior('countdown-timer', array( diff --git a/src/infrastructure/markup/rule/PhabricatorRemarkupRuleEmbedFile.php b/src/infrastructure/markup/rule/PhabricatorRemarkupRuleEmbedFile.php index 6426f27fa0..6adc7958f8 100644 --- a/src/infrastructure/markup/rule/PhabricatorRemarkupRuleEmbedFile.php +++ b/src/infrastructure/markup/rule/PhabricatorRemarkupRuleEmbedFile.php @@ -110,7 +110,7 @@ final class PhabricatorRemarkupRuleEmbedFile require_celerity_resource('lightbox-attachment-css'); $img = phutil_tag('img', $data['attrs']); - $embed = javelin_render_tag( + $embed = javelin_tag( 'a', array( 'href' => $meta['uri'], diff --git a/src/view/AphrontDialogView.php b/src/view/AphrontDialogView.php index 266286cef2..e1ebad90c8 100644 --- a/src/view/AphrontDialogView.php +++ b/src/view/AphrontDialogView.php @@ -79,17 +79,17 @@ final class AphrontDialogView extends AphrontView { $buttons = array(); if ($this->submitButton) { - $buttons[] = javelin_render_tag( + $buttons[] = javelin_tag( 'button', array( 'name' => '__submit__', 'sigil' => '__default__', ), - phutil_escape_html($this->submitButton)); + $this->submitButton); } if ($this->cancelURI) { - $buttons[] = javelin_render_tag( + $buttons[] = javelin_tag( 'a', array( 'href' => $this->cancelURI, @@ -97,7 +97,7 @@ final class AphrontDialogView extends AphrontView { 'name' => '__cancel__', 'sigil' => 'jx-workflow-button', ), - phutil_escape_html($this->cancelText)); + $this->cancelText); } $buttons = implode('', $buttons); @@ -133,7 +133,7 @@ final class AphrontDialogView extends AphrontView { $hidden_inputs = array(); foreach ($this->hidden as $desc) { list($key, $value) = $desc; - $hidden_inputs[] = javelin_render_tag( + $hidden_inputs[] = javelin_tag( 'input', array( 'type' => 'hidden', diff --git a/src/view/control/AphrontAttachedFileView.php b/src/view/control/AphrontAttachedFileView.php index a728515387..a3e1cad357 100644 --- a/src/view/control/AphrontAttachedFileView.php +++ b/src/view/control/AphrontAttachedFileView.php @@ -32,7 +32,7 @@ final class AphrontAttachedFileView extends AphrontView { $file->getName()); $size = number_format($file->getByteSize()).' bytes'; - $remove = javelin_render_tag( + $remove = javelin_tag( 'a', array( 'class' => 'button grey', diff --git a/src/view/control/AphrontTokenizerTemplateView.php b/src/view/control/AphrontTokenizerTemplateView.php index 178b313873..d80fe2566c 100644 --- a/src/view/control/AphrontTokenizerTemplateView.php +++ b/src/view/control/AphrontTokenizerTemplateView.php @@ -41,7 +41,7 @@ final class AphrontTokenizerTemplateView extends AphrontView { $tokens[] = $this->renderToken($key, $value); } - $input = javelin_render_tag( + $input = javelin_tag( 'input', array( 'mustcapture' => true, diff --git a/src/view/control/AphrontTypeaheadTemplateView.php b/src/view/control/AphrontTypeaheadTemplateView.php index 5e27c682cf..e536a7a7cf 100644 --- a/src/view/control/AphrontTypeaheadTemplateView.php +++ b/src/view/control/AphrontTypeaheadTemplateView.php @@ -41,7 +41,7 @@ final class AphrontTypeaheadTemplateView extends AphrontView { $tokens[] = $this->renderToken($key, $value); } - $input = javelin_render_tag( + $input = javelin_tag( 'input', array( 'name' => $name, @@ -52,14 +52,16 @@ final class AphrontTypeaheadTemplateView extends AphrontView { 'autocomplete' => 'off', )); - return javelin_render_tag( + return javelin_tag( 'div', array( 'id' => $id, 'sigil' => 'typeahead-hardpoint', 'class' => 'jx-typeahead-hardpoint', ), - $input. - '
'); + array( + $input, + phutil_tag('div', array('style' => 'clear: both'), ''), + )); } } diff --git a/src/view/form/control/AphrontFormDateControl.php b/src/view/form/control/AphrontFormDateControl.php index aefdafbd75..afe989f854 100644 --- a/src/view/form/control/AphrontFormDateControl.php +++ b/src/view/form/control/AphrontFormDateControl.php @@ -225,7 +225,7 @@ final class AphrontFormDateControl extends AphrontFormControl { 'sigil' => 'year-input', )); - $cal_icon = javelin_render_tag( + $cal_icon = javelin_tag( 'a', array( 'href' => '#', diff --git a/src/view/form/control/AphrontFormTextControl.php b/src/view/form/control/AphrontFormTextControl.php index 76b3cbb32e..7ba47a5728 100644 --- a/src/view/form/control/AphrontFormTextControl.php +++ b/src/view/form/control/AphrontFormTextControl.php @@ -25,7 +25,7 @@ final class AphrontFormTextControl extends AphrontFormControl { } protected function renderInput() { - return javelin_render_tag( + return javelin_tag( 'input', array( 'type' => 'text', diff --git a/src/view/form/control/PhabricatorRemarkupControl.php b/src/view/form/control/PhabricatorRemarkupControl.php index 1272007c0c..be41fdf655 100644 --- a/src/view/form/control/PhabricatorRemarkupControl.php +++ b/src/view/form/control/PhabricatorRemarkupControl.php @@ -99,7 +99,7 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl { require_celerity_resource('sprite-icon-css'); - $buttons[] = javelin_render_tag( + $buttons[] = javelin_tag( 'a', array( 'class' => implode(' ', $classes), diff --git a/src/view/layout/AphrontMoreView.php b/src/view/layout/AphrontMoreView.php index 09f9a099b0..3eb89714a5 100644 --- a/src/view/layout/AphrontMoreView.php +++ b/src/view/layout/AphrontMoreView.php @@ -32,7 +32,7 @@ final class AphrontMoreView extends AphrontView { $link = null; if ($this->more && $this->more != $this->some) { Javelin::initBehavior('aphront-more'); - $link = ' '.javelin_render_tag( + $link = ' '.javelin_tag( 'a', array( 'sigil' => 'aphront-more-view-show-more', diff --git a/src/view/layout/PhabricatorActionView.php b/src/view/layout/PhabricatorActionView.php index b5a6cf5792..53c2c1e943 100644 --- a/src/view/layout/PhabricatorActionView.php +++ b/src/view/layout/PhabricatorActionView.php @@ -66,12 +66,12 @@ final class PhabricatorActionView extends AphrontView { 'Call setUser() when rendering an action as a form.'); } - $item = javelin_render_tag( + $item = javelin_tag( 'button', array( 'class' => 'phabricator-action-view-item', ), - phutil_escape_html($this->name)); + $this->name); $item = phabricator_render_form( $this->user, @@ -82,14 +82,14 @@ final class PhabricatorActionView extends AphrontView { ), $item); } else { - $item = javelin_render_tag( + $item = javelin_tag( 'a', array( 'href' => $this->href, 'class' => 'phabricator-action-view-item', 'sigil' => $this->workflow ? 'workflow' : null, ), - phutil_escape_html($this->name)); + $this->name); } } else { $item = phutil_tag( diff --git a/src/view/layout/PhabricatorAnchorView.php b/src/view/layout/PhabricatorAnchorView.php index 2f642fab3d..4650a91b98 100644 --- a/src/view/layout/PhabricatorAnchorView.php +++ b/src/view/layout/PhabricatorAnchorView.php @@ -18,7 +18,7 @@ final class PhabricatorAnchorView extends AphrontView { public function render() { $marker = null; if ($this->navigationMarker) { - $marker = javelin_render_tag( + $marker = javelin_tag( 'legend', array( 'class' => 'phabricator-anchor-navigation-marker', diff --git a/src/view/layout/PhabricatorCrumbsView.php b/src/view/layout/PhabricatorCrumbsView.php index 457b0221cd..0ac55bb46f 100644 --- a/src/view/layout/PhabricatorCrumbsView.php +++ b/src/view/layout/PhabricatorCrumbsView.php @@ -37,14 +37,17 @@ final class PhabricatorCrumbsView extends AphrontView { ), ''); } - $actions[] = javelin_render_tag( + $actions[] = javelin_tag( 'a', array( 'href' => $action->getHref(), 'class' => 'phabricator-crumbs-action', 'sigil' => $action->getWorkflow() ? 'workflow' : null, ), - $icon.phutil_escape_html($action->getName())); + array( + $icon, + $action->getName(), + )); } $action_view = phutil_render_tag( diff --git a/src/view/layout/PhabricatorFileLinkView.php b/src/view/layout/PhabricatorFileLinkView.php index 6869e9cd35..ff3434d872 100644 --- a/src/view/layout/PhabricatorFileLinkView.php +++ b/src/view/layout/PhabricatorFileLinkView.php @@ -67,7 +67,7 @@ final class PhabricatorFileLinkView extends AphrontView { ); } - return javelin_render_tag( + return javelin_tag( 'a', array( 'href' => $this->getFileViewURI(), @@ -76,7 +76,6 @@ final class PhabricatorFileLinkView extends AphrontView { 'meta' => $meta, 'mustcapture' => $mustcapture, ), - phutil_escape_html($this->getFileName()) - ); + $this->getFileName()); } } diff --git a/src/view/layout/PhabricatorTimelineEventView.php b/src/view/layout/PhabricatorTimelineEventView.php index 63f7af3cdc..792c71da92 100644 --- a/src/view/layout/PhabricatorTimelineEventView.php +++ b/src/view/layout/PhabricatorTimelineEventView.php @@ -235,7 +235,7 @@ final class PhabricatorTimelineEventView extends AphrontView { if ($this->getIsEdited()) { - $extra[] = javelin_render_tag( + $extra[] = javelin_tag( 'a', array( 'href' => '/transactions/history/'.$xaction_phid.'/', @@ -245,7 +245,7 @@ final class PhabricatorTimelineEventView extends AphrontView { } if ($this->getIsEditable()) { - $extra[] = javelin_render_tag( + $extra[] = javelin_tag( 'a', array( 'href' => '/transactions/edit/'.$xaction_phid.'/', diff --git a/src/view/layout/headsup/AphrontHeadsupActionView.php b/src/view/layout/headsup/AphrontHeadsupActionView.php index 6371be8698..eaffca17a2 100644 --- a/src/view/layout/headsup/AphrontHeadsupActionView.php +++ b/src/view/layout/headsup/AphrontHeadsupActionView.php @@ -64,10 +64,10 @@ final class AphrontHeadsupActionView extends AphrontView { $attrs['sigil'] = 'workflow'; } - return javelin_render_tag( + return javelin_tag( $tag, $attrs, - phutil_escape_html($this->name)); + $this->name); } } diff --git a/src/view/page/menu/PhabricatorMainMenuIconView.php b/src/view/page/menu/PhabricatorMainMenuIconView.php index a94c903b55..467e2ba6ee 100644 --- a/src/view/page/menu/PhabricatorMainMenuIconView.php +++ b/src/view/page/menu/PhabricatorMainMenuIconView.php @@ -65,15 +65,15 @@ final class PhabricatorMainMenuIconView extends AphrontView { $classes = $this->classes; $classes[] = 'phabricator-main-menu-icon'; - $label = javelin_render_tag( + $label = javelin_tag( 'a', array( 'href' => $href, 'class' => 'phabricator-main-menu-icon-label', ), - phutil_escape_html($name)); + $name); - $item = javelin_render_tag( + $item = javelin_tag( 'a', array( 'href' => $href, diff --git a/src/view/page/menu/PhabricatorMainMenuSearchView.php b/src/view/page/menu/PhabricatorMainMenuSearchView.php index c444ca9078..fe3ab48e71 100644 --- a/src/view/page/menu/PhabricatorMainMenuSearchView.php +++ b/src/view/page/menu/PhabricatorMainMenuSearchView.php @@ -34,7 +34,7 @@ final class PhabricatorMainMenuSearchView extends AphrontView { $scope = $this->scope; - $target = javelin_render_tag( + $target = javelin_tag( 'div', array( 'id' => $target_id, diff --git a/src/view/page/menu/PhabricatorMainMenuView.php b/src/view/page/menu/PhabricatorMainMenuView.php index e833a6f828..b029e2cc8b 100644 --- a/src/view/page/menu/PhabricatorMainMenuView.php +++ b/src/view/page/menu/PhabricatorMainMenuView.php @@ -118,7 +118,7 @@ final class PhabricatorMainMenuView extends AphrontView { } private function renderPhabricatorMenuButton($header_id) { - return javelin_render_tag( + return javelin_tag( 'a', array( 'class' => 'phabricator-main-menu-expand-button '. @@ -139,7 +139,7 @@ final class PhabricatorMainMenuView extends AphrontView { } public function renderApplicationMenuButton($header_id) { - return javelin_render_tag( + return javelin_tag( 'a', array( 'class' => 'phabricator-main-menu-expand-button '. @@ -344,7 +344,7 @@ final class PhabricatorMainMenuView extends AphrontView { 'dropdownID' => $dropdown_id, )); - $notification_dropdown = javelin_render_tag( + $notification_dropdown = javelin_tag( 'div', array( 'id' => $dropdown_id,