43 if ( strval( $wikitext ) !==
'' ) {
48 return $wikitext .
"\n";
59 if ( $classes === [] ) {
63 return Sanitizer::mergeAttributes(
65 [
'class' => implode(
' ', $classes ) ]
76 if ( $services->getRestrictionStore()->isProtected( $page,
'edit' ) &&
77 $services->getPermissionManager()
78 ->getNamespaceRestrictionLevels( $page->
getNamespace() ) !== [
'' ]
80 # Is the title semi-protected?
81 if ( $services->getRestrictionStore()->isSemiProtected( $page ) ) {
82 $classes[] =
'mw-textarea-sprotected';
84 # Then it must be protected based on static groups (regular)
85 $classes[] =
'mw-textarea-protected';
87 # Is the title cascade-protected?
88 if ( $services->getRestrictionStore()->isCascadeProtected( $page ) ) {
89 $classes[] =
'mw-textarea-cprotected';
106 $attribs = $customAttribs + [
121 $class =
'mw-editfont-' . $userOptionsLookup->
getOption( $user,
'editfont' );
123 if ( isset( $attribs[
'class'] ) ) {
124 if ( is_string( $attribs[
'class'] ) ) {
125 $attribs[
'class'] .=
' ' . $class;
126 } elseif ( is_array( $attribs[
'class'] ) ) {
127 $attribs[
'class'][] = $class;
130 $attribs[
'class'] = $class;
133 $title = Title::newFromPageIdentity( $page );
134 $pageLang = $title->getPageLanguage();
135 $attribs[
'lang'] = $pageLang->getHtmlCode();
136 $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.