Guest User

Untitled

a guest
Jul 27th, 2015
310
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. protected function getHead() {
  2. $monospaced = PhabricatorEnv::getEnvConfig('style.monospace');
  3. $monospaced_win = PhabricatorEnv::getEnvConfig('style.monospace.windows');
  4.  
  5. $request = $this->getRequest();
  6. if ($request) {
  7. $user = $request->getUser();
  8. if ($user) {
  9. $pref = $user->loadPreferences()->getPreference(
  10. PhabricatorUserPreferences::PREFERENCE_MONOSPACED);
  11. $monospaced = nonempty($pref, $monospaced);
  12. $monospaced_win = nonempty($pref, $monospaced_win);
  13. }
  14. }
  15.  
  16. $response = CelerityAPI::getStaticResourceResponse();
  17.  
  18. return hsprintf(
  19. '%s<style type="text/css">'.
  20. '.PhabricatorMonospaced, '.
  21. '.phabricator-remarkup .remarkup-code-block '.
  22. '.remarkup-code { font: %s; } '.
  23. '.platform-windows .PhabricatorMonospaced, '.
  24. '.platform-windows .phabricator-remarkup '.
  25. '.remarkup-code-block .remarkup-code { font: %s; }'.
  26. '</style>%s'.
  27. '<!-- Piwik -->'.
  28. '<script type="text/javascript">'.
  29. 'var _paq = _paq || [];'.
  30. '_paq.push([\'trackPageView\']);'.
  31. '_paq.push([\'enableLinkTracking\']);'.
  32. '(function() {'.
  33. 'var u="//piwik-URL";'.
  34. '_paq.push([\'setTrackerUrl\', u+\'piwik.php\']);'.
  35. '_paq.push([\'setSiteId\', YOURSITEID]);'.
  36. 'var d=document, g=d.createElement(\'script\'), s=d.getElementsByTagName(\'script\')[0];'.
  37. 'g.type=\'text/javascript\'; g.async=true; g.defer=true; g.src=u+\'piwik.js\'; s.parentNode.insertBefore(g,s);'.
  38. '})();'.
  39. '</script>'.
  40. '<noscript><p><img src="//piwik-URL" style="border:0;" alt="" /></p></noscript>'.
  41. '<!-- End Piwik Code -->',
  42. parent::getHead(),
  43. phutil_safe_html($monospaced),
  44. phutil_safe_html($monospaced_win),
  45. $response->renderSingleResource('javelin-magical-init', 'phabricator'));
  46. }
RAW Paste Data