Pwirth has uploaded a new change for review.
https://gerrit.wikimedia.org/r/170019
Change subject: Blog: Thumb float direction
......................................................................
Blog: Thumb float direction
* Added option Tumb float direction to admin settings an blog tag
Change-Id: I90fe09dae10a3920385320847b5ecf2ef83814c5
---
M Blog/Blog.class.php
M Blog/i18n/de.json
M Blog/i18n/en.json
M Blog/i18n/qqq.json
4 files changed, 23 insertions(+), 1 deletion(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions
refs/changes/19/170019/1
diff --git a/Blog/Blog.class.php b/Blog/Blog.class.php
index 9a2a2ce..3c22613 100644
--- a/Blog/Blog.class.php
+++ b/Blog/Blog.class.php
@@ -103,6 +103,9 @@
BsConfig::registerVar( 'MW::Blog::MaxEntryCharacters', 1000,
BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_INT, 'bs-blog-pref-maxentrycharacters',
'int' );
// Defines how images should be rendered. Possible values:
full|thumb|none
BsConfig::registerVar( 'MW::Blog::ImageRenderMode', 'thumb',
BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_STRING|BsConfig::USE_PLUGIN_FOR_PREFS,
'bs-blog-pref-imagerendermode', 'select' );
+ // Defines float direction of images when ImageRenderMode is
thumb. Possible values: left|right|none
+ BsConfig::registerVar( 'MW::Blog::ThumbFloatDirection',
'right',
BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_STRING|BsConfig::USE_PLUGIN_FOR_PREFS,
'bs-blog-pref-imagefloatdirection', 'select' );
+
BsConfig::registerVar( 'MW::Blog::ShowTagFormWhenNotLoggedIn',
false, BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_BOOL, 'toggle' );
wfProfileOut( 'BS::'.__METHOD__ );
@@ -161,6 +164,15 @@
'options' => array(
'thumb' => 'thumb',
'full' => 'full',
+ 'none' => 'none'
+ )
+ );
+ break;
+ case 'ThumbFloatDirection':
+ $aPrefs = array(
+ 'options' => array(
+ 'left' => 'left',
+ 'right' => 'right',
'none' => 'none'
)
);
@@ -320,6 +332,7 @@
$bShowNewEntryField = BsConfig::get(
'MW::Blog::ShowNewEntryField' );
$bNewEntryFieldPosition = BsConfig::get(
'MW::Blog::NewEntryFieldPosition' );
$sImageRenderMode = BsConfig::get(
'MW::Blog::ImageRenderMode' );
+ $sImageFloatDirection = BsConfig::get(
'MW::Blog::ThumbFloatDirection' );
$iMaxEntryCharacters = BsConfig::get(
'MW::Blog::MaxEntryCharacters' );
// Trackbacks are not supported the way we intend it to be.
From http://www.mediawiki.org/wiki/Manual:$wgUseTrackbacks
@@ -334,6 +347,7 @@
$argsBNewEntryField = BsCore::sanitizeArrayEntry(
$args, 'newentryfield', $bShowNewEntryField, BsPARAMTYPE::BOOL );
$argsSNewEntryFieldPosition = BsCore::sanitizeArrayEntry(
$args, 'newentryfieldposition', $bNewEntryFieldPosition, BsPARAMTYPE::STRING );
$argsSImageRenderMode = BsCore::sanitizeArrayEntry(
$args, 'imagerendermode', $sImageRenderMode, BsPARAMTYPE::STRING );
+ $argsSImageFloatDirection = BsCore::sanitizeArrayEntry(
$args, 'imagefloatdirection', $sImageFloatDirection, BsPARAMTYPE::STRING );
$argsIMaxEntryCharacters = BsCore::sanitizeArrayEntry(
$args, 'maxchars', $iMaxEntryCharacters, BsPARAMTYPE::INT );
$argsSSortBy = BsCore::sanitizeArrayEntry(
$args, 'sort', $sSortBy, BsPARAMTYPE::STRING );
$argsBShowInfo = BsCore::sanitizeArrayEntry(
$args, 'showinfo', $bShowInfo, BsPARAMTYPE::BOOL );
@@ -359,6 +373,11 @@
}
$oValidationResult = BsValidator::isValid( 'SetItem',
$argsSImageRenderMode, array( 'fullResponse' => true, 'setname' =>
'imagerendermode', 'set' => array( 'full', 'thumb', 'none' ) ) );
+ if ( $oValidationResult->getErrorCode() ) {
+ $oErrorListView->addItem( new ViewTagError(
$oValidationResult->getI18N() ) );
+ }
+
+ $oValidationResult = BsValidator::isValid( 'SetItem',
$argsSImageFloatDirection, array( 'fullResponse' => true, 'setname' =>
'imagefloatdirection', 'set' => array( 'left', 'right', 'none' ) ) );
if ( $oValidationResult->getErrorCode() ) {
$oErrorListView->addItem( new ViewTagError(
$oValidationResult->getI18N() ) );
}
@@ -479,7 +498,7 @@
break;
case 'thumb':
default:
- $aContent = preg_replace(
'/(\[\[('.$sNamespaceRegEx.'):[^\|\]]*)(\|)?(.*?)(\]\])/',
'$1|thumb|none$3$4|150px$5', $aContent );
+ $aContent = preg_replace(
'/(\[\[('.$sNamespaceRegEx.'):[^\|\]]*)(\|)?(.*?)(\]\])/',
"$1|thumb|$argsSImageFloatDirection$3$4|150px$5", $aContent );
break;
}
diff --git a/Blog/i18n/de.json b/Blog/i18n/de.json
index 4e5cb5c..3ec420c 100644
--- a/Blog/i18n/de.json
+++ b/Blog/i18n/de.json
@@ -25,6 +25,7 @@
"bs-blog-pref-showpermalink": "Link Permalink anzeigen",
"bs-blog-pref-sortby": "Sortierung:",
"bs-blog-pref-imagerendermode": "Bilder anzeigen als:",
+ "bs-blog-pref-imagefloatdirection": "Textumfluss: Bildposition",
"bs-blog-pref-maxentrycharacters": "Anzahl darzustellender Wörter:",
"bs-blog-tag-blog-desc": "Zeigt Blog-Einträge auf jeder beliebigen
Seite an."
}
diff --git a/Blog/i18n/en.json b/Blog/i18n/en.json
index caadefc..b5a51cc 100644
--- a/Blog/i18n/en.json
+++ b/Blog/i18n/en.json
@@ -25,6 +25,7 @@
"bs-blog-pref-showpermalink": "Show permalink link",
"bs-blog-pref-sortby": "Sort by:",
"bs-blog-pref-imagerendermode": "Display pictures as:",
+ "bs-blog-pref-imagefloatdirection": "Text flow: Image position",
"bs-blog-pref-maxentrycharacters": "Number of words per entry:",
"bs-blog-tag-blog-desc": "Display blog entries on every page."
}
diff --git a/Blog/i18n/qqq.json b/Blog/i18n/qqq.json
index 152fe46..e3b228a 100644
--- a/Blog/i18n/qqq.json
+++ b/Blog/i18n/qqq.json
@@ -28,6 +28,7 @@
"bs-blog-pref-showpermalink": "Option in
[{{canonicalurl:Special:WikiAdmin|mode=Preferences}}
Special:WikiAdmin?mode=Preferences], checkbox label for show permalink link",
"bs-blog-pref-sortby": "Option in
[{{canonicalurl:Special:WikiAdmin|mode=Preferences}}
Special:WikiAdmin?mode=Preferences].\n\nUsed as label for the select box having
the following items (hard-coded):\n* creation\n* title\n{{Identical|Sort by}}",
"bs-blog-pref-imagerendermode": "Option in
[{{canonicalurl:Special:WikiAdmin|mode=Preferences}}
Special:WikiAdmin?mode=Preferences].\n\nUsed as label for the select box having
the following items (hard-coded):\n* thumb\n* full\n* none",
+ "bs-blog-pref-imagefloatdirection": "Option in
[{{canonicalurl:Special:WikiAdmin|mode=Preferences}}
Special:WikiAdmin?mode=Preferences].\n\nUsed as label for the select box having
the following items (hard-coded):\n* left\n* right\n* none",
"bs-blog-pref-maxentrycharacters": "Option in
[{{canonicalurl:Special:WikiAdmin|mode=Preferences}}
Special:WikiAdmin?mode=Preferences], label for number of words per entry:",
"bs-blog-tag-blog-desc": "Used in InsertMagic extension, tag
description for display blog entries on every page.\n{{Related|Bs-tag-desc}}"
}
--
To view, visit https://gerrit.wikimedia.org/r/170019
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I90fe09dae10a3920385320847b5ecf2ef83814c5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Pwirth <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits