Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F80927
D7533.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D7533.diff
View Options
diff --git a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php b/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
--- a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
+++ b/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
@@ -248,13 +248,13 @@
$trace = null;
}
- $content = hsprintf(
- '<div class="aphront-unhandled-exception">'.
- '<div class="exception-message">%s</div>'.
- '%s'.
- '</div>',
- $message,
- $trace);
+ $content = phutil_tag(
+ 'div',
+ array('class' => 'aphront-unhandled-exception'),
+ array(
+ phutil_tag('div', array('class' => 'exception-message'), $message),
+ $trace,
+ ));
$dialog = new AphrontDialogView();
$dialog
@@ -384,12 +384,16 @@
'wide',
));
- return hsprintf(
- '<div class="exception-trace">'.
- '<div class="exception-trace-header">Stack Trace</div>'.
- '%s'.
- '</div>',
- $table->render());
+ return phutil_tag(
+ 'div',
+ array('class' => 'exception-trace'),
+ array(
+ phutil_tag(
+ 'div',
+ array('class' => 'exception-trace-header'),
+ pht('Stack Trace')),
+ $table->render(),
+ ));
}
}
diff --git a/src/aphront/console/plugin/DarkConsoleErrorLogPlugin.php b/src/aphront/console/plugin/DarkConsoleErrorLogPlugin.php
--- a/src/aphront/console/plugin/DarkConsoleErrorLogPlugin.php
+++ b/src/aphront/console/plugin/DarkConsoleErrorLogPlugin.php
@@ -90,13 +90,13 @@
$table->setHeaders(array('Error'));
$table->setNoDataString('No errors.');
- return hsprintf(
- '<div>'.
- '<div>%s</div>'.
- '<pre class="PhabricatorMonospaced">%s</pre>'.
- '</div>',
- $table->render(),
- phutil_implode_html('', $details));
+ return phutil_tag(
+ 'div',
+ array(),
+ array(
+ phutil_tag('div', array(), $table->render()),
+ phutil_tag('pre', array('class' => 'PhabricatorMonospaced'), $details),
+ ));
}
}
diff --git a/src/aphront/console/plugin/DarkConsoleEventPlugin.php b/src/aphront/console/plugin/DarkConsoleEventPlugin.php
--- a/src/aphront/console/plugin/DarkConsoleEventPlugin.php
+++ b/src/aphront/console/plugin/DarkConsoleEventPlugin.php
@@ -42,10 +42,10 @@
$out = array();
- $out[] = hsprintf(
- '<div class="dark-console-panel-header">'.
- '<h1>Registered Event Listeners</h1>'.
- '</div>');
+ $out[] = phutil_tag(
+ 'div',
+ array('class' => 'dark-console-panel-header'),
+ phutil_tag('h1', array(), pht('Registered Event Listeners')));
$rows = array();
foreach ($data['listeners'] as $listener) {
@@ -66,10 +66,10 @@
$out[] = $table->render();
- $out[] = hsprintf(
- '<div class="dark-console-panel-header">'.
- '<h1>Event Log</h1>'.
- '</div>');
+ $out[] = phutil_tag(
+ 'div',
+ array('class' => 'dark-console-panel-header'),
+ phutil_tag('h1', array(), pht('Event Log')));
$rows = array();
foreach ($data['events'] as $event) {
diff --git a/src/aphront/console/plugin/DarkConsoleServicesPlugin.php b/src/aphront/console/plugin/DarkConsoleServicesPlugin.php
--- a/src/aphront/console/plugin/DarkConsoleServicesPlugin.php
+++ b/src/aphront/console/plugin/DarkConsoleServicesPlugin.php
@@ -149,21 +149,20 @@
$log = $data['log'];
$results = array();
- $results[] = hsprintf(
- '<div class="dark-console-panel-header">'.
- '%s'.
- '<h1>Calls to External Services</h1>'.
- '<div style="clear: both;"></div>'.
- '</div>',
- phutil_tag(
- 'a',
- array(
- 'href' => $data['analyzeURI'],
- 'class' => $data['didAnalyze']
- ? 'disabled button'
- : 'green button',
- ),
- 'Analyze Query Plans'));
+ $results[] = phutil_tag(
+ 'div',
+ array('class' => 'dark-console-panel-header'),
+ array(
+ phutil_tag(
+ 'a',
+ array(
+ 'href' => $data['analyzeURI'],
+ 'class' => $data['didAnalyze'] ? 'disabled button' : 'green button',
+ ),
+ pht('Analyze Query Plans')),
+ phutil_tag('h1', array(), pht('Calls to External Services')),
+ phutil_tag('div', array('style' => 'clear: both;')),
+ ));
$page_total = $data['end'] - $data['start'];
$totals = array();
diff --git a/src/aphront/console/plugin/DarkConsoleXHProfPlugin.php b/src/aphront/console/plugin/DarkConsoleXHProfPlugin.php
--- a/src/aphront/console/plugin/DarkConsoleXHProfPlugin.php
+++ b/src/aphront/console/plugin/DarkConsoleXHProfPlugin.php
@@ -62,38 +62,41 @@
$result = array();
- $header = hsprintf(
- '<div class="dark-console-panel-header">'.
- '%s'.
- '<h1>XHProf Profiler</h1>'.
- '</div>',
- phutil_tag(
- 'a',
- array(
- 'href' => $profile_uri,
- 'class' => $run
- ? 'disabled button'
- : 'green button',
- ),
- 'Profile Page'));
+ $header = phutil_tag(
+ 'div',
+ array('class' => 'dark-console-panel-header'),
+ array(
+ phutil_tag(
+ 'a',
+ array(
+ 'href' => $profile_uri,
+ 'class' => $run ? 'disabled button' : 'green button',
+ ),
+ pht('Profile Page')),
+ phutil_tag('h1', array(), pht('XHProf Profiler')),
+ ));
$result[] = $header;
if ($run) {
- $result[] = hsprintf(
- '<a href="/xhprof/profile/%s/" '.
- 'class="bright-link" '.
- 'style="float: right; margin: 1em 2em 0 0;'.
- 'font-weight: bold;" '.
- 'target="_blank">Profile Permalink</a>'.
- '<iframe src="/xhprof/profile/%s/?frame=true"></iframe>',
- $run,
- $run);
+ $result[] = phutil_tag(
+ 'a',
+ array(
+ 'href' => "/xhprof/profile/$run/",
+ 'class' => 'bright-link',
+ 'style' => 'float: right; margin: 1em 2em 0 0; font-weight: bold;',
+ 'target' => '_blank',
+ ),
+ pht('Profile Permalink'));
+ $result = phutil_tag(
+ 'iframe',
+ array('src' => "/xhprof/profile/$run/?frame=true"));
} else {
- $result[] = hsprintf(
- '<div class="dark-console-no-content">'.
+ $result[] = phutil_tag(
+ 'div',
+ array('class' => 'dark-console-no-content'),
+ pht(
'Profiling was not enabled for this page. Use the button above '.
- 'to enable it.'.
- '</div>');
+ 'to enable it.'));
}
return phutil_implode_html("\n", $result);
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/m4/ls/cczmmntjyj7zzbib
Default Alt Text
D7533.diff (6 KB)
Attached To
Mode
D7533: Replace some hsprintf() with phutil_tag()
Attached
Detach File
Event Timeline
Log In to Comment