X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles_versions%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=blobdiff_plain;f=includes%2FEditPage.php;h=a1d9ae82d5816b094adffa1f9123387cb572d5b3;hb=c23c2b1c53824311bed3987d07bc0653aee6450e;hp=27671bcebf43e9cd18d57a7a695f32cae6a5b371;hpb=c35b81bda40abd7f8a1bb022f9d4a2ae9b3e7afb;p=lhc%2Fweb%2Fwiklou.git
diff --git a/includes/EditPage.php b/includes/EditPage.php
index 27671bcebf..a1d9ae82d5 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -2473,9 +2473,11 @@ ERROR;
if ( $namespace == NS_MEDIAWIKI ) {
# Show a warning if editing an interface message
$out->wrapWikiMsg( "
\n$1\n
", 'editinginterface' );
- # If this is a default message (but not css or js),
+ # If this is a default message (but not css, json, or js),
# show a hint that it is translatable on translatewiki.net
- if ( !$this->mTitle->hasContentModel( CONTENT_MODEL_CSS )
+ if (
+ !$this->mTitle->hasContentModel( CONTENT_MODEL_CSS )
+ && !$this->mTitle->hasContentModel( CONTENT_MODEL_JSON )
&& !$this->mTitle->hasContentModel( CONTENT_MODEL_JAVASCRIPT )
) {
$defaultMessageText = $this->mTitle->getDefaultMessageText();
@@ -3095,10 +3097,12 @@ ERROR;
}
if ( $this->getTitle()->isSubpageOf( $user->getUserPage() ) ) {
$isUserCssConfig = $this->mTitle->isUserCssConfigPage();
+ $isUserJsonConfig = $this->mTitle->isUserJsonConfigPage();
+ $isUserJsConfig = $this->mTitle->isUserJsConfigPage();
$warning = $isUserCssConfig
? 'usercssispublic'
- : 'userjsispublic';
+ : ( $isUserJsonConfig ? 'userjsonispublic' : 'userjsispublic' );
$out->wrapWikiMsg( '$1
', $warning );
@@ -3109,9 +3113,12 @@ ERROR;
"\n$1\n
",
[ 'usercssyoucanpreview' ]
);
- }
-
- if ( $this->mTitle->isJsSubpage() && $config->get( 'AllowUserJs' ) ) {
+ } elseif ( $isUserJsonConfig /* No comparable 'AllowUserJson' */ ) {
+ $out->wrapWikiMsg(
+ "\n$1\n
",
+ [ 'userjsonyoucanpreview' ]
+ );
+ } elseif ( $isUserJsConfig && $config->get( 'AllowUserJs' ) ) {
$out->wrapWikiMsg(
"\n$1\n
",
[ 'userjsyoucanpreview' ]
@@ -3848,6 +3855,11 @@ ERROR;
if ( $level === 'user' && !$config->get( 'AllowUserCss' ) ) {
$format = false;
}
+ } elseif ( $content->getModel() == CONTENT_MODEL_JSON ) {
+ $format = 'json';
+ if ( $level === 'user' /* No comparable 'AllowUserJson' */ ) {
+ $format = false;
+ }
} elseif ( $content->getModel() == CONTENT_MODEL_JAVASCRIPT ) {
$format = 'js';
if ( $level === 'user' && !$config->get( 'AllowUserJs' ) ) {
@@ -3858,7 +3870,8 @@ ERROR;
}
# Used messages to make sure grep find them:
- # Messages: usercsspreview, userjspreview, sitecsspreview, sitejspreview
+ # Messages: usercsspreview, userjsonpreview, userjspreview,
+ # sitecsspreview, sitejsonpreview, sitejspreview
if ( $level && $format ) {
$note = "" .
$this->context->msg( "{$level}{$format}preview" )->text() .