File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 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) {
442442 $id = substr ($setup[' this' ][0 ], 0 , -4 );
443443 $language_chooser = ' manual_language_chooser' ;
444444 $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+
445456 echo <<<PAGE_TOOLS
446457 <div class =" page-tools" >
447458 <div class =" change-language" >
448459 {$language_chooser ($config[' lang' ], $config[' thispage' ])}
449460 </div>
450461 <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>
453464 </div>
454465 </div>
455466PAGE_TOOLS;
You can’t perform that action at this time.
0 commit comments