| @@ 4713-4727 (lines=15) @@ | ||
| 4710 | // Optional notice for the entire namespace |
|
| 4711 | $editnotice_ns = 'editnotice-' . $this->getNamespace(); |
|
| 4712 | $msg = wfMessage( $editnotice_ns ); |
|
| 4713 | if ( $msg->exists() ) { |
|
| 4714 | $html = $msg->parseAsBlock(); |
|
| 4715 | // Edit notices may have complex logic, but output nothing (T91715) |
|
| 4716 | if ( trim( $html ) !== '' ) { |
|
| 4717 | $notices[$editnotice_ns] = Html::rawElement( |
|
| 4718 | 'div', |
|
| 4719 | [ 'class' => [ |
|
| 4720 | 'mw-editnotice', |
|
| 4721 | 'mw-editnotice-namespace', |
|
| 4722 | Sanitizer::escapeClass( "mw-$editnotice_ns" ) |
|
| 4723 | ] ], |
|
| 4724 | $html |
|
| 4725 | ); |
|
| 4726 | } |
|
| 4727 | } |
|
| 4728 | ||
| 4729 | if ( MWNamespace::hasSubpages( $this->getNamespace() ) ) { |
|
| 4730 | // Optional notice for page itself and any parent page |
|
| @@ 4736-4749 (lines=14) @@ | ||
| 4733 | while ( count( $parts ) > 0 ) { |
|
| 4734 | $editnotice_base .= '-' . array_shift( $parts ); |
|
| 4735 | $msg = wfMessage( $editnotice_base ); |
|
| 4736 | if ( $msg->exists() ) { |
|
| 4737 | $html = $msg->parseAsBlock(); |
|
| 4738 | if ( trim( $html ) !== '' ) { |
|
| 4739 | $notices[$editnotice_base] = Html::rawElement( |
|
| 4740 | 'div', |
|
| 4741 | [ 'class' => [ |
|
| 4742 | 'mw-editnotice', |
|
| 4743 | 'mw-editnotice-base', |
|
| 4744 | Sanitizer::escapeClass( "mw-$editnotice_base" ) |
|
| 4745 | ] ], |
|
| 4746 | $html |
|
| 4747 | ); |
|
| 4748 | } |
|
| 4749 | } |
|
| 4750 | } |
|
| 4751 | } else { |
|
| 4752 | // Even if there are no subpages in namespace, we still don't want "/" in MediaWiki message keys |
|
| @@ 4755-4768 (lines=14) @@ | ||
| 4752 | // Even if there are no subpages in namespace, we still don't want "/" in MediaWiki message keys |
|
| 4753 | $editnoticeText = $editnotice_ns . '-' . strtr( $this->getDBkey(), '/', '-' ); |
|
| 4754 | $msg = wfMessage( $editnoticeText ); |
|
| 4755 | if ( $msg->exists() ) { |
|
| 4756 | $html = $msg->parseAsBlock(); |
|
| 4757 | if ( trim( $html ) !== '' ) { |
|
| 4758 | $notices[$editnoticeText] = Html::rawElement( |
|
| 4759 | 'div', |
|
| 4760 | [ 'class' => [ |
|
| 4761 | 'mw-editnotice', |
|
| 4762 | 'mw-editnotice-page', |
|
| 4763 | Sanitizer::escapeClass( "mw-$editnoticeText" ) |
|
| 4764 | ] ], |
|
| 4765 | $html |
|
| 4766 | ); |
|
| 4767 | } |
|
| 4768 | } |
|
| 4769 | } |
|
| 4770 | ||
| 4771 | Hooks::run( 'TitleGetEditNotices', [ $this, $oldid, &$notices ] ); |
|