@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add `ui.footer-items` to add a custom page footer

Summary: Fixes T6052. Allow installs to link to legal documents, etc., in the page footer.

Test Plan:
- Configured a footer.
- Viewed workboards (no footer).
- Viewed Conpherence (no apparent disruption, I think everything z-indexes over the footer).
- Viewed stuff on mobile (seems OK).
- Viewed login page (saw footer).

{F201718}

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T6052

Differential Revision: https://secure.phabricator.com/D10466

+118 -20
+3 -3
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'core.pkg.css' => '974635bb', 10 + 'core.pkg.css' => 'f4235a32', 11 11 'core.pkg.js' => 'cbdbd552', 12 12 'darkconsole.pkg.js' => 'df001cab', 13 13 'differential.pkg.css' => '36884139', ··· 39 39 'rsrc/css/application/base/main-menu-view.css' => 'aceca0e9', 40 40 'rsrc/css/application/base/notification-menu.css' => '6aa0a74b', 41 41 'rsrc/css/application/base/phabricator-application-launch-view.css' => '8b7e271d', 42 - 'rsrc/css/application/base/standard-page-view.css' => '517cdfb1', 42 + 'rsrc/css/application/base/standard-page-view.css' => 'dd860661', 43 43 'rsrc/css/application/chatlog/chatlog.css' => '852140ff', 44 44 'rsrc/css/application/config/config-options.css' => '7fedf08b', 45 45 'rsrc/css/application/config/config-template.css' => '25d446d6', ··· 739 739 'phabricator-side-menu-view-css' => 'a2ccd7bd', 740 740 'phabricator-slowvote-css' => '266df6a1', 741 741 'phabricator-source-code-view-css' => '7d346aa4', 742 - 'phabricator-standard-page-view' => '517cdfb1', 742 + 'phabricator-standard-page-view' => 'dd860661', 743 743 'phabricator-textareautils' => '5c93c52c', 744 744 'phabricator-title' => '5c1c758c', 745 745 'phabricator-tooltip' => '3915d490',
+1
src/applications/base/controller/PhabricatorController.php
··· 296 296 $page->setDeviceReady(true); 297 297 } 298 298 299 + $page->setShowFooter(idx($options, 'showFooter', true)); 299 300 $page->setShowChrome(idx($options, 'chrome', true)); 300 301 301 302 $application_menu = $this->buildApplicationMenu();
+32
src/applications/config/option/PhabricatorUIConfigOptions.php
··· 20 20 $options[$key] = $key; 21 21 } 22 22 23 + $example = <<<EOJSON 24 + [ 25 + { 26 + "name" : "Copyright 2199 Examplecorp" 27 + }, 28 + { 29 + "name" : "Privacy Policy", 30 + "href" : "http://www.example.org/privacy/" 31 + }, 32 + { 33 + "name" : "Terms and Conditions", 34 + "href" : "http://www.example.org/terms/" 35 + } 36 + ] 37 + EOJSON; 38 + 23 39 return array( 24 40 $this->newOption('ui.header-color', 'enum', 'dark') 25 41 ->setDescription( 26 42 pht( 27 43 'Sets the color of the main header.')) 28 44 ->setEnumOptions($options), 45 + $this->newOption('ui.footer-items', 'list<wild>', array()) 46 + ->setSummary( 47 + pht( 48 + 'Allows you to add footer links on most pages.')) 49 + ->setDescription( 50 + pht( 51 + "Allows you to add a footer with links in it to most ". 52 + "pages. You might want to use these links to point at legal ". 53 + "information or an about page.\n\n". 54 + "Specify a list of dictionaries. Each dictionary describes ". 55 + "a footer item. These keys are supported:\n\n". 56 + " - `name` The name of the item.\n". 57 + " - `href` Optionally, the link target of the item. You can ". 58 + " omit this if you just want a piece of text, like a copyright ". 59 + " notice.")) 60 + ->addExample($example, pht('Basic Example')), 29 61 ); 30 62 } 31 63
+1
src/applications/project/controller/PhabricatorProjectBoardViewController.php
··· 326 326 ), 327 327 array( 328 328 'title' => pht('%s Board', $project->getName()), 329 + 'showFooter' => false, 329 330 )); 330 331 } 331 332
+73 -17
src/view/page/PhabricatorStandardPageView.php
··· 15 15 private $disableConsole; 16 16 private $pageObjects = array(); 17 17 private $applicationMenu; 18 + private $showFooter = true; 19 + 20 + public function setShowFooter($show_footer) { 21 + $this->showFooter = $show_footer; 22 + return $this; 23 + } 24 + 25 + public function getShowFooter() { 26 + return $this->showFooter; 27 + } 18 28 19 29 public function setApplicationMenu(PHUIListView $application_menu) { 20 30 $this->applicationMenu = $application_menu; ··· 329 339 } 330 340 } 331 341 332 - return 333 - phutil_tag( 334 - 'div', 335 - array( 336 - 'id' => 'base-page', 337 - 'class' => 'phabricator-standard-page', 338 - ), 339 - array( 340 - $developer_warning, 341 - $setup_warning, 342 - $header_chrome, 343 - phutil_tag_div('phabricator-standard-page-body', array( 344 - ($console ? hsprintf('<darkconsole />') : null), 345 - parent::getBody(), 346 - phutil_tag('div', array('style' => 'clear: both;')), 347 - )), 348 - )); 342 + return phutil_tag( 343 + 'div', 344 + array( 345 + 'id' => 'base-page', 346 + 'class' => 'phabricator-standard-page', 347 + ), 348 + array( 349 + $developer_warning, 350 + $setup_warning, 351 + $header_chrome, 352 + phutil_tag_div('phabricator-standard-page-body', array( 353 + ($console ? hsprintf('<darkconsole />') : null), 354 + parent::getBody(), 355 + phutil_tag('div', array('style' => 'clear: both;')), 356 + $this->renderFooter(), 357 + )), 358 + )); 349 359 } 350 360 351 361 protected function getTail() { ··· 455 465 return null; 456 466 } 457 467 return $this->getRequest()->getApplicationConfiguration()->getConsole(); 468 + } 469 + 470 + private function renderFooter() { 471 + if (!$this->getShowChrome()) { 472 + return null; 473 + } 474 + 475 + if (!$this->getShowFooter()) { 476 + return null; 477 + } 478 + 479 + $items = PhabricatorEnv::getEnvConfig('ui.footer-items'); 480 + if (!$items) { 481 + return null; 482 + } 483 + 484 + $foot = array(); 485 + foreach ($items as $item) { 486 + $name = idx($item, 'name', pht('Unnamed Footer Item')); 487 + 488 + $href = idx($item, 'href'); 489 + if (!PhabricatorEnv::isValidWebResource($href)) { 490 + $href = null; 491 + } 492 + 493 + if ($href !== null) { 494 + $tag = 'a'; 495 + } else { 496 + $tag = 'span'; 497 + } 498 + 499 + $foot[] = phutil_tag( 500 + $tag, 501 + array( 502 + 'href' => $href, 503 + ), 504 + $name); 505 + } 506 + $foot = phutil_implode_html(" \xC2\xB7 ", $foot); 507 + 508 + return phutil_tag( 509 + 'div', 510 + array( 511 + 'class' => 'phabricator-standard-page-footer', 512 + ), 513 + $foot); 458 514 } 459 515 460 516 }
+8
webroot/rsrc/css/application/base/standard-page-view.css
··· 13 13 border-width: 0px; 14 14 } 15 15 16 + .phabricator-standard-page-footer { 17 + text-align: right; 18 + margin: 0 16px; 19 + padding: 8px 0; 20 + border-top: 1px solid {$lightgreyborder}; 21 + color: {$lightgreytext}; 22 + } 23 + 16 24 .keyboard-shortcut-help td, 17 25 .keyboard-shortcut-help th { 18 26 padding: 8px;