44 if ( strval( $wikitext ) !==
'' ) {
61 if ( $classes === [] ) {
65 return Sanitizer::mergeAttributes(
67 [
'class' => implode(
' ', $classes ) ]
77 if (
$title->isProtected(
'edit' ) &&
79 ->getNamespaceRestrictionLevels(
$title->getNamespace() ) !== [
'' ]
81 # Is the title semi-protected?
82 if (
$title->isSemiProtected() ) {
83 $classes[] =
'mw-textarea-sprotected';
85 # Then it must be protected based on static groups (regular)
86 $classes[] =
'mw-textarea-protected';
88 # Is the title cascade-protected?
89 if (
$title->isCascadeProtected() ) {
90 $classes[] =
'mw-textarea-cprotected';
105 $attribs = $customAttribs + [
122 if ( isset( $attribs[
'class'] ) ) {
123 if ( is_string( $attribs[
'class'] ) ) {
124 $attribs[
'class'] .=
' ' . $class;
125 } elseif ( is_array( $attribs[
'class'] ) ) {
126 $attribs[
'class'][] = $class;
129 $attribs[
'class'] = $class;
132 $pageLang =
$title->getPageLanguage();
133 $attribs[
'lang'] = $pageLang->getHtmlCode();
134 $attribs[
'dir'] = $pageLang->getDir();
UserOptionsLookup $userOptionsLookup
Helps EditPage build textboxes.
getTextboxProtectionCSSClasses(Title $title)
buildTextboxAttribs( $name, array $customAttribs, UserIdentity $user, Title $title)
mergeClassesIntoAttributes(array $classes, array $attribs)
addNewLineAtEnd( $wikitext)
HTML sanitizer for MediaWiki.
Represents a title within MediaWiki.