[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAvatars[master]: BSAvatars: Added hookhandler for user prop migration "MW::Us...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/406027 ) Change subject: BSAvatars: Added hookhandler for user prop migration "MW::UserImage" .. BSAvatars: Added hookhandler for user prop migration "MW::UserImage" * "MW::UserImage" => "bs-avatars-profileimage" => Requires: I5104dd6919cc7dea402bb7328122f5843a5841b6 Change-Id: I0bb6c15d915577e6dcfbc4e5fcb5b4c1e2c55f66 --- M extension.json A src/Hook/BSMigrateUserPropertiesFromDeviatingNames/MigrateUserImage.php 2 files changed, 20 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceAvatars refs/changes/27/406027/2 diff --git a/extension.json b/extension.json index 15065a3..b3042ed 100644 --- a/extension.json +++ b/extension.json @@ -85,7 +85,8 @@ "BeforePageDisplay": "\\BlueSpice\\Avatars\\Hook\\BeforePageDisplay\\AddModules::callback", "GetPreferences": "\\BlueSpice\\Avatars\\Hook\\GetPreferences\\AddProfileImage::callback", "PageHistoryLineEnding": "\\BlueSpice\\Avatars\\Hook\\PageHistoryLineEnding\\AddProfileImage::callback", - "UnitTestsList": "Avatars::onUnitTestsList" + "UnitTestsList": "Avatars::onUnitTestsList", + "BSMigrateUserPropertiesFromDeviatingNames": "\\BlueSpice\\Avatars\\Hook\\BSMigrateUserPropertiesFromDeviatingNames\\MigrateUserImage::callback" }, "load_composer_autoloader": true, "manifest_version": 2 diff --git a/src/Hook/BSMigrateUserPropertiesFromDeviatingNames/MigrateUserImage.php b/src/Hook/BSMigrateUserPropertiesFromDeviatingNames/MigrateUserImage.php new file mode 100644 index 000..1836f18 --- /dev/null +++ b/src/Hook/BSMigrateUserPropertiesFromDeviatingNames/MigrateUserImage.php @@ -0,0 +1,18 @@ +oldName !== "MW::UserImage" ) { + return true; + } + return false; + } + + protected function doProcess() { + $this->newName = "bs-avatars-profileimage"; + return true; + } +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/406027 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0bb6c15d915577e6dcfbc4e5fcb5b4c1e2c55f66 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/BlueSpiceAvatars Gerrit-Branch: master Gerrit-Owner: PwirthGerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Added user properties migration maintenance sc...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/406026 ) Change subject: BSFoundation: Added user properties migration maintenance script .. BSFoundation: Added user properties migration maintenance script * also added missing hook base class BSMigrateSettingsFromDeviatingNames Change-Id: I5104dd6919cc7dea402bb7328122f5843a5841b6 --- M extension.json A maintenance/BSMigrateUserProperties.php A src/Hook/BSMigrateSettingsFromDeviatingNames.php A src/Hook/BSMigrateUserPropertiesFromDeviatingNames.php A src/Hook/LoadExtensionSchemaUpdates/AddBlueSpiceUserPropertiesMigrationMaintenanceScript.php 5 files changed, 286 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/26/406026/2 diff --git a/extension.json b/extension.json index 75005a6..56cd02d 100644 --- a/extension.json +++ b/extension.json @@ -453,7 +453,8 @@ "MakeGlobalVariablesScript": "BsCoreHooks::onMakeGlobalVariablesScript", "LoadExtensionSchemaUpdates": [ "BsCoreHooks::onLoadExtensionSchemaUpdates", - "BlueSpice\\Hook\\LoadExtensionSchemaUpdates\\AddBlueSpice3SettingsAndMigrationMaintenanceScript::callback" + "BlueSpice\\Hook\\LoadExtensionSchemaUpdates\\AddBlueSpice3SettingsAndMigrationMaintenanceScript::callback", + "BlueSpice\\Hook\\LoadExtensionSchemaUpdates\\AddBlueSpiceUserPropertiesMigrationMaintenanceScript::callback" ], "ApiCheckCanExecute": "BsCoreHooks::onApiCheckCanExecute", "UserGetRights": "BsCoreHooks::onUserGetRights", @@ -665,7 +666,8 @@ "BSTemplateHelper": "includes/TemplateHelper.php", "ResourceLoaderBSTemplateModule": "includes/resourceloader/ResourceLoaderBSTemplateModule.php", "BSTasksApiSpec": "includes/utility/BSTasksApiSpec.php", - "BSMigrateSettings": "maintenance/BSMigrateSettings.php" + "BSMigrateSettings": "maintenance/BSMigrateSettings.php", + "BSMigrateUserProperties": "maintenance/BSMigrateUserProperties.php" }, "load_composer_autoloader": true, "manifest_version": 2, diff --git a/maintenance/BSMigrateUserProperties.php b/maintenance/BSMigrateUserProperties.php new file mode 100644 index 000..1704c32 --- /dev/null +++ b/maintenance/BSMigrateUserProperties.php @@ -0,0 +1,113 @@ +getDB( DB_REPLICA )->select( 'user_properties', '*' ); + foreach( $res as $row ) { + if( strpos( $row->up_property, "MW::" ) !== 0 ) { + continue; + } + if( !isset( $this->oldData[$row->up_property] ) ) { + $this->oldData[$row->up_property] = []; + } + $this->oldData[$row->up_property][$row->up_user] = $row->up_value; + } + } + + protected $newData = []; + protected function convertData() { + foreach( $this->oldData as $oldName => $values ) { + $newName = $this->makeNewName( $oldName ); + $this->newData[ $newName ] = $values; + } + } + + protected function makeNewName( $oldName ) { + if( $deviatingName = $this->fromDeviatingNames( $oldName ) ) { + return $deviatingName; + } + + //MW::SomeExtension::SomeUserProperty + $nameParts = explode( '::', $oldName ); + array_shift( $nameParts ); //MW + $newName = implode( '-', $nameParts ); + $newName = strtolower( "bs-$newName" ); + //bs-someextension-someuserproperty + + if( strlen( $newName ) > 255 ) { + throw new Exception( "Variable name '$newName' is too long!" ); + } + + return $newName; + } + + protected function fromDeviatingNames( $oldName ) { + $newName = false; + \Hooks::run( 'BSMigrateUserPropertiesFromDeviatingNames', [ + $oldName, + &$newName + ]); + return $newName; + } + + protected function saveConvertedData() { + foreach( $this->newData as $newName => $values ) { + foreach( $values as $userId => $value ) { + $row = $this->getDB( DB_REPLICA )->selectRow( + 'user_properties', + '*', + [ + 'up_property' => $newName, + 'up_user' => $userId,
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Added has method to EntityConfig to match the ...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/406018 ) Change subject: BSFoundation: Added has method to EntityConfig to match the config interface .. BSFoundation: Added has method to EntityConfig to match the config interface Change-Id: If7ac81f607402eac094db85b400de80e8d9cca08 --- M src/EntityConfig.php 1 file changed, 17 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/18/406018/2 diff --git a/src/EntityConfig.php b/src/EntityConfig.php index f7ecc0b..f9875ae 100644 --- a/src/EntityConfig.php +++ b/src/EntityConfig.php @@ -34,7 +34,7 @@ * EntityConfig class for BlueSpice * @package BlueSpiceFoundation */ -abstract class EntityConfig implements \JsonSerializable { +abstract class EntityConfig implements \JsonSerializable, \Config { protected $type = ''; @@ -112,6 +112,22 @@ } /** +* check for config methods +* @param string $method +* @return bool +*/ + public function has( $method ) { + $method = "get_$method"; + if( is_callable( array($this, $method) ) ) { + return true; + } + if( isset( $this->defaults[$method] ) ) { + return true; + } + return $this->getConfig()->has( $method ); + } + + /** * Returns a json serializable object * @return stdClass */ -- To view, visit https://gerrit.wikimedia.org/r/406018 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If7ac81f607402eac094db85b400de80e8d9cca08 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAvatars[master]: BSAvatars: Fixed user option handling and readfile path
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/405873 ) Change subject: BSAvatars: Fixed user option handling and readfile path .. BSAvatars: Fixed user option handling and readfile path Change-Id: Ifc5cb62a6943e498e7d71fb7cbea363d1b49b9cb --- M Avatars.php M includes/api/BSApiAvatarsTasks.php M resources/BS.Avatars/SettingsWindow.js M src/DynamicFileDispatcher/Image.php M src/DynamicFileDispatcher/UserProfileImage.php 5 files changed, 6 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceAvatars refs/changes/73/405873/2 diff --git a/Avatars.php b/Avatars.php index e89c609..7db8959 100644 --- a/Avatars.php +++ b/Avatars.php @@ -82,8 +82,8 @@ * @param User $oUser */ public static function unsetUserImage($oUser) { - if( $oUser->getOption( 'MW::UserImage' ) ) { - $oUser->setOption( 'MW::UserImage', false ); + if( $oUser->getOption( 'bs-avatars-profileimage' ) ) { + $oUser->setOption( 'bs-avatars-profileimage', false ); $oUser->saveSettings(); $oUser->invalidateCache(); } diff --git a/includes/api/BSApiAvatarsTasks.php b/includes/api/BSApiAvatarsTasks.php index afa244e..c382007 100644 --- a/includes/api/BSApiAvatarsTasks.php +++ b/includes/api/BSApiAvatarsTasks.php @@ -38,7 +38,6 @@ } public function task_uploadFile( $oTaskData, $aParams ) { - global $wgRequest; $oResponse = $this->makeStandardReturn(); $oUser = $this->getUser(); Avatars::unsetUserImage( $oUser ); @@ -77,7 +76,7 @@ } $oUser = $this->getUser(); - $oUser->setOption( 'MW::UserImage', $sUserImage ); + $oUser->setOption( 'bs-avatars-profileimage', $sUserImage ); $oUser->saveSettings(); $oResponse->success = true; diff --git a/resources/BS.Avatars/SettingsWindow.js b/resources/BS.Avatars/SettingsWindow.js index f0a0bfa..d1bad78 100644 --- a/resources/BS.Avatars/SettingsWindow.js +++ b/resources/BS.Avatars/SettingsWindow.js @@ -29,7 +29,7 @@ this.tfUserImage = Ext.create('Ext.form.field.Text', { name: 'uimg', blankText: mw.message('bs-avatars-userimage-help').plain(), - emptyText: mw.user.options.get('MW::UserImage'), + emptyText: mw.user.options.get( 'bs-avatars-profileimage' ), allowBlank: false, labelWidth: 150, padding: "0 5 0 0" @@ -101,7 +101,7 @@ }); }, confirmOverwrite: function(callback) { - if (mw.user.options.get('MW::UserImage')) { + if( mw.user.options.get( 'bs-avatars-profileimage' ) ) { bs.util.confirm('AMwarn2', { text: mw.message('bs-avatars-warning-text').plain(), title: mw.message('bs-avatars-warning-title').plain()}, diff --git a/src/DynamicFileDispatcher/Image.php b/src/DynamicFileDispatcher/Image.php index 25e3e41..ee02ce7 100644 --- a/src/DynamicFileDispatcher/Image.php +++ b/src/DynamicFileDispatcher/Image.php @@ -56,7 +56,7 @@ \BsFileSystemHelper::normalizePath( $path . $this->src ) ); - readfile( "/$path" ); + readfile( $path ); } public function getMimeType() { diff --git a/src/DynamicFileDispatcher/UserProfileImage.php b/src/DynamicFileDispatcher/UserProfileImage.php index 24ab5f3..c46b19e 100644 --- a/src/DynamicFileDispatcher/UserProfileImage.php +++ b/src/DynamicFileDispatcher/UserProfileImage.php @@ -4,7 +4,6 @@ use BlueSpice\Avatars\Generator; use BlueSpice\DynamicFileDispatcher\UserProfileImage as UPI; -use BlueSpice\Avatars\Config; use BlueSpice\DynamicFileDispatcher\UserProfileImage\AnonImage; class UserProfileImage extends UPI { -- To view, visit https://gerrit.wikimedia.org/r/405873 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifc5cb62a6943e498e7d71fb7cbea363d1b49b9cb Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/BlueSpiceAvatars Gerrit-Branch: master Gerrit-Owner: PwirthGerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceUserManager[master]: Fix IAdminTool return value
Pwirth has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405852 ) Change subject: Fix IAdminTool return value .. Fix IAdminTool return value Change-Id: I0600c4cd341377ac576ff79034d7a5820dc5bdff --- M src/AdminTool.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Pwirth: Verified; Looks good to me, approved diff --git a/src/AdminTool.php b/src/AdminTool.php index eea1cbd..8057229 100644 --- a/src/AdminTool.php +++ b/src/AdminTool.php @@ -28,6 +28,7 @@ } public function getDataAttributes() { + return []; } public function getPermissions() { -- To view, visit https://gerrit.wikimedia.org/r/405852 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0600c4cd341377ac576ff79034d7a5820dc5bdff Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceUserManager Gerrit-Branch: master Gerrit-Owner: Robert VogelGerrit-Reviewer: Ljonka Gerrit-Reviewer: Mglaser Gerrit-Reviewer: Pwirth Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpicePermissionManager[master]: Fix IAdminTool return value
Pwirth has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405851 ) Change subject: Fix IAdminTool return value .. Fix IAdminTool return value Change-Id: I6830e35cbf4de1847ad0c3334d44d8a9e899aab5 --- M src/AdminTool.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Pwirth: Verified; Looks good to me, approved diff --git a/src/AdminTool.php b/src/AdminTool.php index 73e8899..f9e452f 100644 --- a/src/AdminTool.php +++ b/src/AdminTool.php @@ -28,6 +28,7 @@ } public function getDataAttributes() { + return []; } public function getPermissions() { -- To view, visit https://gerrit.wikimedia.org/r/405851 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6830e35cbf4de1847ad0c3334d44d8a9e899aab5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpicePermissionManager Gerrit-Branch: master Gerrit-Owner: Robert VogelGerrit-Reviewer: Ljonka Gerrit-Reviewer: Mglaser Gerrit-Reviewer: Pwirth Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpicePageAssignments[master]: Fix IAdminTool return value
Pwirth has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405848 ) Change subject: Fix IAdminTool return value .. Fix IAdminTool return value Change-Id: I10fce59d937e0a400fa529f3aae8c1700d7a4ce3 --- M src/AdminTool.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Pwirth: Verified; Looks good to me, approved diff --git a/src/AdminTool.php b/src/AdminTool.php index d302116..3631d2d 100644 --- a/src/AdminTool.php +++ b/src/AdminTool.php @@ -28,6 +28,7 @@ } public function getDataAttributes() { + return []; } public function getPermissions() { -- To view, visit https://gerrit.wikimedia.org/r/405848 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I10fce59d937e0a400fa529f3aae8c1700d7a4ce3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpicePageAssignments Gerrit-Branch: master Gerrit-Owner: Robert VogelGerrit-Reviewer: Ljonka Gerrit-Reviewer: Mglaser Gerrit-Reviewer: Pwirth Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceNamespaceManager[master]: Fix IAdminTool return value
Pwirth has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405847 ) Change subject: Fix IAdminTool return value .. Fix IAdminTool return value Change-Id: I198d62274204d03d2d41b462a625d9334ea927c5 --- M src/AdminTool.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Pwirth: Verified; Looks good to me, approved diff --git a/src/AdminTool.php b/src/AdminTool.php index b92348e..f8665b1 100644 --- a/src/AdminTool.php +++ b/src/AdminTool.php @@ -28,6 +28,7 @@ } public function getDataAttributes() { + return []; } public function getPermissions() { -- To view, visit https://gerrit.wikimedia.org/r/405847 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I198d62274204d03d2d41b462a625d9334ea927c5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceNamespaceManager Gerrit-Branch: master Gerrit-Owner: Robert VogelGerrit-Reviewer: Ljonka Gerrit-Reviewer: Mglaser Gerrit-Reviewer: Pwirth Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceInterWikiLinks[master]: Fix IAdminTool return value
Pwirth has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405846 ) Change subject: Fix IAdminTool return value .. Fix IAdminTool return value Change-Id: I426ac93679b141c530267dabdddec5dba41592f6 --- M src/AdminTool.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Pwirth: Verified; Looks good to me, approved diff --git a/src/AdminTool.php b/src/AdminTool.php index fd27cc0..07bc2e8 100644 --- a/src/AdminTool.php +++ b/src/AdminTool.php @@ -28,6 +28,7 @@ } public function getDataAttributes() { + return []; } public function getPermissions() { -- To view, visit https://gerrit.wikimedia.org/r/405846 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I426ac93679b141c530267dabdddec5dba41592f6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceInterWikiLinks Gerrit-Branch: master Gerrit-Owner: Robert VogelGerrit-Reviewer: Ljonka Gerrit-Reviewer: Mglaser Gerrit-Reviewer: Pwirth Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAbout[master]: Fix namespace issue and IAdminTool interface return values
Pwirth has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405844 ) Change subject: Fix namespace issue and IAdminTool interface return values .. Fix namespace issue and IAdminTool interface return values Change-Id: I0843bf2dd21adae50d67f983894eb7d44e995650 --- M extension.json M src/AdminTool.php 2 files changed, 5 insertions(+), 6 deletions(-) Approvals: Pwirth: Verified; Looks good to me, approved diff --git a/extension.json b/extension.json index fa7bbd4..69e9789 100644 --- a/extension.json +++ b/extension.json @@ -18,10 +18,10 @@ "BlueSpiceAboutAlias": "includes/specials/SpecialBlueSpiceAbout.alias.php" }, "BlueSpiceFoundationAdminToolRegistry": { - "bs-bluespiceabout": "BlueSpice\\BlueSpiceAbout\\AdminTool" + "bs-bluespiceabout": "BlueSpice\\About\\AdminTool" }, "AutoloadNamespaces": { - "BlueSpice\\BlueSpiceAbout\\" : "src/" + "BlueSpice\\About\\" : "src/" }, "AutoloadClasses": { "BlueSpiceAbout": "BlueSpiceAbout.class.php", diff --git a/src/AdminTool.php b/src/AdminTool.php index 9da1641..9d4e9b0 100644 --- a/src/AdminTool.php +++ b/src/AdminTool.php @@ -1,6 +1,6 @@ https://gerrit.wikimedia.org/r/405844 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0843bf2dd21adae50d67f983894eb7d44e995650 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceAbout Gerrit-Branch: master Gerrit-Owner: Robert VogelGerrit-Reviewer: Ljonka Gerrit-Reviewer: Mglaser Gerrit-Reviewer: Pwirth Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceUserManager[master]: BSUserManager: Added missing load_composer_autoloader
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/405691 ) Change subject: BSUserManager: Added missing load_composer_autoloader .. BSUserManager: Added missing load_composer_autoloader Change-Id: Ib9d8c79ba991b3d8529ad24f3823c8a96647a18f --- M extension.json 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceUserManager refs/changes/91/405691/2 diff --git a/extension.json b/extension.json index 0f52655..d3419c1 100644 --- a/extension.json +++ b/extension.json @@ -83,5 +83,6 @@ "localBasePath": "resources", "remoteExtPath": "BlueSpiceUserManager/resources" }, + "load_composer_autoloader" : true, "manifest_version": 1 } -- To view, visit https://gerrit.wikimedia.org/r/405691 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib9d8c79ba991b3d8529ad24f3823c8a96647a18f Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/BlueSpiceUserManager Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MultiLanguageManager[master]: Added switch language support
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/399362 ) Change subject: Added switch language support .. Added switch language support Change-Id: I28a9ab75c82cefdb260d2b49c77eab79818a6cf8 --- M src/Helper.php M src/MultiLanguageTranslation.php 2 files changed, 14 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultiLanguageManager refs/changes/62/399362/2 diff --git a/src/Helper.php b/src/Helper.php index ca05836..9af559a 100644 --- a/src/Helper.php +++ b/src/Helper.php @@ -92,18 +92,24 @@ $aNew = array_filter( $oNew->getTranslations(), function( $e ) use ( $oOld ){ - if( $oOld->isTranslation( \Title::newFromID( $e->id ) ) ) { - return false; + if( !$oOld->isTranslation( \Title::newFromID( $e->id ) ) ) { + return true; } - return true; + if( !$oOld->isTranslatedLang( $e->lang ) ) { + return true; + } + return false; }); $aDeleted = array_filter( $oOld->getTranslations(), function( $e ) use ( $oNew ){ - if( $oNew->isTranslation( \Title::newFromID( $e->id ) ) ) { - return false; + if( !$oNew->isTranslation( \Title::newFromID( $e->id ) ) ) { + return true; } - return true; + if( !$oNew->isTranslatedLang( $e->lang ) ) { + return true; + } + return false; }); return [ diff --git a/src/MultiLanguageTranslation.php b/src/MultiLanguageTranslation.php index a69535e..8e97060 100644 --- a/src/MultiLanguageTranslation.php +++ b/src/MultiLanguageTranslation.php @@ -185,15 +185,9 @@ //Something unexpected! return \Status::newFatal( 'mlm-error-title-invalid' ); } - if( $oTranslation->isSourceTitle( $oTitle ) ) { + if( $this->isTranslation( $oTitle ) && !$this->isTranslatedLang( $sLang ) ) { return \Status::newFatal( - 'mlm-error-title-isalreadysource', - $oTitle->getFullText() - ); - } - if( $this->isTranslation( $oTitle ) ) { - return \Status::newFatal( - 'mlm-error-title-isalreadysource', + 'mlm-error-lang-alreadytraslated', $oTitle->getFullText() ); } -- To view, visit https://gerrit.wikimedia.org/r/399362 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I28a9ab75c82cefdb260d2b49c77eab79818a6cf8 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/MultiLanguageManager Gerrit-Branch: master Gerrit-Owner: PwirthGerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpicePageTemplates[master]: BSPageTemplates: Fixed typo
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/397555 ) Change subject: BSPageTemplates: Fixed typo .. BSPageTemplates: Fixed typo Change-Id: Ia11da86904b38e92536f6cc7101071b58e7f7a64 --- M extension.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpicePageTemplates refs/changes/55/397555/2 diff --git a/extension.json b/extension.json index 6dca795..4e5b23c 100644 --- a/extension.json +++ b/extension.json @@ -49,7 +49,7 @@ }, "config-prefix": "bsg", "config": { - "PageTemplatesExcludesNs": { + "PageTemplatesExcludeNs": { "value": [ -2, -1, 6, 7, 8, 9,10,11,14,15 ], -- To view, visit https://gerrit.wikimedia.org/r/397555 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia11da86904b38e92536f6cc7101071b58e7f7a64 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/BlueSpicePageTemplates Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAvatars[master]: Fix namespace on thrown exception
Pwirth has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/397482 ) Change subject: Fix namespace on thrown exception .. Fix namespace on thrown exception Change-Id: I7ecfd0720597831d254b03df54c6b76fcc9896f5 --- M src/Generator.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pwirth: Verified; Looks good to me, approved diff --git a/src/Generator.php b/src/Generator.php index 01dbfdb..8ceef44 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -51,7 +51,7 @@ ); break; default: - throw new MWException( + throw new \MWException( 'FATAL: Avatar generator not found!' ); } -- To view, visit https://gerrit.wikimedia.org/r/397482 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7ecfd0720597831d254b03df54c6b76fcc9896f5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceAvatars Gerrit-Branch: master Gerrit-Owner: Robert VogelGerrit-Reviewer: Ljonka Gerrit-Reviewer: Mglaser Gerrit-Reviewer: Pwirth ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: Add ExtensionRegitry and ExtensionFactory
Pwirth has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/397330 ) Change subject: Add ExtensionRegitry and ExtensionFactory .. Add ExtensionRegitry and ExtensionFactory ... to Services Change-Id: I535f2ffa03ce4631279925ddaab4c35726274cdb --- M src/Services.php 1 file changed, 16 insertions(+), 0 deletions(-) Approvals: Pwirth: Looks good to me, approved jenkins-bot: Verified diff --git a/src/Services.php b/src/Services.php index 9d6e369..5f8f51d 100644 --- a/src/Services.php +++ b/src/Services.php @@ -8,6 +8,22 @@ /** * +* @return ExtensionRegistry +*/ + public function getBSExtensionRegistry() { + return $this->getService( 'BSExtensionRegistry' ); + } + + /** +* +* @return ExtensionFactory +*/ + public function getBSExtensionFactory() { + return $this->getService( 'BSExtensionFactory' ); + } + + /** +* * @return ConfigDefinitionFactory */ public function getBSConfigDefinitionFactory() { -- To view, visit https://gerrit.wikimedia.org/r/397330 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I535f2ffa03ce4631279925ddaab4c35726274cdb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Robert VogelGerrit-Reviewer: Ljonka Gerrit-Reviewer: Mglaser Gerrit-Reviewer: Pwirth Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtendedSearch[master]: Remove &$this occurences
Pwirth has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/397268 ) Change subject: Remove &$this occurences .. Remove &$this occurences See T153505 for details. Change-Id: I1f403daeb143f34e579842bcd9e5b36fa2a0f508 --- M src/Lookup.php 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Pwirth: Verified; Looks good to me, approved diff --git a/src/Lookup.php b/src/Lookup.php index f1156de..79b08f4 100644 --- a/src/Lookup.php +++ b/src/Lookup.php @@ -342,7 +342,7 @@ */ public function setBucketTermsAggregation( $sFieldName ) { $aFieldNames = explode( '/', $sFieldName ); - $aBase = &$this; + $aBase = $this; foreach( $aFieldNames as $sFieldNamePart ) { if( !isset( $aBase['aggs'] ) ) { $aBase['aggs'] = []; @@ -368,7 +368,7 @@ public function removeBucketTermsAggregation( $sFieldName ) { $aFieldNames = explode( '/', $sFieldName ); - $aBase = &$this; + $aBase = $this; $aNode = []; $sLeafFieldName = ''; foreach( $aFieldNames as $sFieldNamePart ) { @@ -390,4 +390,4 @@ return $this; } -} \ No newline at end of file +} -- To view, visit https://gerrit.wikimedia.org/r/397268 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1f403daeb143f34e579842bcd9e5b36fa2a0f508 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtendedSearch Gerrit-Branch: master Gerrit-Owner: Robert VogelGerrit-Reviewer: Ljonka Gerrit-Reviewer: Mglaser Gerrit-Reviewer: Pwirth Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Added bsg config to BsSpecialpage base class
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/396577 ) Change subject: BSFoundation: Added bsg config to BsSpecialpage base class .. BSFoundation: Added bsg config to BsSpecialpage base class Change-Id: I36d704030ebc91dc7e18879284b8035f286c13e0 --- M includes/SpecialPage.class.php 1 file changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/77/396577/2 diff --git a/includes/SpecialPage.class.php b/includes/SpecialPage.class.php index a7495c7..b2c987a 100644 --- a/includes/SpecialPage.class.php +++ b/includes/SpecialPage.class.php @@ -36,4 +36,14 @@ protected function getGroupName() { return 'bluespice'; } -} \ No newline at end of file + + /** +* Shortcut to get main config object +* @return \Config +* @since 1.24 +*/ + public function getConfig() { + return \MediaWiki\MediaWikiServices::getInstance() + ->getConfigFactory()->makeConfig( 'bsg' ); + } +} -- To view, visit https://gerrit.wikimedia.org/r/396577 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I36d704030ebc91dc7e18879284b8035f286c13e0 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Added applied status to filter
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/396330 ) Change subject: BSFoundation: Added applied status to filter .. BSFoundation: Added applied status to filter * applied can be set by any pre-filter functionality. So the filters do not match already filtered datasets * Also fixed missing comparission in ListFilter Change-Id: I437e235f4b3ef8496769d9260122022d50bc9ce1 --- M src/Data/Filter.php M src/Data/Filter/ListValue.php 2 files changed, 29 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/30/396330/2 diff --git a/src/Data/Filter.php b/src/Data/Filter.php index ea87ceb..fb05e53 100644 --- a/src/Data/Filter.php +++ b/src/Data/Filter.php @@ -31,6 +31,12 @@ /** * +* @var boolean +*/ + protected $applied = false; + + /** +* * @param array $params */ public function __construct( $params ) { @@ -69,9 +75,19 @@ * @return boolean */ public function matches( $dataSet ) { + if( $this->applied ) { + return true; + } return $this->doesMatch( $dataSet ); } + /** +* +* @param boolean $applied +*/ + public function setAppied( $applied = true ) { + $this->applied = $applied; + } /** * diff --git a/src/Data/Filter/ListValue.php b/src/Data/Filter/ListValue.php index 00bc7ca..c01040b 100644 --- a/src/Data/Filter/ListValue.php +++ b/src/Data/Filter/ListValue.php @@ -5,6 +5,18 @@ use BlueSpice\Data\Filter; class ListValue extends Filter { + const COMPARISON_CONTAINS = 'ct'; + + /** +* +* @param array $params +*/ + public function __construct( $params ) { + if( !isset( $params[self::KEY_COMPARISON] ) ) { + $params[self::KEY_COMPARISON] = static::COMPARISON_CONTAINS; + } + parent::__construct( $params ); + } /** * Performs list filtering based on given filter of type array on a dataset @@ -27,3 +39,4 @@ return true; } } + -- To view, visit https://gerrit.wikimedia.org/r/396330 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I437e235f4b3ef8496769d9260122022d50bc9ce1 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: PwirthGerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: Reworked BsExtensionManager into registry / factory services
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/396312 ) Change subject: Reworked BsExtensionManager into registry / factory services .. Reworked BsExtensionManager into registry / factory services * Added ExtensinRegistry * Added ExtensionFactory * Removed deprecated SecureFileStore usage * Removed deprecated methods in BsExtensionManager * Marked the left over methods in BsExtensionManager as deprecated * Replaced usage of BsExtensionManager methods * Used ResouceLoader to set client configs: assets paths, version Beware, that all the workarounds for wrong BlueSpice extension registry is removed by this commit. Now it is made clear, when something is wrong Change-Id: I57ac9698b385c08e6dd087b85b0aa59697197392 --- M extension.json M includes/Core.class.php M includes/CoreHooks.php M includes/ExtensionManager.class.php M includes/ServiceWiring.php M includes/TemplateHelper.php M includes/api/BSApiFileBackendStore.php M includes/skins/BsBaseTemplate.php M includes/utility/FileSystemHelper.class.php A src/ExtensionFactory.php A src/ExtensionRegistry.php A src/Hook/ResourceLoaderGetConfigVars/AddAssetsPaths.php A src/Hook/ResourceLoaderGetConfigVars/AddVersion.php 13 files changed, 488 insertions(+), 378 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/12/396312/3 diff --git a/extension.json b/extension.json index aca2f07..bc4ed39 100644 --- a/extension.json +++ b/extension.json @@ -12,6 +12,7 @@ "BlueSpiceFoundation": { "Extensions": { "BlueSpiceFoundation": { + "extPath": "/BlueSpiceFoundation", "configDefinitions": { "Logo": "\\BlueSpice\\ConfigDefinition\\Logo::getInstance", "FileExtensions": "\\BlueSpice\\ConfigDefinition\\FileExtensions::getInstance", @@ -456,8 +457,9 @@ ], "UnitTestsList": "BsCoreHooks::onUnitTestsList", "ResourceLoaderGetConfigVars": [ - "BsExtensionManager::onResourceLoaderGetConfigVars", - "BlueSpice\\Hook\\ResourceLoaderGetConfigVars\\AddBSGConfig::callback" + "\\BlueSpice\\Hook\\ResourceLoaderGetConfigVars\\AddVersion::callback", + "\\BlueSpice\\Hook\\ResourceLoaderGetConfigVars\\AddBSGConfig::callback", + "\\BlueSpice\\Hook\\ResourceLoaderGetConfigVars\\AddAssetsPaths::callback" ] }, "config_prefix": "bsg", diff --git a/includes/Core.class.php b/includes/Core.class.php index 5ede68b..37a61ba 100644 --- a/includes/Core.class.php +++ b/includes/Core.class.php @@ -30,6 +30,7 @@ * @licensehttp://www.gnu.org/copyleft/gpl.html GNU Public License v3 * @filesource */ +use MediaWiki\MediaWikiServices; /** * The BsCore @@ -300,7 +301,10 @@ BSNotifications::init(); wfProfileIn('Performance: ' . __METHOD__ . ' - Load and initialize all Extensions'); - BsExtensionManager::initialiseExtensions( self::$oInstance ); + $factory = MediaWikiServices::getInstance()->getService( + 'BSExtensionFactory' + ); + $factory->getExtensions(); wfProfileOut('Performance: ' . __METHOD__ . ' - Load and initialize all Extensions'); global $wgHooks; diff --git a/includes/CoreHooks.php b/includes/CoreHooks.php index 0a9489b..9aea743 100644 --- a/includes/CoreHooks.php +++ b/includes/CoreHooks.php @@ -1,4 +1,6 @@ getConfigFactory()->makeConfig( 'bsg' ); @@ -112,15 +114,6 @@ $out->addJsConfigVars( 'bsImageExtensions', $aImageExtensions ); $out->addJsConfigVars( 'bsIsWindows', wfIsWindows() ); - $aExtensionConfs = BsExtensionManager::getRegisteredExtensions(); - $aAssetsPaths = array( - 'BlueSpiceFoundation' => $wgExtensionAssetsPath.'/BlueSpiceFoundation' - ); - - foreach( $aExtensionConfs as $sName => $aConf ) { - $aAssetsPaths[$sName] = $wgExtensionAssetsPath.$aConf['extPath']; - } - //provide task permission data for current user to be used in js ui elements, eg show / hide elements //get all registered api modules global $wgAPIModules; @@ -132,8 +125,6 @@ } } - //TODO: Implement as RL Module: see ResourceLoaderUserOptionsModule - $out->addJsConfigVars('bsExtensionManagerAssetsPaths', $aAssetsPaths); self::addTestSystem( $out ); return true; } @@
[MediaWiki-commits] [Gerrit] mediawiki...MultiLanguageManager[master]: Fixed possible object when expected array in client config v...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/395984 ) Change subject: Fixed possible object when expected array in client config var for mlmLanguages .. Fixed possible object when expected array in client config var for mlmLanguages Also added an id to the manager oojs window Change-Id: I596aa48d914ad5cff3292ed090d3d3d60dde821a --- M resources/ext.mlm.js M src/Hooks/BeforePageDisplay.php 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultiLanguageManager refs/changes/84/395984/2 diff --git a/resources/ext.mlm.js b/resources/ext.mlm.js index 7dca9fb..ef59c91 100644 --- a/resources/ext.mlm.js +++ b/resources/ext.mlm.js @@ -67,7 +67,7 @@ mw.mlm.dialog.prototype.initialize = function () { mw.mlm.dialog.super.prototype.initialize.call( this ); - this.panel = new OO.ui.PanelLayout( { padded: true, expanded: false } ); + this.panel = new OO.ui.PanelLayout( { padded: true, expanded: false, id: 'mlm-manager' } ); this.content = new OO.ui.FieldsetLayout(); this.errorSection = new OO.ui.Layout(); this.errorSection.$element.css( 'color', 'red' ); diff --git a/src/Hooks/BeforePageDisplay.php b/src/Hooks/BeforePageDisplay.php index 1f78a04..e59f1c2 100644 --- a/src/Hooks/BeforePageDisplay.php +++ b/src/Hooks/BeforePageDisplay.php @@ -45,7 +45,7 @@ $availableLanguages = Helper::getAvailableLanguageCodes(); $this->oOutputPage->addJsConfigVars( 'mlmLanguages', - $availableLanguages + array_values( $availableLanguages ) ); $sysLang = Helper::getSystemLanguageCode(); -- To view, visit https://gerrit.wikimedia.org/r/395984 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I596aa48d914ad5cff3292ed090d3d3d60dde821a Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/MultiLanguageManager Gerrit-Branch: master Gerrit-Owner: PwirthGerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[REL1_27_dev]: PageContentProvider: Add additional wrapper classes
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/395959 ) Change subject: PageContentProvider: Add additional wrapper classes .. PageContentProvider: Add additional wrapper classes Allows better CSS styling in PDF Export. This is required for ERM8101. NEEDS CHERRY-PICK TO REL1_27 AND REL1_27_dev Change-Id: I50614d7fde1a17391baac1330287e9e5ebaed791 --- M includes/utility/PageContentProvider.class.php 1 file changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/59/395959/1 diff --git a/includes/utility/PageContentProvider.class.php b/includes/utility/PageContentProvider.class.php index d2d3ff3..f8951c6 100644 --- a/includes/utility/PageContentProvider.class.php +++ b/includes/utility/PageContentProvider.class.php @@ -26,7 +26,7 @@ //Default Template $sTemplate = array(); - $sTemplate[] = ''; + $sTemplate[] = ''; $sTemplate[] = ''; //jump-anchor $sTemplate[] = '%s'; $sTemplate[] = ''; @@ -349,6 +349,7 @@ if( $this->bEncapsulateContent ) { $sHTML = sprintf( $this->getTemplate(), + $this->getWrapperAttributes( $oTitle ), 'bs-ue-jumpmark-'. md5( $oTitle->getPrefixedText().$aParams['oldid'] ), empty( $sTitle ) ? $oTitle->getPrefixedText( ) : $sTitle, @@ -364,6 +365,15 @@ } /** + * @param \Title $oTitle + * @return string + */ + protected function getWrapperAttributes( $oTitle ) { + $cssClass = Sanitizer::escapeClass( 'page-'.$oTitle->getPrefixedDBKey() ); + return "class=\"bs-page-content $cssClass\""; + } + + /** * This method returns the WikiText of a Wiki page as seen in the edit view. Currently, it supports Title objects of normal Articles. * @param Title $oTitle The MediaWiki Title object from which the html output should be extracted * @param Array $aParams Contains processing information, like the requested revision id (oldid) and wether to follow redirects or not. -- To view, visit https://gerrit.wikimedia.org/r/395959 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I50614d7fde1a17391baac1330287e9e5ebaed791 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: REL1_27_dev Gerrit-Owner: PwirthGerrit-Reviewer: Robert Vogel ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[REL1_27]: PageContentProvider: Add additional wrapper classes
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/395960 ) Change subject: PageContentProvider: Add additional wrapper classes .. PageContentProvider: Add additional wrapper classes Allows better CSS styling in PDF Export. This is required for ERM8101. NEEDS CHERRY-PICK TO REL1_27 AND REL1_27_dev Change-Id: I50614d7fde1a17391baac1330287e9e5ebaed791 --- M includes/utility/PageContentProvider.class.php 1 file changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/60/395960/1 diff --git a/includes/utility/PageContentProvider.class.php b/includes/utility/PageContentProvider.class.php index d2d3ff3..f8951c6 100644 --- a/includes/utility/PageContentProvider.class.php +++ b/includes/utility/PageContentProvider.class.php @@ -26,7 +26,7 @@ //Default Template $sTemplate = array(); - $sTemplate[] = ''; + $sTemplate[] = ''; $sTemplate[] = ''; //jump-anchor $sTemplate[] = '%s'; $sTemplate[] = ''; @@ -349,6 +349,7 @@ if( $this->bEncapsulateContent ) { $sHTML = sprintf( $this->getTemplate(), + $this->getWrapperAttributes( $oTitle ), 'bs-ue-jumpmark-'. md5( $oTitle->getPrefixedText().$aParams['oldid'] ), empty( $sTitle ) ? $oTitle->getPrefixedText( ) : $sTitle, @@ -364,6 +365,15 @@ } /** + * @param \Title $oTitle + * @return string + */ + protected function getWrapperAttributes( $oTitle ) { + $cssClass = Sanitizer::escapeClass( 'page-'.$oTitle->getPrefixedDBKey() ); + return "class=\"bs-page-content $cssClass\""; + } + + /** * This method returns the WikiText of a Wiki page as seen in the edit view. Currently, it supports Title objects of normal Articles. * @param Title $oTitle The MediaWiki Title object from which the html output should be extracted * @param Array $aParams Contains processing information, like the requested revision id (oldid) and wether to follow redirects or not. -- To view, visit https://gerrit.wikimedia.org/r/395960 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I50614d7fde1a17391baac1330287e9e5ebaed791 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: REL1_27 Gerrit-Owner: PwirthGerrit-Reviewer: Robert Vogel ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: Fixed usage of removed isStored method
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/395004 ) Change subject: Fixed usage of removed isStored method .. Fixed usage of removed isStored method Change-Id: If934b233d259ca3175f0f26f5dc83210803dab98 --- M src/ConfigDefinition.php 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/04/395004/1 diff --git a/src/ConfigDefinition.php b/src/ConfigDefinition.php index 7d79ddc..161a3fa 100644 --- a/src/ConfigDefinition.php +++ b/src/ConfigDefinition.php @@ -105,8 +105,7 @@ 'fieldname' => $this->getName(), 'default' => $this->getValue(), 'id' => $this->makeID(), - 'label-message' => $this->getLabelMessageKey(), - 'disabled' => !$this->isStored(), + 'label-message' => $this->getLabelMessageKey() ]; } -- To view, visit https://gerrit.wikimedia.org/r/395004 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If934b233d259ca3175f0f26f5dc83210803dab98 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Added field type filter name mapping to databa...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394936 ) Change subject: BSFoundation: Added field type filter name mapping to database writer .. BSFoundation: Added field type filter name mapping to database writer Change-Id: Ia1d94d7e8e598d3ff85bb4ee049528bd9950ab1e --- M src/Data/DatabaseWriter.php 1 file changed, 24 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/36/394936/1 diff --git a/src/Data/DatabaseWriter.php b/src/Data/DatabaseWriter.php index 895a809..a29e966 100644 --- a/src/Data/DatabaseWriter.php +++ b/src/Data/DatabaseWriter.php @@ -234,13 +234,36 @@ return [ Filter::KEY_FIELD => $fieldName, Filter::KEY_VALUE => $record->get( $fieldName ), - Filter::KEY_TYPE => $this->getFieldType( $fieldName ), + Filter::KEY_TYPE => $this->getFilterTypeFromFieldMapping( $fieldName ), Filter::KEY_COMPARISON => Filter::COMPARISON_EQUALS, ]; } + /** +* Returns the field type defined in the related schema +* @param string $fieldName +* @return string +*/ protected function getFieldType( $fieldName ) { $schema = $this->getSchema(); return $schema[$fieldName][Schema::TYPE]; } + + /** +* Field types are not equal filter names. Field type 'int' would be filter +* 'numeric'. Overwrite this for special fields or when you use your own +* filters +* @param string $fieldName +* @return string +*/ + protected function getFilterTypeFromFieldMapping( $fieldName ) { + $fieldType = $this->getFieldType( $fieldName ); + if( $fieldType === FieldType::INT ) { + return 'numeric'; + } + if( $fieldType === FieldType::FLOAT ) { + return 'numeric'; + } + return $fieldType; + } } -- To view, visit https://gerrit.wikimedia.org/r/394936 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia1d94d7e8e598d3ff85bb4ee049528bd9950ab1e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: [WIP] BSFoundation: Added basic ArticlePreviewImage module
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394306 ) Change subject: [WIP] BSFoundation: Added basic ArticlePreviewImage module .. [WIP] BSFoundation: Added basic ArticlePreviewImage module Change-Id: I92b35f29d753a35907a5e949d08de7f9a6ba4f84 --- M extension.json A resources/assets/article-preview-images/dummy.png A src/DynamicFileDispatcher/ArticlePreviewImage.php A src/DynamicFileDispatcher/ArticlePreviewImage/Image.php 4 files changed, 102 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/06/394306/1 diff --git a/extension.json b/extension.json index aca2f07..e800179 100644 --- a/extension.json +++ b/extension.json @@ -21,7 +21,8 @@ } }, "DynamicFileRegistry": { - "userprofileimage": "\\BlueSpice\\DynamicFileDispatcher\\UserProfileImage" + "userprofileimage": "\\BlueSpice\\DynamicFileDispatcher\\UserProfileImage", + "articlepreviewimage": "\\BlueSpice\\DynamicFileDispatcher\\ArticlePreviewImage" }, "EntityRegistry": {} } diff --git a/resources/assets/article-preview-images/dummy.png b/resources/assets/article-preview-images/dummy.png new file mode 100644 index 000..048b952 --- /dev/null +++ b/resources/assets/article-preview-images/dummy.png Binary files differ diff --git a/src/DynamicFileDispatcher/ArticlePreviewImage.php b/src/DynamicFileDispatcher/ArticlePreviewImage.php new file mode 100644 index 000..192a6d5 --- /dev/null +++ b/src/DynamicFileDispatcher/ArticlePreviewImage.php @@ -0,0 +1,49 @@ + [ + Params::PARAM_TYPE => Params::TYPE_STRING, + Params::PARAM_DEFAULT => '', + ], + static::WIDTH => [ + Params::PARAM_TYPE => Params::TYPE_INT, + Params::PARAM_DEFAULT => 40, //TODO: config + ], + static::HEIGHT => [ + Params::PARAM_TYPE => Params::TYPE_INT, + Params::PARAM_DEFAULT => 40, //TODO: config + ], + ]); + } + + /** +* +* @param Params $params +*/ + protected function extractParams( $params ) { + parent::extractParams( $params ); + if( !\Title::newFromText( $this->params[static::TITLETEXT] ) ) { + throw new \MWException( + "Invalid titletext: {$this->params[static::TITLETEXT]}" + ); + } + } + + /** +* @return File +*/ + public function getFile() { + return new \BlueSpice\DynamicFileDispatcher\ArticlePreviewImage\Image( + $this, + \Title::newFromText( $this->params[static::TITLETEXT] ) + ); + } +} \ No newline at end of file diff --git a/src/DynamicFileDispatcher/ArticlePreviewImage/Image.php b/src/DynamicFileDispatcher/ArticlePreviewImage/Image.php new file mode 100644 index 000..ec1a763 --- /dev/null +++ b/src/DynamicFileDispatcher/ArticlePreviewImage/Image.php @@ -0,0 +1,51 @@ +title = $title; + } + + protected function getSourcePath() { + return $GLOBALS['wgExtensionDirectory'] + ."/BlueSpiceFoundation/resources/assets/article-preview-images/dummy.png"; + } + + /** +* Sets the headers for given \WebResponse +* @param \WebResponse $response +* @return void +*/ + public function setHeaders( \WebResponse $response ) { + $response->header( + 'Content-type: '.$this->getMimeType(), + true + ); + + error_log(var_export($this->getSourcePath(),1)); + $path = \BsFileSystemHelper::normalizePath( + $this->getSourcePath() + ); + + readfile( $path ); + } + + public function getMimeType() { + return 'image/png'; + } +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/394306 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I92b35f29d753a35907a5e949d08de7f9a6ba4f84 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceContextMenu[master]: BSContextMenu: Fixed missing psr-4 autoloader path
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394289 ) Change subject: BSContextMenu: Fixed missing psr-4 autoloader path .. BSContextMenu: Fixed missing psr-4 autoloader path Change-Id: I53e4a2701e542847f0474836198f202a2f930dd8 --- M composer.json 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceContextMenu refs/changes/89/394289/1 diff --git a/composer.json b/composer.json index 8852834..1d0e8a6 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,11 @@ "require": { "composer/installers": "~1.0" }, + "autoload": { + "psr-4": { + "BlueSpice\\ContextMenu\\" : "src" + } + }, "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", "jakub-onderka/php-console-highlighter": "0.3.2" -- To view, visit https://gerrit.wikimedia.org/r/394289 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I53e4a2701e542847f0474836198f202a2f930dd8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceContextMenu Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceBlog[master]: BSBlog: Fixed missing psr-4 autoloader path
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394281 ) Change subject: BSBlog: Fixed missing psr-4 autoloader path .. BSBlog: Fixed missing psr-4 autoloader path Change-Id: If2ee648ef8d398a152aee11b187196e49818eff9 --- M composer.json 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceBlog refs/changes/81/394281/1 diff --git a/composer.json b/composer.json index 7f9f698..a17f212 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,11 @@ "require": { "composer/installers": "~1.0" }, + "autoload": { + "psr-4": { + "BlueSpice\\Blog\\" : "src" + } + }, "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", "jakub-onderka/php-console-highlighter": "0.3.2" -- To view, visit https://gerrit.wikimedia.org/r/394281 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If2ee648ef8d398a152aee11b187196e49818eff9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceBlog Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceNamespaceManager[master]: BSNamespaceManager: Added missing psr-4 autoloader path
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394265 ) Change subject: BSNamespaceManager: Added missing psr-4 autoloader path .. BSNamespaceManager: Added missing psr-4 autoloader path Change-Id: I9da00ba6c9d47849132c2360630f73464ac6a562 --- M composer.json 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceNamespaceManager refs/changes/65/394265/1 diff --git a/composer.json b/composer.json index 855b9c5..938247c 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,11 @@ "require": { "composer/installers": "~1.0" }, + "autoload": { + "psr-4": { + "BlueSpice\\NamespaceManager\\" : "src" + } + }, "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", "jakub-onderka/php-console-highlighter": "0.3.2" -- To view, visit https://gerrit.wikimedia.org/r/394265 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9da00ba6c9d47849132c2360630f73464ac6a562 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceNamespaceManager Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceReaders[master]: BSReaders: Fixed missing psr-4 autoloader path
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394264 ) Change subject: BSReaders: Fixed missing psr-4 autoloader path .. BSReaders: Fixed missing psr-4 autoloader path Change-Id: Ie350bed9a05b392a88b674c8663d0d73fb9b70e1 --- M composer.json 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceReaders refs/changes/64/394264/1 diff --git a/composer.json b/composer.json index 9c6a3c4..63e0b2c 100644 --- a/composer.json +++ b/composer.json @@ -8,6 +8,7 @@ }, "autoload": { "psr-4": { + "BlueSpice\\Readers\\" : "src" } }, "require-dev": { -- To view, visit https://gerrit.wikimedia.org/r/394264 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie350bed9a05b392a88b674c8663d0d73fb9b70e1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceReaders Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceDashboards[master]: BSDashboards: Added missing psr-4 autoloader path
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394263 ) Change subject: BSDashboards: Added missing psr-4 autoloader path .. BSDashboards: Added missing psr-4 autoloader path Change-Id: I595d51e33bb1947f1eb53c23d550f4ab03bcdf43 --- M composer.json M extension.json 2 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceDashboards refs/changes/63/394263/1 diff --git a/composer.json b/composer.json index ec5ebab..2ac5931 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,11 @@ "require": { "composer/installers": "~1.0" }, + "autoload": { + "psr-4": { + "BlueSpice\\Dashboards\\" : "src" + } + }, "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", "jakub-onderka/php-console-highlighter": "0.3.2" diff --git a/extension.json b/extension.json index 7b9fed9..38b653e 100644 --- a/extension.json +++ b/extension.json @@ -99,5 +99,6 @@ "LoadExtensionSchemaUpdates": "Dashboards::getSchemaUpdates", "UnitTestsList": "Dashboards::onUnitTestsList" }, + "load_composer_autoloader": true, "manifest_version": 1 } -- To view, visit https://gerrit.wikimedia.org/r/394263 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I595d51e33bb1947f1eb53c23d550f4ab03bcdf43 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceDashboards Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpicePageTemplates[master]: BSPageTemplates: Fixed mittsin ps4-4 autoloader path
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394261 ) Change subject: BSPageTemplates: Fixed mittsin ps4-4 autoloader path .. BSPageTemplates: Fixed mittsin ps4-4 autoloader path Change-Id: Ifd9f8cfdf0c07472ba6f51b6b073df13cfb79a94 --- M composer.json 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpicePageTemplates refs/changes/61/394261/1 diff --git a/composer.json b/composer.json index 682a0c1..05828d6 100644 --- a/composer.json +++ b/composer.json @@ -8,6 +8,7 @@ }, "autoload": { "psr-4": { + "BlueSpice\\PageTemplates\\" : "src" } }, "require-dev": { -- To view, visit https://gerrit.wikimedia.org/r/394261 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd9f8cfdf0c07472ba6f51b6b073df13cfb79a94 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpicePageTemplates Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpicePagesVisited[master]: BSPagesVisited: Fixed missing psr-4 autoloader path
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394260 ) Change subject: BSPagesVisited: Fixed missing psr-4 autoloader path .. BSPagesVisited: Fixed missing psr-4 autoloader path Change-Id: I9f5c04e8a9a610fc0d37a68bd64e20069aa1ee67 --- M composer.json 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpicePagesVisited refs/changes/60/394260/1 diff --git a/composer.json b/composer.json index 09453f4..093251e 100644 --- a/composer.json +++ b/composer.json @@ -8,6 +8,7 @@ }, "autoload": { "psr-4": { + "BlueSpice\\PagesVisited\\" : "src" } }, "require-dev": { -- To view, visit https://gerrit.wikimedia.org/r/394260 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9f5c04e8a9a610fc0d37a68bd64e20069aa1ee67 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpicePagesVisited Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAvatars[master]: BSAvatars: Removed isStored from ConfigDefinitions, as every...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394259 ) Change subject: BSAvatars: Removed isStored from ConfigDefinitions, as every config with a definition is stored .. BSAvatars: Removed isStored from ConfigDefinitions, as every config with a definition is stored Change-Id: I9428d2f38127822325c655268e1b5bbf7bdcb93a --- M src/ConfigDefinition/AvatarsDefaultSize.php M src/ConfigDefinition/AvatarsGenerator.php 2 files changed, 0 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceAvatars refs/changes/59/394259/1 diff --git a/src/ConfigDefinition/AvatarsDefaultSize.php b/src/ConfigDefinition/AvatarsDefaultSize.php index 1884a2e..c7b8632 100644 --- a/src/ConfigDefinition/AvatarsDefaultSize.php +++ b/src/ConfigDefinition/AvatarsDefaultSize.php @@ -7,8 +7,4 @@ public function getLabelMessageKey() { return 'bs-avatars-pref-defaultsize'; } - - public function isStored() { - return true; - } } diff --git a/src/ConfigDefinition/AvatarsGenerator.php b/src/ConfigDefinition/AvatarsGenerator.php index 399d200..1c499c6 100644 --- a/src/ConfigDefinition/AvatarsGenerator.php +++ b/src/ConfigDefinition/AvatarsGenerator.php @@ -11,8 +11,4 @@ public function getLabelMessageKey() { return 'bs-avatars-pref-generator'; } - - public function isStored() { - return true; - } } -- To view, visit https://gerrit.wikimedia.org/r/394259 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9428d2f38127822325c655268e1b5bbf7bdcb93a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceAvatars Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Removed isStored from ConfigDefinitions, as ev...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394258 ) Change subject: BSFoundation: Removed isStored from ConfigDefinitions, as every config with a definition is stored .. BSFoundation: Removed isStored from ConfigDefinitions, as every config with a definition is stored Change-Id: I04f56e2d3211f0c20fcaa07eb1c41c41ae29ebd7 --- M src/ConfigDefinition.php M src/ConfigDefinition/Favicon.php M src/ConfigDefinition/FileExtensions.php M src/ConfigDefinition/ImageExtensions.php M src/ConfigDefinition/Logo.php M src/ISetting.php 6 files changed, 0 insertions(+), 30 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/58/394258/1 diff --git a/src/ConfigDefinition.php b/src/ConfigDefinition.php index ad10069..7d79ddc 100644 --- a/src/ConfigDefinition.php +++ b/src/ConfigDefinition.php @@ -92,14 +92,6 @@ } /** -* Returns if the config is stored in the database -* @return boolean -*/ - public function isStored() { - return false; - } - - /** * Returns if the config is a ResourceLoader variable * @return boolean */ diff --git a/src/ConfigDefinition/Favicon.php b/src/ConfigDefinition/Favicon.php index 6cb75c5..b1e54a0 100644 --- a/src/ConfigDefinition/Favicon.php +++ b/src/ConfigDefinition/Favicon.php @@ -11,8 +11,4 @@ public function getVariableName() { return 'wg' . $this->getName(); } - - public function isStored() { - return true; - } } diff --git a/src/ConfigDefinition/FileExtensions.php b/src/ConfigDefinition/FileExtensions.php index f599125..cb60f7c 100644 --- a/src/ConfigDefinition/FileExtensions.php +++ b/src/ConfigDefinition/FileExtensions.php @@ -8,10 +8,6 @@ return 'bs-pref-imageextensions'; } - public function isStored() { - return true; - } - public function isRLConfigVar() { return true; } diff --git a/src/ConfigDefinition/ImageExtensions.php b/src/ConfigDefinition/ImageExtensions.php index 2b51452..c8e5f3f 100644 --- a/src/ConfigDefinition/ImageExtensions.php +++ b/src/ConfigDefinition/ImageExtensions.php @@ -8,10 +8,6 @@ return 'bs-pref-fileextensions'; } - public function isStored() { - return true; - } - public function isRLConfigVar() { return true; } diff --git a/src/ConfigDefinition/Logo.php b/src/ConfigDefinition/Logo.php index 05a1e5a..31c72e5 100644 --- a/src/ConfigDefinition/Logo.php +++ b/src/ConfigDefinition/Logo.php @@ -11,8 +11,4 @@ public function getVariableName() { return 'wg' . $this->getName(); } - - public function isStored() { - return true; - } } diff --git a/src/ISetting.php b/src/ISetting.php index e872199..083abb4 100644 --- a/src/ISetting.php +++ b/src/ISetting.php @@ -37,12 +37,6 @@ /** * -* @return boolean, If this variable is stored in the database -*/ - public function isStored(); - - /** -* * @return string, the message key for the label */ public function getLabelMessageKey(); -- To view, visit https://gerrit.wikimedia.org/r/394258 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04f56e2d3211f0c20fcaa07eb1c41c41ae29ebd7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoudation: Client side config rendering
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394083 ) Change subject: BSFoudation: Client side config rendering .. BSFoudation: Client side config rendering * used MediaWikiServices for the new ConfigDefinitionFactory * added a getter for services to the hook handler base class * fixed reference for ResourceLoaderGetConfigVars base class * added method isRLConfigVar to config definition to decide wich config gets handed over to the resourceLoader Change-Id: Icb809c8397d7dc1abe2544ac8f20c77c021240ad --- M includes/ServiceWiring.php M src/ConfigDefinition.php M src/ConfigDefinition/FileExtensions.php M src/ConfigDefinition/ImageExtensions.php A src/ConfigDefinitionFactory.php M src/Hook.php M src/Hook/ResourceLoaderGetConfigVars.php M src/Hook/ResourceLoaderGetConfigVars/AddBSGConfig.php 8 files changed, 130 insertions(+), 52 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/83/394083/3 diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index 865a084..653b764 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -4,6 +4,12 @@ return [ + 'BSConfigDefinitionFactory' => function ( MediaWikiServices $services ) { + return new \BlueSpice\ConfigDefinitionFactory( + $services->getConfigFactory()->makeConfig( 'bsg' ) + ); + }, + 'BSDynamicFileDispatcherFactory' => function ( MediaWikiServices $services ) { return new \BlueSpice\DynamicFileDispatcher\Factory( $services->getConfigFactory()->makeConfig( 'bsg' ) diff --git a/src/ConfigDefinition.php b/src/ConfigDefinition.php index 41d7002..ad10069 100644 --- a/src/ConfigDefinition.php +++ b/src/ConfigDefinition.php @@ -4,8 +4,6 @@ abstract class ConfigDefinition implements ISetting { - protected static $configDefinitions = null; - /** * * @var \IContextSource @@ -30,55 +28,10 @@ * @param \Config $config * @param string $name */ - protected function __construct( $context, $config, $name ) { + public function __construct( $context, $config, $name ) { $this->context = $context; $this->config = $config; $this->name = $name; - } - - /** -* -* @param string $name -* @param \Config $config -* @return ConfigDefinition | false -*/ - public static function factory( $name, \Config $config = null ) { - if( !$config ) { - $config = \MediaWiki\MediaWikiServices::getInstance() - ->getConfigFactory()->makeConfig( 'bsg' ); - } - if( empty( $name ) || !$config->has( $name ) ) { - return false; - } - $definitions = static::getConfigDefinitions(); - if( !isset( $definitions[$name] ) ) { - return false; - } - if( !is_callable( $definitions[$name] ) ) { - return false; - } - return call_user_func_array( $definitions[$name], [ - \RequestContext::getMain(), - $config, - $name, - ]); - } - - protected static function getConfigDefinitions() { - if( static::$configDefinitions ) { - return static::$configDefinitions; - } - static::$configDefinitions = []; - foreach( $GLOBALS['bsgExtensions'] as $extName => $extDefinition ) { - if( empty( $extDefinition['configDefinitions'] ) ) { - continue; - } - static::$configDefinitions = array_merge( - static::$configDefinitions, - $extDefinition['configDefinitions'] - ); - } - return static::$configDefinitions; } /** @@ -138,10 +91,22 @@ ]; } + /** +* Returns if the config is stored in the database +* @return boolean +*/ public function isStored() { return false; } + /** +* Returns if the config is a ResourceLoader variable +* @return boolean +*/ + public function isRLConfigVar() { + return false; + } + protected function makeFormFieldParams() { return [ 'name' => $this->getName(), diff --git a/src/ConfigDefinition/FileExtensions.php b/src/ConfigDefinition/FileExtensions.php index be65e21..f599125 100644 ---
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Fixed missing param in entityFactory->newFromID
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394055 ) Change subject: BSFoundation: Fixed missing param in entityFactory->newFromID .. BSFoundation: Fixed missing param in entityFactory->newFromID Change-Id: I4a6f3c98ace8ff5a0e4062a060263d6e8b437f49 --- M src/EntityFactory.php 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/55/394055/1 diff --git a/src/EntityFactory.php b/src/EntityFactory.php index 34c8414..b3f0b8f 100644 --- a/src/EntityFactory.php +++ b/src/EntityFactory.php @@ -104,7 +104,13 @@ } if( !empty($object->id) && (int) $object->id !== 0 ) { - return $this->newFromID( $object->id ); + $entityConfig = $this->configFactory->newFromType( $object->type ); + if( !$entityConfig instanceof EntityConfig ) { + //TODO: Return a DummyEntity instead of null. + return null; + } + $entityClass = $entityConfig->get( 'EntityClass' ); + return $this->newFromID( $object->id, $entityClass::NS ); } $oInstance = $this->factory( -- To view, visit https://gerrit.wikimedia.org/r/394055 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4a6f3c98ace8ff5a0e4062a060263d6e8b437f49 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAuthors[master]: BSAuthors: Used BS prefix for all bluespice services
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/393729 ) Change subject: BSAuthors: Used BS prefix for all bluespice services .. BSAuthors: Used BS prefix for all bluespice services => requires: 393727 Change-Id: I1f0d2671383326e671ee9fc23e06e7748ec33b45 --- M views/view.AuthorsUserPageProfileImageSetting.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceAuthors refs/changes/29/393729/1 diff --git a/views/view.AuthorsUserPageProfileImageSetting.php b/views/view.AuthorsUserPageProfileImageSetting.php index b6c51e5..e025964 100644 --- a/views/view.AuthorsUserPageProfileImageSetting.php +++ b/views/view.AuthorsUserPageProfileImageSetting.php @@ -50,7 +50,7 @@ 'username' => $this->oUser->getName(), ]; $dfdUrlBuilder = \MediaWiki\MediaWikiServices::getInstance()->getService( - 'DynamicFileDispatcherUrlBuilder' + 'BSDynamicFileDispatcherUrlBuilder' ); $this->sImagePath = $dfdUrlBuilder->build( new \BlueSpice\DynamicFileDispatcher\Params( $params ) -- To view, visit https://gerrit.wikimedia.org/r/393729 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1f0d2671383326e671ee9fc23e06e7748ec33b45 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceAuthors Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Used BS prefix for all bluespice services
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/393727 ) Change subject: BSFoundation: Used BS prefix for all bluespice services .. BSFoundation: Used BS prefix for all bluespice services Change-Id: I7f9c5da2e04336391cbed21d4d57374a313a7fe8 --- M dynamic_file.php M includes/ServiceWiring.php M includes/outputhandler/views/view.UserMiniProfile.php M src/Data/Entity/Schema.php M src/Entity.php M src/EntityConfig.php M src/EntityConfigFactory.php M src/EntityRegistry.php M src/Hook/BSEntityRegister.php 9 files changed, 31 insertions(+), 31 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/27/393727/1 diff --git a/dynamic_file.php b/dynamic_file.php index aae5d81..0ebc15f 100644 --- a/dynamic_file.php +++ b/dynamic_file.php @@ -27,7 +27,7 @@ $fileDispatcher = null; try { $dfdFactory = \MediaWiki\MediaWikiServices::getInstance()->getService( - 'DynamicFileDispatcherFactory' + 'BSDynamicFileDispatcherFactory' ); $dfd = $dfdFactory->newFromParams( new \BlueSpice\DynamicFileDispatcher\RequestParams( [], \RequestContext::getMain()->getRequest() ), diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index d090d07..865a084 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -4,36 +4,36 @@ return [ - 'DynamicFileDispatcherFactory' => function ( MediaWikiServices $services ) { + 'BSDynamicFileDispatcherFactory' => function ( MediaWikiServices $services ) { return new \BlueSpice\DynamicFileDispatcher\Factory( $services->getConfigFactory()->makeConfig( 'bsg' ) ); }, - 'DynamicFileDispatcherUrlBuilder' => function ( MediaWikiServices $services ) { + 'BSDynamicFileDispatcherUrlBuilder' => function ( MediaWikiServices $services ) { return new \BlueSpice\DynamicFileDispatcher\UrlBuilder( - $services->getService( 'DynamicFileDispatcherFactory' ), + $services->getService( 'BSDynamicFileDispatcherFactory' ), $services->getConfigFactory()->makeConfig( 'bsg' ) ); }, - 'EntityRegistry' => function ( MediaWikiServices $services ) { + 'BSEntityRegistry' => function ( MediaWikiServices $services ) { return new \BlueSpice\EntityRegistry( $services->getConfigFactory()->makeConfig( 'bsg' ) ); }, - 'EntityConfigFactory' => function ( MediaWikiServices $services ) { + 'BSEntityConfigFactory' => function ( MediaWikiServices $services ) { return new \BlueSpice\EntityConfigFactory( - $services->getService( 'EntityRegistry' ), + $services->getService( 'BSEntityRegistry' ), $services->getConfigFactory()->makeConfig( 'bsg' ) ); }, - 'EntityFactory' => function ( MediaWikiServices $services ) { + 'BSEntityFactory' => function ( MediaWikiServices $services ) { return new \BlueSpice\EntityFactory( - $services->getService( 'EntityRegistry' ), - $services->getService( 'EntityConfigFactory' ), + $services->getService( 'BSEntityRegistry' ), + $services->getService( 'BSEntityConfigFactory' ), $services->getConfigFactory()->makeConfig( 'bsg' ) ); }, diff --git a/includes/outputhandler/views/view.UserMiniProfile.php b/includes/outputhandler/views/view.UserMiniProfile.php index ecc40e5..5bc65b1 100644 --- a/includes/outputhandler/views/view.UserMiniProfile.php +++ b/includes/outputhandler/views/view.UserMiniProfile.php @@ -35,7 +35,7 @@ 'username' => $this->mOptions['user']->getName(), ]); $dfdUrlBuilder = MediaWikiServices::getInstance()->getService( - 'DynamicFileDispatcherUrlBuilder' + 'BSDynamicFileDispatcherUrlBuilder' ); $url = $dfdUrlBuilder->build( new Params( $params ) diff --git a/src/Data/Entity/Schema.php b/src/Data/Entity/Schema.php index 571932a..3f5c4f4 100644 --- a/src/Data/Entity/Schema.php +++ b/src/Data/Entity/Schema.php @@ -37,10 +37,10 @@ protected function getEntityConfigs() { $entityConfigs = []; $entityRegistry = MediaWikiServices::getInstance()->getService( - 'EntityRegistry' + 'BSEntityRegistry' ); $configFactory = MediaWikiServices::getInstance()->getService( - 'EntityConfigFactory' +
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAvatars[master]: BSAvatars: Switched to manifest version 2 as an example
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/393565 ) Change subject: BSAvatars: Switched to manifest version 2 as an example .. BSAvatars: Switched to manifest version 2 as an example => requires: https://gerrit.wikimedia.org/r/#/c/393564/ Change-Id: If910bdee955305cbc63b32066d5d846e52d9168e --- M extension.json 1 file changed, 9 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceAvatars refs/changes/65/393565/1 diff --git a/extension.json b/extension.json index a7b5c4c..f24afb4 100644 --- a/extension.json +++ b/extension.json @@ -9,13 +9,15 @@ ], "descriptionmsg": "bs-avatars-desc", "type": "bluespice", - "bsgExtensions": { + "attributes": { "BlueSpiceAvatars": { - "className": "Avatars", - "extPath": "/BlueSpiceAvatars", - "configDefinitions": { - "AvatarsDefaultSize": "\\BlueSpice\\Avatars\\ConfigDefinition\\AvatarsDefaultSize::getInstance", - "AvatarsGenerator": "\\BlueSpice\\Avatars\\ConfigDefinition\\AvatarsGenerator::getInstance" + "bsgExtensions": { + "className": "Avatars", + "extPath": "/BlueSpiceAvatars", + "configDefinitions": { + "AvatarsDefaultSize": "\\BlueSpice\\Avatars\\ConfigDefinition\\AvatarsDefaultSize::getInstance", + "AvatarsGenerator": "\\BlueSpice\\Avatars\\ConfigDefinition\\AvatarsGenerator::getInstance" + } } } }, @@ -75,5 +77,5 @@ "BSCoreGetUserMiniProfileBeforeInit": "\\BlueSpice\\Avatars\\Hook\\BSCoreGetUserMiniProfileBeforeInit\\SetAvatar::callback" }, "load_composer_autoloader": true, - "manifest_version": 1 + "manifest_version": 2 } -- To view, visit https://gerrit.wikimedia.org/r/393565 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If910bdee955305cbc63b32066d5d846e52d9168e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceAvatars Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Used extension attributes for registration and...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/393564 ) Change subject: BSFoundation: Used extension attributes for registration and added support for manifest v2 .. BSFoundation: Used extension attributes for registration and added support for manifest v2 Change-Id: I1b5704528e964de10911bb5e1540e96ce1dd9f0e --- M extension.json M includes/DefaultSettings.php M includes/ExtensionManager.class.php M src/DynamicFileDispatcher/Factory.php M src/EntityRegistry.php 5 files changed, 76 insertions(+), 28 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/64/393564/1 diff --git a/extension.json b/extension.json index 7e45d74..eeaf919 100644 --- a/extension.json +++ b/extension.json @@ -8,6 +8,24 @@ "url": "http://bluespice.com;, "descriptionmsg": "bluespicefoundation-desc", "type": "other", + "attributes": { + "BlueSpiceFoundation": { + "bsgExtensions": { + "BlueSpiceFoundation": { + "configDefinitions": { + "Logo": "\\BlueSpice\\ConfigDefinition\\Logo::getInstance", + "FileExtensions": "\\BlueSpice\\ConfigDefinition\\FileExtensions::getInstance", + "ImageExtensions": "\\BlueSpice\\ConfigDefinition\\ImageExtensions::getInstance", + "Favicon": "\\BlueSpice\\ConfigDefinition\\Favicon::getInstance" + } + } + }, + "bsgDynamicFileRegistry": { + "userprofileimage": "\\BlueSpice\\DynamicFileDispatcher\\UserProfileImage" + }, + "bsgEntityRegistry": {} + } + }, "ExtensionFunctions": [ "BsCoreHooks::setup" ], @@ -458,14 +476,6 @@ } }, "ConfigFiles": { - "value": [] - }, - "DynamicFileRegistry": { - "value": { - "userprofileimage": "\\BlueSpice\\DynamicFileDispatcher\\UserProfileImage" - } - }, - "EntityRegistry": { "value": [] } }, diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 716ce55..59a8529 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -318,20 +318,6 @@ ) ); /** - * BsExtensionManager extension registration - */ -$GLOBALS['bsgExtensions'] = [ - "BlueSpiceFoundation" => [ - "configDefinitions" => [ - "Logo" => "\\BlueSpice\\ConfigDefinition\\Logo::getInstance", - "FileExtensions" => "\\BlueSpice\\ConfigDefinition\\FileExtensions::getInstance", - "ImageExtensions" => "\\BlueSpice\\ConfigDefinition\\ImageExtensions::getInstance", - "Favicon" => "\\BlueSpice\\ConfigDefinition\\Favicon::getInstance", - ] - ] -]; - -/** * BsTemplateHelper template directory overwrite * $bsgTemplates = array( *BSExtension.Template.Name": "$wgExtensionsDirectory/MyExtension/PathToTemplateDir", diff --git a/includes/ExtensionManager.class.php b/includes/ExtensionManager.class.php index 051ccc6..92b0f17 100644 --- a/includes/ExtensionManager.class.php +++ b/includes/ExtensionManager.class.php @@ -205,14 +205,30 @@ */ public static function initialiseExtensions( $oCore ) { wfProfileIn( 'Performance: ' . __METHOD__ ); - $aBSExtFromJSON = ExtensionRegistry::getInstance()->getAttribute( + $extRegistry = ExtensionRegistry::getInstance(); + $aBSExtFromJSON = $extRegistry->getAttribute( 'bsgExtensions' ); + foreach( $extRegistry->getAllThings() as $sExtName => $aDefinition ) { + //attributes in manifest version 2+ + $attrName = "{$sExtName}bsgExtensions"; + if( empty( $extRegistry->getAttribute( $attrName ) ) ) { + continue; + } + + $aBSExtFromJSON[$sExtName] = $extRegistry->getAttribute( + $attrName + ); + } + + if( empty( $GLOBALS['bsgExtensions'] ) ) { + $GLOBALS['bsgExtensions'] = []; + } if( !empty( $aBSExtFromJSON ) ) { - $GLOBALS['bsgExtensions'] =
[MediaWiki-commits] [Gerrit] mediawiki...MultiLanguageManager[master]: [WIP]: Added a oojs ui
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/393072 ) Change subject: [WIP]: Added a oojs ui .. [WIP]: Added a oojs ui Change-Id: I3da5e718989718d9f67164b2dfcd50ad25ffd441 --- M extension.json A resources/ext.mlm.js M src/Hooks/BeforePageDisplay.php 3 files changed, 227 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultiLanguageManager refs/changes/72/393072/1 diff --git a/extension.json b/extension.json index 9c6259b..11d75f6 100644 --- a/extension.json +++ b/extension.json @@ -56,6 +56,16 @@ "styles": [ "ext.mlm.less" ] + }, + "ext.mlm": { + "scripts": [ + "ext.mlm.js" + ], + "dependencies": [ + "mediawiki.api", + "oojs", + "oojs-ui" + ] } }, "config_prefix": "mg", diff --git a/resources/ext.mlm.js b/resources/ext.mlm.js new file mode 100644 index 000..4a8e078 --- /dev/null +++ b/resources/ext.mlm.js @@ -0,0 +1,183 @@ + +( function( mw, $ ){ + mw.mlm = mw.mlm || {}; + $(document).on( 'click', '#ca-mlm', function( e ) { + if( !mw.mlm.dialog ) { + return; + } + var windowManager = new OO.ui.WindowManager( { + factory: mw.mlm.factory + } ); + $( 'body' ).append( windowManager.$element ); + + // Open window by symbolic name. + windowManager.openWindow( 'mlm' ); + e.stopPropagation(); + return false; + }); + mw.loader.using( 'oojs-ui', function() { + + mw.mlm.factory = new OO.Factory(); + + mw.mlm.srcTitle = mw.config.get( + 'mlmSourceTitle', + mw.config.get( 'wgTitle' ) + ); + mw.mlm.translations = mw.config.get( + 'mlmTranslations', + {} + ); + mw.mlm.languages = mw.config.get( + 'mlmLanguages', + [] + ); + var lang = mw.config.get( 'wgContentLanguage' ).split('-'); + mw.mlm.lang = lang[0]; + + mw.mlm.dialog = function( config ) { + this.translations = {}; + mw.mlm.dialog.super.call( this, config ); + }; + OO.inheritClass( mw.mlm.dialog, OO.ui.ProcessDialog ); + + // Specify a symbolic name (e.g., 'simple', in this example) using the static 'name' property. + mw.mlm.dialog.static.name = 'mlm'; + mw.mlm.dialog.static.title = 'MultiLanguageManager'; + mw.mlm.dialog.static.actions = [ + { action: 'save', label: 'Save', flags: [ 'primary', 'constructive' ] }, + { action: 'cancel', label: 'Cancel', flags: 'safe' }, + { action: 'delete', label: 'Delete', flags: 'destructive' } + ]; + + mw.mlm.dialog.prototype.initialize = function () { + mw.mlm.dialog.super.prototype.initialize.call( this ); + + this.panel = new OO.ui.PanelLayout( { padded: true, expanded: false } ); + this.content = new OO.ui.FieldsetLayout(); + + var options = []; + for( var i = 0; i < mw.mlm.languages.length; i++ ) { + if( mw.mlm.languages[i] === mw.mlm.lang ) { + continue; + } + options.push( { + data: mw.mlm.languages[i], + label: mw.mlm.languages[i] + }); + } + + this.srcLang = new OO.ui.ButtonWidget( { + label: mw.mlm.lang, + disabled: true + }); + this.srcText = new OO.ui.TextInputWidget( { + value: mw.mlm.srcTitle, + label: 'Src', + disabled: true + }); + + this.srcSection = new OO.ui.HorizontalLayout( { + items: [ + this.srcLang, + this.srcText + ] + }); +
[MediaWiki-commits] [Gerrit] mediawiki...MultiLanguageManager[master]: Added more information into the composer.json
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/393030 ) Change subject: Added more information into the composer.json .. Added more information into the composer.json Change-Id: If5e8e21644fff75b585ff7f832f62e84b3adc23a --- M composer.json 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultiLanguageManager refs/changes/30/393030/1 diff --git a/composer.json b/composer.json index b9b4f42..c61212a 100644 --- a/composer.json +++ b/composer.json @@ -1,4 +1,10 @@ { + "name": "mediawiki/multi-language-manager", + "type": "mediawiki-extension", + "description": "Provides linking articles as translations", + "require": { + "composer/installers": "~1.0" + }, "autoload": { "psr-4": { "MultiLanguageManager\\Tests\\": "tests/phpunit", -- To view, visit https://gerrit.wikimedia.org/r/393030 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If5e8e21644fff75b585ff7f832f62e84b3adc23a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MultiLanguageManager Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Used ReaderParams for PrimarayDataProvider
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/392610 ) Change subject: BSFoundation: Used ReaderParams for PrimarayDataProvider .. BSFoundation: Used ReaderParams for PrimarayDataProvider * this makes sorting limit etc. also avaiable for pre-filtering Change-Id: Ib1fd5d45f11338408774329987b590b8fba83ad5 --- M src/Data/IPrimaryDataProvider.php M src/Data/Reader.php M src/Data/Settings/PrimaryDataProvider.php M src/Data/Watchlist/PrimaryDataProvider.php 4 files changed, 11 insertions(+), 16 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/10/392610/1 diff --git a/src/Data/IPrimaryDataProvider.php b/src/Data/IPrimaryDataProvider.php index 5871aab..4f390f7 100644 --- a/src/Data/IPrimaryDataProvider.php +++ b/src/Data/IPrimaryDataProvider.php @@ -6,12 +6,9 @@ /** * -* @param string $query Special simple filter that aims at one specific -* field that the DataProvider needs to define. -* @param Filter[] $preFilters Complete set of filters that will also be -* applied later during the process by the "Filterer" step. Having it here -* allows us to prefilter and tweak performance -* @return \BlueSpice\Data\Record[] +* @param ReaderParams $params Having it here allows us to prefilter and +* tweak performance +* @return Record[] */ - public function makeData( $query = '', $preFilters = [] ); + public function makeData( $params ); } \ No newline at end of file diff --git a/src/Data/Reader.php b/src/Data/Reader.php index 5e1d519..98a2d90 100644 --- a/src/Data/Reader.php +++ b/src/Data/Reader.php @@ -58,7 +58,7 @@ */ public function read( $params ) { $primaryDataProvider = $this->makePrimaryDataProvider( $params ); - $dataSets = $primaryDataProvider->makeData( $params->getQuery(), $params->getFilter() ); + $dataSets = $primaryDataProvider->makeData( $params ); $filterer = $this->makeFilterer( $params ); $dataSets = $filterer->filter( $dataSets ); @@ -78,7 +78,7 @@ $dataSets = $secondaryDataProvider->extend( $dataSets ); } - $resultSet = new ResultSet( $dataSets, $total ); + $resultSet = new ResultSet( $dataSets, $total ); return $resultSet; } diff --git a/src/Data/Settings/PrimaryDataProvider.php b/src/Data/Settings/PrimaryDataProvider.php index df98328..c3cf5b8 100644 --- a/src/Data/Settings/PrimaryDataProvider.php +++ b/src/Data/Settings/PrimaryDataProvider.php @@ -28,10 +28,9 @@ /** * -* @param string $query -* @param type $preFilters +* @param \BlueSpice\Data\ReaderParams $params */ - public function makeData( $query = '', $preFilters = [] ) { + public function makeData( $params ) { $this->data = []; //workaround for the upgrade process. The new settings cannot be //accessed before they are migrated diff --git a/src/Data/Watchlist/PrimaryDataProvider.php b/src/Data/Watchlist/PrimaryDataProvider.php index 1de86d5..aa1f8b6 100644 --- a/src/Data/Watchlist/PrimaryDataProvider.php +++ b/src/Data/Watchlist/PrimaryDataProvider.php @@ -42,14 +42,13 @@ /** * -* @param string $query -* @param type $preFilters +* @param \BlueSpice\Data\ReaderParams $params */ - public function makeData( $query = '', $preFilters = [] ) { + public function makeData( $params ) { $res = $this->db->select( 'watchlist', '*', - $this->makePreFilterConds( $preFilters ) + $this->makePreFilterConds( $params->getFilter() ) ); $distinctUserIds = []; -- To view, visit https://gerrit.wikimedia.org/r/392610 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib1fd5d45f11338408774329987b590b8fba83ad5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: [WIP]: POC: Querybuilder filter und sort base classes
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/392046 ) Change subject: [WIP]: POC: Querybuilder filter und sort base classes .. [WIP]: POC: Querybuilder filter und sort base classes Change-Id: I33d0953b80a0976ab9184adcb39e768b37c8318c --- A src/Data/DataSetFilter.php R src/Data/DataSetFilter/Boolean.php R src/Data/DataSetFilter/Date.php R src/Data/DataSetFilter/ListValue.php R src/Data/DataSetFilter/Numeric.php A src/Data/DataSetFilter/Range.php R src/Data/DataSetFilter/StringValue.php R src/Data/DataSetFilter/TemplateTitle.php R src/Data/DataSetFilter/Title.php A src/Data/DataSetSort.php M src/Data/DatabaseWriter.php M src/Data/Filter.php D src/Data/Filter/Range.php M src/Data/FilterFactory.php M src/Data/Filterer.php A src/Data/IFilter.php M src/Data/IPrimaryDataProvider.php A src/Data/ISort.php A src/Data/QueryBuilder.php A src/Data/QueryFilter.php A src/Data/QueryFilterFactory.php A src/Data/QuerySort.php M src/Data/ReaderParams.php M src/Data/Sort.php M src/Data/Watchlist/PrimaryDataProvider.php A tests/phpunit/Data/DataSetFilter/BooleanTest.php R tests/phpunit/Data/DataSetFilter/DateTest.php R tests/phpunit/Data/DataSetFilter/ListValueTest.php R tests/phpunit/Data/DataSetFilter/NumericTest.php R tests/phpunit/Data/DataSetFilter/StringValueTest.php R tests/phpunit/Data/DataSetFilter/TemplateTitleTest.php R tests/phpunit/Data/DataSetFilter/TitleTest.php D tests/phpunit/Data/Filter/BooleanTest.php M tests/phpunit/Data/FiltererTest.php M tests/phpunit/Data/ReaderParamsTest.php M tests/phpunit/Data/SorterTest.php 36 files changed, 499 insertions(+), 244 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/46/392046/1 diff --git a/src/Data/DataSetFilter.php b/src/Data/DataSetFilter.php new file mode 100644 index 000..2ee7f17 --- /dev/null +++ b/src/Data/DataSetFilter.php @@ -0,0 +1,40 @@ +doesMatch( $dataSet ); + } + + + /** +* +* @param stdClass[]|array[] $filters +* @return Filter[] +*/ + public static function newCollectionFromArray( $filters ) { + $filterObjects = []; + foreach( $filters as $filter ) { + if( is_object( $filter ) ) { + $filter = (array) $filter; + } + try { + $filterObjects[] = FilterFactory::newFromArray( $filter ); + } catch( \Exception $e ) { + continue; + } + } + return $filterObjects; + } + + protected abstract function doesMatch( $dataSet ); +} diff --git a/src/Data/Filter/Boolean.php b/src/Data/DataSetFilter/Boolean.php similarity index 81% rename from src/Data/Filter/Boolean.php rename to src/Data/DataSetFilter/Boolean.php index 22fa99f..59c6a1b 100644 --- a/src/Data/Filter/Boolean.php +++ b/src/Data/DataSetFilter/Boolean.php @@ -1,10 +1,10 @@ direction, [ static::ASCENDING, static::DESCENDING ] ) ) { + throw new UnexpectedValueException( + "'{$this->direction}' is not an allowed value for argument \$direction" + ); + } + } + + /** +* +* @param stdClass[]|array[] $sorts +* @return Sort[] +*/ + public static function newCollectionFromArray( $sorts ) { + $sortObjects = []; + foreach( $sorts as $sort ) { + if( is_array( $sort ) ) { + $sort = (object) $sort; + } + + $sortObjects[] = new DataSetSort( + $sort->property, + isset( $sort->direction ) ? $sort->direction : null + ); + } + return $sortObjects; + } +} diff --git a/src/Data/DatabaseWriter.php b/src/Data/DatabaseWriter.php index 895a809..b078f35 100644 --- a/src/Data/DatabaseWriter.php +++ b/src/Data/DatabaseWriter.php @@ -235,7 +235,7 @@ Filter::KEY_FIELD => $fieldName, Filter::KEY_VALUE => $record->get( $fieldName ), Filter::KEY_TYPE => $this->getFieldType( $fieldName ), - Filter::KEY_COMPARISON => Filter::COMPARISON_EQUALS, + Filter::KEY_COMPARISON => DataSetFilter::COMPARISON_EQUALS, ]; } diff --git a/src/Data/Filter.php b/src/Data/Filter.php index ea87ceb..cf60413 100644 --- a/src/Data/Filter.php +++ b/src/Data/Filter.php @@ -2,14 +2,7 @@ namespace BlueSpice\Data; -abstract class Filter { - const COMPARISON_EQUALS = 'eq'; - const COMPARISON_NOT_EQUALS = 'neq'; - - const KEY_TYPE = 'type'; - const
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: [WIP] BSFoundation: Entities - Used service wireing and the ...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/390995 ) Change subject: [WIP] BSFoundation: Entities - Used service wireing and the new config mechanism .. [WIP] BSFoundation: Entities - Used service wireing and the new config mechanism Change-Id: I224db93df435fa54fc30a4e6d87a0a3eb7c34861 --- M extension.json M includes/ServiceWiring.php M src/Data/Entity/Schema.php M src/Entity.php M src/EntityConfig.php A src/EntityConfigFactory.php M src/EntityRegistry.php M src/Hook/BSEntityConfigDefaults.php M src/Hook/BSEntityRegister.php 9 files changed, 299 insertions(+), 57 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/95/390995/1 diff --git a/extension.json b/extension.json index e8fe8b0..a9ed4a6 100644 --- a/extension.json +++ b/extension.json @@ -464,6 +464,9 @@ "value": { "userprofileimage": "\\BlueSpice\\DynamicFileDispatcher\\UserProfileImage" } + }, + "EntityRegistry": { + "value": [] } }, "ConfigRegistry": { diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index 240c6dd..fe18294 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -17,4 +17,16 @@ ); }, + 'EntityRegistry' => function ( MediaWikiServices $services ) { + return new \BlueSpice\EntityRegistry( + $services->getConfigFactory()->makeConfig( 'bsg' ) + ); + }, + + 'EntityConfigFactory' => function ( MediaWikiServices $services ) { + return new \BlueSpice\EntityConfigFactory( + $services->getService( 'EntityRegistry' ), + $services->getConfigFactory()->makeConfig( 'bsg' ) + ); + }, ]; diff --git a/src/Data/Entity/Schema.php b/src/Data/Entity/Schema.php index 41c73a0..571932a 100644 --- a/src/Data/Entity/Schema.php +++ b/src/Data/Entity/Schema.php @@ -2,7 +2,7 @@ namespace BlueSpice\Data\Entity; -use BlueSpice\EntityRegistry; +use MediaWiki\MediaWikiServices; use BlueSpice\EntityConfig; use BlueSpice\Data\FieldType; @@ -36,8 +36,14 @@ */ protected function getEntityConfigs() { $entityConfigs = []; - foreach( EntityRegistry::getRegisterdTypeKeys() as $type ) { - if( !$entityConfig = EntityConfig::factory( $type ) ) { + $entityRegistry = MediaWikiServices::getInstance()->getService( + 'EntityRegistry' + ); + $configFactory = MediaWikiServices::getInstance()->getService( + 'EntityConfigFactory' + ); + foreach( $entityRegistry->getTypes() as $type ) { + if( !$entityConfig = $configFactory->newFromType( $type ) ) { continue; } $entityConfigs[] = $entityConfig; diff --git a/src/Entity.php b/src/Entity.php index 9857921..350e89c 100644 --- a/src/Entity.php +++ b/src/Entity.php @@ -28,6 +28,7 @@ */ namespace BlueSpice; use BlueSpice\Content\Entity as EntityContent; +use MediaWiki\MediaWikiServices; abstract class Entity implements \JsonSerializable { const NS = -1; @@ -99,10 +100,12 @@ } if( empty($oObject->type) ) { - //$oObject->type = EntityRegistry::getDefaultHandlerType(); return null; } - if( !EntityRegistry::isRegisteredType($oObject->type) ) { + $entityRegistry = MediaWikiServices::getInstance()->getService( + 'EntityRegistry' + ); + if( !$entityRegistry->hasType($oObject->type) ) { return null; } @@ -180,9 +183,11 @@ if( empty($oData->type) ) { return null; - //$oData->type = EntityRegistry::getDefaultHandlerType(); } - if( !EntityRegistry::isRegisteredType($oData->type) ) { + $entityRegistry = MediaWikiServices::getInstance()->getService( + 'EntityRegistry' + ); + if( !$entityRegistry->hasType($oData->type) ) { return null; } diff --git a/src/EntityConfig.php b/src/EntityConfig.php index 6f5c783..f48ddac 100644 --- a/src/EntityConfig.php +++ b/src/EntityConfig.php @@ -27,6 +27,7 @@ * @filesource */ namespace BlueSpice; +use MediaWiki\MediaWikiServices; use BlueSpice\Data\Entity\Schema; use BlueSpice\Data\FieldType; @@ -34,43 +35,86 @@ * EntityConfig class for BlueSpice * @package
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Added cache invalidation for new config mechanism
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/390275 ) Change subject: BSFoundation: Added cache invalidation for new config mechanism .. BSFoundation: Added cache invalidation for new config mechanism Change-Id: I1f1adb81153aabba5e3d2563d9d0b2eb80509673 --- M src/Config.php 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/75/390275/1 diff --git a/src/Config.php b/src/Config.php index c94e899..eb9a2c1 100644 --- a/src/Config.php +++ b/src/Config.php @@ -39,15 +39,18 @@ */ protected $loadBalancer = null; + protected $databaseConfig = null; + /** * * @param \LoadBalancer $loadBalancer */ public function __construct( $loadBalancer ) { $this->loadBalancer = $loadBalancer; + $this->databaseConfig = $this->makeDatabaseConfig(); parent::__construct( [ new \GlobalVarConfig( 'bsgOverride' ), - $this->makeDatabaseConfig(), + &$this->databaseConfig, new \GlobalVarConfig( 'bsg' ), new \GlobalVarConfig( 'wg' ), ] ); @@ -63,12 +66,11 @@ } /** -* //TODO: We need a config chache invalidation when writing to the db! * Invalidates the cache of config stored in the database * @return boolean */ public function invalidateCache() { - //TODO: We need a config chache invalidation when writing to the db! + $this->databaseConfig = $this->makeDatabaseConfig(); return true; } -- To view, visit https://gerrit.wikimedia.org/r/390275 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1f1adb81153aabba5e3d2563d9d0b2eb80509673 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Added the bluespice config mechanism to all BS...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/390272 ) Change subject: BSFoundation: Added the bluespice config mechanism to all BSApi classes .. BSFoundation: Added the bluespice config mechanism to all BSApi classes Change-Id: I8bce571611f1970bb98d086cd5e275fad6f1c116 --- M includes/api/BSApiBase.php 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/72/390272/1 diff --git a/includes/api/BSApiBase.php b/includes/api/BSApiBase.php index e709b7f..eb41202 100644 --- a/includes/api/BSApiBase.php +++ b/includes/api/BSApiBase.php @@ -95,4 +95,15 @@ public function getCustomPrinter() { return new BSApiFormatJson( $this->getMain(), $this->getParameter( 'format' ) ); } + + /** +* Get the Config object +* +* @since 1.23 +* @return Config +*/ + public function getConfig() { + return \MediaWiki\MediaWikiServices::getInstance() + ->getConfigFactory()->makeConfig( 'bsg' ); + } } -- To view, visit https://gerrit.wikimedia.org/r/390272 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8bce571611f1970bb98d086cd5e275fad6f1c116 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceUserManager[master]: BSUserManager: Fixed ps4 autoload path and added first hook ...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/390254 ) Change subject: BSUserManager: Fixed ps4 autoload path and added first hook base class .. BSUserManager: Fixed ps4 autoload path and added first hook base class Change-Id: Iac9685e2407ef1d687f86ed09a2cc863151c5f2b --- M composer.json A src/Hook/BSUserManagerAfterAddUser.php 2 files changed, 109 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceUserManager refs/changes/54/390254/1 diff --git a/composer.json b/composer.json index 1da1ef4..fe8e70a 100644 --- a/composer.json +++ b/composer.json @@ -8,8 +8,8 @@ }, "autoload" : { "psr-4": { - "BS\\UserManager\\": "src", - "BS\\UserManager\\Tests\\": "tests/phpunit" + "BlueSpice\\UserManager\\": "src", + "BlueSpice\\UserManager\\Tests\\": "tests/phpunit" } }, "require-dev": { diff --git a/src/Hook/BSUserManagerAfterAddUser.php b/src/Hook/BSUserManagerAfterAddUser.php new file mode 100644 index 000..87a4ce4 --- /dev/null +++ b/src/Hook/BSUserManagerAfterAddUser.php @@ -0,0 +1,107 @@ +http://bluespice.com + * + * @author Patric Wirth+ * @packageBlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @licensehttp://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\UserManager\Hook; +use BlueSpice\Hook; + +/** + * Located in \UserManager::addUser after a user was initially added + */ +abstract class BSUserManagerAfterAddUser extends Hook { + + /** +* +* @var \UserManager +*/ + protected $userManager = null; + + /** +* +* @var \User +*/ + protected $user = null; + + /** +* +* @var array +*/ + protected $metaData = null; + + /** +* +* @var \Status +*/ + protected $status = null; + + /** +* +* @var \User +*/ + protected $performer = null; + + /** +* @param \UserManager $userManager +* @param \User $user +* @param array $metaData +* @param \Status $status +* @param \User $performer +* @return boolean +*/ + public static function callback( $userManager, $user, $metaData, &$status, $performer ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $userManager, + $user, + $metaData, + $status, + $performer + ); + return $hookHandler->process(); + } + + /** +* @param \IContextSource $context +* @param \Config $config +* @param \UserManager $userManager +* @param \User $user +* @param array $metaData +* @param \Status $status +* @param \User $performer +*/ + public function __construct( $context, $config, $userManager, $user, $metaData, &$status, $performer ) { + parent::__construct( $context, $config ); + + $this->userManager = $userManager; + $this->user = $user; + $this->metaData = $metaData; + $this->status = &$status; + $this->performer = $performer; + } +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/390254 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iac9685e2407ef1d687f86ed09a2cc863151c5f2b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceUserManager Gerrit-Branch: master Gerrit-Owner: Pwirth ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAuthors[master]: BSAuthors: Used DynamicFileDispatcherUrlBuilder for userimgages
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/390247 ) Change subject: BSAuthors: Used DynamicFileDispatcherUrlBuilder for userimgages .. BSAuthors: Used DynamicFileDispatcherUrlBuilder for userimgages => requires: https://gerrit.wikimedia.org/r/#/c/378243/ Change-Id: I52e35e51c9fda3611e0f0eaa3cdb1c6467b58d8f --- M views/view.AuthorsUserPageProfileImageSetting.php 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceAuthors refs/changes/47/390247/1 diff --git a/views/view.AuthorsUserPageProfileImageSetting.php b/views/view.AuthorsUserPageProfileImageSetting.php index 5c8a4c6..1848b05 100644 --- a/views/view.AuthorsUserPageProfileImageSetting.php +++ b/views/view.AuthorsUserPageProfileImageSetting.php @@ -45,6 +45,17 @@ */ public function execute( $params = false ) { $this->initFields(); + $params = [ + \BlueSpice\DynamicFileDispatcher\Params::MODULE => 'userprofileimage', + 'username' => $this->oUser->getName(), + ]; + $dfdUrlBuilder = \MediaWiki\MediaWikiServices::getInstance()->getService( + 'DynamicFileDispatcherUrlBuilder' + ); + $this->sImagePath = $dfdUrlBuilder->build( + new \BlueSpice\DynamicFileDispatcher\Params( $params ) + ); + Hooks::run( 'BsAuthorPageProfileImageAfterInitFields', array( $this, $this->oUser ) ); $aOut = array(); -- To view, visit https://gerrit.wikimedia.org/r/390247 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I52e35e51c9fda3611e0f0eaa3cdb1c6467b58d8f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceAuthors Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[REL1_27]: BSFoundation: Added real client side filter falidation to Ex...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/389474 ) Change subject: BSFoundation: Added real client side filter falidation to ExtJS string field grid filter .. BSFoundation: Added real client side filter falidation to ExtJS string field grid filter => Needs cherry-pick to master Change-Id: I2a41c90b0423c89655df625c5e7d01c4f5e3b4b2 --- M resources/bluespice.extjs/Ext.ux/grid/filter/StringFilter.js 1 file changed, 13 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/74/389474/1 diff --git a/resources/bluespice.extjs/Ext.ux/grid/filter/StringFilter.js b/resources/bluespice.extjs/Ext.ux/grid/filter/StringFilter.js index 5b00c2a..dfb0a89 100644 --- a/resources/bluespice.extjs/Ext.ux/grid/filter/StringFilter.js +++ b/resources/bluespice.extjs/Ext.ux/grid/filter/StringFilter.js @@ -95,16 +95,25 @@ * @return {Boolean} true if the record is valid within the bounds * of the filter, false otherwise. */ -validateRecord: function(record) { +validateRecord: function( record ) { var val = record.get(this.dataIndex), values = this.getValue(); -if (values.eq !== undefined && val != values.eq) { +if (values.eq !== undefined && values.eq !== '' && val.toLowerCase() !== values.eq.toLowerCase() ) { return false; } -if (values.lt !== undefined && val >= values.lt) { +if( values.neq !== undefined && values.neq !== '' && val.toLowerCase() === values.neq.toLowerCase() ) { return false; } -if (values.gt !== undefined && val <= values.gt) { +if( values.ct !== undefined && values.ct !== '' && val.toLowerCase().indexOf( values.ct.toLowerCase() ) === -1 ) { +return false; +} +if( values.nct !== undefined && values.nct !== '' && val.toLowerCase().indexOf( values.nct.toLowerCase() ) !== -1 ) { +return false; +} +if( values.sw !== undefined && values.sw !== '' && val.toLowerCase().indexOf( values.sw.toLowerCase() ) !== 0 ) { +return false; +} +if( values.ew !== undefined && values.ew !== '' && val.toLowerCase().endsWith( values.ew.toLowerCase() ) !== true ) { return false; } return true; -- To view, visit https://gerrit.wikimedia.org/r/389474 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2a41c90b0423c89655df625c5e7d01c4f5e3b4b2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: REL1_27 Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAvatars[master]: BSAvatars: Using new config mechanism
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/388498 ) Change subject: BSAvatars: Using new config mechanism .. BSAvatars: Using new config mechanism => Requires: I1776ef3ba3e00963a342c01bcb717249c50b7de9 Change-Id: Iba259cb1c976046895e23cb93a1c8a46f803c560 --- M Avatars.class.php M composer.json M extension.json A src/ConfigDefinition/AvatarsDefaultSize.php A src/ConfigDefinition/AvatarsGenerator.php 5 files changed, 76 insertions(+), 36 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceAvatars refs/changes/98/388498/1 diff --git a/Avatars.class.php b/Avatars.class.php index 6f0ae97..f4d138d 100644 --- a/Avatars.class.php +++ b/Avatars.class.php @@ -36,27 +36,9 @@ * @package BlueSpice_Extensions * @subpackage Avatars */ -class Avatars extends BsExtensionMW { +class Avatars extends \BlueSpice\Extension { - public static $bAvatarsActive = true; public static $sAvatarFilePrefix = "BS_avatar_"; - - /** -* Initialization of Avatar extension -*/ - protected function initExt() { - wfProfileIn('BS::' . __METHOD__); - - BsConfig::registerVar('MW::Avatars::DefaultSize', 40, BsConfig::LEVEL_PUBLIC | BsConfig::TYPE_INT, 'bs-avatars-pref-defaultsize', 'int'); - BsConfig::registerVar('MW::Avatars::Generator', 'InstantAvatar', BsConfig::LEVEL_PUBLIC | BsConfig::TYPE_STRING | BsConfig::USE_PLUGIN_FOR_PREFS, 'bs-avatars-pref-generator', 'select'); - - $this->setHook('BSCoreGetUserMiniProfileBeforeInit'); - $this->setHook('BsAuthorPageProfileImageAfterInitFields'); - - # TODO: required rights? user->read? - #$this->mCore->registerPermission( 'viewfiles', array( 'user' ) ); - wfProfileOut('BS::' . __METHOD__); - } /** * extension.json callback @@ -67,7 +49,7 @@ if ( version_compare( $GLOBALS['wgVersion'], '1.28c', '>' ) ) { $wgForeignFileRepos[] = array( 'class' => 'FileRepo', - 'name' => 'Avatars', + 'name' => 'BlueSpiceAvatars', 'directory' => BS_DATA_DIR . '/Avatars/', 'hashLevels' => 0, 'url' => BS_DATA_PATH . '/Avatars', @@ -75,7 +57,7 @@ } else { $wgForeignFileRepos[] = array( 'class' => 'FSRepo', - 'name' => 'Avatars', + 'name' => 'BlueSpiceAvatars', 'directory' => BS_DATA_DIR . '/Avatars/', 'hashLevels' => 0, 'url' => BS_DATA_PATH . '/Avatars', @@ -108,7 +90,7 @@ * @param type $aParams * @return boolean */ - public function onBSCoreGetUserMiniProfileBeforeInit(&$oUserMiniProfileView, &$oUser, &$aParams) { + public static function onBSCoreGetUserMiniProfileBeforeInit( &$oUserMiniProfileView, &$oUser, &$aParams ) { # Set anonymous image for anonymous or deleted users if ($oUser->isAnon()) { $oUserMiniProfileView->setUserImageSrc(BsConfig::get('MW::DeletedUserImage')); @@ -127,8 +109,9 @@ return true; } + $oAvatars = \BsExtensionManager::getExtension( 'BlueSpiceAvatars' ); # Set or generate user's avatar - $oUserMiniProfileView->setUserImageSrc( $this->generateAvatar( + $oUserMiniProfileView->setUserImageSrc( $oAvatars->generateAvatar( $oUser, $aParams )); @@ -143,7 +126,7 @@ */ public static function getAvatarFile( $iUserId ) { $sAvatarFileName = self::$sAvatarFilePrefix . $iUserId . ".png"; - return BsFileSystemHelper::getFileFromRepoName( $sAvatarFileName, 'Avatars' ); + return BsFileSystemHelper::getFileFromRepoName( $sAvatarFileName, 'BlueSpiceAvatars' ); } /** @@ -152,7 +135,7 @@ * @param User $oUser * @return boolean */ - public function onBsAuthorPageProfileImageAfterInitFields($oView, $oUser) { + public static function onBsAuthorPageProfileImageAfterInitFields($oView, $oUser) { # If user has set MW image or URL return immediately if ($oUser->getOption('MW::UserImage')) return true; @@ -161,7 +144,9 @@ $oView->setImagePath(BsConfig::get('MW::DefaultUserImage')); return true; } -
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: [WIP] BSFoundation: Added dettings data store
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/385375 ) Change subject: [WIP] BSFoundation: Added dettings data store .. [WIP] BSFoundation: Added dettings data store Change-Id: I1776ef3ba3e00963a342c01bcb717249c50b7de9 --- M src/Config.php M src/Data/FieldType.php A src/Data/Settings/PrimaryDataProvider.php A src/Data/Settings/Reader.php A src/Data/Settings/Record.php A src/Data/Settings/Schema.php A src/Data/Settings/SecondaryDataProvider.php A src/Data/Settings/Store.php 8 files changed, 169 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/75/385375/1 diff --git a/src/Config.php b/src/Config.php index e81912b..cb5e505 100644 --- a/src/Config.php +++ b/src/Config.php @@ -1,6 +1,8 @@ loadBalancer->getConnection( DB_REPLICA ); - //when config get initialized before the database is created - //(f.e.: in update.php) - //TODO: Cache this config if( !$dbr->tableExists( 'bs_settings3' ) ) { return new \HashConfig( $hash ); } - $res = $dbr->select( 'bs_settings3', '*' ); + $store = $this->getStore(); + $resultSet = $store->getReader()->read( new Data\ReaderParams( [] ) ); - foreach( $res as $row ) { - if( strpos( $row->s_name, 'bsg' ) === 0 ) { - $name = substr( $row->s_name, 3 ); - $hash[$name] = \FormatJson::decode( $row->s_value ); - } + foreach( $resultSet->getRecords() as $row ) { + $hash[$row['name']] = $row['value']; } return new \HashConfig( $hash ); } + protected function getStore() { + return new Store( + new Context( \RequestContext::getMain(), $this ), + $this->loadBalancer + ); + } + } diff --git a/src/Data/FieldType.php b/src/Data/FieldType.php index 672a7b6..d419cf2 100644 --- a/src/Data/FieldType.php +++ b/src/Data/FieldType.php @@ -13,4 +13,5 @@ const INT = 'int'; const STRING = 'string'; const LISTVALUE = 'list'; + const MIXED = 'mixed'; } diff --git a/src/Data/Settings/PrimaryDataProvider.php b/src/Data/Settings/PrimaryDataProvider.php new file mode 100644 index 000..3b30031 --- /dev/null +++ b/src/Data/Settings/PrimaryDataProvider.php @@ -0,0 +1,60 @@ +db = $db; + } + + /** +* +* @param string $query +* @param type $preFilters +*/ + public function makeData( $query = '', $preFilters = [] ) { + if( static::$stored ) { + return static::$stored; + } + $res = $this->db->select( 'bs_settings3', '*' ); + + foreach( $res as $row ) { + $this->appendRowToData( $row ); + } + + static::$stored = $this->data; + return static::$stored; + } + + protected function appendRowToData( $row ) { + if( strpos( $row->s_name, 'bsg' ) !== 0 ) { + return; + } + + $this->data[] = new Record( (object) [ + Record::NAME => $row->s_name, + Record::VALUE => \FormatJson::decode( $row->s_value ) + ]); + } +} \ No newline at end of file diff --git a/src/Data/Settings/Reader.php b/src/Data/Settings/Reader.php new file mode 100644 index 000..099dfa5 --- /dev/null +++ b/src/Data/Settings/Reader.php @@ -0,0 +1,25 @@ +getConfig() ); + } + + protected function makePrimaryDataProvider( $params ) { + return new PrimaryDataProvider( $this->db ); + } + + protected function makeSecondaryDataProvider() { + return new SecondaryDataProvider( + \MediaWiki\MediaWikiServices::getInstance()->getLinkRenderer() + ); + } + + public function getSchema() { + return new Schema(); + } +} \ No newline at end of file diff --git a/src/Data/Settings/Record.php b/src/Data/Settings/Record.php new file mode 100644 index 000..6fd09c2 --- /dev/null +++ b/src/Data/Settings/Record.php @@ -0,0 +1,8 @@ + [ + self::FILTERABLE => true, + self::SORTABLE => true, + self::TYPE => FieldType::STRING + ], + Record::VALUE => [ + self::FILTERABLE => false, + self::SORTABLE => false, + self::TYPE => FieldType::MIXED + ], + ]);
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Improvements to the new config definition
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/385363 ) Change subject: BSFoundation: Improvements to the new config definition .. BSFoundation: Improvements to the new config definition * removed unused getDescrittionMessage method * fixed typo * removed the default handler functionality, as only defined config will be used as settings Change-Id: I5c71350952270524af484e43b8b37d532f8b61af --- M src/ConfigDefinition.php M src/ConfigDefinition/ArraySetting.php M src/ConfigDefinition/IntSetting.php M src/ConfigDefinition/StringSetting.php M src/ISetting.php 5 files changed, 11 insertions(+), 53 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/63/385363/1 diff --git a/src/ConfigDefinition.php b/src/ConfigDefinition.php index 7bdd610..41d7002 100644 --- a/src/ConfigDefinition.php +++ b/src/ConfigDefinition.php @@ -51,39 +51,17 @@ return false; } $definitions = static::getConfigDefinitions(); - if( isset( $definitions[$name] ) ) { - $callback = $definitions[$name]; - } else { - $callback = static::getDefaultDefinitionCallback( - $name, - $config - ); - if( !$callback ) { - return false; - } - } - if( !is_callable( $callback ) ) { + if( !isset( $definitions[$name] ) ) { return false; } - return call_user_func_array( $callback, [ + if( !is_callable( $definitions[$name] ) ) { + return false; + } + return call_user_func_array( $definitions[$name], [ \RequestContext::getMain(), $config, $name, ]); - } - - protected static function getDefaultDefinitionCallback( $name, \Config $config = null ) { - //TODO: make this configurable - if( is_string( $config->get( $name ) ) ) { - return "\\BlueSpice\\ConfigDefinition\\StringSetting::getInstance"; - } - if( is_int( $config->get( $name ) ) ) { - return "\\BlueSpice\\ConfigDefinition\\IntSetting::getInstance"; - } - if( is_array( $config->get( $name ) ) ) { - return "\\BlueSpice\\ConfigDefinition\\ArraySetting::getInstance"; - } - return null; } protected static function getConfigDefinitions() { @@ -122,14 +100,6 @@ /** * -* @return \Message -*/ - public function getDescripttionMessage() { - return null; - } - - /** -* * @return mixed */ public function getValue() { @@ -164,7 +134,7 @@ return [ static::MAIN_PATH_TYPE . '/' . static::TYPE_SYSTEM, static::MAIN_PATH_EXTENSION . '/BlueSpiceFoundation', - static::MAIN_PATH_PAKAGE . '/BlueSpice', + static::MAIN_PATH_PACKAGE . '/BlueSpice', ]; } diff --git a/src/ConfigDefinition/ArraySetting.php b/src/ConfigDefinition/ArraySetting.php index 01dd99e..69f6187 100644 --- a/src/ConfigDefinition/ArraySetting.php +++ b/src/ConfigDefinition/ArraySetting.php @@ -2,7 +2,7 @@ namespace BlueSpice\ConfigDefinition; -class ArraySetting extends \BlueSpice\ConfigDefinition { +abstract class ArraySetting extends \BlueSpice\ConfigDefinition { public function getHtmlFormField() { return new \HTMLMultiSelectEx( $this->makeFormFieldParams() ); @@ -12,9 +12,5 @@ $params = parent::makeFormFieldParams(); $params['options'] = $this->getValue(); return $params; - } - - public function getLabelMessageKey() { - return $this->getVariableName(); } } diff --git a/src/ConfigDefinition/IntSetting.php b/src/ConfigDefinition/IntSetting.php index 2db23c7..cf726db 100644 --- a/src/ConfigDefinition/IntSetting.php +++ b/src/ConfigDefinition/IntSetting.php @@ -2,7 +2,7 @@ namespace BlueSpice\ConfigDefinition; -class IntSetting extends \BlueSpice\ConfigDefinition { +abstract class IntSetting extends \BlueSpice\ConfigDefinition { public function getHtmlFormField() { return new \HTMLIntFieldOverride( $this->makeFormFieldParams() ); @@ -11,9 +11,5 @@ protected function makeFormFieldParams() { $params = parent::makeFormFieldParams(); return $params; - } - -
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAuthors[master]: Fixed extension registration after move
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/383780 ) Change subject: Fixed extension registration after move .. Fixed extension registration after move Change-Id: I86ca8330c7dd6a88e2f7025f72695b151bb6a881 --- M extension.json 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceAuthors refs/changes/80/383780/1 diff --git a/extension.json b/extension.json index 4925921..2af0aa6 100644 --- a/extension.json +++ b/extension.json @@ -1,5 +1,5 @@ { - "name": "Authors", + "name": "BlueSpiceAuthors", "version": "2.27.1-alpha", "url": "https://help.bluespice.com/index.php/Authors;, "author": [ @@ -9,7 +9,7 @@ "descriptionmsg": "bs-authors-desc", "type": "bluespice", "bsgExtensions": { - "Authors": { + "BlueSpiceAuthors": { "className": "Authors", "extPath": "/BlueSpiceAuthors" } -- To view, visit https://gerrit.wikimedia.org/r/383780 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I86ca8330c7dd6a88e2f7025f72695b151bb6a881 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceAuthors Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceUserManager[master]: Fixed BlueSpiceUserManager after move
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/383574 ) Change subject: Fixed BlueSpiceUserManager after move .. Fixed BlueSpiceUserManager after move * fixed extension registration * added extjs loader path Change-Id: I8911e8bc889df89686dbd527f834751ab16c1b37 --- M extension.json M resources/bluespice.userManager.js 2 files changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceUserManager refs/changes/74/383574/1 diff --git a/extension.json b/extension.json index 236231c..4a86e10 100644 --- a/extension.json +++ b/extension.json @@ -12,7 +12,7 @@ "license-name": "GPL-2.0+", "type": "bluespice", "bsgExtensions": { - "UserManager": { + "BlueSpiceUserManager": { "className": "UserManager", "extPath": "/BlueSpiceUserManager" } diff --git a/resources/bluespice.userManager.js b/resources/bluespice.userManager.js index dc82175..502337c 100644 --- a/resources/bluespice.userManager.js +++ b/resources/bluespice.userManager.js @@ -12,6 +12,10 @@ (function( mw, $, bs, d, undefined){ Ext.onReady( function(){ + Ext.Loader.setPath( + 'BS.UserManager', + bs.em.paths.get( 'BlueSpiceUserManager' ) + '/resources/BS.UserManager' + ); Ext.create( 'BS.UserManager.panel.Manager', { renderTo: 'bs-usermanager-grid', operationPermissions: { -- To view, visit https://gerrit.wikimedia.org/r/383574 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8911e8bc889df89686dbd527f834751ab16c1b37 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceUserManager Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpicePageTemplates[master]: Fixed BlueSpicePageTemplates after move
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/383571 ) Change subject: Fixed BlueSpicePageTemplates after move .. Fixed BlueSpicePageTemplates after move * fixed extension registration and path * added extjs autoloader path Change-Id: If1af78bc0a18a36d87e5be8de5bf49fba9d599fb --- M extension.json M resources/bluespice.pageTemplates.js 2 files changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpicePageTemplates refs/changes/71/383571/1 diff --git a/extension.json b/extension.json index fb32e8c..36eefef 100644 --- a/extension.json +++ b/extension.json @@ -10,9 +10,9 @@ "descriptionmsg": "bs-pagetemplates-desc", "type": "bluespice", "bsgExtensions": { - "PageTemplates": { + "BlueSpicePageTemplates": { "className": "PageTemplates", - "extPath": "/BlueSpiceExtensions/PageTemplates" + "extPath": "/BlueSpicePageTemplates" } }, "APIModules": { diff --git a/resources/bluespice.pageTemplates.js b/resources/bluespice.pageTemplates.js index 861a880..1c99cb9 100644 --- a/resources/bluespice.pageTemplates.js +++ b/resources/bluespice.pageTemplates.js @@ -11,6 +11,10 @@ */ Ext.onReady( function(){ + Ext.Loader.setPath( + 'BS.PageTemplates', + bs.em.paths.get( 'BlueSpicePageTemplates' ) + '/resources/BS.PageTemplates' + ); Ext.create( 'BS.PageTemplates.Panel', { renderTo: 'bs-pagetemplates-grid' } ); -- To view, visit https://gerrit.wikimedia.org/r/383571 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If1af78bc0a18a36d87e5be8de5bf49fba9d599fb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpicePageTemplates Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtendedStatistics[master]: Fixed BlueSpice extension registration
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/383566 ) Change subject: Fixed BlueSpice extension registration .. Fixed BlueSpice extension registration => extension key must be equal to extension name Change-Id: I22b58901699e6c63c234e863c068a31b7448551b --- M extension.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtendedStatistics refs/changes/66/383566/1 diff --git a/extension.json b/extension.json index 57e1a02..84da167 100644 --- a/extension.json +++ b/extension.json @@ -1,5 +1,5 @@ { - "name": "ExtendedStatistics", + "name": "BlueSpiceExtendedStatistics", "version": "2.27.1-alpha", "url": "https://help.bluespice.com/index.php/ExtendedStatistics;, "author": [ -- To view, visit https://gerrit.wikimedia.org/r/383566 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I22b58901699e6c63c234e863c068a31b7448551b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtendedStatistics Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: [WIP] New base class for BlueSpice extensions
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/383149 ) Change subject: [WIP] New base class for BlueSpice extensions .. [WIP] New base class for BlueSpice extensions Change-Id: I216b91dd668f69d61ed6d39727436c9ae2225b7a --- M includes/ExtensionMW.class.php M includes/ExtensionManager.class.php A src/Context.php A src/Extension.php 4 files changed, 205 insertions(+), 65 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/49/383149/1 diff --git a/includes/ExtensionMW.class.php b/includes/ExtensionMW.class.php index 3e4cc82..7835153 100644 --- a/includes/ExtensionMW.class.php +++ b/includes/ExtensionMW.class.php @@ -1,19 +1,14 @@ protected $mExtensionFile = null; protected $mExtensionType = null; protected $mInfo = null; - protected $mExtensionKey = null; - - protected $mResourcePath = null; - - protected $sName = ''; - protected $sStatus = ''; - protected $sPackage = ''; /** * @@ -22,8 +17,6 @@ protected $mCore = null; protected $aStandardContext = array( '*', '*', '*' ); - - protected function initExt() {} /** * Save a reference to current adapter instance. @@ -61,16 +54,6 @@ 'status' => $this->sStatus, 'package' => $this->sPackage, ); - } - - // TODO MRG (01.09.10 01:57): Kommentar - public function getName() { - return $this->sName; - } - - // TODO MRG (01.09.10 01:57): Kommentar - public function getExtensionKey() { - return $this->mExtensionKey; } /** @@ -119,6 +102,7 @@ * @param string $hook name of the hook to register to * @param string $method (optional) name of method register to * @param bool $bExecuteFirst set this method to be first to be executed when hook triggered +* @deprecated since version 3.31.0 */ public function setHook( $hook, $method = false, $bExecuteFirst = false ) { global $wgHooks; @@ -139,46 +123,4 @@ } } - /** -* Returns the resource path for the current extension -* @global string $IP -* @global string $wgScriptPath -* @return string -*/ - public function getResourcePath() { - return $this->mResourcePath; - } - - /** -* Returns the image path for the current extension -* @param boolean $bResources Whether or not the image directory is located inside the resources directory -* @return string -*/ - public function getImagePath( $bResources = false ) { - if ( $bResources ) { - return $this->getResourcePath().'/images/'; - } - return dirname( $this->getResourcePath() ).'/images/'; - } - - /** -* Returns the cache key for this particlular extension -* @param string $sSubKey -* @return string -*/ - public function getCacheKey( $sSubKey = 'default' ) { - return BsCacheHelper::getCacheKey( - 'BlueSpice', - $this->getName(), - $sSubKey - ); - } - - /** -* Returns an array of tag extension definitions -* @return array -*/ - public function makeTagExtensionDefinitions() { - return array(); - } } diff --git a/includes/ExtensionManager.class.php b/includes/ExtensionManager.class.php index 466c2e2..004d33b 100644 --- a/includes/ExtensionManager.class.php +++ b/includes/ExtensionManager.class.php @@ -146,7 +146,7 @@ return self::$prRunningExtensions; } - protected static function makeExtensionConfig( $sExtName = "", $aConfig = array() ) { + protected static function makeExtensionDefinition( $sExtName = "", $aConfig = array() ) { global $bsgBlueSpiceExtInfo; if( !isset( $aConfig['className'] ) ) { $aConfig['className'] = $sExtName; @@ -193,7 +193,7 @@ foreach( $GLOBALS['bsgExtensions'] as $sExtName => $aConfig ) { self::$prRegisteredExtensions[$sExtName] - = self::makeExtensionConfig( $sExtName, $aConfig ); + = self::makeExtensionDefinition( $sExtName, $aConfig ); } foreach ( self::$prRegisteredExtensions as $sExtName => $aConfig ) { @@ -205,7 +205,11 @@ ); } - self::$prRunningExtensions[$sExtName] = new $sClassName(); + self::$prRunningExtensions[$sExtName] =
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: Replaced BlueSpiceExtensions with the extension names
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382396 ) Change subject: Replaced BlueSpiceExtensions with the extension names .. Replaced BlueSpiceExtensions with the extension names Unfortunately the BlueSpiceExtensions extension.json can not be used to register all the extension in the directory, because it is bad practice to use an registration callback to register extensions. => Follow up to https://gerrit.wikimedia.org/r/#/c/381716/ Change-Id: I8cecf03fc1826706edb8a68e5f0268fdc97c4074 --- M Avatars/maintenance/CreateAvatarHTML.php M Dashboards/maintenance/clearConfigs.php M ExtendedSearch/maintenance/searchAddToIndex.php M ExtendedSearch/maintenance/searchDeleteIndex.php M ExtendedSearch/maintenance/searchUpdate.php M UsageTracker/maintenance/usageTrackerUpdate.php 6 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions refs/changes/96/382396/1 diff --git a/Avatars/maintenance/CreateAvatarHTML.php b/Avatars/maintenance/CreateAvatarHTML.php index 504197f..cc8a376 100644 --- a/Avatars/maintenance/CreateAvatarHTML.php +++ b/Avatars/maintenance/CreateAvatarHTML.php @@ -12,8 +12,8 @@ $this->mDescription = "Create HTML with links to Avatars"; #$this->addArg( "username", "Username of new user" ); #$this->addArg( "password", "Password to set (not required if --force is used)", false); - $this->requireExtension( 'BlueSpiceExtensions' ); $this->requireExtension( 'BlueSpiceFoundation' ); + $this->requireExtension( 'Avatars' ); } public function execute() { diff --git a/Dashboards/maintenance/clearConfigs.php b/Dashboards/maintenance/clearConfigs.php index e19be2f..9adcecd 100644 --- a/Dashboards/maintenance/clearConfigs.php +++ b/Dashboards/maintenance/clearConfigs.php @@ -5,8 +5,8 @@ class BSDashBoardsClearConfigMaintenance extends LoggedUpdateMaintenance { public function __construct() { parent::__construct(); - $this->requireExtension( 'BlueSpiceExtensions' ); $this->requireExtension( 'BlueSpiceFoundation' ); + $this->requireExtension( 'Dashboards' ); } public function doDBUpdates() { diff --git a/ExtendedSearch/maintenance/searchAddToIndex.php b/ExtendedSearch/maintenance/searchAddToIndex.php index d4340f2..c18537a 100644 --- a/ExtendedSearch/maintenance/searchAddToIndex.php +++ b/ExtendedSearch/maintenance/searchAddToIndex.php @@ -10,7 +10,7 @@ public function __construct() { parent::__construct(); $this->addOption( 'input', 'plain text list of article names ( NS:Title )', true, true ); - $this->requireExtension( 'BlueSpiceExtensions' ); + $this->requireExtension( 'ExtendedSearch' ); } /** diff --git a/ExtendedSearch/maintenance/searchDeleteIndex.php b/ExtendedSearch/maintenance/searchDeleteIndex.php index b2761f8..b96f26f 100644 --- a/ExtendedSearch/maintenance/searchDeleteIndex.php +++ b/ExtendedSearch/maintenance/searchDeleteIndex.php @@ -15,7 +15,7 @@ public function __construct() { parent::__construct(); - $this->requireExtension( 'BlueSpiceExtensions' ); + $this->requireExtension( 'ExtendedSearch' ); $this->requireExtension( 'BlueSpiceFoundation' ); $this->addOption( 'param', 'Specific param to delete', false, true ); } diff --git a/ExtendedSearch/maintenance/searchUpdate.php b/ExtendedSearch/maintenance/searchUpdate.php index d7ea035..0f7b7bc 100644 --- a/ExtendedSearch/maintenance/searchUpdate.php +++ b/ExtendedSearch/maintenance/searchUpdate.php @@ -19,7 +19,7 @@ class SearchUpdate extends BSMaintenance { public function __construct() { parent::__construct(); - $this->requireExtension( 'BlueSpiceExtensions' ); + $this->requireExtension( 'ExtendedSearch' ); } public function execute() { diff --git a/UsageTracker/maintenance/usageTrackerUpdate.php b/UsageTracker/maintenance/usageTrackerUpdate.php index 4674925..049f6ee 100644 --- a/UsageTracker/maintenance/usageTrackerUpdate.php +++ b/UsageTracker/maintenance/usageTrackerUpdate.php @@ -19,7 +19,7 @@ class UsageTrackerUpdate extends BSMaintenance { public function __construct() { parent::__construct(); - $this->requireExtension( 'BlueSpiceExtensions' ); + $this->requireExtension( 'UsageTracker' ); } public function execute() { -- To view, visit https://gerrit.wikimedia.org/r/382396 To unsubscribe, visit
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: Moved the configurations to BlueSpiceFoundation registry cal...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382394 ) Change subject: Moved the configurations to BlueSpiceFoundation registry callback .. Moved the configurations to BlueSpiceFoundation registry callback * moved the includes of DefaultSettings.php and Defines.php into the CoreHooks * removed includes/AutoLoader.php as this is not needed anymore * moved the last hook in BlueSpice.hooks.php into the extension.json => renamed the extension from "BlueSpice" to "BlueSpiceFoundation" => Follow up to https://gerrit.wikimedia.org/r/#/c/381719/ Change-Id: I03f8d5262f5639ff8f4c3d1347d5b12a6ebb375e --- D BlueSpice.hooks.php M BlueSpiceFoundation.php M extension.json D includes/AutoLoader.php M includes/CoreHooks.php M includes/DefaultSettings.php 6 files changed, 29 insertions(+), 56 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/94/382394/1 diff --git a/BlueSpice.hooks.php b/BlueSpice.hooks.php deleted file mode 100644 index 7c071c8..000 --- a/BlueSpice.hooks.php +++ /dev/null @@ -1,4 +0,0 @@ -isLoaded('BlueSpiceFoundation') ){ wfLoadExtension('BlueSpiceFoundation'); } - -if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) { - include_once( __DIR__ . '/vendor/autoload.php' ); -} - -$GLOBALS['wgFooterIcons']['poweredby']['bluespice'] = array( - "src" => $GLOBALS['wgScriptPath'] . "/extensions/BlueSpiceFoundation/resources/bluespice/images/bs-poweredby_bluespice_88x31.png", - "url" => "http://bluespice.com;, - "alt" => "Powered by BlueSpice", -); - -require_once( __DIR__."/includes/AutoLoader.php"); -require_once( __DIR__."/includes/Defines.php" ); -require_once( __DIR__."/includes/DefaultSettings.php" ); - -// Register hooks -require_once( 'BlueSpice.hooks.php' ); -//Setup - -// initalise BlueSpice as first extension in a fully initialised environment -array_unshift( - $GLOBALS['wgExtensionFunctions'], - 'BsCore::doInitialise' -); \ No newline at end of file diff --git a/extension.json b/extension.json index 4e4d878..57988e8 100644 --- a/extension.json +++ b/extension.json @@ -1,5 +1,5 @@ { - "name": "BlueSpice", + "name": "BlueSpiceFoundation", "version": "2.27.1", "license-name": "GPL-2.0+", "author": [ @@ -426,7 +426,10 @@ "SkinAfterContent": "BsCoreHooks::onSkinAfterContent", "ParserFirstCallInit": "BsCoreHooks::onParserFirstCallInit", "ExtensionTypes": "BsCoreHooks::onExtensionTypes", - "PageContentSaveComplete": "BsCoreHooks::onPageContentSaveComplete", + "PageContentSaveComplete": [ + "BsCoreHooks::onPageContentSaveComplete", + "BsCacheHelper::onPageContentSaveComplete" + ], "UnitTestsList": "BsCoreHooks::onUnitTestsList", "ResourceLoaderGetConfigVars": "BsExtensionManager::onResourceLoaderGetConfigVars" }, diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php deleted file mode 100644 index e31df44..000 --- a/includes/AutoLoader.php +++ /dev/null @@ -1,14 +0,0 @@ - $GLOBALS['wgScriptPath'] . "/extensions/BlueSpiceFoundation/resources/bluespice/images/bs-poweredby_bluespice_88x31.png", + "url" => "http://bluespice.com;, + "alt" => "Powered by BlueSpice", +); + /* * If this global is set to an array like * $bsgTestSystem = array( @@ -41,9 +47,9 @@ * the color will determine a div that is placed above the bs-wrapper * with the text element as a headline in it */ -$bsgTestSystem = false; +$GLOBALS['bsgTestSystem'] = false; -$bsgPermissionConfig = array( +$GLOBALS['bsgPermissionConfig'] = array( 'read' => array( 'type' => 'namespace', 'preventLockout' => true @@ -168,7 +174,7 @@ * renamed of deleted and system NS that can not be modified. Used in * BlueSpiceExtensions/NamespaceManager and NamespaceHelper */ -$bsgSystemNamespaces = array( +$GLOBALS['bsgSystemNamespaces'] = array( //1599 => 'NS_COOL_STUFF' ); @@ -315,7 +321,7 @@ /** * BsExtensionManager extension registration */ -$bsgExtensions = array(); +$GLOBALS['bsgExtensions'] = array(); /** * BsTemplateHelper template directory overwrite -- To view, visit https://gerrit.wikimedia.org/r/382394 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I03f8d5262f5639ff8f4c3d1347d5b12a6ebb375e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: Using the data store to determinate the fields, that need to...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/381184 ) Change subject: Using the data store to determinate the fields, that need to be saved .. Using the data store to determinate the fields, that need to be saved Change-Id: I725c90fb402cb6d46b0a917370ef492299cf05de --- A src/Data/Entity/Writer.php M src/Entity.php M src/EntityConfig.php 3 files changed, 49 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/84/381184/1 diff --git a/src/Data/Entity/Writer.php b/src/Data/Entity/Writer.php new file mode 100644 index 000..bc56dc3 --- /dev/null +++ b/src/Data/Entity/Writer.php @@ -0,0 +1,36 @@ +context = $context; + if( $this->context === null ) { + $this->context = \RequestContext::getMain(); + } + $this->config = $config; + if( $this->config === null ) { + $this->config = \MediaWiki\MediaWikiServices::getInstance()->getMainConfig(); + } + } + + public function getSchema() { + return new Schema(); + } + + /** +* +* @param array $dataSet +* @return \Status +*/ + public function write( $dataSet ) { + throw new Exception( 'Writing entity store is not supported yet' ); + } +} \ No newline at end of file diff --git a/src/Entity.php b/src/Entity.php index 275097a..9857921 100644 --- a/src/Entity.php +++ b/src/Entity.php @@ -241,11 +241,22 @@ if ( is_null( $oTitle ) ) { return \Status::newFatal( 'Related Title error' ); } + $sStoreClass = $this->getConfig()->get( 'StoreClass' ); + if( !class_exists( $sStoreClass ) ) { + return \Status::newFatal( "Store class '$sStoreClass' not found" ); + } + $oStore = new $sStoreClass( \RequestContext::getMain() ); + $oSchema = $oStore->getWriter()->getSchema(); + $aData = array_intersect_key( + $this->getFullData(), + array_flip( $oSchema->getStorableFields() ) + ); $oWikiPage = \WikiPage::factory( $oTitle ); + try { $oStatus = $oWikiPage->doEditContent( - new $sContentClass( json_encode( $this ) ), + new $sContentClass( json_encode( $aData ) ), "", 0, 0, diff --git a/src/EntityConfig.php b/src/EntityConfig.php index 5018097..6f5c783 100644 --- a/src/EntityConfig.php +++ b/src/EntityConfig.php @@ -116,6 +116,7 @@ abstract protected function addGetterDefaults(); abstract protected function get_EntityClass(); + abstract protected function get_StoreClass(); protected function get_ContentClass() { return "\\BlueSpice\\Content\\Entity"; -- To view, visit https://gerrit.wikimedia.org/r/381184 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I725c90fb402cb6d46b0a917370ef492299cf05de Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: Moved generateID to Content class
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/381175 ) Change subject: Moved generateID to Content class .. Moved generateID to Content class Change-Id: I0aa1a895a6038af5154cef940b30c36f91c0c5c7 --- M src/Content/Entity.php M src/Entity.php 2 files changed, 40 insertions(+), 31 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/75/381175/1 diff --git a/src/Content/Entity.php b/src/Content/Entity.php index ae5910e..36744cc 100644 --- a/src/Content/Entity.php +++ b/src/Content/Entity.php @@ -106,4 +106,36 @@ return \Xml::tags( 'tr', array(), $th . $td ); } + + /** +* Returns a generated id for a given entity. +* @param \BlueSpice\Entity $entity +* @return int +*/ + public static function generateID( \BlueSpice\Entity $entity ) { + //this is the case if the current Entity is new (no Title created yet) + //Get the page_title of the last created title in entity namespace and + //add +1. Entities are stored like: MYEntityNamespace:1, + //MYEntityNamespace:2, MYEntityNamespace:3 + if ( (int) $entity->getID() > 0 ) { + return $entity->getID(); + } + $dbw = wfGetDB( DB_MASTER ); + $res = $dbw->selectRow( + 'page', + 'page_title', + array( 'page_namespace' => $entity::NS ), + __METHOD__, + array( + 'ORDER BY' => 'LENGTH( page_title ) DESC, page_title DESC' + ) + ); + + if ( $res ) { + $id = (int) $res->page_title + 1; + } else { + $id = 1; + } + return $id; + } } \ No newline at end of file diff --git a/src/Entity.php b/src/Entity.php index e8bb3d9..275097a 100644 --- a/src/Entity.php +++ b/src/Entity.php @@ -74,32 +74,6 @@ return $oInstance; } - protected function generateID() { - //this is the case if the current Entity is new (no Title created yet) - //Get the page_title of the last created title in entity namespace and - //add +1. Entities are stored like: MYEntityNamespace:1, - //MYEntityNamespace:2, MYEntityNamespace:3 - //TODO: This should be done by related Content object - if ( (int) $this->getID() === 0 ) { - $dbw = wfGetDB( DB_MASTER ); - $res = $dbw->selectRow( - 'page', - 'page_title', - array( 'page_namespace' => static::NS ), - __METHOD__, - array( - 'ORDER BY' => 'LENGTH( page_title ) DESC, page_title DESC' - ) - ); - - if ( $res ) { - $this->iID = (int) $res->page_title + 1; - } else { - $this->iID = 1; - } - } - } - /** * Get Entity by EntityContent Object, wrapper for newFromObject * @param EntityContent $sContent @@ -239,16 +213,20 @@ * @return \Status */ public function save( \User $oUser = null, $aOptions = [] ) { - if( !$oUser instanceof User ) { + if( !$oUser instanceof \User ) { return \Status::newFatal( 'No User' ); } if( $this->exists() && !$this->hasUnsavedChanges() ) { return \Status::newGood( $this ); } - if( empty($this->getID()) ) { - $this->generateID(); + $sContentClass = $this->getConfig()->get( 'ContentClass' ); + if( !class_exists( $sContentClass ) ) { + return \Status::newFatal( "Content class '$sContentClass' not found" ); } - if( empty($this->getID()) ) { + if( empty( $this->getID() ) ) { + $this->iID = $sContentClass::generateID( $this ); + } + if( empty( $this->getID() ) ) { return \Status::newFatal( 'No ID generated' ); } if( empty($this->getOwnerID()) ) { @@ -265,7 +243,6 @@ } $oWikiPage = \WikiPage::factory( $oTitle ); - $sContentClass = $this->getConfig()->get( 'ContentClass' ); try { $oStatus
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: Added entity schema and entity reader base class
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380527 ) Change subject: Added entity schema and entity reader base class .. Added entity schema and entity reader base class Also improved the schema base class Change-Id: I96e369b299a7f250f5da5f43df840adddba1153b --- A src/Data/Entity/Reader.php A src/Data/Entity/Schema.php M src/Data/Schema.php M src/EntityConfig.php 4 files changed, 190 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/27/380527/1 diff --git a/src/Data/Entity/Reader.php b/src/Data/Entity/Reader.php new file mode 100644 index 000..35d44a6 --- /dev/null +++ b/src/Data/Entity/Reader.php @@ -0,0 +1,10 @@ + true, + self::SORTABLE => true, + self::TYPE => FieldType::STRING, + self::STORABLE => true, + self::INDEXABLE => true, + ]; + } + + protected function fillMissingWithDefaults( $fieldDefinition ) { + foreach( $this->getDefaultFieldDefinition() as $key => $defaultVal ) { + if( array_key_exists( $key, $fieldDefinition ) ) { + continue; + } + $fieldDefinition[$key] = $defaultVal; + } + return $fieldDefinition; + } + + /** +* +* @return \BlueSpice\Social\EntityConfig[] +*/ + protected function getEntityConfigs() { + $entityConfigs = []; + foreach( EntityRegistry::getRegisterdTypeKeys() as $type ) { + if( !$entityConfig = EntityConfig::factory( $type ) ) { + continue; + } + $entityConfigs[] = $entityConfig; + } + return $entityConfigs; + } + + public function __construct() { + $scheme = []; + foreach( $this->getEntityConfigs() as $entityConfig ) { + $definitions = $entityConfig->get( 'AttributeDefinitions' ); + foreach( $definitions as $key => $definition ) { + $definitions[$key] = $this->fillMissingWithDefaults( + $definition + ); + } + $scheme = array_merge( $scheme, $definitions ); + } + parent::__construct( $scheme ); + } + + /** +* @return string[] +*/ + public function getIndexableFields() { + return array_keys( $this->filter( self::INDEXABLE, true ) ); + } + + /** +* @return string[] +*/ + public function getStorableFields() { + return array_keys( $this->filter( self::STORABLE, true ) ); + } + + /** +* @return string[] +*/ + public function getUnindexableFields() { + return array_keys( $this->filter( self::INDEXABLE, false ) ); + } + + /** +* @return string[] +*/ + public function getUnstorableFields() { + return array_keys( $this->filter( self::STORABLE, false ) ); + } +} \ No newline at end of file diff --git a/src/Data/Schema.php b/src/Data/Schema.php index a59990f..817375a 100644 --- a/src/Data/Schema.php +++ b/src/Data/Schema.php @@ -7,28 +7,41 @@ const SORTABLE = 'sortable'; const TYPE = 'type'; + protected function filter( $key, $value ) { + return array_filter( (array)$this, function( $e ) use( $key, $value ) { + return array_key_exists( $key, $e ) + ? $e[$key] === $value + : false + ; + }); + } + /** * @return string[] */ public function getUnsortableFields() { - $unsortableFields = []; - foreach( $this as $fieldName => $fieldDef ) { - if( $this->fieldIsSortable( $fieldDef ) ) { - continue; - } - - $unsortableFields[] = $fieldName; - } - - return $unsortableFields; + return array_keys( $this->filter( self::SORTABLE, false ) ); } - protected function fieldIsSortable( $fieldDef ) { - if( !isset( $fieldDef[self::SORTABLE] ) ) { - return false; - } + /** +* @return string[] +*/ + public function getUnfilterableFields() { + return array_keys( $this->filter( self::FILTERABLE, false ) ); + } - return $fieldDef[self::SORTABLE]; +
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: Replaced private variable and method definitions in new data...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380492 ) Change subject: Replaced private variable and method definitions in new data reader with protected .. Replaced private variable and method definitions in new data reader with protected Change-Id: I191bbc9fff157ff27b386e754356a98a328848f6 --- M src/Data/Reader.php M src/Data/ReaderParams.php 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/92/380492/1 diff --git a/src/Data/Reader.php b/src/Data/Reader.php index 05621d2..6afc5f3 100644 --- a/src/Data/Reader.php +++ b/src/Data/Reader.php @@ -10,7 +10,7 @@ * * @var \IContextSource */ - private $context = null; + protected $context = null; /** * diff --git a/src/Data/ReaderParams.php b/src/Data/ReaderParams.php index 5265c78..b7390ab 100644 --- a/src/Data/ReaderParams.php +++ b/src/Data/ReaderParams.php @@ -49,7 +49,7 @@ $this->setFilter( $params ); } - private function setIfAvailable( &$property, $source, $field ) { + protected function setIfAvailable( &$property, $source, $field ) { if( isset( $source[$field] ) ) { $property = $source[$field]; } -- To view, visit https://gerrit.wikimedia.org/r/380492 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I191bbc9fff157ff27b386e754356a98a328848f6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Removed the cores "ScriptBlock" functionality ...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/379515 ) Change subject: BSFoundation: Removed the cores "ScriptBlock" functionality ... .. BSFoundation: Removed the cores "ScriptBlock" functionality ... ... cause i am not even old enough to know when this was in use ;) Change-Id: Iec7f5727dd250646993ca0d6817ab395929ad763 --- M includes/Core.class.php M includes/CoreHooks.php 2 files changed, 0 insertions(+), 31 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/15/379515/1 diff --git a/includes/Core.class.php b/includes/Core.class.php index 3775882..2048a6b 100644 --- a/includes/Core.class.php +++ b/includes/Core.class.php @@ -102,8 +102,6 @@ */ protected static $aUserMiniProfiles = array(); - protected static $aClientScriptBlocks = array(); - protected static $bHtmlFormClassLoaded = false; /** @@ -718,25 +716,5 @@ public static function getMediaWikiWebrootPath() { global $wgScriptPath; return str_replace($wgScriptPath, '', self::getMediaWikiIncludePath()); - } - - public static function getClientScriptBlocks() { - return self::$aClientScriptBlocks; - } - - /** -* Use this to place javascript logic _below_ the including script files. Therefore you can benefit from the available frameworks like BlueSpiceFramework, ExtJS and jQuery. -* @param String $sExtensionKey The name of the extension. This is just for creating a nice comment within the script-Tags -* @param String $sCode The JavaScript code, that should be executed after all scriptfiles have been included -* @param String $sUniqueKey (Optional) If provided the script block gets saved in with a unique key and therefore will not be registered multiple times. -* @deprecated Use MediaWikis Outpage interface instead -*/ - public static function registerClientScriptBlock( $sExtensionKey, $sCode, $sUniqueKey = '' ) { - wfDeprecated(__METHOD__); - if( !empty( $sUniqueKey ) ) { - self::$aClientScriptBlocks[$sUniqueKey] = array( $sExtensionKey, $sCode ); - } else { - self::$aClientScriptBlocks[] = array( $sExtensionKey, $sCode ); - } } } diff --git a/includes/CoreHooks.php b/includes/CoreHooks.php index 9955cf2..9b41d5e 100755 --- a/includes/CoreHooks.php +++ b/includes/CoreHooks.php @@ -83,15 +83,6 @@ $wgFavicon = BsConfig::get( 'MW::FaviconPath' ); - $aScriptBlocks = BsCore::getClientScriptBlocks(); - foreach ( $aScriptBlocks as $sKey => $aClientScriptBlock ) { - $aOutput[] = ''; - $aOutput[] = '//'.$aClientScriptBlock[0].' ('.$sKey.')'; - $aOutput[] = $aClientScriptBlock[1]; - $aOutput[] = ''; - $out->addScript( implode( "\n", $aOutput ) ); - } - //Make some variables available on client side: global $wgEnableUploads, $wgMaxUploadSize; $iMaxPhpUploadSize = (int) ini_get('upload_max_filesize'); -- To view, visit https://gerrit.wikimedia.org/r/379515 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iec7f5727dd250646993ca0d6817ab395929ad763 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Duplicator[master]: Fixed specialpage messages not getting rendered correctly
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/379493 ) Change subject: Fixed specialpage messages not getting rendered correctly .. Fixed specialpage messages not getting rendered correctly => Needs cherry-picks to REL1_30, REL1_29, REL1_28, REL1_27 Change-Id: Icc8a7db7c3ed2106dd6bf0abba03f8300db9c555 --- M Duplicator.page.php 1 file changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Duplicator refs/changes/93/379493/1 diff --git a/Duplicator.page.php b/Duplicator.page.php index d41bce0..0f4d3ee 100644 --- a/Duplicator.page.php +++ b/Duplicator.page.php @@ -116,13 +116,13 @@ $num = $this->duplicate( $this->sourceTitle, $this->destTitle, $this->history ); if( $num ) { $success = Html::openElement( 'ul' ) . - Html::element( 'li', + Html::rawElement( 'li', array(), $this->msg( 'duplicator-success', $this->sourceTitle->getPrefixedText(), $this->destTitle->getPrefixedText() - )->plain() . ' ' . - $this->msg( 'duplicator-success-revisions' )->numParams( $num )->plain() + )->parse() . ' ' . + $this->msg( 'duplicator-success-revisions' )->numParams( $num )->text() ); # If there are subpages and we've been asked to duplicate them, do so @@ -135,20 +135,20 @@ $dt = $this->destTitle->getTalkPage(); $num = $this->duplicate( $st, $dt, $this->history ); if ( $num ) { - $success .= Html::element( 'li', + $success .= Html::rawElement( 'li', array(), $this->msg( 'duplicator-success', $st->getPrefixedText(), $dt->getPrefixedText() - )->plain() . ' ' . - $this->msg( 'duplicator-success-revisions' )->numParams( $num )->plain() + )->parse() . ' ' . + $this->msg( 'duplicator-success-revisions' )->numParams( $num )->text() ); if ( $this->subpages ) { $success .= $this->duplicateSubpages( $st, $dt, $this->history ); } } else { - $success .= Html::element( 'li', array(), $this->msg( 'duplicator-success-talknotcopied' )->plain() ); + $success .= Html::rawElement( 'li', array(), $this->msg( 'duplicator-success-talknotcopied' )->text() ); } } @@ -260,7 +260,7 @@ $this->msg( 'duplicator-failed-dest-exists', $sub->getPrefixedText(), $destSub->getPrefixedText() - )->plain() + )->text() ); } else { $num = $this->duplicate( $sub, $destSub, $this->history ); @@ -269,15 +269,15 @@ $this->msg( 'duplicator-success', $sub->getPrefixedText(), $destSub->getPrefixedText() - )->plain() . ' ' . + )->text() . ' ' . $this->msg( 'duplicator-success-revisions', $wgLang->formatNum( $num ) - )->plain() + )->text() ); } } else {
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: [WIP]: BSFoundation: DynamicFileDisplatcher initial
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378243 ) Change subject: [WIP]: BSFoundation: DynamicFileDisplatcher initial .. [WIP]: BSFoundation: DynamicFileDisplatcher initial Change-Id: I0289c32020607414db921499e3e16f331b9fae9b --- A dynamic_file.php M extension.json A src/DynamicFileDispatcher.php A src/DynamicFileDispatcher/UserProfileImage.php 4 files changed, 272 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/43/378243/1 diff --git a/dynamic_file.php b/dynamic_file.php new file mode 100644 index 000..9b213e6 --- /dev/null +++ b/dynamic_file.php @@ -0,0 +1,46 @@ +checkUrlExtension() ) { + return; +} + +// Set a dummy $wgTitle, because $wgTitle == null breaks various things +// In a perfect world this wouldn't be necessary +$wgTitle = Title::makeTitle( + NS_SPECIAL, + 'Badtitle/dummy title for dynamic file calls set in dynamic_file.php' +); + +// RequestContext will read from $wgTitle, but it will also whine about it. +// In a perfect world this wouldn't be necessary either. +RequestContext::getMain()->setTitle( $wgTitle ); +$fileDispatcher = null; +try { + $fileDispatcher = DynamicFileDispatcher::newFromRequest( + RequestContext::getMain() + ); + + if ( !$fileDispatcher instanceof DynamicFileDispatcher ) { + throw new MWException( 'Bad file dispatcher module' ); + } + header( 'Content-type: '.$fileDispatcher->getMimeType() ); + readfile( $fileDispatcher->getInternalUrl() ); + //$fileDispatcher->getContent(); +} catch ( Exception $e ) { + echo $e; +} + +$mediawiki = new MediaWiki(); +$mediawiki->doPostOutputShutdown( 'fast' ); diff --git a/extension.json b/extension.json index a3bc9b2..83da09c 100644 --- a/extension.json +++ b/extension.json @@ -435,6 +435,9 @@ "[http://www.hallowelt.com Hallo Welt! GmbH]" ] }, + "DynamicFileRegistry": { + "userprofileimage": "\\BlueSpice\\DynamicFileDispatcher\\UserProfileImage" + }, "ConfigFiles": [] }, "ConfigRegistry": { diff --git a/src/DynamicFileDispatcher.php b/src/DynamicFileDispatcher.php new file mode 100644 index 000..b82260a --- /dev/null +++ b/src/DynamicFileDispatcher.php @@ -0,0 +1,179 @@ +getRequest()->getVal( + static::MODULE, + '' + ); + } + $instance = static::factory( $params, $context ); + $instance->extractParamsFromRequest(); + return $instance; + } + + protected static function getModule( $moduleName ) { + $modules = static::getModules(); + if( !isset( $modules[$moduleName] ) ) { + return false; + } + return $modules[$moduleName]; + } + + protected static function getModules() { + if( static::$modules ) { + return static::$modules; + } + $config = \MediaWiki\MediaWikiServices::getInstance() + ->getConfigFactory()->makeConfig( 'bsg' ); + static::$modules = $config->get( 'DynamicFileRegistry' ); + return static::$modules; + } + + protected function __construct( $params, $context ) { + $this->context = $context; + $this->extractParams( $params ); + } + + public function getParamDefinition() { + return [ + static::MODULE => [ + static::PARAM_TYPE => static::TYPE_STRING, + static::PARAM_DEFAULT => '', + ] + ]; + } + + protected function extractParams( $params ) { + $this->module = $params[ static::MODULE ]; + foreach( $this->getParamDefinition() as $paramName => $definition ) { + if( $paramName === static::MODULE ) { + continue; + } + if( isset( $params[$paramName] ) ) { + $this->$paramName = $params[$paramName]; + continue; + } + $this->$paramName = $definition[static::PARAM_DEFAULT]; + } + } + + protected function extractParamsFromRequest() { + $request = $this->getContext()->getRequest(); + foreach( $this->getParamDefinition() as $paramName => $definition ) { + if( $paramName === static::MODULE ) { + continue; + } +
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtendedSearch[master]: BSWikiAdmin: Admin menu - individual module permission check
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/377788 ) Change subject: BSWikiAdmin: Admin menu - individual module permission check .. BSWikiAdmin: Admin menu - individual module permission check * Added individual permission checks to the extensions that make use of the hook BSWikiAdminMenuItems to register non WikiAdminModule links to the menu => Soft requires https://gerrit.wikimedia.org/r/#/c/377786/ => part of #7401 Change-Id: Ifff5629df315f3ffc3f01b55ecf9b9e9a4385b2f --- M src/Setup.php 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtendedSearch refs/changes/88/377788/1 diff --git a/src/Setup.php b/src/Setup.php index 6c2f155..75ffd70 100644 --- a/src/Setup.php +++ b/src/Setup.php @@ -42,9 +42,13 @@ /** * Adds link to admin panel * @param array $aOutSortable +* @param \User The user in which context the menu is rendered * @return boolean always true to keep hook running */ - public static function onBSWikiAdminMenuItems( &$aOutSortable ) { + public static function onBSWikiAdminMenuItems( &$aOutSortable, $oUser ) { + if( !$oUser->isAllowed( 'extendedsearchadmin-viewspecialpage' ) ) { + return true; + } $oSpecialPage = \SpecialPage::getTitleFor( 'BSSearchAdmin' ); $sLink = \Html::element( 'a', -- To view, visit https://gerrit.wikimedia.org/r/377788 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifff5629df315f3ffc3f01b55ecf9b9e9a4385b2f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtendedSearch Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceCategoryManager[master]: BSWikiAdmin: Admin menu - individual module permission check
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/377789 ) Change subject: BSWikiAdmin: Admin menu - individual module permission check .. BSWikiAdmin: Admin menu - individual module permission check * Added individual permission checks to the extensions that make use of the hook BSWikiAdminMenuItems to register non WikiAdminModule links to the menu => Requires https://gerrit.wikimedia.org/r/#/c/377786/ => Needs cherry-pick to REL1_27 => part of #7401 Change-Id: I3fa7d185922bb45270760843daa5f261d4ab935a --- M includes/BlueSpiceCategoryManager.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceCategoryManager refs/changes/89/377789/1 diff --git a/includes/BlueSpiceCategoryManager.php b/includes/BlueSpiceCategoryManager.php index 0a7857b..73b2db7 100644 --- a/includes/BlueSpiceCategoryManager.php +++ b/includes/BlueSpiceCategoryManager.php @@ -7,7 +7,8 @@ 'image' => '/extensions/BlueSpiceCategoryManager/resources/images/bs-btn_categorymanager.png', 'level' => 'wikiadmin', 'message' => 'bs-categorymanager-label', - 'iconCls' => 'bs-icon-tag' + 'iconCls' => 'bs-icon-tag', + 'permissions' => [ 'categorymanager-viewspecialpage' ], ) ); wfProfileOut( 'BS::'.__METHOD__ ); } -- To view, visit https://gerrit.wikimedia.org/r/377789 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3fa7d185922bb45270760843daa5f261d4ab935a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceCategoryManager Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: BSWikiAdmin: Admin menu - individual module permission check
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/377786 ) Change subject: BSWikiAdmin: Admin menu - individual module permission check .. BSWikiAdmin: Admin menu - individual module permission check * Admin menu for left sidebar now checks individual admin module permissions instead of only showing when user has 'wikiadmin' permission * Added individual permissions for admin modules to the extensions providing these * Added individual permission checks to the extensions that make use of the hook BSWikiAdminMenuItems to register non WikiAdminModule links to the menu => part of #7401 => needs cherry-pick to REL1_27 Change-Id: I33a14d6a429d474d3a900e8e23d40b061fc965b3 --- M AboutBlueSpice/AboutBlueSpice.class.php M ExtensionInfo/ExtensionInfo.class.php M Flexiskin/Flexiskin.class.php M GroupManager/GroupManager.class.php M InterWikiLinks/InterWikiLinks.class.php M NamespaceManager/NamespaceManager.class.php M PageAssignments/includes/PageAssignmentsHooks.php M PageTemplates/PageTemplates.class.php M PermissionManager/PermissionManager.class.php M Preferences/Preferences.class.php M UserManager/UserManager.class.php M WikiAdmin/WikiAdmin.class.php 12 files changed, 66 insertions(+), 41 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions refs/changes/86/377786/1 diff --git a/AboutBlueSpice/AboutBlueSpice.class.php b/AboutBlueSpice/AboutBlueSpice.class.php index efa6a08..9bea414 100644 --- a/AboutBlueSpice/AboutBlueSpice.class.php +++ b/AboutBlueSpice/AboutBlueSpice.class.php @@ -65,12 +65,16 @@ /** * Returns a list item with a link to the "About BlueSpice" special page * @param array $aOutSortable Indexed list of menu items. Add item in HTML form. +* @param \User The user in which context the menu is rendered * @return string Link to the "About BlueSpice" special page */ - public static function onBSWikiAdminMenuItems( &$aOutSortable ) { + public static function onBSWikiAdminMenuItems( &$aOutSortable, $oUser ) { if ( !BsConfig::get( 'MW::AboutBlueSpice::ShowMenuLinks' )) { return true; } + if( !$oUser->isAllowed( 'aboutbluespice-viewspecialpage' ) ) { + return true; + } $oSpecialPage = SpecialPage::getTitleFor( 'AboutBlueSpice' ); $sLink = Html::element( 'a', diff --git a/ExtensionInfo/ExtensionInfo.class.php b/ExtensionInfo/ExtensionInfo.class.php index 3368573..8bf1b63 100644 --- a/ExtensionInfo/ExtensionInfo.class.php +++ b/ExtensionInfo/ExtensionInfo.class.php @@ -41,9 +41,13 @@ /** * Adds a link to WikiAdmin menu * @param array $aOutSortable +* @param \User The user in which context the menu is rendered * @return boolean Alway true to keep hook running */ - public static function onBSWikiAdminMenuItems( &$aOutSortable ) { + public static function onBSWikiAdminMenuItems( &$aOutSortable, $oUser ) { + if( !$oUser->isAllowed( 'wikiadmin' ) ) { + return true; + } $sLabel = wfMessage( 'bs-extensioninfo-label' )->plain(); $aOutSortable[$sLabel] = Html::rawElement( 'li', array(), Linker::link( SpecialPage::getTitleFor( 'ExtensionInfo' ), $sLabel, array( 'class' => 'bs-admin-link bs-icon-puzzle' ) ) diff --git a/Flexiskin/Flexiskin.class.php b/Flexiskin/Flexiskin.class.php index 8158787..fa494fd 100755 --- a/Flexiskin/Flexiskin.class.php +++ b/Flexiskin/Flexiskin.class.php @@ -50,7 +50,8 @@ 'image' => '/extensions/BlueSpiceExtensions/WikiAdmin/resources/images/bs-btn_flexiskin_v1.png', 'level' => 'wikiadmin', 'message' => 'bs-flexiskin-label', - 'iconCls' => 'bs-icon-painting-roll' + 'iconCls' => 'bs-icon-painting-roll', + 'permissions' => [ 'flexiskin-viewspecialpage' ], ) ); wfProfileOut( 'BS::' . __METHOD__ ); } diff --git a/GroupManager/GroupManager.class.php b/GroupManager/GroupManager.class.php index 75e218c..d5fc90b 100644 --- a/GroupManager/GroupManager.class.php +++ b/GroupManager/GroupManager.class.php @@ -43,13 +43,13 @@ */ public function __construct() { wfProfileIn( 'BS::'.__METHOD__ ); - WikiAdmin::registerModule('GroupManager', array( + WikiAdmin::registerModule( 'GroupManager', [ 'image' => '/extensions/BlueSpiceExtensions/WikiAdmin/resources/images/bs-btn_gruppe_v1.png', 'level' => 'wikiadmin', 'message' => 'bs-groupmanager-label', -
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Added more hook base classes
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/377216 ) Change subject: BSFoundation: Added more hook base classes .. BSFoundation: Added more hook base classes * GetPreferences * SkinTemplateOutputPageBeforeExec Change-Id: Ia7d142fd81b506a7894f4b63cb2c730ea200bb3c --- A src/Hook/GetPreferences.php A src/Hook/SkinTemplateOutputPageBeforeExec.php 2 files changed, 150 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/16/377216/1 diff --git a/src/Hook/GetPreferences.php b/src/Hook/GetPreferences.php new file mode 100644 index 000..6d4d341 --- /dev/null +++ b/src/Hook/GetPreferences.php @@ -0,0 +1,75 @@ +http://bluespice.com + * + * @author Patric Wirth+ * @packageBlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @licensehttp://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class GetPreferences extends Hook { + + /** +* +* @var \User +*/ + protected $user = null; + + /** +* +* @var array +*/ + protected $preferences = null; + + /** +* +* @param \User $user +* @param array $preferences +* @return boolean +*/ + public static function callback( $user, &$preferences ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $user, + $preferences + ); + return $hookHandler->process(); + } + + /** +* +* @param \IContextSource $context +* @param \Config $config +* @param \User $user +* @param array $preferences +*/ + public function __construct( $context, $config, &$user, &$preferences ) { + parent::__construct( $context, $config ); + + $this->user = $user; + $this->preferences = &$preferences; + } +} \ No newline at end of file diff --git a/src/Hook/SkinTemplateOutputPageBeforeExec.php b/src/Hook/SkinTemplateOutputPageBeforeExec.php new file mode 100644 index 000..cc1ebad --- /dev/null +++ b/src/Hook/SkinTemplateOutputPageBeforeExec.php @@ -0,0 +1,75 @@ +http://bluespice.com + * + * @author Patric Wirth + * @packageBlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @licensehttp://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class SkinTemplateOutputPageBeforeExec extends Hook { + + /** +* +* @var \SkinTemplate +*/ + protected $skin = null; + + /** +* +* @var \QuickTemplate +*/ + protected $template = null; + + /** +* +* @param \SkinTemplate $skin +* @param \QuickTemplate template +* @return boolean +*/ + public static function callback( &$skin, &$template ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $skin, + $template + ); + return $hookHandler->process(); + } + + /** +* +* @param \IContextSource $context +* @param \Config $config +* @param \SkinTemplate $skin +* @param \QuickTemplate template +*/ + public function __construct( $context, $config, &$skin, &$template ) { + parent::__construct( $context, $config ); + + $this->skin = $skin; + $this->template = &$template; + } +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/377216 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia7d142fd81b506a7894f4b63cb2c730ea200bb3c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Added missing wfProfileOut calls in FileSystem...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/376476 ) Change subject: BSFoundation: Added missing wfProfileOut calls in FileSystemHelper .. BSFoundation: Added missing wfProfileOut calls in FileSystemHelper Change-Id: Ic34375c7e74b46491705b76130a5537372b41b4c --- M includes/utility/FileSystemHelper.class.php 1 file changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/76/376476/1 diff --git a/includes/utility/FileSystemHelper.class.php b/includes/utility/FileSystemHelper.class.php index d392b52..ae0bb27 100644 --- a/includes/utility/FileSystemHelper.class.php +++ b/includes/utility/FileSystemHelper.class.php @@ -9,8 +9,10 @@ */ public static function ensureCacheDirectory($sSubDirName = '') { wfProfileIn(__METHOD__); - if (self::hasTraversal($sSubDirName)) + if ( self::hasTraversal( $sSubDirName ) ) { + wfProfileOut( __METHOD__ ); return Status::newFatal(wfMessage("bs-filesystemhelper-has-path-traversal")); + } if (!empty($sSubDirName) && !preg_match('#^[a-zA-Z/\\\]+#', $sSubDirName)) { wfProfileOut(__METHOD__); return Status::newFatal('Requested subdirectory of ' . BS_CACHE_DIR . ' contains illegal chars'); @@ -45,8 +47,10 @@ */ public static function ensureDataDirectory($sSubDirName = '') { wfProfileIn(__METHOD__); - if (self::hasTraversal($sSubDirName)) + if ( self::hasTraversal( $sSubDirName ) ) { + wfProfileOut( __METHOD__ ); return Status::newFatal(wfMessage("bs-filesystemhelper-has-path-traversal")); + } if (!empty($sSubDirName) && !preg_match('#^[a-zA-Z/\\\]+#', $sSubDirName)) { wfProfileOut(__METHOD__); return Status::newFatal('Requested subdirectory of ' . BS_DATA_DIR . ' contains illegal chars'); @@ -84,8 +88,10 @@ public static function saveToCacheDirectory($sFileName, $data, $sSubDirName = '') { wfProfileIn(__METHOD__); $oStatus = self::ensureCacheDirectory($sSubDirName); - if (self::hasTraversal($sSubDirName . DS . $sFileName)) + if ( self::hasTraversal( $sSubDirName . DS . $sFileName ) ) { + wfProfileOut( __METHOD__ ); return Status::newFatal(wfMessage("bs-filesystemhelper-has-path-traversal")); + } if (!$oStatus->isGood()) { wfProfileOut(__METHOD__); return $oStatus; @@ -109,8 +115,10 @@ public static function saveToDataDirectory($sFileName, $data, $sSubDirName = '') { wfProfileIn(__METHOD__); $oStatus = self::ensureDataDirectory($sSubDirName); - if (self::hasTraversal($sSubDirName . DS . $sFileName)) + if ( self::hasTraversal( $sSubDirName . DS . $sFileName ) ) { + wfProfileOut( __METHOD__ ); return Status::newFatal(wfMessage("bs-filesystemhelper-has-path-traversal")); + } if (!$oStatus->isGood()) { wfProfileOut(__METHOD__); return $oStatus; -- To view, visit https://gerrit.wikimedia.org/r/376476 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic34375c7e74b46491705b76130a5537372b41b4c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Fixed Entity default ns and instance 'cache'
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/376475 ) Change subject: BSFoundation: Fixed Entity default ns and instance 'cache' .. BSFoundation: Fixed Entity default ns and instance 'cache' Change-Id: Ic7796d91d1748664236d2b8d73a5328d324fc60b --- M src/Entity.php 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/75/376475/1 diff --git a/src/Entity.php b/src/Entity.php index 0de18dd..e8bb3d9 100644 --- a/src/Entity.php +++ b/src/Entity.php @@ -30,7 +30,7 @@ use BlueSpice\Content\Entity as EntityContent; abstract class Entity implements \JsonSerializable { - const NS = ''; + const NS = -1; protected static $aEntitiesByID = array(); protected $bUnsavedChanges = true; @@ -353,7 +353,7 @@ if( static::hasCacheEntry( $oInstance->getID() ) ) { return $oInstance; } - static::$aEntitiesByID[$oInstance->getID()] = $oInstance; + static::$aEntitiesByID[static::NS][$oInstance->getID()] = $oInstance; return $oInstance; } @@ -366,7 +366,7 @@ if( !static::hasCacheEntry($oInstance->getID()) ) { return $oInstance; } - unset( static::$aEntitiesByID[$oInstance->getID()] ); + unset( static::$aEntitiesByID[static::NS][$oInstance->getID()] ); return $oInstance; } @@ -379,11 +379,11 @@ if( !static::hasCacheEntry( $iID ) ) { return null; } - return static::$aEntitiesByID[(int) $iID]; + return static::$aEntitiesByID[static::NS][(int) $iID]; } protected static function hasCacheEntry( $iID ) { - return isset( static::$aEntitiesByID[(int) $iID] ); + return isset( static::$aEntitiesByID[static::NS][(int) $iID] ); } /** -- To view, visit https://gerrit.wikimedia.org/r/376475 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic7796d91d1748664236d2b8d73a5328d324fc60b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MultiLanguageManager[master]: Also hide the MLM label in the left sidebar for monobook skin
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/376192 ) Change subject: Also hide the MLM label in the left sidebar for monobook skin .. Also hide the MLM label in the left sidebar for monobook skin Change-Id: I72e5670352c91ebd32cefd9812ffee1b7c452e6d --- M resources/ext.mlm.less 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultiLanguageManager refs/changes/92/376192/1 diff --git a/resources/ext.mlm.less b/resources/ext.mlm.less index e884375..1021019 100644 --- a/resources/ext.mlm.less +++ b/resources/ext.mlm.less @@ -1,4 +1,4 @@ -#p-MLM-label { +#p-MLM-label, #p-MLM h3 { display: none; } li.mlm-flag { -- To view, visit https://gerrit.wikimedia.org/r/376192 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I72e5670352c91ebd32cefd9812ffee1b7c452e6d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MultiLanguageManager Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_27]: Statistics: Fix for NaN error on list
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/373877 ) Change subject: Statistics: Fix for NaN error on list .. Statistics: Fix for NaN error on list Type of column in list view was set as "int" even if only one member is integer. ERM: #7260 Change-Id: I1473ff92fff96c69f52cc6ead16f8aee5b872764 --- M Statistics/includes/api/BSApiStatisticsTasks.php 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions refs/changes/77/373877/1 diff --git a/Statistics/includes/api/BSApiStatisticsTasks.php b/Statistics/includes/api/BSApiStatisticsTasks.php index 1094a1a..61b3cee 100644 --- a/Statistics/includes/api/BSApiStatisticsTasks.php +++ b/Statistics/includes/api/BSApiStatisticsTasks.php @@ -188,6 +188,8 @@ for( $i = 0; $i < count( $aData ); $i++ ) { if( $this->isInt( $aData[ $i ] ) ) { $aTypes[ $aFields[ $i ][ 'name' ] ][] = 'int'; + } else { + $aTypes[ $aFields[ $i ][ 'name' ] ][] = 'string'; } $aItem[ $aFields[ $i ][ 'name' ] ] = $aData[ $i ]; } -- To view, visit https://gerrit.wikimedia.org/r/373877 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1473ff92fff96c69f52cc6ead16f8aee5b872764 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: REL1_27 Gerrit-Owner: PwirthGerrit-Reviewer: ItSpiderman ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[REL1_27]: Manually cherry-picked https://gerrit.wikimedia.org/r/#/c/37...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/373538 ) Change subject: Manually cherry-picked https://gerrit.wikimedia.org/r/#/c/373535/ .. Manually cherry-picked https://gerrit.wikimedia.org/r/#/c/373535/ Change-Id: I975b02f18918f6373cc7795485a9f80839dc1b88 BSFoundation: Changed the recent added getSubpagesSorted the match the style of ArticleHelper --- M includes/utility/ArticleHelper.class.php 1 file changed, 19 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/38/373538/1 diff --git a/includes/utility/ArticleHelper.class.php b/includes/utility/ArticleHelper.class.php index d09ad1c..9568b0f 100644 --- a/includes/utility/ArticleHelper.class.php +++ b/includes/utility/ArticleHelper.class.php @@ -178,25 +178,35 @@ } /** -* Retuns subpages of a title sorted by name +* Retuns subpages of a given title alphabetical sorted by fullArticleText * -* @param Title $oTitle +* @param \Title $oTitle * @param int $iLimit * @return array */ - public static function getSubpagesSorted( $oTitle, $iLimit ) { - $aSubpages = $oTitle->getSubpages( $iLimit ); + public static function getSubpagesSortedForTitle( \Title $oTitle, $iLimit = -1 ) { + return self::getInstance( $oTitle )->getSubpagesSorted( $iLimit ); + } + + /** +* Retuns subpages alphabetical sorted by fullArticleText +* @param int $iLimit +* @return array +*/ + public function getSubpagesSorted( $iLimit = -1 ) { + $aSubpages = $this->oTitle->getSubpages( $iLimit ); $aTitleArray = []; foreach( $aSubpages as $oSubpage ) { $aTitleArray[] = $oSubpage; } - usort( $aTitleArray, array( 'BsArticleHelper', 'sortSubpagesInternal' ) ); + usort( $aTitleArray, function( $a, $b ) { + return strcmp( + strtolower( $a->getFullText() ), + strtolower( $b->getFullText() ) + ); + }); return $aTitleArray; - } - - protected static function sortSubpagesInternal( $a, $b ) { - return strcmp( strtolower( $a->getFullText() ), strtolower( $b->getFullText() ) ); } } \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/373538 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I975b02f18918f6373cc7795485a9f80839dc1b88 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: REL1_27 Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: Changed the recent added getSubpagesSorted the match the sty...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/373536 ) Change subject: Changed the recent added getSubpagesSorted the match the style of ArticleHelper .. Changed the recent added getSubpagesSorted the match the style of ArticleHelper Change-Id: Ib64fc72c25d128b6e885a2ff45300c590c6158bd Requires: https://gerrit.wikimedia.org/r/#/c/373535/ --- M ArticleInfo/ArticleInfo.class.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions refs/changes/36/373536/1 diff --git a/ArticleInfo/ArticleInfo.class.php b/ArticleInfo/ArticleInfo.class.php index 8c74f9b..e251a64 100644 --- a/ArticleInfo/ArticleInfo.class.php +++ b/ArticleInfo/ArticleInfo.class.php @@ -501,7 +501,7 @@ $oSubpageListView->setKey( 'Subpages' ); $oSubpageListView->setHeading( wfMessage( 'bs-articleinfo-subpages' )->plain() ); - $aSubpages = BsArticleHelper::getSubpagesSorted( $oTitle, -1 ); + $aSubpages = BsArticleHelper::getSubpagesSortedForTitle( $oTitle ); if ( count( $aSubpages ) > 100 ) { $oSubpageListView->setBodyText( wfMessage( 'bs-articleinfo-subpages-too-much' )->plain() ); -- To view, visit https://gerrit.wikimedia.org/r/373536 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib64fc72c25d128b6e885a2ff45300c590c6158bd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Changed the recent added getSubpagesSorted the...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/373535 ) Change subject: BSFoundation: Changed the recent added getSubpagesSorted the match the style of ArticleHelper .. BSFoundation: Changed the recent added getSubpagesSorted the match the style of ArticleHelper Change-Id: I77984c0391b582bdaba964ba30afdb50ac6a305e --- M includes/utility/ArticleHelper.class.php 1 file changed, 19 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/35/373535/1 diff --git a/includes/utility/ArticleHelper.class.php b/includes/utility/ArticleHelper.class.php index d09ad1c..9568b0f 100644 --- a/includes/utility/ArticleHelper.class.php +++ b/includes/utility/ArticleHelper.class.php @@ -178,25 +178,35 @@ } /** -* Retuns subpages of a title sorted by name +* Retuns subpages of a given title alphabetical sorted by fullArticleText * -* @param Title $oTitle +* @param \Title $oTitle * @param int $iLimit * @return array */ - public static function getSubpagesSorted( $oTitle, $iLimit ) { - $aSubpages = $oTitle->getSubpages( $iLimit ); + public static function getSubpagesSortedForTitle( \Title $oTitle, $iLimit = -1 ) { + return self::getInstance( $oTitle )->getSubpagesSorted( $iLimit ); + } + + /** +* Retuns subpages alphabetical sorted by fullArticleText +* @param int $iLimit +* @return array +*/ + public function getSubpagesSorted( $iLimit = -1 ) { + $aSubpages = $this->oTitle->getSubpages( $iLimit ); $aTitleArray = []; foreach( $aSubpages as $oSubpage ) { $aTitleArray[] = $oSubpage; } - usort( $aTitleArray, array( 'BsArticleHelper', 'sortSubpagesInternal' ) ); + usort( $aTitleArray, function( $a, $b ) { + return strcmp( + strtolower( $a->getFullText() ), + strtolower( $b->getFullText() ) + ); + }); return $aTitleArray; - } - - protected static function sortSubpagesInternal( $a, $b ) { - return strcmp( strtolower( $a->getFullText() ), strtolower( $b->getFullText() ) ); } } \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/373535 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I77984c0391b582bdaba964ba30afdb50ac6a305e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_27]: ArticleInfo: Fix for subpage list sorting
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/373512 ) Change subject: ArticleInfo: Fix for subpage list sorting .. ArticleInfo: Fix for subpage list sorting Please see: https://gerrit.wikimedia.org/r/#/c/373294/ Change-Id: I09f3facb0852ee0888741358cafdbc3ae2021a00 ERM: #7287 --- M ArticleInfo/ArticleInfo.class.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions refs/changes/12/373512/1 diff --git a/ArticleInfo/ArticleInfo.class.php b/ArticleInfo/ArticleInfo.class.php index 467f901..8c74f9b 100644 --- a/ArticleInfo/ArticleInfo.class.php +++ b/ArticleInfo/ArticleInfo.class.php @@ -501,7 +501,7 @@ $oSubpageListView->setKey( 'Subpages' ); $oSubpageListView->setHeading( wfMessage( 'bs-articleinfo-subpages' )->plain() ); - $aSubpages = $oTitle->getSubpages( -1 ); + $aSubpages = BsArticleHelper::getSubpagesSorted( $oTitle, -1 ); if ( count( $aSubpages ) > 100 ) { $oSubpageListView->setBodyText( wfMessage( 'bs-articleinfo-subpages-too-much' )->plain() ); -- To view, visit https://gerrit.wikimedia.org/r/373512 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I09f3facb0852ee0888741358cafdbc3ae2021a00 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: REL1_27 Gerrit-Owner: PwirthGerrit-Reviewer: ItSpiderman ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[REL1_27]: Add getSubpagesSorted function
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/373511 ) Change subject: Add getSubpagesSorted function .. Add getSubpagesSorted function When calling getSubpages on Title object it will return a list that is not sorted, pages with capital letter will be before lowercased even if letter itself should go later. Eg. "Beta" would go before "alpha". This helper method fixed that sorting issue and returns properly sorted array Change-Id: I73fe4a9a44babaf4c9afd257612436578233551e ERM: #7287 --- M includes/utility/ArticleHelper.class.php 1 file changed, 22 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/11/373511/1 diff --git a/includes/utility/ArticleHelper.class.php b/includes/utility/ArticleHelper.class.php index 4c6a611..d09ad1c 100644 --- a/includes/utility/ArticleHelper.class.php +++ b/includes/utility/ArticleHelper.class.php @@ -177,4 +177,26 @@ BsCacheHelper::invalidateCache( $sKey ); } + /** +* Retuns subpages of a title sorted by name +* +* @param Title $oTitle +* @param int $iLimit +* @return array +*/ + public static function getSubpagesSorted( $oTitle, $iLimit ) { + $aSubpages = $oTitle->getSubpages( $iLimit ); + $aTitleArray = []; + foreach( $aSubpages as $oSubpage ) { + $aTitleArray[] = $oSubpage; + } + usort( $aTitleArray, array( 'BsArticleHelper', 'sortSubpagesInternal' ) ); + + return $aTitleArray; + } + + protected static function sortSubpagesInternal( $a, $b ) { + return strcmp( strtolower( $a->getFullText() ), strtolower( $b->getFullText() ) ); + } + } \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/373511 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73fe4a9a44babaf4c9afd257612436578233551e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: REL1_27 Gerrit-Owner: PwirthGerrit-Reviewer: ItSpiderman ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Added more base classes for MW hooks
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/373308 ) Change subject: BSFoundation: Added more base classes for MW hooks .. BSFoundation: Added more base classes for MW hooks * ArticleDeleteComplete, FileDeleteComplete, UploadComplete Change-Id: I2ef8f96c75cf09cec856a27904a49c801d071aa7 --- A src/Hook/ArticleDeleteComplete.php A src/Hook/FileDeleteComplete.php A src/Hook/UploadComplete.php 3 files changed, 280 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/08/373308/1 diff --git a/src/Hook/ArticleDeleteComplete.php b/src/Hook/ArticleDeleteComplete.php new file mode 100644 index 000..3f0a132 --- /dev/null +++ b/src/Hook/ArticleDeleteComplete.php @@ -0,0 +1,115 @@ +http://bluespice.com + * + * @author Patric Wirth+ * @packageBlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @licensehttp://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class ArticleDeleteComplete extends Hook { + + /** +* +* @var \WikiPage +*/ + protected $wikipage = null; + + /** +* +* @var \User +*/ + protected $user = null; + + /** +* +* @var string +*/ + protected $reason = null; + + /** +* +* @var integer +*/ + protected $id = null; + + /** +* +* @var \Content +*/ + protected $content = null; + + /** +* +* @var \LogEntry +*/ + protected $logEntry = false; + + /** +* +* @param \WikiPage $wikipage +* @param \User $user +* @param string $reason +* @param integer $id +* @param \Content $content +* @param \LogEntry $logEntry +* @return boolean +*/ + public static function callback( &$wikipage, &$user, $reason, $id, $content, $logEntry ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $wikipage, + $user, + $reason, + $id, + $content, + $logEntry + ); + return $hookHandler->process(); + } + + /** +* +* @param \IContextSource $context +* @param \Context $config +* @param \WikiPage $wikipage +* @param \User $user +* @param string $reason +* @param integer $id +* @param \Content $content +* @param \LogEntry $logEntry +*/ + public function __construct( $context, $config, &$wikipage, &$user, $reason, $id, $content, $logEntry ) { + parent::__construct( $context, $config ); + + $this->wikipage = &$wikipage; + $this->user = &$user; + $this->reason = $reason; + $this->id = $id; + $this->content = $content; + $this->logEntry = $logEntry; + } +} \ No newline at end of file diff --git a/src/Hook/FileDeleteComplete.php b/src/Hook/FileDeleteComplete.php new file mode 100644 index 000..a929e18 --- /dev/null +++ b/src/Hook/FileDeleteComplete.php @@ -0,0 +1,100 @@ +http://bluespice.com + * + * @author Patric Wirth + * @packageBlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @licensehttp://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class FileDeleteComplete extends Hook { + /** +* +* @var \File +*/ + protected $file = null; + /** +* Archive name +* @var string +*/ + protected $oldimage = null; + /** +* +* @var \WikiPage +*/ + protected $wikipage = null; + /** +* +* @var \User +*/ + protected $user = null; + /** +* +* @var string +*/ + protected $reason = null; + + /** +* +* @param \File $file +* @param string $oldimage +* @param \WikiPage $wikipage +* @param \User $user +* @param string $reason +* @return boolean +*/ + public static function callback( $file, $oldimage, $wikipage, $user, $reason ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $file, +
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_27]: Statistics: Fix for column label and dataIndex
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/373301 ) Change subject: Statistics: Fix for column label and dataIndex .. Statistics: Fix for column label and dataIndex In statistic tables data index is derived from field label ( message key ). Its normalized (lowecased, spaces replaced with _), but there was a case where label contained a period, which is also not allowed, breaking that columns values. Change-Id: I07a2e47ed8f23151ffef275650555da2064ee40f ERM: #7260 --- M Statistics/includes/api/BSApiStatisticsTasks.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions refs/changes/01/373301/1 diff --git a/Statistics/includes/api/BSApiStatisticsTasks.php b/Statistics/includes/api/BSApiStatisticsTasks.php index a47c73c..1094a1a 100644 --- a/Statistics/includes/api/BSApiStatisticsTasks.php +++ b/Statistics/includes/api/BSApiStatisticsTasks.php @@ -176,6 +176,7 @@ foreach( $aLabels as $sLabel ) { $sField = strtolower( $sLabel ); $sField = str_replace( " ", "_", $sField ); + $sField = str_replace( ".", "", $sField ); $aFields[] = array( 'name' => $sField ); $aColumns[] = array( 'header' => $sLabel, 'dataIndex' => $sField ); } -- To view, visit https://gerrit.wikimedia.org/r/373301 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I07a2e47ed8f23151ffef275650555da2064ee40f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: REL1_27 Gerrit-Owner: PwirthGerrit-Reviewer: ItSpiderman ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Removed unneeded reference
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372812 ) Change subject: BSFoundation: Removed unneeded reference .. BSFoundation: Removed unneeded reference Change-Id: I1035dc3a9b742d9b50d449a56f899afbf161bc23 --- M src/Hook/BSEntitySetValuesByObject.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/12/372812/1 diff --git a/src/Hook/BSEntitySetValuesByObject.php b/src/Hook/BSEntitySetValuesByObject.php index 47d7814..a61546b 100644 --- a/src/Hook/BSEntitySetValuesByObject.php +++ b/src/Hook/BSEntitySetValuesByObject.php @@ -49,7 +49,7 @@ * @param \stdClass $data * @return boolean */ - public static function callback( $entity, &$data ) { + public static function callback( $entity, $data ) { $className = static::class; $hookHandler = new $className( null, @@ -66,10 +66,10 @@ * @param Entity $entity * @param \stdClass $data */ - public function __construct( $context, $config, $entity, &$data ) { + public function __construct( $context, $config, $entity, $data ) { parent::__construct( $context, $config ); $this->entity = $entity; - $this->data = &$data; + $this->data = $data; } } \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/372812 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1035dc3a9b742d9b50d449a56f899afbf161bc23 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Fixed callback registration for SoftwareInfo hook
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372530 ) Change subject: BSFoundation: Fixed callback registration for SoftwareInfo hook .. BSFoundation: Fixed callback registration for SoftwareInfo hook Change-Id: If8a3978f6e1ad9c7defa1952824c1b01811fcdc2 --- M extension.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/30/372530/1 diff --git a/extension.json b/extension.json index 22c8896..c4fd34d 100644 --- a/extension.json +++ b/extension.json @@ -396,7 +396,7 @@ }, "Hooks": { "SetupAfterCache": "BsCoreHooks::onSetupAfterCache", - "SoftwareInfo": "BlueSpice\\Hooks\\SoftwareInfo\\AddBlueSpice::callback", + "SoftwareInfo": "BlueSpice\\Hook\\SoftwareInfo\\AddBlueSpice::callback", "BeforePageDisplay": "BsCoreHooks::onBeforePageDisplay", "LinkEnd": [ "BlueSpice\\Hook\\LinkEnd\\AddDataTitle::callback", -- To view, visit https://gerrit.wikimedia.org/r/372530 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If8a3978f6e1ad9c7defa1952824c1b01811fcdc2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Replaced all wfRunHooks with Hooks::run
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372404 ) Change subject: BSFoundation: Replaced all wfRunHooks with Hooks::run .. BSFoundation: Replaced all wfRunHooks with Hooks::run Change-Id: I9617e0ce162ae792aecd84bde35e8eac20e7c2f8 --- M includes/Config.class.php M includes/Core.class.php M includes/CoreHooks.php M includes/Entity.php M includes/EntityRegistry.php M includes/api/BSApiExtJSStoreBase.php M includes/api/BSApiPingTasks.php M includes/outputhandler/views/view.UserMiniProfile.php M includes/skins/BsBaseTemplate.php M includes/utility/WidgetListHelper.class.php M maintenance/DeployJavaWebApps.php 11 files changed, 20 insertions(+), 20 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/04/372404/1 diff --git a/includes/Config.class.php b/includes/Config.class.php index 2486bd6..f87a727 100644 --- a/includes/Config.class.php +++ b/includes/Config.class.php @@ -183,7 +183,7 @@ wfProfileIn ( 'BS::Core::ConfigGet' ); $mReturn = null; - if( !wfRunHooks ( "BSCoreConfigGet", array ( $sPath, &$mReturn ) ) ) { + if( !Hooks::run ( "BSCoreConfigGet", array ( $sPath, &$mReturn ) ) ) { wfProfileOut ( 'BS::Core::ConfigGet' ); return $mReturn; } @@ -331,12 +331,12 @@ ); } - wfRunHooks( 'BsSettingsBeforeSaveSettings', array( &$aSettings ) ); + Hooks::run( 'BsSettingsBeforeSaveSettings', array( &$aSettings ) ); # write the settings array to the database $bReturn = $dbw->insert('bs_settings', $aSettings); - wfRunHooks( 'BsSettingsAfterSaveSettings', array( $aSettings ) ); + Hooks::run( 'BsSettingsAfterSaveSettings', array( $aSettings ) ); BsCacheHelper::invalidateCache( BsCacheHelper::getCacheKey( 'BlueSpice', 'BsConfig', 'settings' ) diff --git a/includes/Core.class.php b/includes/Core.class.php index 8f83052..de26310 100644 --- a/includes/Core.class.php +++ b/includes/Core.class.php @@ -519,7 +519,7 @@ $oUserMiniProfileView->setOptions( $aParams ); $oUserMiniProfileView->setOption( 'user', $oUser ); - wfRunHooks( 'BSCoreGetUserMiniProfileBeforeInit', array( &$oUserMiniProfileView, &$oUser, &$aParams ) ); + Hooks::run( 'BSCoreGetUserMiniProfileBeforeInit', array( &$oUserMiniProfileView, &$oUser, &$aParams ) ); $oUserMiniProfileView->init(); diff --git a/includes/CoreHooks.php b/includes/CoreHooks.php index e53c7ac..da40d81 100755 --- a/includes/CoreHooks.php +++ b/includes/CoreHooks.php @@ -203,7 +203,7 @@ $oUser = $out->getUser(); $aScriptSettings = BsConfig::getScriptSettings(); - wfRunHooks('BsFoundationBeforeMakeGlobalVariablesScript', array( $oUser, &$aScriptSettings ) ); + Hooks::run('BsFoundationBeforeMakeGlobalVariablesScript', array( $oUser, &$aScriptSettings ) ); foreach ( $aScriptSettings as $oVar ) { $mValue = $oVar->getValue(); @@ -535,7 +535,7 @@ $oTitle = $skin->getTitle(); $aSettingViews = array(); - wfRunHooks( 'BS:UserPageSettings', array( $oUser, $oTitle, &$aSettingViews ) ); + Hooks::run( 'BS:UserPageSettings', array( $oUser, $oTitle, &$aSettingViews ) ); $oUserPageSettingsView = new ViewBaseElement(); $oUserPageSettingsView->setAutoWrap( diff --git a/includes/Entity.php b/includes/Entity.php index df4bcb0..c5e816d 100644 --- a/includes/Entity.php +++ b/includes/Entity.php @@ -283,7 +283,7 @@ $this->setUnsavedChanges( false ); - wfRunHooks( 'BSEntitySaveComplete', array( $this, $oStatus, $oUser ) ); + Hooks::run( 'BSEntitySaveComplete', array( $this, $oStatus, $oUser ) ); $this->invalidateCache(); return $oStatus; @@ -299,7 +299,7 @@ $oStatus = null; $oWikiPage = WikiPage::factory( $oTitle ); - wfRunHooks( 'BSEntityDelete', array( $this, $oStatus, $oUser ) ); + Hooks::run( 'BSEntityDelete', array( $this, $oStatus, $oUser ) ); if( $oStatus instanceof Status && $oStatus->isOK() ) { return $oStatus; } @@ -312,7 +312,7 @@ return Status::newFatal( $e->getMessage() ); } - wfRunHooks( 'BSEntityDeleteComplete', array( $this, $oStatus ) ); + Hooks::run( 'BSEntityDeleteComplete', array( $this, $oStatus ) ); if( !$oStatus->isOK() ) { return
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: [WIP] BSFoundation: Adding Hook base classes for all hooks p...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372353 ) Change subject: [WIP] BSFoundation: Adding Hook base classes for all hooks provided by BSFoundation .. [WIP] BSFoundation: Adding Hook base classes for all hooks provided by BSFoundation Change-Id: Ice07909cbb5fd4aa50e42d9bcfc392011b6ef12f --- A src/Hook/BSCoreConfigGet.php 1 file changed, 50 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/53/372353/1 diff --git a/src/Hook/BSCoreConfigGet.php b/src/Hook/BSCoreConfigGet.php new file mode 100644 index 000..3735370 --- /dev/null +++ b/src/Hook/BSCoreConfigGet.php @@ -0,0 +1,50 @@ +process(); + } + + /** +* @param \IContextSource $context +* @param \Config $config +* @param string $sPath +* @param mixed $mReturn +*/ + public function __construct( $context, $config, $sPath, &$mReturn ) { + parent::__construct( $context, $config ); + + $this->sPath = $sPath; + $this->mReturn = &$mReturn; + } +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/372353 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ice07909cbb5fd4aa50e42d9bcfc392011b6ef12f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoudation: Moved the Hook base class out of the Hook names...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372350 ) Change subject: BSFoudation: Moved the Hook base class out of the Hook namespace .. BSFoudation: Moved the Hook base class out of the Hook namespace Change-Id: I4b3e81ebf20579dc9a997212d7235eb2847d3991 --- R src/Hook.php M src/Hook/BeforePageDisplay.php M src/Hook/LinkEnd.php M src/Hook/LoadExtensionSchemaUpdates.php M src/Hook/MakeGlobalVariablesScript.php M src/Hook/PageContentSaveComplete.php M src/Hook/ParserFirstCallInit.php M src/Hook/SkinTemplateNavigation.php M src/Hook/SoftwareInfo.php M src/Hook/UserCan.php M src/Hook/UserGetRights.php 11 files changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/50/372350/1 diff --git a/src/Hook/Hook.php b/src/Hook.php similarity index 97% rename from src/Hook/Hook.php rename to src/Hook.php index 9ee8e18..4725063 100644 --- a/src/Hook/Hook.php +++ b/src/Hook.php @@ -1,5 +1,5 @@ https://gerrit.wikimedia.org/r/372350 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4b3e81ebf20579dc9a997212d7235eb2847d3991 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_23]: BSContextMenu: Fixed links for IE11
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372347 ) Change subject: BSContextMenu: Fixed links for IE11 .. BSContextMenu: Fixed links for IE11 * The menu DOM elements got removed before the click event could bubble up. Therefore IE11 did not execute the navigation * Also removed unused code * Also fixed typo See https://sourceforge.net/p/bluespice/bugs/424/ NEEDS CHERRY-PICK TO REL1_27 AND REL1_23 Change-Id: Id1e2d278fb76fa3b844eedec6d7d7694e09f6070 --- M ContextMenu/resources/bluespice.contextmenu.js 1 file changed, 13 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions refs/changes/47/372347/1 diff --git a/ContextMenu/resources/bluespice.contextmenu.js b/ContextMenu/resources/bluespice.contextmenu.js index e703073..372f736 100644 --- a/ContextMenu/resources/bluespice.contextmenu.js +++ b/ContextMenu/resources/bluespice.contextmenu.js @@ -1,22 +1,21 @@ (function(mw, $, bs){ + var menu = null; + var showMenu = function( anchor, items, e ) { $(document).trigger( 'BSContextMenuBeforeCreate', [anchor, items]); - var menu = new Ext.menu.Menu({ + /* +* Unfortunately ExtJS does not use "close" when the context +* menu disappears, but "hide". Therefore closeAction: 'destroy', +* which is default does not work. But as we use DOM IDs we +* really need to remove the them from the DOM, otherwise we +* get ugly collisions when a second menu is opened. +*/ + Ext.destroy(menu); + + menu = new Ext.menu.Menu({ id: 'bs-cm-menu', - items: items, - listeners: { - /* -* Unfortunately ExtJS does not use "close" when the context -* menu disappears, but hide. Therefore closeAction: 'destroy', -* wich is default does not work. But as we use DOM IDs we -* really need to remove the tem from the DOM, otherwise we -* get ugly collisions when a secon menu is opened. -*/ - hide:function(menu, opt){ - Ext.destroy(menu); - } - } + items: items }); menu.showAt(e.pageX, e.pageY); -- To view, visit https://gerrit.wikimedia.org/r/372347 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id1e2d278fb76fa3b844eedec6d7d7694e09f6070 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: REL1_23 Gerrit-Owner: PwirthGerrit-Reviewer: Robert Vogel ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_27]: BSContextMenu: Fixed links for IE11
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372346 ) Change subject: BSContextMenu: Fixed links for IE11 .. BSContextMenu: Fixed links for IE11 * The menu DOM elements got removed before the click event could bubble up. Therefore IE11 did not execute the navigation * Also removed unused code * Also fixed typo See https://sourceforge.net/p/bluespice/bugs/424/ NEEDS CHERRY-PICK TO REL1_27 AND REL1_23 Change-Id: Id1e2d278fb76fa3b844eedec6d7d7694e09f6070 --- M ContextMenu/resources/bluespice.contextmenu.js 1 file changed, 13 insertions(+), 26 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions refs/changes/46/372346/1 diff --git a/ContextMenu/resources/bluespice.contextmenu.js b/ContextMenu/resources/bluespice.contextmenu.js index 0b16bea..f957589 100644 --- a/ContextMenu/resources/bluespice.contextmenu.js +++ b/ContextMenu/resources/bluespice.contextmenu.js @@ -1,39 +1,26 @@ (function(mw, $, bs){ + var menu = null; + var showMenu = function( anchor, items, e ) { $(document).trigger( 'BSContextMenuBeforeCreate', [anchor, items]); - var menu = new Ext.menu.Menu({ + /* +* Unfortunately ExtJS does not use "close" when the context +* menu disappears, but "hide". Therefore closeAction: 'destroy', +* which is default does not work. But as we use DOM IDs we +* really need to remove the them from the DOM, otherwise we +* get ugly collisions when a second menu is opened. +*/ + Ext.destroy(menu); + + menu = new Ext.menu.Menu({ id: 'bs-cm-menu', - items: items, - listeners: { - /* -* Unfortunately ExtJS does not use "close" when the context -* menu disappears, but hide. Therefore closeAction: 'destroy', -* wich is default does not work. But as we use DOM IDs we -* really need to remove the tem from the DOM, otherwise we -* get ugly collisions when a secon menu is opened. -*/ - hide:function(menu, opt){ - Ext.destroy(menu); - } - } + items: items }); menu.showAt(e.pageX, e.pageY); e.preventDefault(); return false; - }; - - var appendSection = function(base, additions, sectionkey) { - if( base.length > 0 ) { - base.push('-'); - } - var additionsLength = additions.length; - for( var i = 0; i < additionsLength; i++ ) { - base.push( additions[i] ); - } - - return base; }; var modus = mw.user.options.get('MW::ContextMenu::Modus', 'ctrl'); -- To view, visit https://gerrit.wikimedia.org/r/372346 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id1e2d278fb76fa3b844eedec6d7d7694e09f6070 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: REL1_27 Gerrit-Owner: PwirthGerrit-Reviewer: Robert Vogel ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Replaced deprecated DB_WRITE with DB_MASTER
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372344 ) Change subject: BSFoundation: Replaced deprecated DB_WRITE with DB_MASTER .. BSFoundation: Replaced deprecated DB_WRITE with DB_MASTER Change-Id: I8742ea4ed838f69a2194643691b2b4479b34887c --- M includes/Config.class.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/44/372344/1 diff --git a/includes/Config.class.php b/includes/Config.class.php index 2486bd6..16eaf8a 100644 --- a/includes/Config.class.php +++ b/includes/Config.class.php @@ -299,7 +299,7 @@ * @return bool false if an error occurs */ public static function saveSettings() { - $dbw = wfGetDB ( DB_WRITE ); + $dbw = wfGetDB ( DB_MASTER ); $dbw->delete( 'bs_settings', '*' ); -- To view, visit https://gerrit.wikimedia.org/r/372344 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8742ea4ed838f69a2194643691b2b4479b34887c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: BSPermissionManager: Replaced deprecated DB_WRITE with DB_MA...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372343 ) Change subject: BSPermissionManager: Replaced deprecated DB_WRITE with DB_MASTER .. BSPermissionManager: Replaced deprecated DB_WRITE with DB_MASTER Change-Id: I5b09f358dc2349c6935c4bd50488ac9981517b28 --- M PermissionManager/PermissionManager.class.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions refs/changes/43/372343/1 diff --git a/PermissionManager/PermissionManager.class.php b/PermissionManager/PermissionManager.class.php index 2fa245c..f9cfcf3 100644 --- a/PermissionManager/PermissionManager.class.php +++ b/PermissionManager/PermissionManager.class.php @@ -235,7 +235,7 @@ public static function setTemplateData( $oTemplate ) { global $wgRequest; - $dbw = wfGetDB( DB_WRITE ); + $dbw = wfGetDB( DB_MASTER ); //return false if $oTemplate is empty if ( $oTemplate == null ) { $aResult = array( -- To view, visit https://gerrit.wikimedia.org/r/372343 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5b09f358dc2349c6935c4bd50488ac9981517b28 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceSkin[master]: BSSkin: Fixed if statement for newer versions of echo
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372340 ) Change subject: BSSkin: Fixed if statement for newer versions of echo .. BSSkin: Fixed if statement for newer versions of echo * in newer versions than 1.27 of echo, this text can be a message obect Change-Id: I9cfbc0e9fa71187a7934bf022cb9906687d2eaeb --- M includes/BlueSpiceSkinHooks.php 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/BlueSpiceSkin refs/changes/40/372340/1 diff --git a/includes/BlueSpiceSkinHooks.php b/includes/BlueSpiceSkinHooks.php index 5c43323..0e43c9c 100644 --- a/includes/BlueSpiceSkinHooks.php +++ b/includes/BlueSpiceSkinHooks.php @@ -148,8 +148,10 @@ 'class' => 'mw-echo-notification-badge-nojs oo-ui-icon-bell oo-ui-widget-enabled mw-echo-notifications-badge', ) + $tpl->data['personal_urls']['notifications-alert']; - if ( isset( $tpl->data['personal_urls']['notifications-alert']['text'] ) - && $tpl->data['personal_urls']['notifications-alert']['text'] > 0 ) { + $bNotifications = !empty( + $tpl->data['personal_urls']['notifications-alert']['text'] + ); + if ( $bNotifications ) { $tpl->data['bs_personal_info'][10]['active'] = true; } -- To view, visit https://gerrit.wikimedia.org/r/372340 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9cfbc0e9fa71187a7934bf022cb9906687d2eaeb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/BlueSpiceSkin Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Changed the 'Hook' namespace to its singular '...
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372152 ) Change subject: BSFoundation: Changed the 'Hook' namespace to its singular 'Hook' .. BSFoundation: Changed the 'Hook' namespace to its singular 'Hook' Change-Id: I1ef3349841c8e4be3794dfb751d4600477f4c146 --- M extension.json R src/Hook/BeforePageDisplay.php R src/Hook/Hook.php R src/Hook/LinkEnd.php R src/Hook/LinkEnd/AddDataTitle.php R src/Hook/LinkEnd/AddDataUserName.php R src/Hook/LoadExtensionSchemaUpdates.php R src/Hook/MakeGlobalVariablesScript.php R src/Hook/PageContentSaveComplete.php R src/Hook/ParserFirstCallInit.php R src/Hook/SkinTemplateNavigation.php R src/Hook/SoftwareInfo.php R src/Hook/SoftwareInfo/AddBlueSpice.php R src/Hook/UserCan.php R src/Hook/UserGetRights.php 15 files changed, 18 insertions(+), 18 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/52/372152/1 diff --git a/extension.json b/extension.json index 6b6a86c..e6ff4f1 100644 --- a/extension.json +++ b/extension.json @@ -399,8 +399,8 @@ "SoftwareInfo": "BlueSpice\\Hooks\\SoftwareInfo\\AddBlueSpice::callback", "BeforePageDisplay": "BsCoreHooks::onBeforePageDisplay", "LinkEnd": [ - "BlueSpice\\Hooks\\LinkEnd\\AddDataTitle::callback", - "BlueSpice\\Hooks\\LinkEnd\\AddDataUserName::callback" + "BlueSpice\\Hook\\LinkEnd\\AddDataTitle::callback", + "BlueSpice\\Hook\\LinkEnd\\AddDataUserName::callback" ], "LinkerMakeMediaLinkFile": "BsCoreHooks::onLinkerMakeMediaLinkFile", "ThumbnailBeforeProduceHTML": "BsCoreHooks::onThumbnailBeforeProduceHTML", diff --git a/src/Hooks/BeforePageDisplay.php b/src/Hook/BeforePageDisplay.php similarity index 100% rename from src/Hooks/BeforePageDisplay.php rename to src/Hook/BeforePageDisplay.php diff --git a/src/Hooks/Hook.php b/src/Hook/Hook.php similarity index 97% rename from src/Hooks/Hook.php rename to src/Hook/Hook.php index 78dc028..9ee8e18 100644 --- a/src/Hooks/Hook.php +++ b/src/Hook/Hook.php @@ -1,5 +1,5 @@ target->getNamespace() !== NS_USER || $this->target->isSubpage() ) { return true; diff --git a/src/Hooks/LoadExtensionSchemaUpdates.php b/src/Hook/LoadExtensionSchemaUpdates.php similarity index 95% rename from src/Hooks/LoadExtensionSchemaUpdates.php rename to src/Hook/LoadExtensionSchemaUpdates.php index 57009f6..f52e95a 100644 --- a/src/Hooks/LoadExtensionSchemaUpdates.php +++ b/src/Hook/LoadExtensionSchemaUpdates.php @@ -1,6 +1,6 @@ https://gerrit.wikimedia.org/r/372152 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1ef3349841c8e4be3794dfb751d4600477f4c146 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Replaced deprecated BsCore::getUserDisplayName
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372145 ) Change subject: BSFoundation: Replaced deprecated BsCore::getUserDisplayName .. BSFoundation: Replaced deprecated BsCore::getUserDisplayName * Used BsUserHelper::getUserDisplayName instead Change-Id: Ic9be61c1c389447abdcb34df87d3140afa2fb1bf --- M src/Hooks/LinkEnd/AddDataUserName.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/45/372145/1 diff --git a/src/Hooks/LinkEnd/AddDataUserName.php b/src/Hooks/LinkEnd/AddDataUserName.php index 82acb92..703c1c2 100644 --- a/src/Hooks/LinkEnd/AddDataUserName.php +++ b/src/Hooks/LinkEnd/AddDataUserName.php @@ -17,7 +17,7 @@ if( $this->target->getText() === $this->html ) { $this->html = htmlspecialchars( - \BsCore::getUserDisplayName( $user ) + \BsUserHelper::getUserDisplayName( $user ) ); } -- To view, visit https://gerrit.wikimedia.org/r/372145 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic9be61c1c389447abdcb34df87d3140afa2fb1bf Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Fixed possible fatal in LinkEnd hook handler
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372144 ) Change subject: BSFoundation: Fixed possible fatal in LinkEnd hook handler .. BSFoundation: Fixed possible fatal in LinkEnd hook handler * in rare cases $this->target->getText() returns '127.0.0.1' which results in 'false' in User::newFromName Change-Id: Ieb1db3038a9d113e908e5f27123f32876e6f3cdf --- M src/Hooks/LinkEnd/AddDataUserName.php 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/44/372144/1 diff --git a/src/Hooks/LinkEnd/AddDataUserName.php b/src/Hooks/LinkEnd/AddDataUserName.php index 496268d..82acb92 100644 --- a/src/Hooks/LinkEnd/AddDataUserName.php +++ b/src/Hooks/LinkEnd/AddDataUserName.php @@ -9,6 +9,11 @@ } $user = \User::newFromName( $this->target->getText() ); + if( !$user ) { + //in rare cases $this->target->getText() returns '127.0.0.1' which + //results in 'false' in User::newFromName + return true; + } if( $this->target->getText() === $this->html ) { $this->html = htmlspecialchars( -- To view, visit https://gerrit.wikimedia.org/r/372144 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb1db3038a9d113e908e5f27123f32876e6f3cdf Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Moved entity classes to the ps4 autoloader dir
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372143 ) Change subject: BSFoundation: Moved entity classes to the ps4 autoloader dir .. BSFoundation: Moved entity classes to the ps4 autoloader dir Change-Id: Idb7e29f796688dcc6716dca66524c06b3a12a829 --- M extension.json D includes/content/EntityContent.php D includes/content/EntityContentHandler.php A src/Content/Entity.php A src/Content/EntityHandler.php R src/Entity.php R src/EntityConfig.php R src/EntityRegistry.php 8 files changed, 228 insertions(+), 226 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/43/372143/1 diff --git a/extension.json b/extension.json index 6b6a86c..8affeca 100644 --- a/extension.json +++ b/extension.json @@ -572,11 +572,6 @@ "BsSTYLEMEDIA": "includes/Common.php", "EXTINFO": "includes/Common.php", "EXTTYPE": "includes/Common.php", - "BSEntity": "includes/Entity.php", - "BSEntityRegistry": "includes/EntityRegistry.php", - "BSEntityConfig": "includes/entityconfigs/EntityConfig.php", - "BSEntityContent": "includes/content/EntityContent.php", - "BSEntityContentHandler": "includes/content/EntityContentHandler.php", "BSApiTestCase": "tests/BSApiTestCase.php", "BSFixturesProvider": "tests/BSFixturesProvider.php", "BSPageFixturesProvider": "tests/BSPageFixturesProvider.php", diff --git a/includes/content/EntityContent.php b/includes/content/EntityContent.php deleted file mode 100644 index 6e317f4..000 --- a/includes/content/EntityContent.php +++ /dev/null @@ -1,108 +0,0 @@ -getNativeData(), true ); - } - - /** -* @return bool Whether content is valid JSON. -*/ - public function isValid() { - return $this->getJsonData() !== null; - } - - /** -* Pretty-print JSON -* -* @return bool|null|string -*/ - public function beautifyJSON() { - $decoded = FormatJson::decode( $this->getNativeData(), true ); - if ( !is_array( $decoded ) ) { - return null; - } - return FormatJson::encode( $decoded, true ); - - } - - /** -* Beautifies JSON prior to save. -* @param Title $title Title -* @param User $user User -* @param ParserOptions $popts -* @return JsonContent -*/ - public function preSaveTransform( Title $title, User $user, ParserOptions $popts ) { - return new static( $this->beautifyJSON() ); - } - - /** -* Set the HTML and add the appropriate styles -* -* -* @param Title $title -* @param int $revId -* @param ParserOptions $options -* @param bool $generateHtml -* @param ParserOutput $output -*/ - protected function fillParserOutput( Title $title, $revId, - ParserOptions $options, $generateHtml, ParserOutput &$output - ) { - return parent::fillParserOutput( - $title, - $revId, - $options, - $generateHtml, - $output - ); - } - /** -* Constructs an HTML representation of a JSON object. -* @param array $mapping -* @return string HTML -*/ - protected function objectTable( $mapping ) { - $rows = array(); - - foreach ( $mapping as $key => $val ) { - $rows[] = $this->objectRow( $key, $val ); - } - return Xml::tags( 'table', array( 'class' => 'mw-json' ), - Xml::tags( 'tbody', array(), join( "\n", $rows ) ) - ); - } - - /** -* Constructs HTML representation of a single key-value pair. -* @param string $key -* @param mixed $val -* @return string HTML. -*/ - protected function objectRow( $key, $val ) { - $th = Xml::elementClean( 'th', array(), $key ); - if ( is_array( $val ) ) { - $td = Xml::tags( 'td', array(), self::objectTable( $val ) ); - } else { - if ( is_string( $val ) ) { - $val = '"' . $val . '"'; - } else { - $val = FormatJson::encode( $val ); - } - - $td = Xml::elementClean( 'td', array( 'class' => 'value' ), $val ); - } - - return Xml::tags( 'tr', array(), $th . $td ); - } -} \ No newline at end of file diff --git a/includes/content/EntityContentHandler.php
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Fixed typos in new hook classes
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372102 ) Change subject: BSFoundation: Fixed typos in new hook classes .. BSFoundation: Fixed typos in new hook classes Change-Id: I989daf0b2da55e01621df6f22aa319aa76421c93 --- M src/Hooks/BeforePageDisplay.php M src/Hooks/SkinTemplateNavigation.php 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/02/372102/1 diff --git a/src/Hooks/BeforePageDisplay.php b/src/Hooks/BeforePageDisplay.php index f60998d..22d9a1d 100644 --- a/src/Hooks/BeforePageDisplay.php +++ b/src/Hooks/BeforePageDisplay.php @@ -2,7 +2,7 @@ namespace BlueSpice\Hooks; -abstract class BeforePageDisplay extends BlueSpice\Hooks\Hook { +abstract class BeforePageDisplay extends Hook { /** * diff --git a/src/Hooks/SkinTemplateNavigation.php b/src/Hooks/SkinTemplateNavigation.php index b14cf0f..c1395a9 100644 --- a/src/Hooks/SkinTemplateNavigation.php +++ b/src/Hooks/SkinTemplateNavigation.php @@ -2,7 +2,7 @@ namespace BlueSpice\Hooks; -class SkinTemplateNavigation extends Hook { +abstract class SkinTemplateNavigation extends Hook { /** * -- To view, visit https://gerrit.wikimedia.org/r/372102 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I989daf0b2da55e01621df6f22aa319aa76421c93 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_27]: PageAssignments: Added page link to notifications
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/371011 ) Change subject: PageAssignments: Added page link to notifications .. PageAssignments: Added page link to notifications Change-Id: Ice27eb665f4a30916e6b1a7346e89901350c4482 --- M PageAssignments/includes/PageAssignmentsNotificationHooks.php 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions refs/changes/11/371011/1 diff --git a/PageAssignments/includes/PageAssignmentsNotificationHooks.php b/PageAssignments/includes/PageAssignmentsNotificationHooks.php index c19523a..621237e 100644 --- a/PageAssignments/includes/PageAssignmentsNotificationHooks.php +++ b/PageAssignments/includes/PageAssignmentsNotificationHooks.php @@ -18,7 +18,8 @@ BSNotifications::registerNotificationCategory( 'bs-pageassignments-action-cat' ); $aExtraParams = array( - 'formatter-class' => 'PageAssignmentsNotificationFormatter' + 'formatter-class' => 'PageAssignmentsNotificationFormatter', + 'primary-link' => array( 'message' => 'notification-link-text-view-page', 'destination' => 'title' ) ); BSNotifications::registerNotification( @@ -29,7 +30,8 @@ 'notification-bs-pageassignments-assignment-change-add-subject', array('agent', 'title', 'titlelink'), 'notification-bs-pageassignments-assignment-change-add-body', - array('agent', 'title', 'titlelink') + array('agent', 'title', 'titlelink'), + $aExtraParams ); BSNotifications::registerNotification( @@ -40,7 +42,8 @@ 'notification-bs-pageassignments-assignment-change-remove-subject', array('agent', 'title', 'titlelink'), 'notification-bs-pageassignments-assignment-change-remove-body', - array('agent', 'title', 'titlelink') + array('agent', 'title', 'titlelink'), + $aExtraParams ); BSNotifications::registerNotification( -- To view, visit https://gerrit.wikimedia.org/r/371011 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ice27eb665f4a30916e6b1a7346e89901350c4482 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: REL1_27 Gerrit-Owner: PwirthGerrit-Reviewer: Robert Vogel ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_27]: BSPageTemplates: Removed outdated bugfix
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/371007 ) Change subject: BSPageTemplates: Removed outdated bugfix .. BSPageTemplates: Removed outdated bugfix Until MW 1.17 '' tags where not stripped ped 'preload' situations. So a bugfix was implemented. Nowadays this problem is fixed in MW core and the former bugfix is now a bug. See https://www.mediawiki.org/wiki/Manual:Creating_pages_with_preloaded_text#Loading_the_preload_file NEEDS CHERRY-PICK TO REL1_27 AND REL1_23 Change-Id: I3eb214ce80d686a5da2fb4788827f80c0859a608 --- M PageTemplates/PageTemplates.class.php 1 file changed, 0 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions refs/changes/07/371007/1 diff --git a/PageTemplates/PageTemplates.class.php b/PageTemplates/PageTemplates.class.php index b6ce4d4..78228c8 100644 --- a/PageTemplates/PageTemplates.class.php +++ b/PageTemplates/PageTemplates.class.php @@ -56,7 +56,6 @@ //Hooks $this->setHook( 'LinkBegin' ); - $this->setHook( 'EditPage::showEditForm:initial', 'onEditPageShowEditFormInitial' ); $this->setHook( 'MessagesPreLoad' ); $this->setHook( 'ParserFirstCallInit' ); @@ -209,20 +208,6 @@ if ( !isset( $aQuery['preload'] ) ) { $aQuery['action'] = 'view'; - } - - return true; - } - - /** -* Removes noinclude parts from templates -* @param EditPage $oEdit MediaWiki EditPage object -* @return bool allow other hooked methods to be executed. Always true. -*/ - function onEditPageShowEditFormInitial( &$oEdit ) { - if ( RequestContext::getMain()->getRequest()->getVal( 'preload', '' ) ) { - // TODO MRG (27.09.11 10:28): Put replacement of noinclude into core - $oEdit->textbox1 = preg_replace( '/.*?<\/noinclude>/s', '', $oEdit->textbox1 ); } return true; -- To view, visit https://gerrit.wikimedia.org/r/371007 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3eb214ce80d686a5da2fb4788827f80c0859a608 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: REL1_27 Gerrit-Owner: PwirthGerrit-Reviewer: Robert Vogel ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_23]: BSPageTemplates: Removed outdated bugfix
Pwirth has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/371008 ) Change subject: BSPageTemplates: Removed outdated bugfix .. BSPageTemplates: Removed outdated bugfix Until MW 1.17 '' tags where not stripped ped 'preload' situations. So a bugfix was implemented. Nowadays this problem is fixed in MW core and the former bugfix is now a bug. See https://www.mediawiki.org/wiki/Manual:Creating_pages_with_preloaded_text#Loading_the_preload_file NEEDS CHERRY-PICK TO REL1_27 AND REL1_23 Change-Id: I3eb214ce80d686a5da2fb4788827f80c0859a608 --- M PageTemplates/PageTemplates.class.php 1 file changed, 0 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions refs/changes/08/371008/1 diff --git a/PageTemplates/PageTemplates.class.php b/PageTemplates/PageTemplates.class.php index f89680d..03c20fc 100644 --- a/PageTemplates/PageTemplates.class.php +++ b/PageTemplates/PageTemplates.class.php @@ -76,7 +76,6 @@ //Hooks $this->setHook( 'LinkBegin' ); - $this->setHook( 'EditPage::showEditForm:initial', 'onEditPageShowEditFormInitial' ); $this->setHook( 'MessagesPreLoad' ); $this->setHook( 'ParserFirstCallInit' ); @@ -379,20 +378,6 @@ if ( !isset( $aQuery['preload'] ) ) { $aQuery['action'] = 'view'; - } - - return true; - } - - /** -* Removes noinclude parts from templates -* @param EditPage $oEdit MediaWiki EditPage object -* @return bool allow other hooked methods to be executed. Always true. -*/ - function onEditPageShowEditFormInitial( &$oEdit ) { - if ( RequestContext::getMain()->getRequest()->getVal( 'preload', '' ) ) { - // TODO MRG (27.09.11 10:28): Put replacement of noinclude into core - $oEdit->textbox1 = preg_replace( '/.*?<\/noinclude>/s', '', $oEdit->textbox1 ); } return true; -- To view, visit https://gerrit.wikimedia.org/r/371008 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3eb214ce80d686a5da2fb4788827f80c0859a608 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: REL1_23 Gerrit-Owner: PwirthGerrit-Reviewer: Robert Vogel ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits