30 if ( strval( $wikitext ) !==
'' ) {
35 return $wikitext .
"\n";
47 if ( $classes === [] ) {
51 return Sanitizer::mergeAttributes(
53 [
'class' => implode(
' ', $classes ) ]
64 if ( $services->getRestrictionStore()->isProtected( $page,
'edit' ) &&
65 $services->getPermissionManager()
66 ->getNamespaceRestrictionLevels( $page->
getNamespace() ) !== [
'' ]
68 # Is the title semi-protected?
69 if ( $services->getRestrictionStore()->isSemiProtected( $page ) ) {
70 $classes[] =
'mw-textarea-sprotected';
72 # Then it must be protected based on static groups (regular)
73 $classes[] =
'mw-textarea-protected';
75 # Is the title cascade-protected?
76 if ( $services->getRestrictionStore()->isCascadeProtected( $page ) ) {
77 $classes[] =
'mw-textarea-cprotected';
94 $attribs = $customAttribs + [
106 $class =
'mw-editfont-' . $userOptionsLookup->
getOption( $user,
'editfont' );
107 Html::addClass( $attribs[
'class'], $class );
109 $title = Title::newFromPageIdentity( $page );
110 $pageLang = $title->getPageLanguage();
111 $attribs[
'lang'] = $pageLang->getHtmlCode();
112 $attribs[
'dir'] = $pageLang->getDir();
Helps EditPage build textboxes.
buildTextboxAttribs( $name, array $customAttribs, UserIdentity $user, PageIdentity $page)
mergeClassesIntoAttributes(array $classes, array $attribs)
getTextboxProtectionCSSClasses(PageIdentity $page)
addNewLineAtEnd( $wikitext)
Interface for objects (potentially) representing an editable wiki page.