Robert Vogel has submitted this change and it was merged.
Change subject: Blog: Thumb float direction (backport)
......................................................................
Blog: Thumb float direction (backport)
* Added option Tumb float direction to admin settings an blog tag
* 170019
Change-Id: Ie7f73bdaa8e318a6cc640a53fd59605d92975efd
---
M Blog/Blog.class.php
M Blog/languages/Blog.i18n.php
2 files changed, 22 insertions(+), 1 deletion(-)
Approvals:
Robert Vogel: Verified; Looks good to me, approved
Tweichart: Checked; Looks good to me, but someone else must approve
diff --git a/Blog/Blog.class.php b/Blog/Blog.class.php
index fc89264..4a25acd 100644
--- a/Blog/Blog.class.php
+++ b/Blog/Blog.class.php
@@ -132,6 +132,9 @@
// Defines how images should be rendered. Possible values:
full|thumb|none
//BsConfig::registerVar('MW::Blog::ImageRenderMode', 'thumb',
BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_STRING, $this->mI18N);
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,
'bs-blog-pref-ShowTagFormWhenNotLoggedIn', 'toggle');
global $wgServer, $wgScriptPath;
@@ -174,6 +177,15 @@
'thumb' => 'thumb',
'full' => 'full',
'none' => 'none'
+ )
+ );
+ break;
+ case 'ThumbFloatDirection':
+ $aPrefs = array(
+ 'options' => array(
+ 'left' => 'left',
+ 'right' => 'right',
+ 'none' => 'none'
)
);
break;
@@ -333,6 +345,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
@@ -347,6 +360,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 );
@@ -372,6 +386,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() ) );
}
@@ -492,7 +511,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/languages/Blog.i18n.php b/Blog/languages/Blog.i18n.php
index ac4cffa..59ba02c 100644
--- a/Blog/languages/Blog.i18n.php
+++ b/Blog/languages/Blog.i18n.php
@@ -42,6 +42,7 @@
'bs-blog-pref-ShowTrackback' => 'Shoe <i>Trackback</i>
link (feature not activated)',
'bs-blog-pref-SortBy' => 'Sort by',
'bs-blog-pref-ImageRenderMode' => 'Display pictures',
+ 'bs-blog-pref-imagefloatdirection' => 'Text flow: Image
position',
'bs-blog-pref-MaxEntryCharacters' => 'Number of displayed
words',
'bs-blog-pref-ShowTagFormWhenNotLoggedIn' => 'Show insert form also for
not registed users',
'bs-blog-tag-blog-desc' => 'This tag provides you the
opportunity to display blog entry on every page.'
@@ -74,6 +75,7 @@
'bs-blog-pref-ShowTrackback' => 'Link <i>Trackback</i>
anzeigen (ist momentan deaktiviert)',
'bs-blog-pref-SortBy' => 'Sortierung',
'bs-blog-pref-ImageRenderMode' => 'Bilder anzeigen',
+ 'bs-blog-pref-imagefloatdirection' => 'Textumfluss:
Bildposition',
'bs-blog-pref-MaxEntryCharacters' => 'Anzahl darzustellender
Wörter ',
'bs-blog-pref-ShowTagFormWhenNotLoggedIn' => 'Erstellformular auch für
nicht angemeldete Benutzer anzeigen',
'bs-blog-tag-blog-desc' => 'Dieser Tag stellt die
Funktionalität bereit, auf jeder Seite sich Blog Einträge anzeigen zulassen.'
--
To view, visit https://gerrit.wikimedia.org/r/184582
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie7f73bdaa8e318a6cc640a53fd59605d92975efd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_22
Gerrit-Owner: Pwirth <[email protected]>
Gerrit-Reviewer: Mglaser <[email protected]>
Gerrit-Reviewer: Pigpen <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: Tweichart <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits