44 if ( strval( $wikitext ) !==
'' ) {
49 return $wikitext .
"\n";
61 if ( $classes === [] ) {
65 return Sanitizer::mergeAttributes(
67 [
'class' => implode(
' ', $classes ) ]
78 if ( $services->getRestrictionStore()->isProtected( $page,
'edit' ) &&
79 $services->getPermissionManager()
80 ->getNamespaceRestrictionLevels( $page->
getNamespace() ) !== [
'' ]
82 # Is the title semi-protected?
83 if ( $services->getRestrictionStore()->isSemiProtected( $page ) ) {
84 $classes[] =
'mw-textarea-sprotected';
86 # Then it must be protected based on static groups (regular)
87 $classes[] =
'mw-textarea-protected';
89 # Is the title cascade-protected?
90 if ( $services->getRestrictionStore()->isCascadeProtected( $page ) ) {
91 $classes[] =
'mw-textarea-cprotected';
108 $attribs = $customAttribs + [
120 $class =
'mw-editfont-' . $userOptionsLookup->
getOption( $user,
'editfont' );
121 Html::addClass( $attribs[
'class'], $class );
123 $title = Title::newFromPageIdentity( $page );
124 $pageLang = $title->getPageLanguage();
125 $attribs[
'lang'] = $pageLang->getHtmlCode();
126 $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.