45 if ( strval( $wikitext ) !==
'' ) {
62 if ( $classes === [] ) {
66 return Sanitizer::mergeAttributes(
68 [
'class' => implode(
' ', $classes ) ]
79 if ( $services->getRestrictionStore()->isProtected( $page,
'edit' ) &&
80 $services->getPermissionManager()
81 ->getNamespaceRestrictionLevels( $page->
getNamespace() ) !== [
'' ]
83 # Is the title semi-protected?
84 if ( $services->getRestrictionStore()->isSemiProtected( $page ) ) {
85 $classes[] =
'mw-textarea-sprotected';
87 # Then it must be protected based on static groups (regular)
88 $classes[] =
'mw-textarea-protected';
90 # Is the title cascade-protected?
91 if ( $services->getRestrictionStore()->isCascadeProtected( $page ) ) {
92 $classes[] =
'mw-textarea-cprotected';
109 $attribs = $customAttribs + [
124 $class =
'mw-editfont-' . $userOptionsLookup->getOption( $user,
'editfont' );
126 if ( isset( $attribs[
'class'] ) ) {
127 if ( is_string( $attribs[
'class'] ) ) {
128 $attribs[
'class'] .=
' ' . $class;
129 } elseif ( is_array( $attribs[
'class'] ) ) {
130 $attribs[
'class'][] = $class;
133 $attribs[
'class'] = $class;
136 $title = Title::castFromPageIdentity( $page );
137 $pageLang =
$title->getPageLanguage();
138 $attribs[
'lang'] = $pageLang->getHtmlCode();
139 $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)
HTML sanitizer for MediaWiki.
Represents a title within MediaWiki.
Interface for objects (potentially) representing an editable wiki page.