51 if ( strval( $wikitext ) !==
'' ) {
56 return $wikitext .
"\n";
68 if ( $classes === [] ) {
72 return Sanitizer::mergeAttributes(
74 [
'class' => implode(
' ', $classes ) ]
84 if ( $this->restrictionStore->isProtected( $page,
'edit' ) &&
85 $this->permissionManager->getNamespaceRestrictionLevels( $page->
getNamespace() ) !== [
'' ]
87 # Is the title semi-protected?
88 if ( $this->restrictionStore->isSemiProtected( $page ) ) {
89 $classes[] =
'mw-textarea-sprotected';
91 # Then it must be protected based on static groups (regular)
92 $classes[] =
'mw-textarea-protected';
94 # Is the title cascade-protected?
95 if ( $this->restrictionStore->isCascadeProtected( $page ) ) {
96 $classes[] =
'mw-textarea-cprotected';
113 $attribs = $customAttribs + [
124 $class =
'mw-editfont-' . $this->userOptionsLookup->getOption( $user,
'editfont' );
125 Html::addClass( $attribs[
'class'], $class );
127 $title = Title::newFromPageIdentity( $page );
128 $pageLang = $title->getPageLanguage();
129 $attribs[
'lang'] = $pageLang->getHtmlCode();
130 $attribs[
'dir'] = $pageLang->getDir();
Helps EditPage build textboxes.
buildTextboxAttribs( $name, array $customAttribs, UserIdentity $user, PageIdentity $page)
mergeClassesIntoAttributes(array $classes, array $attribs)
getTextboxProtectionCSSClasses(PageIdentity $page)
__construct(?PermissionManager $permissionManager=null, ?RestrictionStore $restrictionStore=null, ?UserOptionsLookup $userOptionsLookup=null,)
addNewLineAtEnd( $wikitext)
Interface for objects (potentially) representing an editable wiki page.