File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -442,14 +442,25 @@ function manual_setup($setup) {
442
442
$id = substr ($setup[' this' ][0 ], 0 , -4 );
443
443
$language_chooser = ' manual_language_chooser' ;
444
444
$repo = strtolower ($config[' lang' ]); // pt_BR etc.
445
+
446
+ $edit_url = " https://github.com/php/doc-{$repo}" ;
447
+ // If the documentation source information is available (generated using
448
+ // doc-base/configure.php and PhD) then try and make a source-specific URL.
449
+ if (isset ($setup[' source' ])) {
450
+ $source_lang = $setup[' source' ][' lang' ];
451
+ if ($source_lang === $repo || $source_lang === ' base' ) {
452
+ $edit_url = " https://github.com/php/doc-{$source_lang}/blob/master/{$setup['source']['path']}" ;
453
+ }
454
+ }
455
+
445
456
echo <<<PAGE_TOOLS
446
457
<div class =" page-tools" >
447
458
<div class =" change-language" >
448
459
{$language_chooser ($config[' lang' ], $config[' thispage' ])}
449
460
</div >
450
461
<div class =" edit-bug" >
451
- <a href=" https://github.com/php/doc-{$repo }" >Submit a Pull Request</a>
452
- <a href=" https://github.com/php/doc-en /issues/new?body=From%20manual%20page:%20https:%2F%2Fphp.net%2F$id%0A%0A---" >Report a Bug</a>
462
+ <a href=" {$edit_url }" >Submit a Pull Request</a>
463
+ <a href=" https://github.com/php/doc-{$repo} /issues/new?body=From%20manual%20page:%20https:%2F%2Fphp.net%2F$id%0A%0A---" >Report a Bug</a>
453
464
</div >
454
465
</div >
455
466
PAGE_TOOLS;
You can’t perform that action at this time.
0 commit comments