38 if ( strval( $wikitext ) !==
'' ) {
43 return $wikitext .
"\n";
56 if ( $classes === [] ) {
60 return Sanitizer::mergeAttributes(
62 [
'class' => implode(
' ', $classes ) ]
72 if ( $this->restrictionStore->isProtected( $page,
'edit' ) &&
73 $this->permissionManager->getNamespaceRestrictionLevels( $page->
getNamespace() ) !== [
'' ]
75 # Is the title semi-protected?
76 if ( $this->restrictionStore->isSemiProtected( $page ) ) {
77 $classes[] =
'mw-textarea-sprotected';
79 # Then it must be protected based on static groups (regular)
80 $classes[] =
'mw-textarea-protected';
82 # Is the title cascade-protected?
83 if ( $this->restrictionStore->isCascadeProtected( $page ) ) {
84 $classes[] =
'mw-textarea-cprotected';
101 $attribs = $customAttribs + [
112 $class =
'mw-editfont-' . $this->userOptionsLookup->getOption( $user,
'editfont' );
113 Html::addClass( $attribs[
'class'], $class );
115 $title = Title::newFromPageIdentity( $page );
116 $pageLang = $title->getPageLanguage();
117 $attribs[
'lang'] = $pageLang->getHtmlCode();
118 $attribs[
'dir'] = $pageLang->getDir();
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
Helps EditPage build textboxes.
buildTextboxAttribs( $name, array $customAttribs, UserIdentity $user, PageIdentity $page)
mergeClassesIntoAttributes(array $classes, array $attribs)
getTextboxProtectionCSSClasses(PageIdentity $page)
__construct(private readonly PermissionManager $permissionManager, private readonly RestrictionStore $restrictionStore, private readonly UserOptionsLookup $userOptionsLookup,)
addNewLineAtEnd( $wikitext)
Interface for objects (potentially) representing an editable wiki page.