[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceWhoIsOnline[master]: Initial commit Added all files from BlueSpiceExtensions/WhoI...

2017-11-24 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393228 )

Change subject: Initial commit Added all files from 
BlueSpiceExtensions/WhoIsOnline
..

Initial commit
Added all files from BlueSpiceExtensions/WhoIsOnline

Change-Id: I2b46ab1759617fbc1e58ff2f4a57e39b6f838add
---
A .gitignore
A .gitreview
A CODE_OF_CONDUCT.md
A THIRD_PARTY_LICENSES.md
A WhoIsOnline.class.php
A composer.json
A db/mysql/whoisonline.patch.wo_action.sql
A db/mysql/whoisonline.patch.wo_page_namespace.index.sql
A db/mysql/whoisonline.patch.wo_timestamp.index.sql
A db/mysql/whoisonline.patch.wo_timestamp.sql
A db/mysql/whoisonline.patch.wo_user_id.index.sql
A db/oracle/whoisonline.patch.wo_action.sql
A db/oracle/whoisonline.patch.wo_page_namespace.index.oci.sql
A db/oracle/whoisonline.patch.wo_timestamp.index.oci.sql
A db/oracle/whoisonline.patch.wo_timestamp.oci.sql
A db/oracle/whoisonline.patch.wo_user_id.index.oci.sql
A db/postgres/whoisonline.patch.wo_page_namespace.index.pg.sql
A db/postgres/whoisonline.patch.wo_timestamp.index.pg.sql
A db/postgres/whoisonline.patch.wo_timestamp.pg.sql
A db/postgres/whoisonline.patch.wo_user_id.index.pg.sql
A extension.json
A i18n/ast.json
A i18n/ba.json
A i18n/br.json
A i18n/ce.json
A i18n/de.json
A i18n/en.json
A i18n/es.json
A i18n/eu.json
A i18n/fa.json
A i18n/fr.json
A i18n/fy.json
A i18n/gl.json
A i18n/he.json
A i18n/hi.json
A i18n/hu.json
A i18n/id.json
A i18n/it.json
A i18n/ja.json
A i18n/ko.json
A i18n/ksh.json
A i18n/lb.json
A i18n/lt.json
A i18n/mk.json
A i18n/nb.json
A i18n/nl.json
A i18n/om.json
A i18n/pl.json
A i18n/pt-br.json
A i18n/pt.json
A i18n/qqq.json
A i18n/ru.json
A i18n/sl.json
A i18n/sq.json
A i18n/sr-ec.json
A i18n/sr-el.json
A i18n/sv.json
A i18n/tcy.json
A i18n/te.json
A i18n/th.json
A i18n/tr.json
A i18n/uk.json
A i18n/zh-hans.json
A i18n/zh-hant.json
A languages/WhoIsOnline.i18n.magic.php
A resources/bluespice.whoIsOnline.js
A views/view.WhoIsOnlineItemWidget.php
A views/view.WhoIsOnlineTag.php
A views/view.WhoIsOnlineWidget.php
A whoisonline.oci.sql
A whoisonline.pg.sql
A whoisonline.sql
72 files changed, 1,687 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceWhoIsOnline 
refs/changes/28/393228/1

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..db8a779
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+/node_modules
+/vendor
+/composer.lock
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 000..5f96e81
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/BlueSpiceWhoIsOnline.git
+track=1
+defaultrebase=0
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 000..d8e5d08
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1 @@
+The development of this software is covered by a [Code of 
Conduct](https://www.mediawiki.org/wiki/Code_of_Conduct).
diff --git a/THIRD_PARTY_LICENSES.md b/THIRD_PARTY_LICENSES.md
new file mode 100644
index 000..ce11ce4
--- /dev/null
+++ b/THIRD_PARTY_LICENSES.md
@@ -0,0 +1,31 @@
+Third Party Licenses
+
+This is an overview of all the 3rd party licenses used in BlueSpiceAvatars.
+
+Software
+
+
+| Software | Author | Version | License |
+|:|:---|:|:---|
+
+Images
+--
+
+| Image | Author | Version | License |
+|:|:---|:|:---|
+
+Fonts
+-
+
+| Font | Author | Version | License |
+|:|:---|:|:---|
+
+License texts
+=
+All licenses can be found in full text in the folder
+
+```BlueSpiceFoundation/doc/legal```
+
+or online at
+
+https://github.com/wikimedia/mediawiki-extensions-BlueSpiceFoundation/tree/master/doc/legal
\ No newline at end of file
diff --git a/WhoIsOnline.class.php b/WhoIsOnline.class.php
new file mode 100644
index 000..4fc1c6e
--- /dev/null
+++ b/WhoIsOnline.class.php
@@ -0,0 +1,511 @@
+http://www.bluespice.com
+ *
+ * @author Markus Glaser 
+ * @version2.23.1
+ * @packageBlueSpice_Extensions
+ * @subpackage WhoIsOnline
+ * @copyright  Copyright (C) 2016 Hallo Welt! GmbH, All rights reserved.
+ * @licensehttp://www.gnu.org/copyleft/gpl.html GNU Public License v2 or 
later
+ * @filesource
+ */
+
+/**
+ * Base class for WhoIsOnline extension
+ * @package BlueSpice_Extensions
+ * @subpackage WhoIsOnline
+ */
+class WhoIsOnline extends BsExtensionMW {
+
+   private $aWhoIsOnlineData = array();
+   protected static $bContextAlreadyTraced = false;
+
+
+
+   /**
+* Initialization of ShoutBox extension
+*/
+   protected function initExt() {
+   wfProfileIn( 'BS::'.__METHOD__ );
+
+   // Hooks
+   $this->setHook( 'ParserFirstCallInit' );
+   $this->setHook( 'BeforePageDisplay');
+   $this->setHook( 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: BlueSpiceExtensions/WatchList was moved to BlueSpiceWatchLis...

2017-11-24 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393219 )

Change subject: BlueSpiceExtensions/WatchList was moved to BlueSpiceWatchList 
https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/BlueSpiceWatchList
..

BlueSpiceExtensions/WatchList was moved to BlueSpiceWatchList 
https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/BlueSpiceWatchList

Change-Id: I0da8e95673080b1df3452e67548095b0a6a562f5
---
D WatchList/COPYING
D WatchList/WatchList.class.php
D WatchList/WatchList.setup.php
D WatchList/extension.json
D WatchList/i18n/ar.json
D WatchList/i18n/ast.json
D WatchList/i18n/ba.json
D WatchList/i18n/bgn.json
D WatchList/i18n/bho.json
D WatchList/i18n/br.json
D WatchList/i18n/ce.json
D WatchList/i18n/cv.json
D WatchList/i18n/de-formal.json
D WatchList/i18n/de.json
D WatchList/i18n/en.json
D WatchList/i18n/es.json
D WatchList/i18n/fa.json
D WatchList/i18n/fr.json
D WatchList/i18n/fy.json
D WatchList/i18n/gl.json
D WatchList/i18n/he.json
D WatchList/i18n/hu.json
D WatchList/i18n/ia.json
D WatchList/i18n/id.json
D WatchList/i18n/inh.json
D WatchList/i18n/it.json
D WatchList/i18n/ja.json
D WatchList/i18n/kab.json
D WatchList/i18n/ko.json
D WatchList/i18n/ksh.json
D WatchList/i18n/lb.json
D WatchList/i18n/lt.json
D WatchList/i18n/lv.json
D WatchList/i18n/mai.json
D WatchList/i18n/mk.json
D WatchList/i18n/mwl.json
D WatchList/i18n/nb.json
D WatchList/i18n/ne.json
D WatchList/i18n/nl.json
D WatchList/i18n/pl.json
D WatchList/i18n/pt-br.json
D WatchList/i18n/pt.json
D WatchList/i18n/qqq.json
D WatchList/i18n/roa-tara.json
D WatchList/i18n/ru.json
D WatchList/i18n/sh.json
D WatchList/i18n/sl.json
D WatchList/i18n/sv.json
D WatchList/i18n/tcy.json
D WatchList/i18n/tr.json
D WatchList/i18n/uk.json
D WatchList/i18n/yi.json
D WatchList/i18n/yo.json
D WatchList/i18n/zh-hans.json
D WatchList/i18n/zh-hant.json
D WatchList/resources/bluespice.watchlist.css
56 files changed, 0 insertions(+), 1,618 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/19/393219/1

diff --git a/WatchList/COPYING b/WatchList/COPYING
deleted file mode 100644
index e72bfdd..000
--- a/WatchList/COPYING
+++ /dev/null
@@ -1,674 +0,0 @@
-GNU GENERAL PUBLIC LICENSE
-   Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. 
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceWatchList[master]: Initial commit Added files from BlueSpiceExtensions/WatchList

2017-11-24 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393217 )

Change subject: Initial commit Added files from BlueSpiceExtensions/WatchList
..

Initial commit
Added files from BlueSpiceExtensions/WatchList

Change-Id: Ia1e2c3751581c210d162e1bc0c8a635b0211ccf5
---
A .gitignore
A .gitreview
A CODE_OF_CONDUCT.md
A THIRD_PARTY_LICENSES.md
A WatchList.class.php
A composer.json
A extension.json
A i18n/ar.json
A i18n/ast.json
A i18n/ba.json
A i18n/bgn.json
A i18n/bho.json
A i18n/br.json
A i18n/ce.json
A i18n/cv.json
A i18n/de-formal.json
A i18n/de.json
A i18n/en.json
A i18n/es.json
A i18n/fa.json
A i18n/fr.json
A i18n/fy.json
A i18n/gl.json
A i18n/he.json
A i18n/hu.json
A i18n/ia.json
A i18n/id.json
A i18n/inh.json
A i18n/it.json
A i18n/ja.json
A i18n/kab.json
A i18n/ko.json
A i18n/ksh.json
A i18n/lb.json
A i18n/lt.json
A i18n/lv.json
A i18n/mai.json
A i18n/mk.json
A i18n/mwl.json
A i18n/nb.json
A i18n/ne.json
A i18n/nl.json
A i18n/pl.json
A i18n/pt-br.json
A i18n/pt.json
A i18n/qqq.json
A i18n/roa-tara.json
A i18n/ru.json
A i18n/sh.json
A i18n/sl.json
A i18n/sv.json
A i18n/tcy.json
A i18n/tr.json
A i18n/uk.json
A i18n/yi.json
A i18n/yo.json
A i18n/zh-hans.json
A i18n/zh-hant.json
A resources/bluespice.watchlist.css
59 files changed, 998 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceWatchList 
refs/changes/17/393217/1

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..db8a779
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+/node_modules
+/vendor
+/composer.lock
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 000..04a4ba4
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/BlueSpiceWatchList.git
+track=1
+defaultrebase=0
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 000..d8e5d08
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1 @@
+The development of this software is covered by a [Code of 
Conduct](https://www.mediawiki.org/wiki/Code_of_Conduct).
diff --git a/THIRD_PARTY_LICENSES.md b/THIRD_PARTY_LICENSES.md
new file mode 100644
index 000..ce11ce4
--- /dev/null
+++ b/THIRD_PARTY_LICENSES.md
@@ -0,0 +1,31 @@
+Third Party Licenses
+
+This is an overview of all the 3rd party licenses used in BlueSpiceAvatars.
+
+Software
+
+
+| Software | Author | Version | License |
+|:|:---|:|:---|
+
+Images
+--
+
+| Image | Author | Version | License |
+|:|:---|:|:---|
+
+Fonts
+-
+
+| Font | Author | Version | License |
+|:|:---|:|:---|
+
+License texts
+=
+All licenses can be found in full text in the folder
+
+```BlueSpiceFoundation/doc/legal```
+
+or online at
+
+https://github.com/wikimedia/mediawiki-extensions-BlueSpiceFoundation/tree/master/doc/legal
\ No newline at end of file
diff --git a/WatchList.class.php b/WatchList.class.php
new file mode 100644
index 000..b6a3d2c
--- /dev/null
+++ b/WatchList.class.php
@@ -0,0 +1,290 @@
+http://www.bluespice.com
+ *
+ * @author Robert Vogel 
+ * @version2.23.1
+ * @packageBlueSpice_Extensions
+ * @subpackage WatchList
+ * @copyright  Copyright (C) 2016 Hallo Welt! GmbH, All rights reserved.
+ * @licensehttp://www.gnu.org/copyleft/gpl.html GNU Public License v2 or 
later
+ * @filesource
+ */
+
+// Last review MRG (01.07.11 15:41)
+
+/**
+ * Base class for WatchList extension
+ * @package BlueSpice_Extensions
+ * @subpackage WantedArticle
+ */
+class WatchList extends BsExtensionMW {
+   /**
+* Initialization of WatchList extension
+*/
+   protected function initExt() {
+   $this->setHook( 'BeforePageDisplay' );
+   $this->setHook( 'ParserFirstCallInit' );
+   $this->setHook( 'BSUserSidebarDefaultWidgets' );
+   $this->setHook( 'BSWidgetListHelperInitKeyWords' );
+   $this->setHook( 'BSInsertMagicAjaxGetData' );
+   $this->setHook( 'BSUsageTrackerRegisterCollectors' );
+
+   BsConfig::registerVar( 'MW::WatchList::WidgetLimit', 10, 
BsConfig::LEVEL_USER|BsConfig::TYPE_INT, 'bs-watchlist-pref-widgetlimit', 'int' 
);
+   BsConfig::registerVar( 'MW::WatchList::WidgetSortOdr', 'time', 
BsConfig::LEVEL_USER|BsConfig::TYPE_STRING|BsConfig::USE_PLUGIN_FOR_PREFS, 
'bs-watchlist-pref-widgetsortodr', 'select' );
+   }
+
+   public function runPreferencePlugin( $sAdapterName, $oVariable ) {
+   return array(
+   'options' => array(
+   wfMessage( 'bs-watchlist-pref-sort-time' 
)->plain() => 'time',
+   wfMessage( 'bs-watchlist-pref-sort-title' 
)->plain() => 'pagename',
+   )
+   );
+   

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtendedSearch[master]: Revert "BlueSpiceExtendedSearch: Change licence and versio"

2017-11-22 Thread Nasty (Code Review)
Hello Pwirth, Robert Vogel, Ljonka, Mglaser, Pmiguelpirzer, jenkins-bot,

I'd like you to do a code review.  Please visit

https://gerrit.wikimedia.org/r/392847

to review the following change.


Change subject: Revert "BlueSpiceExtendedSearch: Change licence and versio"
..

Revert "BlueSpiceExtendedSearch: Change licence and versio"

This reverts commit 4d4cc056832b988db1469123ecc7614c1351ba7f.

syntax error

Change-Id: I98af10d4acb231bf01afd7b885b6d525d9544abe
---
D COPYING
M extension.json
2 files changed, 2 insertions(+), 676 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtendedSearch 
refs/changes/47/392847/1

diff --git a/COPYING b/COPYING
deleted file mode 100644
index e72bfdd..000
--- a/COPYING
+++ /dev/null
@@ -1,674 +0,0 @@
-GNU GENERAL PUBLIC LICENSE
-   Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. 
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-   TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: Removed NamespaceManager

2017-11-07 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/389703 )

Change subject: Removed NamespaceManager
..

Removed NamespaceManager

Change-Id: If7dc6b6eb747e14576b373b5ed3c2ccafb73367b
---
M BlueSpiceExtensions.default.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/03/389703/1

diff --git a/BlueSpiceExtensions.default.php b/BlueSpiceExtensions.default.php
index 78b11ad..0c64740 100644
--- a/BlueSpiceExtensions.default.php
+++ b/BlueSpiceExtensions.default.php
@@ -16,7 +16,6 @@
 require_once( __DIR__."/InsertLink/InsertLink.setup.php" );
 require_once( __DIR__."/InsertMagic/InsertMagic.setup.php" );
 require_once( __DIR__."/NamespaceCss/NamespaceCss.setup.php" );
-require_once( __DIR__."/NamespaceManager/NamespaceManager.setup.php" );
 require_once( __DIR__."/PageAccess/PageAccess.setup.php" );
 require_once( __DIR__."/TopMenuBarCustomizer/TopMenuBarCustomizer.setup.php" );
 require_once( __DIR__."/UsageTracker/UsageTracker.setup.php" );

-- 
To view, visit https://gerrit.wikimedia.org/r/389703
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If7dc6b6eb747e14576b373b5ed3c2ccafb73367b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: Added UrlTitleParser to BSFooundation for a better way to ge...

2017-10-30 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/387220 )

Change subject: Added UrlTitleParser to BSFooundation for a better way to get a 
title from an url Added tests
..

Added UrlTitleParser to BSFooundation for a better way to get a title from an 
url
Added tests

Change-Id: I46ae5b4a83b1360acdcddfc7e768f923c3a2a130
---
A src/Utility/UrlTitleParser.php
A tests/phpunit/Utility/UrlTitleParserTest.php
2 files changed, 146 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/20/387220/1

diff --git a/src/Utility/UrlTitleParser.php b/src/Utility/UrlTitleParser.php
new file mode 100644
index 000..f59f506
--- /dev/null
+++ b/src/Utility/UrlTitleParser.php
@@ -0,0 +1,65 @@
+config = $config;
+   $this->url = $url;
+   }
+
+   /**
+* Parses the title.
+* @return null|\Title
+* @throws Exception No valid title
+*/
+   public function parseTitle() {
+   $titleText = '';
+   $parsedUrl = wfParseUrl( $this->url );
+
+   // get params?
+   if( isset( $parsedUrl['query'] ) ) {
+   $queryString = wfCgiToArray( $parsedUrl['query'] );
+
+   // title param is set
+   if( isset( $queryString['title'] ) ) {
+   $titleText = $queryString['title'];
+   } else { // no title param
+   $titleText = $this->removeScriptPathFromUrl( 
$this->config->get( 'ScriptPath' ), $parsedUrl['path'] );
+   }
+   } else {
+   $titleText = $this->removeScriptPathFromUrl( 
$this->config->get( 'Server' ) . $this->config->get( 'ScriptPath' ), $this->url 
);
+   }
+
+   $decodedTitleText = urldecode( $titleText );
+
+   if( empty( $decodedTitleText ) || $decodedTitleText == '/' || 
$decodedTitleText == $this->url ) {
+   throw new MWException( "Did not find suitable title in 
'$decodedTitleText'" );
+   }
+
+   $title = \Title::newFromText( $decodedTitleText );
+   if( $title instanceof \Title === false ) {
+   throw new MWException( "Could not create title from 
'$decodedTitleText'" );
+   }
+
+   return $title;
+   }
+
+   private function removeScriptPathFromUrl( $scriptPath, $url ) {
+   if ( substr( $url, 0, strlen( $scriptPath ) ) == $scriptPath ) {
+   $url = substr( $url, strlen( $scriptPath ) );
+   }
+
+   return $url;
+   }
+}
\ No newline at end of file
diff --git a/tests/phpunit/Utility/UrlTitleParserTest.php 
b/tests/phpunit/Utility/UrlTitleParserTest.php
new file mode 100644
index 000..fe92eb7
--- /dev/null
+++ b/tests/phpunit/Utility/UrlTitleParserTest.php
@@ -0,0 +1,81 @@
+setMwGlobals( 'wgServer', 'http://tollerserver.de' );
+   $this->setMwGlobals( 'wgScriptPath', '/' );
+   }
+
+   /**
+* @param $url
+* @param $expectation
+* @dataProvider provideFromUrlWithTitleData
+*/
+   public function testFromUrl( $url, $expectation ) {
+   $parser = new UrlTitleParser( $url, 
MediaWikiServices::getInstance()->getMainConfig() );
+   $title = $parser->parseTitle();
+
+   $this->assertEquals( $expectation, $title->getPrefixedDbKey() );
+   }
+
+   /**
+* @param $url
+* @param $exception
+* @dataProvider provideFromUrlWithExceptionData
+*/
+   public function testFromUrlException( $url, $exception ) {
+   $this->setExpectedException( $exception );
+
+   $parser = new UrlTitleParser( $url, 
MediaWikiServices::getInstance()->getMainConfig() );
+   $title = $parser->parseTitle();
+   }
+
+   public function provideFromUrlWithExceptionData() {
+   return [
+   'normal-path-with-ending-slash' => [
+   'http://tollerserver.de/', 'MWException'
+   ],
+   'normal-path-without-ending-slash' => [
+   'http://tollerserver.de', 'MWException'
+   ]
+   ];
+   }
+
+   public function provideFromUrlWithTitleData() {
+   return [
+   'normal-with-index' => [
+   
'http://tollerserver.de/index.php?title=Sometitle=something', 'Sometitle'
+   ],
+   'normal-without-index' => [
+   'http://tollerserver.de/Some_title?a=b', 
'Some_title'
+   ],
+   'subpage-without-index' => [
+

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceConfigManager[master]: Fixed whitespace error Fixed name in composer.json Fixed nam...

2017-10-24 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/386186 )

Change subject: Fixed whitespace error Fixed name in composer.json Fixed name 
in extension.json
..

Fixed whitespace error
Fixed name in composer.json
Fixed name in extension.json

Change-Id: Ie05332dfacf7013ac5be5e176bc22078f6f8ced1
---
M composer.json
M doc/Hooks.txt
M extension.json
3 files changed, 3 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceConfigManager 
refs/changes/86/386186/1

diff --git a/composer.json b/composer.json
index 94a7670..31a0047 100644
--- a/composer.json
+++ b/composer.json
@@ -1,5 +1,5 @@
 {
-  "name": "mediawiki/BlueSpiceConfigManager",
+  "name": "mediawiki/blue-spice-config-manager",
   "type": "mediawiki-extension",
   "description": "BlueSpiceConfigManager",
   "license": "GPL-3.0",
diff --git a/doc/Hooks.txt b/doc/Hooks.txt
index a1060da..c538eb8 100644
--- a/doc/Hooks.txt
+++ b/doc/Hooks.txt
@@ -3,5 +3,5 @@
 'BSWikiAdminPreferencesBeforeSetVariable':
  $this:
  &$var:
- &$value: 
+ &$value:
  &$bReturn:
diff --git a/extension.json b/extension.json
index 9607ffa..ee4002f 100644
--- a/extension.json
+++ b/extension.json
@@ -10,7 +10,7 @@
"license-name": "GPL-2.0+",
"type": "bluespice",
"bsgExtensions": {
-   "Preferences": {
+   "BlueSpiceConfigManager": {
"className": "BsPreferences",
"extPath": "/BlueSpiceConfigManager"
}

-- 
To view, visit https://gerrit.wikimedia.org/r/386186
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie05332dfacf7013ac5be5e176bc22078f6f8ced1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceConfigManager
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_27]: BlueSpiceExtensions/CSyntaxHighlight changed tag to

2017-10-23 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/385968 )

Change subject: BlueSpiceExtensions/CSyntaxHighlight changed  tag to 
 tag for geshi
..

BlueSpiceExtensions/CSyntaxHighlight changed  tag to  tag for geshi

Change-Id: I5ddc0ad3f0a2084f357c98fec9ccb6de6fb3b4c3
---
M CSyntaxHighlight/CSyntaxHighlight.class.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/68/385968/1

diff --git a/CSyntaxHighlight/CSyntaxHighlight.class.php 
b/CSyntaxHighlight/CSyntaxHighlight.class.php
index 62d6eec..08ba00d 100644
--- a/CSyntaxHighlight/CSyntaxHighlight.class.php
+++ b/CSyntaxHighlight/CSyntaxHighlight.class.php
@@ -168,7 +168,7 @@
$oDescriptor->name = "source";
$oDescriptor->desc = wfMessage( 'bs-csyntaxhighlight-tag-desc' 
)->text();
$oDescriptor->helplink = 
'https://help.bluespice.com/index.php/CSyntaxHighlight';
-   $oDescriptor->code = "";
+   $oDescriptor->code = '';
$oDescriptor->previewable = true;
 
$oResponse->result[] = $oDescriptor;

-- 
To view, visit https://gerrit.wikimedia.org/r/385968
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5ddc0ad3f0a2084f357c98fec9ccb6de6fb3b4c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_27
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: BlueSpiceExtensions/CSyntaxHighlight changed tag to

2017-10-23 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/385965 )

Change subject: BlueSpiceExtensions/CSyntaxHighlight changed  tag to 
 tag for geshi
..

BlueSpiceExtensions/CSyntaxHighlight changed  tag to  tag for geshi

Change-Id: I2a576e33bb98c8127e5cfe55b43c8b340fb314c4
---
M CSyntaxHighlight/CSyntaxHighlight.class.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/65/385965/1

diff --git a/CSyntaxHighlight/CSyntaxHighlight.class.php 
b/CSyntaxHighlight/CSyntaxHighlight.class.php
index 62d6eec..08ba00d 100644
--- a/CSyntaxHighlight/CSyntaxHighlight.class.php
+++ b/CSyntaxHighlight/CSyntaxHighlight.class.php
@@ -168,7 +168,7 @@
$oDescriptor->name = "source";
$oDescriptor->desc = wfMessage( 'bs-csyntaxhighlight-tag-desc' 
)->text();
$oDescriptor->helplink = 
'https://help.bluespice.com/index.php/CSyntaxHighlight';
-   $oDescriptor->code = "";
+   $oDescriptor->code = '';
$oDescriptor->previewable = true;
 
$oResponse->result[] = $oDescriptor;

-- 
To view, visit https://gerrit.wikimedia.org/r/385965
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a576e33bb98c8127e5cfe55b43c8b340fb314c4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] translatewiki[master]: Moved extension BlueSpiceExtensions/NamespaceManager -> Blue...

2017-10-20 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/385350 )

Change subject: Moved extension BlueSpiceExtensions/NamespaceManager -> 
BlueSpiceNamespaceManager
..

Moved extension BlueSpiceExtensions/NamespaceManager -> 
BlueSpiceNamespaceManager

BlueSpiceExtensions/NamespaceManager
https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/BlueSpiceExtensions

BlueSpiceNamespaceManager
https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/BlueSpiceNamespaceManager

Change-Id: Iaf457ce15e271fcca1216cb2a1fc216c7dfabede
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/50/385350/1

diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index 17856b2..4e20f18 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -326,11 +326,11 @@
 descmsg = bs-namespacecss-desc
 file = BlueSpiceExtensions/NamespaceCss/i18n/%CODE%.json
 
-Blue Spice - Namespace Manager
+Blue Spice Namespace Manager
 id = ext-bs-namespacemanager
 descmsg = bs-namespacemanager-desc
-file = BlueSpiceExtensions/NamespaceManager/i18n/%CODE%.json
-aliasfile = 
BlueSpiceExtensions/NamespaceManager/includes/specials/SpecialNamespaceManager.alias.php
+file = BlueSpiceNamespaceManager/i18n/%CODE%.json
+aliasfile = 
BlueSpiceNamespaceManager/includes/specials/SpecialNamespaceManager.alias.php
 
 Blue Spice - Page Access
 id = ext-bs-pageaccess

-- 
To view, visit https://gerrit.wikimedia.org/r/385350
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaf457ce15e271fcca1216cb2a1fc216c7dfabede
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] translatewiki[master]: Moved BlueSpiceExtensions/Preferences to BlueSpiceConfigManager

2017-10-20 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/385335 )

Change subject: Moved BlueSpiceExtensions/Preferences to BlueSpiceConfigManager
..

Moved BlueSpiceExtensions/Preferences to BlueSpiceConfigManager

Extension removed:
https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/BlueSpiceExtensions

Extension added
https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/BlueSpiceConfigManager

Change-Id: I2d5493d7b819d92ccf77ae7ff43b04ac41100aed
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/35/385335/1

diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index 17856b2..da1a6f1 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -342,11 +342,11 @@
 descmsg = bs-pagesvisited-desc
 file = BlueSpiceExtensions/PagesVisited/i18n/%CODE%.json
 
-Blue Spice - Preferences
+Blue Spice Config Manager
 id = ext-bs-preferences
 descmsg = bs-preferences-desc
-file = BlueSpiceExtensions/Preferences/i18n/%CODE%.json
-aliasfile = 
BlueSpiceExtensions/Preferences/includes/specials/SpecialBlueSpicePreferences.alias.php
+file = BlueSpiceConfigManager/i18n/%CODE%.json
+aliasfile = 
BlueSpiceConfigManager/includes/specials/SpecialBlueSpicePreferences.alias.php
 optional = prefs-bluespice
 
 Blue Spice - Readers

-- 
To view, visit https://gerrit.wikimedia.org/r/385335
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d5493d7b819d92ccf77ae7ff43b04ac41100aed
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: Moved Preferences extension to BlueSpiceConfigManager

2017-10-20 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/385333 )

Change subject: Moved Preferences extension to BlueSpiceConfigManager
..

Moved Preferences extension to BlueSpiceConfigManager

Change-Id: I34a28ef0c2ccaebeb96d9638c21942ca4447c66c
---
D Preferences/Preferences.class.php
D Preferences/Preferences.setup.php
D Preferences/doc/Hooks.txt
D Preferences/extension.json
D Preferences/i18n/ast.json
D Preferences/i18n/atj.json
D Preferences/i18n/av.json
D Preferences/i18n/ba.json
D Preferences/i18n/be-tarask.json
D Preferences/i18n/bn.json
D Preferences/i18n/br.json
D Preferences/i18n/ca.json
D Preferences/i18n/cnh.json
D Preferences/i18n/de.json
D Preferences/i18n/diq.json
D Preferences/i18n/dty.json
D Preferences/i18n/el.json
D Preferences/i18n/en.json
D Preferences/i18n/es.json
D Preferences/i18n/eu.json
D Preferences/i18n/fa.json
D Preferences/i18n/fr.json
D Preferences/i18n/gl.json
D Preferences/i18n/he.json
D Preferences/i18n/it.json
D Preferences/i18n/ja.json
D Preferences/i18n/ko.json
D Preferences/i18n/ksh.json
D Preferences/i18n/ku-latn.json
D Preferences/i18n/lb.json
D Preferences/i18n/li.json
D Preferences/i18n/lij.json
D Preferences/i18n/lki.json
D Preferences/i18n/lt.json
D Preferences/i18n/mai.json
D Preferences/i18n/mk.json
D Preferences/i18n/mr.json
D Preferences/i18n/nb.json
D Preferences/i18n/ne.json
D Preferences/i18n/nl.json
D Preferences/i18n/pl.json
D Preferences/i18n/ps.json
D Preferences/i18n/pt-br.json
D Preferences/i18n/pt.json
D Preferences/i18n/qqq.json
D Preferences/i18n/roa-tara.json
D Preferences/i18n/ru.json
D Preferences/i18n/sl.json
D Preferences/i18n/sr-ec.json
D Preferences/i18n/sv.json
D Preferences/i18n/ta.json
D Preferences/i18n/tcy.json
D Preferences/i18n/uk.json
D Preferences/i18n/zh-hans.json
D Preferences/i18n/zh-hant.json
D Preferences/includes/specials/SpecialBlueSpicePreferences.alias.php
D Preferences/includes/specials/SpecialBlueSpicePreferences.php
D Preferences/resources/bluespice.preferences.js
58 files changed, 0 insertions(+), 912 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/33/385333/1

diff --git a/Preferences/Preferences.class.php 
b/Preferences/Preferences.class.php
deleted file mode 100644
index 87bce6b..000
--- a/Preferences/Preferences.class.php
+++ /dev/null
@@ -1,136 +0,0 @@
-http://www.bluespice.com
- *
- * @author Sebastian Ulbricht 
- * @version2.23.1
- * @packageBluespice_Extensions
- * @subpackage Preferences
- * @copyright  Copyright (C) 2016 Hallo Welt! GmbH, All rights reserved.
- * @licensehttp://www.gnu.org/copyleft/gpl.html GNU Public License v2 or 
later
- * @filesource
- */
-
-// Last review MRG (01.07.11 13:56)
-
-/**
- * the Preferences class
- * @package BlueSpice_Extensions
- * @subpackage Preferences
- */
-class BsPreferences extends BsExtensionMW {
-
-   public function __construct() {
-   wfProfileIn( 'BS::' . __METHOD__ );
-   // Base settings
-   $this->mExtensionFile = __FILE__;
-   $this->mExtensionType = EXTTYPE::SPECIALPAGE;
-
-   WikiAdmin::registerModule( 'BlueSpicePreferences', [
-   'image' => 
'/extensions/BlueSpiceExtensions/WikiAdmin/resources/images/bs-btn_einstellungen_v1.png',
-   'level' => 'wikiadmin',
-   'message' => 'bs-bluespicepreferences-label',
-   'iconCls' => 'bs-icon-wrench',
-   'permissions' => [ 
'bluespicepreferences-viewspecialpage' ],
-   ]);
-
-   wfProfileOut( 'BS::' . __METHOD__ );
-   }
-
-   protected function initExt() {
-   $this->mCore->registerPermission( 
'bluespicepreferences-viewspecialpage', array( 'sysop' ), array( 'type' => 
'global' ) );
-   }
-
-   /**
-* saves the settings to the database
-* @param array $aData an associative array of fieldnames and values
-*/
-   public function savePreferences( $aData ) {
-   if ( wfReadOnly() ) {
-   $url = SpecialPage::getTitleFor( 'WikiAdmin' 
)->getFullURL( array(
-   'mode' => 'Preferences',
-   'success' => 0
-   ) );
-   $this->getOutput()->redirect( $url );
-
-   return false;
-   }
-
-   $vars = BsConfig::getRegisteredVars();
-   foreach ( $vars as $var ) {
-   $options = $var->getOptions();
-   if ( !( $options & ( BsConfig::LEVEL_PUBLIC | 
BsConfig::LEVEL_USER ) ) ) {
-   continue;
-   }
-   if ( $options & BsConfig::NO_DEFAULT ) continue;
-
-   $name = 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceConfigManager[master]: Initial commit. Added all files from BlueSpiceExtensions/Pre...

2017-10-20 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/385330 )

Change subject: Initial commit. Added all files from 
BlueSpiceExtensions/Preferences
..

Initial commit. Added all files from BlueSpiceExtensions/Preferences

Change-Id: Ica5322b4ffd2b0fcafe962a63ef5f9a47b77a474
---
A CODE_OF_CONDUCT.md
A Preferences.class.php
A composer.json
A doc/Hooks.txt
A extension.json
A i18n/ast.json
A i18n/atj.json
A i18n/av.json
A i18n/ba.json
A i18n/be-tarask.json
A i18n/bn.json
A i18n/br.json
A i18n/ca.json
A i18n/cnh.json
A i18n/de.json
A i18n/diq.json
A i18n/dty.json
A i18n/el.json
A i18n/en.json
A i18n/es.json
A i18n/eu.json
A i18n/fa.json
A i18n/fr.json
A i18n/gl.json
A i18n/he.json
A i18n/it.json
A i18n/ja.json
A i18n/ko.json
A i18n/ksh.json
A i18n/ku-latn.json
A i18n/lb.json
A i18n/li.json
A i18n/lij.json
A i18n/lki.json
A i18n/lt.json
A i18n/mai.json
A i18n/mk.json
A i18n/mr.json
A i18n/nb.json
A i18n/ne.json
A i18n/nl.json
A i18n/pl.json
A i18n/ps.json
A i18n/pt-br.json
A i18n/pt.json
A i18n/qqq.json
A i18n/roa-tara.json
A i18n/ru.json
A i18n/sl.json
A i18n/sr-ec.json
A i18n/sv.json
A i18n/ta.json
A i18n/tcy.json
A i18n/uk.json
A i18n/zh-hans.json
A i18n/zh-hant.json
A includes/specials/SpecialBlueSpicePreferences.alias.php
A includes/specials/SpecialBlueSpicePreferences.php
A resources/bluespice.preferences.js
59 files changed, 921 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceConfigManager 
refs/changes/30/385330/1

diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 000..d8e5d08
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1 @@
+The development of this software is covered by a [Code of 
Conduct](https://www.mediawiki.org/wiki/Code_of_Conduct).
diff --git a/Preferences.class.php b/Preferences.class.php
new file mode 100644
index 000..87bce6b
--- /dev/null
+++ b/Preferences.class.php
@@ -0,0 +1,136 @@
+http://www.bluespice.com
+ *
+ * @author Sebastian Ulbricht 
+ * @version2.23.1
+ * @packageBluespice_Extensions
+ * @subpackage Preferences
+ * @copyright  Copyright (C) 2016 Hallo Welt! GmbH, All rights reserved.
+ * @licensehttp://www.gnu.org/copyleft/gpl.html GNU Public License v2 or 
later
+ * @filesource
+ */
+
+// Last review MRG (01.07.11 13:56)
+
+/**
+ * the Preferences class
+ * @package BlueSpice_Extensions
+ * @subpackage Preferences
+ */
+class BsPreferences extends BsExtensionMW {
+
+   public function __construct() {
+   wfProfileIn( 'BS::' . __METHOD__ );
+   // Base settings
+   $this->mExtensionFile = __FILE__;
+   $this->mExtensionType = EXTTYPE::SPECIALPAGE;
+
+   WikiAdmin::registerModule( 'BlueSpicePreferences', [
+   'image' => 
'/extensions/BlueSpiceExtensions/WikiAdmin/resources/images/bs-btn_einstellungen_v1.png',
+   'level' => 'wikiadmin',
+   'message' => 'bs-bluespicepreferences-label',
+   'iconCls' => 'bs-icon-wrench',
+   'permissions' => [ 
'bluespicepreferences-viewspecialpage' ],
+   ]);
+
+   wfProfileOut( 'BS::' . __METHOD__ );
+   }
+
+   protected function initExt() {
+   $this->mCore->registerPermission( 
'bluespicepreferences-viewspecialpage', array( 'sysop' ), array( 'type' => 
'global' ) );
+   }
+
+   /**
+* saves the settings to the database
+* @param array $aData an associative array of fieldnames and values
+*/
+   public function savePreferences( $aData ) {
+   if ( wfReadOnly() ) {
+   $url = SpecialPage::getTitleFor( 'WikiAdmin' 
)->getFullURL( array(
+   'mode' => 'Preferences',
+   'success' => 0
+   ) );
+   $this->getOutput()->redirect( $url );
+
+   return false;
+   }
+
+   $vars = BsConfig::getRegisteredVars();
+   foreach ( $vars as $var ) {
+   $options = $var->getOptions();
+   if ( !( $options & ( BsConfig::LEVEL_PUBLIC | 
BsConfig::LEVEL_USER ) ) ) {
+   continue;
+   }
+   if ( $options & BsConfig::NO_DEFAULT ) continue;
+
+   $name = $this->generateFieldId( $var );
+   $value = isset( $aData[$name] ) ? $aData[$name] : NULL;
+   if ( ( $var->getOptions() & BsConfig::TYPE_BOOL ) && 
$value == NULL ) {
+   BsConfig::set($var->getKey(), 0, true);
+   }
+
+   $bReturn = true;
+
+   Hooks::run( 'BSWikiAdminPreferencesBeforeSetVariable', 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceConfigManager[master]: initial commit

2017-10-20 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/385324 )

Change subject: initial commit
..

initial commit

Change-Id: I7c6b23e0524f636ce730b7cb6b6abfb25645d175
---
A .gitignore
A .gitreview
2 files changed, 9 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceConfigManager 
refs/changes/24/385324/1

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..d37d322
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+node_modules/
+vendor
+composer.lock
\ No newline at end of file
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 000..4bf6acc
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/BlueSpiceConfigManager.git
+track=1
+defaultrebase=0

-- 
To view, visit https://gerrit.wikimedia.org/r/385324
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c6b23e0524f636ce730b7cb6b6abfb25645d175
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceConfigManager
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: removed moved extensions Authors Statistic

2017-09-21 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/379522 )

Change subject: removed moved extensions Authors Statistic
..

removed moved extensions
Authors
Statistic

Change-Id: I424ee32b83c3be47aa2afdb14fc840ac65c357eb
---
M BlueSpiceExtensions.default.php
1 file changed, 0 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/22/379522/1

diff --git a/BlueSpiceExtensions.default.php b/BlueSpiceExtensions.default.php
index c4d94b1..517bc24 100644
--- a/BlueSpiceExtensions.default.php
+++ b/BlueSpiceExtensions.default.php
@@ -14,7 +14,6 @@
 require_once( __DIR__."/RSSFeeder/RSSFeeder.setup.php" );
 require_once( __DIR__."/AboutBlueSpice/AboutBlueSpice.setup.php" );
 require_once( __DIR__."/ArticleInfo/ArticleInfo.setup.php" );
-require_once( __DIR__."/Authors/Authors.setup.php" );
 require_once( __DIR__."/Blog/Blog.setup.php" );
 require_once( __DIR__."/Checklist/Checklist.setup.php" );
 require_once( __DIR__."/ContextMenu/ContextMenu.setup.php" );
@@ -47,7 +46,6 @@
 require_once( __DIR__."/RSSStandards/RSSStandards.setup.php" );
 require_once( __DIR__."/PageAssignments/PageAssignments.setup.php" );
 require_once( __DIR__."/SaferEdit/SaferEdit.setup.php" );
-require_once( __DIR__."/Statistics/Statistics.setup.php" );
 require_once( __DIR__."/Avatars/Avatars.setup.php" );
 require_once( __DIR__."/Readers/Readers.setup.php" );
 #require_once( __DIR__."/ExtendedSearch/ExtendedSearch.setup.php" );

-- 
To view, visit https://gerrit.wikimedia.org/r/379522
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I424ee32b83c3be47aa2afdb14fc840ac65c357eb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] translatewiki[master]: Update of config file in regards to changes in BlueSpice ext...

2017-09-19 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/378883 )

Change subject: Update of config file in regards to changes in BlueSpice 
extensions
..

Update of config file in regards to changes in BlueSpice extensions

BlueSpiceExtensions/Authors -> BlueSpiceAuthors:
https://gerrit.wikimedia.org/r/378880
https://gerrit.wikimedia.org/r/378844

BlueSpiceExtensions/Statistics -> BlueSpiceExtendedStatistics
https://gerrit.wikimedia.org/r/378881
https://gerrit.wikimedia.org/r/378699

This commit based on https://phabricator.wikimedia.org/T143106

Change-Id: Idec4816e46d584dda46c7134e7188d502835aa3e
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/83/378883/1

diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index e02fe37..cbc490f 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -196,7 +196,7 @@
 Blue Spice - Authors
 id = ext-bs-authors
 descmsg = bs-authors-desc
-file = BlueSpiceExtensions/Authors/i18n/%CODE%.json
+file = BlueSpiceAuthors/i18n/%CODE%.json
 
 Blue Spice - Blog
 id = ext-bs-blog
@@ -421,7 +421,7 @@
 Blue Spice - Statistics
 id = ext-bs-statistics
 descmsg = bs-statistics-desc
-file = BlueSpiceExtensions/Statistics/i18n/%CODE%.json
+file = BlueSpiceExtendedStatistics/i18n/%CODE%.json
 
 Blue Spice - Top Menu Bar Customizer
 id = ext-bs-topmenubarcustomizer

-- 
To view, visit https://gerrit.wikimedia.org/r/378883
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idec4816e46d584dda46c7134e7188d502835aa3e
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: Remove Authors extensions

2017-09-19 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/378880 )

Change subject: Remove Authors extensions
..

Remove Authors extensions

This extensions is moved to BlueSpiceAuthors

Change-Id: I9d0da745fadfb8ce5325cae77b511aeb1365af05
---
D Authors/Authors.class.php
D Authors/Authors.setup.php
D Authors/doc/Hooks.txt
D Authors/extension.json
D Authors/i18n/ast.json
D Authors/i18n/ba.json
D Authors/i18n/bcc.json
D Authors/i18n/bn.json
D Authors/i18n/br.json
D Authors/i18n/ca.json
D Authors/i18n/ce.json
D Authors/i18n/de.json
D Authors/i18n/diq.json
D Authors/i18n/el.json
D Authors/i18n/en.json
D Authors/i18n/es.json
D Authors/i18n/et.json
D Authors/i18n/eu.json
D Authors/i18n/fa.json
D Authors/i18n/fr.json
D Authors/i18n/gl.json
D Authors/i18n/gu.json
D Authors/i18n/he.json
D Authors/i18n/hi.json
D Authors/i18n/hu.json
D Authors/i18n/ia.json
D Authors/i18n/id.json
D Authors/i18n/it.json
D Authors/i18n/ja.json
D Authors/i18n/kn.json
D Authors/i18n/ko.json
D Authors/i18n/ksh.json
D Authors/i18n/lb.json
D Authors/i18n/lt.json
D Authors/i18n/lv.json
D Authors/i18n/mk.json
D Authors/i18n/mr.json
D Authors/i18n/nb.json
D Authors/i18n/nl.json
D Authors/i18n/oc.json
D Authors/i18n/pl.json
D Authors/i18n/ps.json
D Authors/i18n/pt-br.json
D Authors/i18n/pt.json
D Authors/i18n/qqq.json
D Authors/i18n/roa-tara.json
D Authors/i18n/ru.json
D Authors/i18n/sl.json
D Authors/i18n/sv.json
D Authors/i18n/tr.json
D Authors/i18n/uk.json
D Authors/i18n/vi.json
D Authors/i18n/zh-hans.json
D Authors/i18n/zh-hant.json
D Authors/languages/Authors.i18n.magic.php
D Authors/resources/bluespice.authors.css
D Authors/resources/images/bs-author-orig-bg.png
D Authors/resources/images/more-users_v2.png
D Authors/views/view.Authors.php
D Authors/views/view.AuthorsUserPageProfileImageSetting.php
60 files changed, 0 insertions(+), 1,432 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/80/378880/1

diff --git a/Authors/Authors.class.php b/Authors/Authors.class.php
deleted file mode 100644
index 22bc111..000
--- a/Authors/Authors.class.php
+++ /dev/null
@@ -1,337 +0,0 @@
-http://www.bluespice.com
- *
- * @author Markus Glaser 
- * @author Robert Vogel 
- * @version2.23.1
- * @packageBlueSpice_Extensions
- * @subpackage Authors
- * @copyright  Copyright (C) 2016 Hallo Welt! GmbH, All rights reserved.
- * @licensehttp://www.gnu.org/copyleft/gpl.html GNU Public License v2 or 
later
- * @filesource
- */
-
-//Last review MRG (30.06.11 10:25)
-
-/**
- * Base class for Authors extension
- * @package BlueSpice_Extensions
- * @subpackage Authors
- */
-class Authors extends BsExtensionMW {
-
-   /**
-* Initialization of Authors extension
-*/
-   protected function initExt() {
-   wfProfileIn( 'BS::'.__METHOD__ );
-   // Hooks
-   $this->setHook( 'SkinTemplateOutputPageBeforeExec' );
-   $this->setHook( 'BeforePageDisplay' );
-   $this->setHook( 'BSInsertMagicAjaxGetData' );
-   $this->setHook( 'BS:UserPageSettings', 'onUserPageSettings' );
-   $this->setHook( 'PageContentSave' );
-
-   BsConfig::registerVar( 'MW::Authors::Blacklist',   array( 
'MediaWiki default' ), BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_ARRAY_STRING );
-   BsConfig::registerVar( 'MW::Authors::Limit',   10,  
 BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_INT, 
'bs-authors-pref-limit', 'int' );
-   BsConfig::registerVar( 'MW::Authors::MoreImage',   
'more-users_v2.png',  BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_STRING );
-   BsConfig::registerVar( 'MW::Authors::Show',true,
 BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_BOOL, 
'bs-authors-pref-show', 'toggle' );
-
-   $this->mCore->registerBehaviorSwitch( 'bs_noauthors' );
-
-   wfProfileOut( 'BS::'.__METHOD__ );
-   }
-
-   /**
-* Inject tags into InsertMagic
-* @param Object $oResponse reference
-* $param String $type
-* @return always true to keep hook running
-*/
-   public function onBSInsertMagicAjaxGetData( &$oResponse, $type ) {
-   if( $type != 'switches' ) return true;
-
-   $oDescriptor = new stdClass();
-   $oDescriptor->id = 'bs:authors';
-   $oDescriptor->type = 'switch';
-   $oDescriptor->name = 'NOAUTHORS';
-   $oDescriptor->desc = wfMessage( 'bs-authors-switch-description' 
)->plain();
-   $oDescriptor->code = '__NOAUTHORS__';
-   $oDescriptor->previewable = false;
-   $oResponse->result[] = $oDescriptor;
-
-   return true;
-   }
-
-   /**
-* Hook-Handler for MediaWiki 'BeforePageDisplay' 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAuthors[master]: Initial commit

2017-09-19 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/378845 )

Change subject: Initial commit
..

Initial commit

Change-Id: I3d0537234e8a8d51a4c42fb8d17fd4d6f0603747
---
M .gitreview
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceAuthors 
refs/changes/45/378845/1

diff --git a/.gitreview b/.gitreview
index ac6662d..bee6799 100644
--- a/.gitreview
+++ b/.gitreview
@@ -1,6 +1,6 @@
 [gerrit]
 host=gerrit.wikimedia.org
 port=29418
-project=mediawiki/extensions/BlueSpiceExtendedStatistics.git
+project=mediawiki/extensions/BlueSpiceAuthors.git
 track=1
 defaultrebase=0

-- 
To view, visit https://gerrit.wikimedia.org/r/378845
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d0537234e8a8d51a4c42fb8d17fd4d6f0603747
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceAuthors
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAuthors[master]: Initial commit

2017-09-19 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/378844 )

Change subject: Initial commit
..

Initial commit

Change-Id: I605d50676078117000e155f7eef033410dd2f0e3
---
A .gitignore
A .gitreview
A Authors.class.php
A composer.json
A doc/Hooks.txt
A extension.json
A i18n/ast.json
A i18n/ba.json
A i18n/bcc.json
A i18n/bn.json
A i18n/br.json
A i18n/ca.json
A i18n/ce.json
A i18n/de.json
A i18n/diq.json
A i18n/el.json
A i18n/en.json
A i18n/es.json
A i18n/et.json
A i18n/eu.json
A i18n/fa.json
A i18n/fr.json
A i18n/gl.json
A i18n/gu.json
A i18n/he.json
A i18n/hi.json
A i18n/hu.json
A i18n/ia.json
A i18n/id.json
A i18n/it.json
A i18n/ja.json
A i18n/kn.json
A i18n/ko.json
A i18n/ksh.json
A i18n/lb.json
A i18n/lt.json
A i18n/lv.json
A i18n/mk.json
A i18n/mr.json
A i18n/nb.json
A i18n/nl.json
A i18n/oc.json
A i18n/pl.json
A i18n/ps.json
A i18n/pt-br.json
A i18n/pt.json
A i18n/qqq.json
A i18n/roa-tara.json
A i18n/ru.json
A i18n/sl.json
A i18n/sv.json
A i18n/tr.json
A i18n/uk.json
A i18n/vi.json
A i18n/zh-hans.json
A i18n/zh-hant.json
A languages/Authors.i18n.magic.php
A resources/bluespice.authors.css
A resources/images/bs-author-orig-bg.png
A resources/images/more-users_v2.png
A views/view.Authors.php
A views/view.AuthorsUserPageProfileImageSetting.php
62 files changed, 1,447 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceAuthors 
refs/changes/44/378844/1

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..d37d322
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+node_modules/
+vendor
+composer.lock
\ No newline at end of file
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 000..ac6662d
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/BlueSpiceExtendedStatistics.git
+track=1
+defaultrebase=0
diff --git a/Authors.class.php b/Authors.class.php
new file mode 100644
index 000..22bc111
--- /dev/null
+++ b/Authors.class.php
@@ -0,0 +1,337 @@
+http://www.bluespice.com
+ *
+ * @author Markus Glaser 
+ * @author Robert Vogel 
+ * @version2.23.1
+ * @packageBlueSpice_Extensions
+ * @subpackage Authors
+ * @copyright  Copyright (C) 2016 Hallo Welt! GmbH, All rights reserved.
+ * @licensehttp://www.gnu.org/copyleft/gpl.html GNU Public License v2 or 
later
+ * @filesource
+ */
+
+//Last review MRG (30.06.11 10:25)
+
+/**
+ * Base class for Authors extension
+ * @package BlueSpice_Extensions
+ * @subpackage Authors
+ */
+class Authors extends BsExtensionMW {
+
+   /**
+* Initialization of Authors extension
+*/
+   protected function initExt() {
+   wfProfileIn( 'BS::'.__METHOD__ );
+   // Hooks
+   $this->setHook( 'SkinTemplateOutputPageBeforeExec' );
+   $this->setHook( 'BeforePageDisplay' );
+   $this->setHook( 'BSInsertMagicAjaxGetData' );
+   $this->setHook( 'BS:UserPageSettings', 'onUserPageSettings' );
+   $this->setHook( 'PageContentSave' );
+
+   BsConfig::registerVar( 'MW::Authors::Blacklist',   array( 
'MediaWiki default' ), BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_ARRAY_STRING );
+   BsConfig::registerVar( 'MW::Authors::Limit',   10,  
 BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_INT, 
'bs-authors-pref-limit', 'int' );
+   BsConfig::registerVar( 'MW::Authors::MoreImage',   
'more-users_v2.png',  BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_STRING );
+   BsConfig::registerVar( 'MW::Authors::Show',true,
 BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_BOOL, 
'bs-authors-pref-show', 'toggle' );
+
+   $this->mCore->registerBehaviorSwitch( 'bs_noauthors' );
+
+   wfProfileOut( 'BS::'.__METHOD__ );
+   }
+
+   /**
+* Inject tags into InsertMagic
+* @param Object $oResponse reference
+* $param String $type
+* @return always true to keep hook running
+*/
+   public function onBSInsertMagicAjaxGetData( &$oResponse, $type ) {
+   if( $type != 'switches' ) return true;
+
+   $oDescriptor = new stdClass();
+   $oDescriptor->id = 'bs:authors';
+   $oDescriptor->type = 'switch';
+   $oDescriptor->name = 'NOAUTHORS';
+   $oDescriptor->desc = wfMessage( 'bs-authors-switch-description' 
)->plain();
+   $oDescriptor->code = '__NOAUTHORS__';
+   $oDescriptor->previewable = false;
+   $oResponse->result[] = $oDescriptor;
+
+   return true;
+   }
+
+   /**
+* Hook-Handler for MediaWiki 'BeforePageDisplay' hook. Sets context if 
needed.
+* @param OutputPage $oOutputPage
+* @param Skin 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAuthors[master]: Initial commit

2017-09-18 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/378711 )

Change subject: Initial commit
..

Initial commit

Change-Id: Ifad9bdd7361f5bf3c61eac1503891b890933d343
---
A .gitreview
A Authors.class.php
A composer.json
A doc/Hooks.txt
A extension.json
A i18n/ast.json
A i18n/ba.json
A i18n/bcc.json
A i18n/bn.json
A i18n/br.json
A i18n/ca.json
A i18n/ce.json
A i18n/de.json
A i18n/diq.json
A i18n/el.json
A i18n/en.json
A i18n/es.json
A i18n/et.json
A i18n/eu.json
A i18n/fa.json
A i18n/fr.json
A i18n/gl.json
A i18n/gu.json
A i18n/he.json
A i18n/hi.json
A i18n/hu.json
A i18n/ia.json
A i18n/id.json
A i18n/it.json
A i18n/ja.json
A i18n/kn.json
A i18n/ko.json
A i18n/ksh.json
A i18n/lb.json
A i18n/lt.json
A i18n/lv.json
A i18n/mk.json
A i18n/mr.json
A i18n/nb.json
A i18n/nl.json
A i18n/oc.json
A i18n/pl.json
A i18n/ps.json
A i18n/pt-br.json
A i18n/pt.json
A i18n/qqq.json
A i18n/roa-tara.json
A i18n/ru.json
A i18n/sl.json
A i18n/sv.json
A i18n/tr.json
A i18n/uk.json
A i18n/vi.json
A i18n/zh-hans.json
A i18n/zh-hant.json
A languages/Authors.i18n.magic.php
A resources/bluespice.authors.css
A resources/images/bs-author-orig-bg.png
A resources/images/more-users_v2.png
A views/view.Authors.php
A views/view.AuthorsUserPageProfileImageSetting.php
61 files changed, 1,445 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceAuthors 
refs/changes/11/378711/1

diff --git a/.gitreview b/.gitreview
new file mode 100644
index 000..bee6799
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/BlueSpiceAuthors.git
+track=1
+defaultrebase=0
diff --git a/Authors.class.php b/Authors.class.php
new file mode 100644
index 000..22bc111
--- /dev/null
+++ b/Authors.class.php
@@ -0,0 +1,337 @@
+http://www.bluespice.com
+ *
+ * @author Markus Glaser 
+ * @author Robert Vogel 
+ * @version2.23.1
+ * @packageBlueSpice_Extensions
+ * @subpackage Authors
+ * @copyright  Copyright (C) 2016 Hallo Welt! GmbH, All rights reserved.
+ * @licensehttp://www.gnu.org/copyleft/gpl.html GNU Public License v2 or 
later
+ * @filesource
+ */
+
+//Last review MRG (30.06.11 10:25)
+
+/**
+ * Base class for Authors extension
+ * @package BlueSpice_Extensions
+ * @subpackage Authors
+ */
+class Authors extends BsExtensionMW {
+
+   /**
+* Initialization of Authors extension
+*/
+   protected function initExt() {
+   wfProfileIn( 'BS::'.__METHOD__ );
+   // Hooks
+   $this->setHook( 'SkinTemplateOutputPageBeforeExec' );
+   $this->setHook( 'BeforePageDisplay' );
+   $this->setHook( 'BSInsertMagicAjaxGetData' );
+   $this->setHook( 'BS:UserPageSettings', 'onUserPageSettings' );
+   $this->setHook( 'PageContentSave' );
+
+   BsConfig::registerVar( 'MW::Authors::Blacklist',   array( 
'MediaWiki default' ), BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_ARRAY_STRING );
+   BsConfig::registerVar( 'MW::Authors::Limit',   10,  
 BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_INT, 
'bs-authors-pref-limit', 'int' );
+   BsConfig::registerVar( 'MW::Authors::MoreImage',   
'more-users_v2.png',  BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_STRING );
+   BsConfig::registerVar( 'MW::Authors::Show',true,
 BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_BOOL, 
'bs-authors-pref-show', 'toggle' );
+
+   $this->mCore->registerBehaviorSwitch( 'bs_noauthors' );
+
+   wfProfileOut( 'BS::'.__METHOD__ );
+   }
+
+   /**
+* Inject tags into InsertMagic
+* @param Object $oResponse reference
+* $param String $type
+* @return always true to keep hook running
+*/
+   public function onBSInsertMagicAjaxGetData( &$oResponse, $type ) {
+   if( $type != 'switches' ) return true;
+
+   $oDescriptor = new stdClass();
+   $oDescriptor->id = 'bs:authors';
+   $oDescriptor->type = 'switch';
+   $oDescriptor->name = 'NOAUTHORS';
+   $oDescriptor->desc = wfMessage( 'bs-authors-switch-description' 
)->plain();
+   $oDescriptor->code = '__NOAUTHORS__';
+   $oDescriptor->previewable = false;
+   $oResponse->result[] = $oDescriptor;
+
+   return true;
+   }
+
+   /**
+* Hook-Handler for MediaWiki 'BeforePageDisplay' hook. Sets context if 
needed.
+* @param OutputPage $oOutputPage
+* @param Skin $oSkin
+* @return bool
+*/
+   public function onBeforePageDisplay( &$oOutputPage, &$oSkin ) {
+   if ( $this->checkContext() === false ) return true;
+   

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAuthors[master]: Removed unused files

2017-09-18 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/378710 )

Change subject: Removed unused files
..

Removed unused files

Change-Id: I2a9587e172c9e4a187c60dfee21bcf7f954f99b2
---
D groups
D project.config
2 files changed, 0 insertions(+), 15 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceAuthors 
refs/changes/10/378710/1

diff --git a/groups b/groups
deleted file mode 100644
index 28d0fcc..000
--- a/groups
+++ /dev/null
@@ -1,4 +0,0 @@
-# UUID Group Name
-#
-96de72a7678707ad71b6ff789626aab7b2244b6f   extension-BlueSpiceAuthors
-f7087318186de2eac3b21b63abd2a145035455a3   bluespice
diff --git a/project.config b/project.config
deleted file mode 100644
index b80c871..000
--- a/project.config
+++ /dev/null
@@ -1,11 +0,0 @@
-[project]
-   description = MediaWiki extension BlueSpiceAuthors
-[access]
-   inheritFrom = mediawiki/extensions
-[receive]
-   requireChangeId = true
-[submit]
-   mergeContent = true
-[access "refs/*"]
-   owner = group bluespice
-   owner = group extension-BlueSpiceAuthors

-- 
To view, visit https://gerrit.wikimedia.org/r/378710
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a9587e172c9e4a187c60dfee21bcf7f954f99b2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceAuthors
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAuthors[master]: Initial commit

2017-09-18 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/378709 )

Change subject: Initial commit
..

Initial commit

Change-Id: I7d0074b382d6d43dcf82efe0b8a17e06f02f1a42
---
A .gitignore
A .gitreview
A Authors.class.php
A composer.json
A doc/Hooks.txt
A extension.json
A i18n/ast.json
A i18n/ba.json
A i18n/bcc.json
A i18n/bn.json
A i18n/br.json
A i18n/ca.json
A i18n/ce.json
A i18n/de.json
A i18n/diq.json
A i18n/el.json
A i18n/en.json
A i18n/es.json
A i18n/et.json
A i18n/eu.json
A i18n/fa.json
A i18n/fr.json
A i18n/gl.json
A i18n/gu.json
A i18n/he.json
A i18n/hi.json
A i18n/hu.json
A i18n/ia.json
A i18n/id.json
A i18n/it.json
A i18n/ja.json
A i18n/kn.json
A i18n/ko.json
A i18n/ksh.json
A i18n/lb.json
A i18n/lt.json
A i18n/lv.json
A i18n/mk.json
A i18n/mr.json
A i18n/nb.json
A i18n/nl.json
A i18n/oc.json
A i18n/pl.json
A i18n/ps.json
A i18n/pt-br.json
A i18n/pt.json
A i18n/qqq.json
A i18n/roa-tara.json
A i18n/ru.json
A i18n/sl.json
A i18n/sv.json
A i18n/tr.json
A i18n/uk.json
A i18n/vi.json
A i18n/zh-hans.json
A i18n/zh-hant.json
A languages/Authors.i18n.magic.php
A resources/bluespice.authors.css
A resources/images/bs-author-orig-bg.png
A resources/images/more-users_v2.png
A views/view.Authors.php
A views/view.AuthorsUserPageProfileImageSetting.php
62 files changed, 1,448 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceAuthors 
refs/changes/09/378709/1

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..d37d322
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+node_modules/
+vendor
+composer.lock
\ No newline at end of file
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 000..bee6799
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/BlueSpiceAuthors.git
+track=1
+defaultrebase=0
diff --git a/Authors.class.php b/Authors.class.php
new file mode 100644
index 000..22bc111
--- /dev/null
+++ b/Authors.class.php
@@ -0,0 +1,337 @@
+http://www.bluespice.com
+ *
+ * @author Markus Glaser 
+ * @author Robert Vogel 
+ * @version2.23.1
+ * @packageBlueSpice_Extensions
+ * @subpackage Authors
+ * @copyright  Copyright (C) 2016 Hallo Welt! GmbH, All rights reserved.
+ * @licensehttp://www.gnu.org/copyleft/gpl.html GNU Public License v2 or 
later
+ * @filesource
+ */
+
+//Last review MRG (30.06.11 10:25)
+
+/**
+ * Base class for Authors extension
+ * @package BlueSpice_Extensions
+ * @subpackage Authors
+ */
+class Authors extends BsExtensionMW {
+
+   /**
+* Initialization of Authors extension
+*/
+   protected function initExt() {
+   wfProfileIn( 'BS::'.__METHOD__ );
+   // Hooks
+   $this->setHook( 'SkinTemplateOutputPageBeforeExec' );
+   $this->setHook( 'BeforePageDisplay' );
+   $this->setHook( 'BSInsertMagicAjaxGetData' );
+   $this->setHook( 'BS:UserPageSettings', 'onUserPageSettings' );
+   $this->setHook( 'PageContentSave' );
+
+   BsConfig::registerVar( 'MW::Authors::Blacklist',   array( 
'MediaWiki default' ), BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_ARRAY_STRING );
+   BsConfig::registerVar( 'MW::Authors::Limit',   10,  
 BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_INT, 
'bs-authors-pref-limit', 'int' );
+   BsConfig::registerVar( 'MW::Authors::MoreImage',   
'more-users_v2.png',  BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_STRING );
+   BsConfig::registerVar( 'MW::Authors::Show',true,
 BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_BOOL, 
'bs-authors-pref-show', 'toggle' );
+
+   $this->mCore->registerBehaviorSwitch( 'bs_noauthors' );
+
+   wfProfileOut( 'BS::'.__METHOD__ );
+   }
+
+   /**
+* Inject tags into InsertMagic
+* @param Object $oResponse reference
+* $param String $type
+* @return always true to keep hook running
+*/
+   public function onBSInsertMagicAjaxGetData( &$oResponse, $type ) {
+   if( $type != 'switches' ) return true;
+
+   $oDescriptor = new stdClass();
+   $oDescriptor->id = 'bs:authors';
+   $oDescriptor->type = 'switch';
+   $oDescriptor->name = 'NOAUTHORS';
+   $oDescriptor->desc = wfMessage( 'bs-authors-switch-description' 
)->plain();
+   $oDescriptor->code = '__NOAUTHORS__';
+   $oDescriptor->previewable = false;
+   $oResponse->result[] = $oDescriptor;
+
+   return true;
+   }
+
+   /**
+* Hook-Handler for MediaWiki 'BeforePageDisplay' hook. Sets context if 
needed.
+* @param OutputPage $oOutputPage
+* @param Skin $oSkin
+   

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtendedStatistics[master]: Refactoring: moved ExtendedStatistics to a new repo and chan...

2017-09-18 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/378699 )

Change subject: Refactoring: moved ExtendedStatistics to a new repo and changed 
calss name of extension
..

Refactoring: moved ExtendedStatistics to a new repo and changed calss name of 
extension

Change-Id: I4cb3a3acb8473ce5590df04ef9ce785c38558879
---
R ExtendedStatistics.class.php
M composer.json
M extension.json
R includes/Charting.class.php
R includes/Diagram.class.php
R includes/DiagramEditsPerUser.class.php
R includes/DiagramNumberOfArticles.class.php
R includes/DiagramNumberOfEdits.class.php
R includes/DiagramNumberOfPages.class.php
R includes/DiagramNumberOfUsers.class.php
R includes/DiagramSearches.class.php
R includes/FilterCategory.class.php
R includes/FilterNamespace.class.php
R includes/FilterSearchScope.class.php
R includes/FilterUsers.class.php
R includes/Interval.class.php
R includes/MultiSelectFilter.class.php
R includes/MySQLDbReader.class.php
R includes/OracleDbReader.class.php
R includes/PostGreSQLDbReader.class.php
R includes/SelectFilter.class.php
R includes/StatisticsFilter.class.php
R includes/StatsDataProvider.class.php
R includes/api/BSApiStatisticsAvailableDiagramsStore.php
R includes/api/BSApiStatisticsSearchOptionsStore.php
R includes/api/BSApiStatisticsTasks.php
R includes/specials/SpecialExtendedStatistics.alias.php
R includes/specials/SpecialExtendedStatistics.class.php
28 files changed, 48 insertions(+), 21 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtendedStatistics
 refs/changes/99/378699/1

diff --git a/ExtendedStatistics.php b/ExtendedStatistics.class.php
similarity index 92%
rename from ExtendedStatistics.php
rename to ExtendedStatistics.class.php
index 76cde7c..128df9f 100644
--- a/ExtendedStatistics.php
+++ b/ExtendedStatistics.class.php
@@ -83,17 +83,17 @@
);
BsConfig::registerVar( 'MW::Statistics::AvailableGrains', 
$aAvailableGrains, BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_ARRAY_MIXED, 
'bs-statistics-pref-AvailableGrains');
 
-   Statistics::addAvailableFilter( 'FilterUsers' );
-   Statistics::addAvailableFilter( 'FilterNamespace' );
-   Statistics::addAvailableFilter( 'FilterCategory' );
-   Statistics::addAvailableFilter( 'FilterSearchScope' );
+   self::addAvailableFilter( 'FilterUsers' );
+   self::addAvailableFilter( 'FilterNamespace' );
+   self::addAvailableFilter( 'FilterCategory' );
+   self::addAvailableFilter( 'FilterSearchScope' );
 
-   Statistics::addAvailableDiagramClass( 'BsDiagramNumberOfUsers' 
);
-   Statistics::addAvailableDiagramClass( 'BsDiagramNumberOfPages' 
);
-   Statistics::addAvailableDiagramClass( 
'BsDiagramNumberOfArticles' );
-   Statistics::addAvailableDiagramClass( 'BsDiagramNumberOfEdits' 
);
-   Statistics::addAvailableDiagramClass( 'BsDiagramEditsPerUser' );
-   Statistics::addAvailableDiagramClass( 'BsDiagramSearches' );
+   self::addAvailableDiagramClass( 'BsDiagramNumberOfUsers' );
+   self::addAvailableDiagramClass( 'BsDiagramNumberOfPages' );
+   self::addAvailableDiagramClass( 'BsDiagramNumberOfArticles' );
+   self::addAvailableDiagramClass( 'BsDiagramNumberOfEdits' );
+   self::addAvailableDiagramClass( 'BsDiagramEditsPerUser' );
+   self::addAvailableDiagramClass( 'BsDiagramSearches' );
 
wfProfileOut( 'BS::Statistics::initExt' );
}
@@ -109,7 +109,7 @@
$sDiagramClassName =  $sDiagramClass;
}
 
-   Statistics::$aAvailableDiagramClasses[$sDiagramClassName] = 
$sDiagramClassName;
+   self::$aAvailableDiagramClasses[$sDiagramClassName] = 
$sDiagramClassName;
}
 
/**
@@ -118,7 +118,7 @@
 */
public static function getAvailableDiagrams() {
self::loadAvailableDiagrams();
-   return Statistics::$aAvailableDiagrams;
+   return self::$aAvailableDiagrams;
}
 
/**
@@ -130,7 +130,7 @@
return self::$aAvailableDiagrams;
}
self::$aAvailableDiagrams = array();
-   foreach ( Statistics::$aAvailableDiagramClasses as 
$sDiagramClass ) {
+   foreach ( self::$aAvailableDiagramClasses as $sDiagramClass ) {
self::$aAvailableDiagrams[$sDiagramClass] = new 
$sDiagramClass();
}
return self::$aAvailableDiagrams;
@@ -143,7 +143,7 @@
 */
public static function getDiagram( $sDiagramClass ) {
self::loadAvailableDiagrams();
-   return Statistics::$aAvailableDiagrams[$sDiagramClass];
+   return 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: BlueSpiceExtensions, TinyMCE Plugin bswikicode Fix: Browser ...

2017-08-10 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371054 )

Change subject: BlueSpiceExtensions, TinyMCE Plugin bswikicode Fix: Browser 
freezes if a spezial tag has a template in it.
..

BlueSpiceExtensions, TinyMCE Plugin bswikicode Fix: Browser freezes if a 
spezial tag has a template in it.

Browser freezes if a spezial tag has a template in it and you change from wiki 
editor to the visual editor.

Fix for ERM#6743

Has to cherry pick to REL1_27

Change-Id: I3b310140b15c3bc9e899b9c30512583cde656bb4
---
M VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
1 file changed, 37 insertions(+), 38 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/54/371054/1

diff --git a/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js 
b/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
index 78c55a2..772a594 100644
--- a/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
+++ b/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
@@ -1730,6 +1730,42 @@
i++;
}
 
+   //quirky. Needs to be there for the occasional second pass of 
cleanup
+   if (!_specialtags) {
+   _specialtags = new Array();
+   }
+
+   specialTagsList = 
mw.config.get('BsVisualEditorConfigDefault').specialtaglist;
+   // Tags without innerHTML need /> as end marker. Maybe this 
should be task of a preprocessor, in order to allow mw style tags without /.
+   regex = '<(' + specialTagsList + 
')((\\s|\\r|\\n)+[^>]*)*?((\\s\\/>)|(\\/>)|(>([\\S\\s]*?((<\\/\\1>)|(<\\/ 
\\1>)';
+
+   matcher = new RegExp(regex, 'gmi');
+   mtext = text;
+   i = 0;
+   st = '';
+
+   innerText = '';
+   var retValue = false;
+   var moreAttribs = '';
+
+   while ((st = matcher.exec(mtext)) !== null) {
+   retValue = $(document).triggerHandler( 
'BSVisualEditorRenderSpecialTag', [this, st[1], st] );
+   if ( retValue ) {
+   innerText = retValue.innerText;
+   moreAttribs = retValue.moreAttribs;
+   } else {
+   innerText = ' ' + st[1] + ' ';
+   }
+   text = text.replace(
+   st[0],
+   ''
+   + innerText
+   + ''
+   );
+   _specialtags[i] = st[0];
+   i++;
+   }
+
curlyBraceDepth = 0;
squareBraceDepth = 0;
templateDepth = 0;
@@ -1801,45 +1837,8 @@
+ templateName + '" 
data-bs-type="template" data-bs-id="' + i + '">'
+ '{{ ' + templateName + ' }}'
+ ''
-   );
-   }
-   }
-
-   //quirky. Needs to be there for the occasional second pass of 
cleanup
-   if (!_specialtags) {
-   _specialtags = new Array();
-   }
-
-   specialTagsList = 
mw.config.get('BsVisualEditorConfigDefault').specialtaglist;
-   // Tags without innerHTML need /> as end marker. Maybe this 
should be task of a preprocessor, in order to allow mw style tags without /.
-   regex = '<(' + specialTagsList + 
')((\\s|\\r|\\n)+[^>]*)*?((\\s\\/>)|(\\/>)|(>([\\S\\s]*?((<\\/\\1>)|(<\\/ 
\\1>)';
-
-   matcher = new RegExp(regex, 'gmi');
-   mtext = text;
-   i = 0;
-   st = '';
-
-   var innerText = '';
-   var retValue = false;
-   var moreAttribs = '';
-
-   while ((st = matcher.exec(mtext)) !== null) {
-   retValue = $(document).triggerHandler( 
'BSVisualEditorRenderSpecialTag', [this, st[1], st] );
-   if ( retValue ) {
-   innerText = retValue.innerText;
-   moreAttribs = retValue.moreAttribs;
-   } else {
-   innerText = ' ' + st[1] + ' ';
-   }
-   text = text.replace(
-   st[0],
-   ''
-   //+ ' ' + st[1] + ' '
-   + innerText
-   + ''
);
-   _specialtags[i] = st[0];
-   i++;
+   }
  

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: ShoutBox: usernames with a blank space between didn't work.

2017-07-14 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/365235 )

Change subject: ShoutBox: usernames with a blank space between didn't work.
..

ShoutBox: usernames with a blank space between didn't work.

Fixed issue from ERM#6680

Change-Id: Ib4d0bcb5a2566866ddd6a9230434ac0f6f2c8687
---
M ShoutBox/resources/bluespice.shoutBox.mention.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/35/365235/1

diff --git a/ShoutBox/resources/bluespice.shoutBox.mention.js 
b/ShoutBox/resources/bluespice.shoutBox.mention.js
index 8cc6802..34e2b8a 100644
--- a/ShoutBox/resources/bluespice.shoutBox.mention.js
+++ b/ShoutBox/resources/bluespice.shoutBox.mention.js
@@ -18,7 +18,7 @@
replace: function ( mention ) {
//put the username in the shoutbox, not the displayname 
for better usage later
var username = mention.match( /\((.*?)\)/ );
-   return '@' + username[1] + ' ';
+   return '@' + username[1].replace(' ', '_') + ' ';
},
getUsers: function () {
$.getJSON( bs.api.makeUrl( 'bs-user-store', { limit: 
999 } ), function ( data ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/365235
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib4d0bcb5a2566866ddd6a9230434ac0f6f2c8687
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceCategoryManager[master]: BlueSpiceCategoryManager: removed link from treepanel and ad...

2017-07-13 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/364994 )

Change subject: BlueSpiceCategoryManager: removed link from treepanel and added 
it to action column.
..

BlueSpiceCategoryManager: removed link from treepanel and added it to action 
column.

Drag'n'drop didn't work an the link in tree panel.

Added loader gif

Fixed an issue from ERM#6654

Change-Id: Ia8d3f4d874d0d6667687d587adeaf5ba9dcf0d4a
---
M extension.json
M i18n/de.json
M i18n/en.json
M i18n/qqq.json
M includes/specials/SpecialBlueSpiceCategoryManager.php
M resources/BS.BlueSpiceCategoryManager/Model.js
M resources/BS.BlueSpiceCategoryManager/TreePanel.js
M resources/bluespice.categorymanager.css
8 files changed, 27 insertions(+), 11 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceCategoryManager 
refs/changes/94/364994/1

diff --git a/extension.json b/extension.json
index a76e1bd..96dfc4f 100644
--- a/extension.json
+++ b/extension.json
@@ -50,7 +50,8 @@
"bs-categorymanager-dlg-new-title",
"bs-categorymanager-removecategoryconfirm-text",

"bs-categorymanager-removecategoryconfirm-title",
-   
"bs-categorymanager-addcategory-dialog-error-title"
+   
"bs-categorymanager-addcategory-dialog-error-title",
+   "bs-categorymanager-action-show-category"
]
}
},
diff --git a/i18n/de.json b/i18n/de.json
index a969496..998ab6a 100644
--- a/i18n/de.json
+++ b/i18n/de.json
@@ -15,5 +15,6 @@
"bs-categorymanager-dlg-new-prompt": "Bitte gib den Namen ein:",
"bs-categorymanager-removecategoryconfirm-text": "Bist du sicher, dass 
du diese Kategorie löschen willst?",
"bs-categorymanager-removecategoryconfirm-title": "Kategorie löschen",
-   "bs-categorymanager-addcategory-dialog-error-title": "Die Erstellung 
der Kategorie ist fehlgeschlagen"
+   "bs-categorymanager-addcategory-dialog-error-title": "Die Erstellung 
der Kategorie ist fehlgeschlagen",
+   "bs-categorymanager-action-show-category": "Kategorie anzeigen"
 }
diff --git a/i18n/en.json b/i18n/en.json
index 8c9d5f5..db117e6 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -14,5 +14,6 @@
"bs-categorymanager-dlg-new-prompt": "Please enter the name:",
"bs-categorymanager-removecategoryconfirm-text": "Are you sure you want 
to delete this category?",
"bs-categorymanager-removecategoryconfirm-title": "Remove category",
-   "bs-categorymanager-addcategory-dialog-error-title": "Creation of 
category failed"
+   "bs-categorymanager-addcategory-dialog-error-title": "Creation of 
category failed",
+   "bs-categorymanager-action-show-category": "Show category"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 3c87b73..b05ecec 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -15,5 +15,6 @@
"bs-categorymanager-dlg-new-prompt": "Label of the input field for the 
new category name",
"bs-categorymanager-removecategoryconfirm-text": "Prompt message in 
case a user tries to delete a category",
"bs-categorymanager-removecategoryconfirm-title": "Title of the prompt 
that is shown to the user before a category gets deleted",
-   "bs-categorymanager-addcategory-dialog-error-title": "Title of the 
error dialog if something went wrong at new categorie"
+   "bs-categorymanager-addcategory-dialog-error-title": "Title of the 
error dialog if something went wrong at new categorie",
+   "bs-categorymanager-action-show-category": "The action in the action 
column to open this category in a new tab/window."
 }
diff --git a/includes/specials/SpecialBlueSpiceCategoryManager.php 
b/includes/specials/SpecialBlueSpiceCategoryManager.php
index e7d11f8..99f5089 100644
--- a/includes/specials/SpecialBlueSpiceCategoryManager.php
+++ b/includes/specials/SpecialBlueSpiceCategoryManager.php
@@ -10,7 +10,7 @@
parent::execute( $sParameter );
 
$this->getOutput()->addModules("ext.bluespice.categorymanager");
-   $this->getOutput()->addHTML( '' );
+   $this->getOutput()->addHTML( '' );
 
return true;
}
diff --git a/resources/BS.BlueSpiceCategoryManager/Model.js 
b/resources/BS.BlueSpiceCategoryManager/Model.js
index 42a0a31..81a0c14 100644
--- a/resources/BS.BlueSpiceCategoryManager/Model.js
+++ b/resources/BS.BlueSpiceCategoryManager/Model.js
@@ -3,15 +3,18 @@
fields: [
{
name: 'text', type: 'string', convert: function ( 
value, record ) {
-   return mw.html.element( 'a' , {
-   'href': mw.Title.makeTitle( 
bs.ns.NS_CATEGORY, record.raw.text ).getUrl(),
-   

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: BlueSpiceExtensions: Added all grids a loader gif

2017-07-13 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/364972 )

Change subject: BlueSpiceExtensions: Added all grids a loader gif
..

BlueSpiceExtensions: Added all grids a loader gif

Change-Id: I0d61bba97dfa1f42fee2980fd377251b51b6d934
---
M Flexiskin/includes/specials/SpecialFlexiskin.class.php
M GroupManager/includes/specials/SpecialGroupManager.class.php
M InterWikiLinks/includes/specials/SpecialInterWikiLinks.class.php
M NamespaceManager/includes/specials/SpecialNamespaceManager.class.php
M PageAssignments/includes/specials/SpecialManagePageAssignments.php
M PageAssignments/includes/specials/SpecialPageAssignments.php
M PageTemplates/includes/specials/SpecialPageTemplatesAdmin.class.php
M PermissionManager/includes/specials/SpecialPermissionManager.class.php
M UserManager/includes/specials/SpecialUserManager.class.php
9 files changed, 9 insertions(+), 9 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/72/364972/1

diff --git a/Flexiskin/includes/specials/SpecialFlexiskin.class.php 
b/Flexiskin/includes/specials/SpecialFlexiskin.class.php
index 0c52d79..c51e92c 100644
--- a/Flexiskin/includes/specials/SpecialFlexiskin.class.php
+++ b/Flexiskin/includes/specials/SpecialFlexiskin.class.php
@@ -16,6 +16,6 @@
parent::execute( $sParameter );
 
$this->getOutput()->addModules( "ext.bluespice.flexiskin" );
-   $this->getOutput()->addHTML( '' );
+   $this->getOutput()->addHTML( '' );
}
 }
diff --git a/GroupManager/includes/specials/SpecialGroupManager.class.php 
b/GroupManager/includes/specials/SpecialGroupManager.class.php
index f1e3801..764d853 100644
--- a/GroupManager/includes/specials/SpecialGroupManager.class.php
+++ b/GroupManager/includes/specials/SpecialGroupManager.class.php
@@ -24,7 +24,7 @@
$oOutputPage = $this->getOutput();
 
$this->getOutput()->addModules( 'ext.bluespice.groupManager' );
-   $oOutputPage->addHTML( '' 
);
+   $oOutputPage->addHTML( '' );
}
 
protected function getGroupName() {
diff --git a/InterWikiLinks/includes/specials/SpecialInterWikiLinks.class.php 
b/InterWikiLinks/includes/specials/SpecialInterWikiLinks.class.php
index 4b11804..62198ce 100644
--- a/InterWikiLinks/includes/specials/SpecialInterWikiLinks.class.php
+++ b/InterWikiLinks/includes/specials/SpecialInterWikiLinks.class.php
@@ -28,7 +28,7 @@
$oOutputPage->addJsConfigVars( 'BSInterWikiPrefixes', 
InterWikiLinks::getInterWikiLinkPrefixes() );
 
$oOutputPage->addModules( 'ext.bluespice.interWikiLinks' );
-   $oOutputPage->addHTML( '' );
+   $oOutputPage->addHTML( '' );
}
 
protected function getGroupName() {
diff --git 
a/NamespaceManager/includes/specials/SpecialNamespaceManager.class.php 
b/NamespaceManager/includes/specials/SpecialNamespaceManager.class.php
index 1e5de33..aa54a5b 100644
--- a/NamespaceManager/includes/specials/SpecialNamespaceManager.class.php
+++ b/NamespaceManager/includes/specials/SpecialNamespaceManager.class.php
@@ -96,7 +96,7 @@
Hooks::run( 'NamespaceManager::getMetaFields', array( 
&$aMetaFields ) );
$this->getOutput()->addJsConfigVars( 
'bsNamespaceManagerMetaFields', $aMetaFields );
 
-   $this->getOutput()->addHTML( '' );
+   $this->getOutput()->addHTML( '' );
}
 
 }
diff --git a/PageAssignments/includes/specials/SpecialManagePageAssignments.php 
b/PageAssignments/includes/specials/SpecialManagePageAssignments.php
index 6fb1a6a..1723145 100644
--- a/PageAssignments/includes/specials/SpecialManagePageAssignments.php
+++ b/PageAssignments/includes/specials/SpecialManagePageAssignments.php
@@ -13,7 +13,7 @@
Hooks::run( 'BSPageAssignmentsManager', array( $this, &$aDeps ) 
);
$this->getOutput()->addJsConfigVars( 
'bsPageAssignmentsManagerDeps', $aDeps );
$this->getOutput()->addHTML(
-   Html::element( 'div', array( 'id' => 
'bs-pageassignments-manager' ) )
+   Html::element( 'div', array( 'id' => 
'bs-pageassignments-manager', 'class' => 'bs-manager-container' ) )
);
}
 
diff --git a/PageAssignments/includes/specials/SpecialPageAssignments.php 
b/PageAssignments/includes/specials/SpecialPageAssignments.php
index 64f290f..b1d09af 100644
--- a/PageAssignments/includes/specials/SpecialPageAssignments.php
+++ b/PageAssignments/includes/specials/SpecialPageAssignments.php
@@ -13,7 +13,7 @@
Hooks::run( 'BSPageAssignmentsOverview', array( $this, &$aDeps 
) );
$this->getOutput()->addJsConfigVars( 
'bsPageAssignmentsOverviewDeps', $aDeps );
$this->getOutput()->addHTML(
-   Html::element( 'div', array( 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BlueSpiceFoundation: added a loader gif css class.

2017-07-13 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/364970 )

Change subject: BlueSpiceFoundation: added a loader gif css class.
..

BlueSpiceFoundation: added a loader gif css class.

Simply add class="bs-manager-container" and there is a loader gif

Change-Id: I69d1a4f71415bccf112703562b3f48be1dc5403a
---
M resources/bluespice/bluespice.css
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/70/364970/1

diff --git a/resources/bluespice/bluespice.css 
b/resources/bluespice/bluespice.css
index d30f045..1a8e6c9 100644
--- a/resources/bluespice/bluespice.css
+++ b/resources/bluespice/bluespice.css
@@ -120,4 +120,11 @@
 
 .bs-tab-content {
clear: both;
+}
+
+.bs-manager-container {
+   min-height: 300px;
+   background-image: url( 'images/bs-ajax-loader-bar-blue.gif' );
+   background-repeat: no-repeat;
+   background-position: center center;
 }
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/364970
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I69d1a4f71415bccf112703562b3f48be1dc5403a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceInsertTemplate[master]: BlueSpiceInserTemplate: In visual editor on edit, duplicate ...

2017-07-12 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/364722 )

Change subject: BlueSpiceInserTemplate: In visual editor on edit, duplicate 
template Fixed: The template was duplicated on edit at the end of the page.
..

BlueSpiceInserTemplate: In visual editor on edit, duplicate template
Fixed:
The template was duplicated on edit at the end of the page.

ERM#6594

Cherrypick to REL1_27

Change-Id: Ie626a03f6e99c0c89afb783023f0e8f91b10
---
M resources/bluespice.insertTemplate.js
1 file changed, 6 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceInsertTemplate 
refs/changes/22/364722/1

diff --git a/resources/bluespice.insertTemplate.js 
b/resources/bluespice.insertTemplate.js
index 9d4dd0b..9c038dd 100644
--- a/resources/bluespice.insertTemplate.js
+++ b/resources/bluespice.insertTemplate.js
@@ -90,6 +90,7 @@
 me.data.type = node.getAttribute('data-bs-type');
 me.data.name = node.getAttribute('data-bs-name');
 
+   me.data.node = node;
 var templates = me.caller.plugins.bswikicode.getTemplateList();
 var currentCode = templates[me.data.id];
 
@@ -101,7 +102,6 @@
 var me = BsInsertTemplateVisualEditorConnector;
 me.bookmark = me.caller.selection.getBookmark();
 me.caller.selection.moveToBookmark( me.bookmark );
-var selectedNode = me.caller.selection.getNode();
 var code = data.code;
 
 var specialtags = me.caller.plugins.bswikicode.getTemplateList();
@@ -117,15 +117,16 @@
'class':'template',
'data-bs-name': me.data.name,
'data-bs-type': 'template',
-   'data-bs-id': me.data.id
+   'data-bs-id': me.data.id,
+   'contenteditable': false
};
var spanContent = '{{ '+me.data.name+' }}';
spanAttrs['class'] += ' mceNonEditable';
 
 var newSpanNode = null;
-if ( selectedNode.nodeName.toLowerCase() == 'span') {
+if ( me.data.node.nodeName.toLowerCase() == 'span') {
 newSpanNode = me.caller.dom.create( 'span', spanAttrs, spanContent 
);
-me.caller.dom.replace(newSpanNode, selectedNode);
+me.caller.dom.replace(newSpanNode, me.data.node);
 //Place cursor to end
 me.caller.selection.select(newSpanNode, false);
 } else {
@@ -133,6 +134,7 @@
 me.caller.insertContent(newSpanNode);
 }
 
+me.data.node = null;
 me.caller.selection.collapse(false);
 }
 };
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/364722
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie626a03f6e99c0c89afb783023f0e8f91b10
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceInsertTemplate
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceCategoryManager[master]: Added icons and action column

2017-07-07 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363824 )

Change subject: Added icons and action column
..

Added icons and action column

See ERM#6654

Change-Id: I325f0a78a086150fae2f2a289b443e386e92da63
---
M extension.json
M i18n/fr.json
M resources/BS.BlueSpiceCategoryManager/Model.js
M resources/BS.BlueSpiceCategoryManager/TreePanel.js
A resources/bluespice.categorymanager.css
5 files changed, 104 insertions(+), 17 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceCategoryManager 
refs/changes/24/363824/1

diff --git a/extension.json b/extension.json
index 7e05e5e..a76e1bd 100644
--- a/extension.json
+++ b/extension.json
@@ -35,6 +35,9 @@
"scripts": [
"bluespice.categorymanager.js"
],
+   "styles": [
+   "bluespice.categorymanager.css"
+   ],
"dependencies": [
"ext.bluespice.extjs",
"ext.bluespice.extjs.BS.deferred",
diff --git a/i18n/fr.json b/i18n/fr.json
index 6021b11..d6046ad 100644
--- a/i18n/fr.json
+++ b/i18n/fr.json
@@ -1,7 +1,8 @@
 {
"@metadata": {
"authors": [
-   "Gomoko"
+   "Gomoko",
+   "Wladek92"
]
},
"bluespicecategorymanager": "Gestionnaire de catégorie",
@@ -12,5 +13,6 @@
"bs-categorymanager-dlg-new-title": "Créer une catégorie",
"bs-categorymanager-dlg-new-prompt": "Veuillez saisir le nom :",
"bs-categorymanager-removecategoryconfirm-text": "Êtes-vous sûr de 
vouloir supprimer cette catégorie ?",
-   "bs-categorymanager-removecategoryconfirm-title": "Supprimer la 
catégorie"
+   "bs-categorymanager-removecategoryconfirm-title": "Supprimer la 
catégorie",
+   "bs-categorymanager-addcategory-dialog-error-title": "Echec dans la 
création de catégorie"
 }
diff --git a/resources/BS.BlueSpiceCategoryManager/Model.js 
b/resources/BS.BlueSpiceCategoryManager/Model.js
index 0e70951..bceaaaf 100644
--- a/resources/BS.BlueSpiceCategoryManager/Model.js
+++ b/resources/BS.BlueSpiceCategoryManager/Model.js
@@ -1,7 +1,21 @@
 Ext.define( 'BS.BlueSpiceCategoryManager.Model', {
extend: 'BS.model.Category',
fields: [
-   { name: 'text', type: 'string' },
+   {
+   name: 'text', type: 'string', convert: function ( 
value, record ) {
+   return mw.html.element( 'a' , {
+   'href': mw.Title.makeTitle( 
bs.ns.NS_CATEGORY, record.raw.text ).getUrl(),
+   'class': (record.raw.leaf ? 
'bs-icon-tag' : 'bs-icon-tags' ),
+   'target': '_blank'
+   },
+   value );
+   }
+   },
+   {
+   name: 'categoryName', type: 'string', convert: function 
( value, record ) {
+   return record.raw.text;
+   }
+   },
{
name: 'leaf', type: 'boolean', convert: function ( 
value, record ) {
return false;
@@ -13,13 +27,13 @@
}
},
{
-   name: 'href', type: 'string', convert: function ( 
value, record ) {
-   var catTitle = mw.Title.makeTitle( 
bs.ns.NS_CATEGORY, record.get( 'text' ) );
-   return catTitle.getUrl();
+   name: 'icon', type: 'string', convert: function ( 
value, record ) {
+   return '';
+   }
+   },{
+   name: 'iconCls', type: 'string', convert: function ( 
value, record ) {
+   return '';
}
-   },
-   {
-   name: 'hrefTarget', type: 'string', defaultValue: 
'_blank'
}
]
 } );
\ No newline at end of file
diff --git a/resources/BS.BlueSpiceCategoryManager/TreePanel.js 
b/resources/BS.BlueSpiceCategoryManager/TreePanel.js
index 8bd22cd..9dc8f21 100644
--- a/resources/BS.BlueSpiceCategoryManager/TreePanel.js
+++ b/resources/BS.BlueSpiceCategoryManager/TreePanel.js
@@ -32,13 +32,17 @@
model: 'BS.BlueSpiceCategoryManager.Model'
});
 
+   var me = this;
+
this.treePanel = new Ext.tree.Panel({
useArrows: true,
height: 500,
rootVisible: false,
displayField: 'text',
 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BlueSpiceFoundation: BSApiExtJSStoreBase: order a grid with ...

2017-07-06 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363549 )

Change subject: BlueSpiceFoundation: BSApiExtJSStoreBase: order a grid with 
stdClass value
..

BlueSpiceFoundation: BSApiExtJSStoreBase: order a grid with stdClass value

Can't cast to string. PHP 7 workaround. In PHP 7 cast throws no exception. It's 
a fatal error so i can't catch it

fixed issue from ERM#6715

Change-Id: Ib2060a11bac48d1fe0bd443d3770df9c22336302
---
M includes/api/BSApiExtJSStoreBase.php
1 file changed, 12 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/49/363549/1

diff --git a/includes/api/BSApiExtJSStoreBase.php 
b/includes/api/BSApiExtJSStoreBase.php
index bd305aa..24fd695 100644
--- a/includes/api/BSApiExtJSStoreBase.php
+++ b/includes/api/BSApiExtJSStoreBase.php
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * l1 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
  * This file is part of BlueSpice for MediaWiki
  * For further information visit http://bluespice.com
@@ -598,7 +598,17 @@
protected function getSortValueFromList( $aValues, $oDataSet, 
$sProperty ) {
$sCombinedValue = '';
foreach( $aValues as $sValue ) {
-   $sCombinedValue .= (string)$sValue;
+   // PHP 7 workaround. In PHP 7 cast throws no exception. 
It's a fatal error so i can't catch it :-(
+   if(
+   ( !is_array( $aValues ) ) &&
+   ( ( !is_object( $aValues ) && settype( 
$aValues, 'string' ) !== false ) ||
+   ( is_object( $aValues ) && 
method_exists( $aValues, '__toString' ) ) )
+   )
+   {
+   $sCombinedValue .= (string)$sValue;
+   } else {
+   $sCombinedValue .= serialize( $sValue );
+   }
}
return $sCombinedValue;
}

-- 
To view, visit https://gerrit.wikimedia.org/r/363549
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2060a11bac48d1fe0bd443d3770df9c22336302
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: BlueSpiceExtensions/Dashboards: nothing was shown oin dashbo...

2017-07-03 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/362989 )

Change subject: BlueSpiceExtensions/Dashboards: nothing was shown oin dashboards
..

BlueSpiceExtensions/Dashboards: nothing was shown oin dashboards

The dashboard config was still encoded in database.

Maintenance script clearConfigs was not called in update.php

Dashboard config was not saved on remove portlet.

Fixed some issues ERM#6744

Change-Id: Id31001a6c3e1e3f43d60bcb5d9bf5469d6d13a4a
---
M Dashboards/Dashboards.class.php
M Dashboards/extension.json
M Dashboards/maintenance/clearConfigs.php
M Dashboards/resources/BS.Dashboards/DashboardPanel.js
4 files changed, 15 insertions(+), 6 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/89/362989/1

diff --git a/Dashboards/Dashboards.class.php b/Dashboards/Dashboards.class.php
index e27ffc9..d77acb9 100644
--- a/Dashboards/Dashboards.class.php
+++ b/Dashboards/Dashboards.class.php
@@ -89,6 +89,8 @@
'bs_dashboards_configs',
__DIR__ .'/db/mysql/bs_dashboards_configs.sql'
);
+
+   $updater->addPostDatabaseUpdateMaintenance( clearConfigs::class 
);
return true;
}
 
diff --git a/Dashboards/extension.json b/Dashboards/extension.json
index 6864e31..1f0edd2 100644
--- a/Dashboards/extension.json
+++ b/Dashboards/extension.json
@@ -38,7 +38,8 @@
"SpecialUserDashboard": 
"includes/specials/SpecialUserDashboard.php",
"BSApiDashboardTasks": "includes/api/BSApiDashboardTasks.php",
"BSApiDashboardStore": "includes/api/BSApiDashboardStore.php",
-   "BSApiDashboardWidgetsTasks": 
"includes/api/BSApiDashboardWidgetsTasks.php"
+   "BSApiDashboardWidgetsTasks": 
"includes/api/BSApiDashboardWidgetsTasks.php",
+   "clearConfigs": "maintenance/clearConfigs.php"
},
"ResourceModules": {
"ext.bluespice.dashboards": {
diff --git a/Dashboards/maintenance/clearConfigs.php 
b/Dashboards/maintenance/clearConfigs.php
index d53e8c3..c795cfb 100644
--- a/Dashboards/maintenance/clearConfigs.php
+++ b/Dashboards/maintenance/clearConfigs.php
@@ -2,15 +2,15 @@
 
 require_once( dirname(dirname(dirname(dirname(__DIR__ . 
'/maintenance/Maintenance.php' );
 
-class clearConfigs extends Maintenance{
-   public function execute() {
+class clearConfigs extends LoggedUpdateMaintenance {
+   public function doDBUpdates() {
$aFinalPortletList = array();
$aPortlets = array();
 
Hooks::run( 'BSDashboardsUserDashboardPortalPortlets', array( 
&$aPortlets ) );
Hooks::run( 'BSDashboardsAdminDashboardPortalPortlets', array( 
&$aPortlets ) );
Hooks::run( 'BSDashboardsGetPortlets', array( &$aPortlets ) );
-
+   $this->output( 'clearing dashboards... ');
for ( $i = 0; $i < count( $aPortlets ); $i++ ) {
$aFinalPortletList[] = $aPortlets[$i]["type"];
}
@@ -61,8 +61,14 @@
)
);
}
+
+   return true;
}
}
+
+   protected function getUpdateKey() {
+   return 'bs_dashboards-clear-configs';
+   }
 }
 
 $maintClass = 'clearConfigs';
diff --git a/Dashboards/resources/BS.Dashboards/DashboardPanel.js 
b/Dashboards/resources/BS.Dashboards/DashboardPanel.js
index 2487685..6059896 100644
--- a/Dashboards/resources/BS.Dashboards/DashboardPanel.js
+++ b/Dashboards/resources/BS.Dashboards/DashboardPanel.js
@@ -62,8 +62,8 @@
onPortletConfigChange: function( portlet, cfg ) {
this.savePortalConfig();
},
-   onPortletDestroy: function() {
-   this.items.remove(portlet);
+   onPortletDestroy: function( portlet ) {
+   this.items.remove( portlet );
this.savePortalConfig();
},
onDrop: function() {

-- 
To view, visit https://gerrit.wikimedia.org/r/362989
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id31001a6c3e1e3f43d60bcb5d9bf5469d6d13a4a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_27]: ExtendedSearch: removed ExtendedSearchAdmin

2017-06-30 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/362397 )

Change subject: ExtendedSearch: removed ExtendedSearchAdmin
..

ExtendedSearch: removed ExtendedSearchAdmin

It is not needed anymore.

ERM#6267

Needs merge to master.

Change-Id: I44b9ecde3298b76d75dbeff3624ecadd2217e722
---
M ExtendedSearch/ExtendedSearch.class.php
M ExtendedSearch/extension.json
M ExtendedSearch/i18n/en.json
D ExtendedSearch/includes/ExtendedSearchAdmin.class.php
M ExtendedSearch/includes/specials/SpecialExtendedSearch.class.php
D ExtendedSearch/includes/specials/SpecialExtendedSearchAdmin.alias.php
D ExtendedSearch/includes/specials/SpecialExtendedSearchAdmin.class.php
D ExtendedSearch/resources/bluespice.extendedSearch.admin.js
D ExtendedSearch/resources/images/bs-searchindex-delete.png
D ExtendedSearch/resources/images/bs-searchindex-optimization.png
D ExtendedSearch/resources/images/bs-searchindex-rebuild.png
11 files changed, 4 insertions(+), 365 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/97/362397/1

diff --git a/ExtendedSearch/ExtendedSearch.class.php 
b/ExtendedSearch/ExtendedSearch.class.php
index 06310bb..5c5923f 100644
--- a/ExtendedSearch/ExtendedSearch.class.php
+++ b/ExtendedSearch/ExtendedSearch.class.php
@@ -48,12 +48,7 @@
 */
public function __construct() {
wfProfileIn( 'BS::'.__METHOD__ );
-WikiAdmin::registerModuleClass( 'ExtendedSearchAdmin', array(
-   'image' => 
'/extensions/BlueSpiceExtensions/WikiAdmin/resources/images/bs-btn_suche_v1.png',
-   'level' => 'wikiadmin',
-   'message' => 'bs-extendedsearchadmin-label',
-   'iconCls' => 'bs-icon-magnifying-glass'
-   ) );
+
 
wfProfileOut( 'BS::'.__METHOD__ );
}
diff --git a/ExtendedSearch/extension.json b/ExtendedSearch/extension.json
index 49a6f59..9f6324a 100644
--- a/ExtendedSearch/extension.json
+++ b/ExtendedSearch/extension.json
@@ -19,8 +19,7 @@
},
"callback": "ExtendedSearch::onRegistration",
"SpecialPages": {
-   "SpecialExtendedSearch": "SpecialExtendedSearch",
-   "ExtendedSearchAdmin": "SpecialExtendedSearchAdmin"
+   "SpecialExtendedSearch": "SpecialExtendedSearch"
},
"APIModules": {
"feedextendedsearch": "ApiFeedExtendedSearch"
@@ -31,8 +30,7 @@
]
},
"ExtensionMessagesFiles": {
-   "ExtendedSearchAlias": 
"languages/SpecialExtendedSearch.alias.php",
-   "ExtendedSearchAdminAlias": 
"includes/specials/SpecialExtendedSearchAdmin.alias.php"
+   "ExtendedSearchAlias": 
"languages/SpecialExtendedSearch.alias.php"
},
"AutoloadClasses": {
"ApiFeedExtendedSearch": "api/ApiFeedExtendedSearch.php",
@@ -53,7 +51,6 @@
"BuildIndexMwSingleFile": 
"includes/BuildIndex/BuildIndexMwSingleFile.class.php",
"BuildIndexMwSpecialLinked": 
"includes/BuildIndex/BuildIndexMwSpecialLinked.class.php",
"BuildIndexMwLinked": 
"includes/BuildIndex/BuildIndexMwLinked.class.php",
-   "ExtendedSearchAdmin": "includes/ExtendedSearchAdmin.class.php",
"ExtendedSearchBase": "includes/ExtendedSearchBase.class.php",
"SearchIndex": "includes/SearchIndex/SearchIndex.class.php",
"SearchOptions": "includes/SearchIndex/SearchOptions.class.php",
@@ -71,7 +68,6 @@
"ViewMoreLikeThis": "views/view.MoreLikeThis.php",
"ViewExtendedSearchResultEntry": 
"views/view.ExtendedSearchResultEntry.php",
"SpecialExtendedSearch": 
"includes/specials/SpecialExtendedSearch.class.php",
-   "SpecialExtendedSearchAdmin": 
"includes/specials/SpecialExtendedSearchAdmin.class.php",
"TagCloudSearchStatsHandler": 
"includes/Handler/TagCloudSearchStatsHandler.class.php"
},
"ResourceModules": {
@@ -91,9 +87,6 @@
"dependencies": [
"jquery.ui.autocomplete"
]
-   },
-   "ext.bluespice.extendedsearch.admin": {
-   "scripts": "bluespice.extendedSearch.admin.js"
},
"ext.bluespice.extendedsearch.specialpage.style": {
"styles": "bluespice.extendedSearch.specialpage.css",
diff --git a/ExtendedSearch/i18n/en.json b/ExtendedSearch/i18n/en.json
index bac530b..565304d 100644
--- a/ExtendedSearch/i18n/en.json
+++ b/ExtendedSearch/i18n/en.json
@@ -73,21 +73,8 @@
"bs-extendedsearch-pref-showmlt": "Show similar pages",
"bs-extendedsearch-pref-solrcore": "Solr core instance:",
"bs-extendedsearch-pref-mltns": "Namespaces 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceCategoryManager[REL1_27]: BlueSpiceCategoryManager: fixed no response message on new c...

2017-06-30 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/362352 )

Change subject: BlueSpiceCategoryManager: fixed no response message on new 
category fails
..

BlueSpiceCategoryManager: fixed no response message on new category fails

There was no response if adding a new category fails or it is duplicated.

ERM#6720

Needs merge to master

Change-Id: I403db1b08b24793eea494280f499c489e01082fc
---
M extension.json
M i18n/de.json
M i18n/en.json
M i18n/qqq.json
M resources/BS.BlueSpiceCategoryManager/TreePanel.js
5 files changed, 11 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceCategoryManager 
refs/changes/52/362352/1

diff --git a/extension.json b/extension.json
index 34a6eb5..3451b86 100644
--- a/extension.json
+++ b/extension.json
@@ -46,7 +46,8 @@
"bs-categorymanager-dlg-new-prompt",
"bs-categorymanager-dlg-new-title",
"bs-categorymanager-removecategoryconfirm-text",
-   "bs-categorymanager-removecategoryconfirm-title"
+   
"bs-categorymanager-removecategoryconfirm-title",
+   
"bs-categorymanager-addcategory-dialog-error-title"
]
}
},
diff --git a/i18n/de.json b/i18n/de.json
index effd66a..7d4d729 100644
--- a/i18n/de.json
+++ b/i18n/de.json
@@ -13,5 +13,6 @@
"bs-categorymanager-dlg-new-title": "Kategorie erstellen",
"bs-categorymanager-dlg-new-prompt": "Bitte gib den Namen ein:",
"bs-categorymanager-removecategoryconfirm-text": "Bist du sicher, dass 
du diese Kategorie löschen willst?",
-   "bs-categorymanager-removecategoryconfirm-title": "Kategorie löschen"
+   "bs-categorymanager-removecategoryconfirm-title": "Kategorie löschen",
+   "bs-categorymanager-addcategory-dialog-error-title": "Kategorie 
erstellen fehlgeschlagen"
 }
diff --git a/i18n/en.json b/i18n/en.json
index c03441a..3f698e3 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -13,5 +13,6 @@
"bs-categorymanager-dlg-new-title": "Create category",
"bs-categorymanager-dlg-new-prompt": "Please enter the name:",
"bs-categorymanager-removecategoryconfirm-text": "Are you sure you want 
to delete this category?",
-   "bs-categorymanager-removecategoryconfirm-title": "Remove category"
+   "bs-categorymanager-removecategoryconfirm-title": "Remove category",
+   "bs-categorymanager-addcategory-dialog-error-title": "Create category 
failed"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index a52f57d..00da172 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -14,5 +14,6 @@
"bs-categorymanager-dlg-new-title": "Title of dialog window that allows 
creation of new category",
"bs-categorymanager-dlg-new-prompt": "Label of the input field for the 
new category name",
"bs-categorymanager-removecategoryconfirm-text": "Prompt message in 
case a user tries to delete a category",
-   "bs-categorymanager-removecategoryconfirm-title": "Title of the prompt 
that is shown to the user before a category gets deleted"
+   "bs-categorymanager-removecategoryconfirm-title": "Title of the prompt 
that is shown to the user before a category gets deleted",
+   "bs-categorymanager-addcategory-dialog-error-title": "Title of the 
error dialog if something went wrong at new categorie"
 }
diff --git a/resources/BS.BlueSpiceCategoryManager/TreePanel.js 
b/resources/BS.BlueSpiceCategoryManager/TreePanel.js
index 73e10ef..8bd22cd 100644
--- a/resources/BS.BlueSpiceCategoryManager/TreePanel.js
+++ b/resources/BS.BlueSpiceCategoryManager/TreePanel.js
@@ -151,7 +151,9 @@
me.treePanel.getStore().load();
me.treePanel.setLoading( false 
);
})
-   .fail( function() {
+   .fail( function( jqXHR, textStatus, 
response ) {
+   Ext.Msg.alert( mw.message( 
'bs-categorymanager-addcategory-dialog-error-title' ).plain(), response.message 
);
+
me.treePanel.setLoading( false 
);
});
},

-- 
To view, visit https://gerrit.wikimedia.org/r/362352
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I403db1b08b24793eea494280f499c489e01082fc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceCategoryManager
Gerrit-Branch: REL1_27
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceCategoryManager[REL1_27]: BlueSpiceCategoryManager: fixed leaf items

2017-06-27 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/361653 )

Change subject: BlueSpiceCategoryManager: fixed leaf items
..

BlueSpiceCategoryManager: fixed leaf items

Items without a child did not have an arrow anymore.

ERM6654

Change-Id: I480da165b1d6f81327ccef56b5aa8378ba83450d
---
M resources/BS.BlueSpiceCategoryManager/Model.js
1 file changed, 1 insertion(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceCategoryManager 
refs/changes/53/361653/1

diff --git a/resources/BS.BlueSpiceCategoryManager/Model.js 
b/resources/BS.BlueSpiceCategoryManager/Model.js
index 0c3ed38..0e70951 100644
--- a/resources/BS.BlueSpiceCategoryManager/Model.js
+++ b/resources/BS.BlueSpiceCategoryManager/Model.js
@@ -9,11 +9,7 @@
},
{
name: 'loaded', type: 'boolean', convert: function ( 
value, record ) {
-   if( !record.data.root ) {
-   return record.raw.leaf;
-   }
-
-   return value;
+   return record.raw.leaf;
}
},
{

-- 
To view, visit https://gerrit.wikimedia.org/r/361653
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I480da165b1d6f81327ccef56b5aa8378ba83450d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceCategoryManager
Gerrit-Branch: REL1_27
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSFoundation: Made bluespice upload available in mobile view

2017-06-22 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/360838 )

Change subject: BSFoundation: Made bluespice upload available in mobile view
..

BSFoundation: Made bluespice upload available in mobile view

Change-Id: I793485492ad1be7c73bd9ab43238c53e4b538c0a
---
M extension.json
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/38/360838/1

diff --git a/extension.json b/extension.json
index 967307a..d988d9f 100644
--- a/extension.json
+++ b/extension.json
@@ -218,7 +218,9 @@
"bs-upload-error-long",
"bs-upload-filetypenotsupported",
"bs-upload-details"
-   ]
+   ],
+   "targets": [ "desktop", "mobile" ]
+
},
"ext.bluespice.extjs.filerepo": {
"localBasePath": "resources",

-- 
To view, visit https://gerrit.wikimedia.org/r/360838
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I793485492ad1be7c73bd9ab43238c53e4b538c0a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceSMWConnector[REL1_23]: BlueSpiceSMWConnector: visual editor and mandatory are now w...

2017-06-01 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/356580 )

Change subject: BlueSpiceSMWConnector: visual editor and mandatory are now 
working
..

BlueSpiceSMWConnector: visual editor and mandatory are now working

The visual editor did not push his content to textare on save.

ER#M6395

Change-Id: Ic9a3df2a20ed950127ac97de6fbea985f548cf35
---
M resources/ext.BSSMWConnector.SF.VisualEditorField.js
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceSMWConnector 
refs/changes/80/356580/1

diff --git a/resources/ext.BSSMWConnector.SF.VisualEditorField.js 
b/resources/ext.BSSMWConnector.SF.VisualEditorField.js
index 470c69a..f1283fb 100644
--- a/resources/ext.BSSMWConnector.SF.VisualEditorField.js
+++ b/resources/ext.BSSMWConnector.SF.VisualEditorField.js
@@ -18,6 +18,11 @@
'bswikicodetemplateescape': sp + 
'/extensions/BlueSpiceSMWConnector/resources/tiny_mce_plugins/bswikicodetemplateescape/plugin.js',
'bsbehaviour': 
'../tiny_mce_plugins/bsbehaviour/plugin.js',
'bsactions': 
'../tiny_mce_plugins/bsactions/plugin.js'
+   },
+   init_instance_callback: function ( editor ) {
+   editor.on( 'Blur', function () {
+   tinymce.triggerSave();
+   });
}
});
});

-- 
To view, visit https://gerrit.wikimedia.org/r/356580
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic9a3df2a20ed950127ac97de6fbea985f548cf35
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceSMWConnector
Gerrit-Branch: REL1_23
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceSMWConnector[REL1_27]: BlueSpiceSMWConnector: visual editor and mandatory are now w...

2017-06-01 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/356565 )

Change subject: BlueSpiceSMWConnector: visual editor and mandatory are now 
working
..

BlueSpiceSMWConnector: visual editor and mandatory are now working

The visual editor did not push his content to textare on save.
ER#M6395

needs merge to master

Change-Id: Ibdc5a87af32d24e86b1e4a48ad859abd264a697a
---
M resources/ext.BSSMWConnector.SF.VisualEditorField.js
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceSMWConnector 
refs/changes/65/356565/1

diff --git a/resources/ext.BSSMWConnector.SF.VisualEditorField.js 
b/resources/ext.BSSMWConnector.SF.VisualEditorField.js
index 470c69a..e5b6e23 100644
--- a/resources/ext.BSSMWConnector.SF.VisualEditorField.js
+++ b/resources/ext.BSSMWConnector.SF.VisualEditorField.js
@@ -18,6 +18,11 @@
'bswikicodetemplateescape': sp + 
'/extensions/BlueSpiceSMWConnector/resources/tiny_mce_plugins/bswikicodetemplateescape/plugin.js',
'bsbehaviour': 
'../tiny_mce_plugins/bsbehaviour/plugin.js',
'bsactions': 
'../tiny_mce_plugins/bsactions/plugin.js'
+   },
+   init_instance_callback: function ( editor ) {
+   editor.on( 'Change', function () {
+   tinymce.triggerSave();
+   });
}
});
});

-- 
To view, visit https://gerrit.wikimedia.org/r/356565
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibdc5a87af32d24e86b1e4a48ad859abd264a697a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceSMWConnector
Gerrit-Branch: REL1_27
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceCategoryManager[REL1_27]: BlueSpiceCategoryManager: codestyling, leaf items

2017-05-31 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/356367 )

Change subject: BlueSpiceCategoryManager: codestyling, leaf items
..

BlueSpiceCategoryManager: codestyling, leaf items

Items without child nodes are now be able to get categories dropped in.
Codestyling

needs merge to master

Change-Id: I19a24db4712c1f406ee11be8260665ed080e7160
---
M resources/BS.BlueSpiceCategoryManager/Model.js
M resources/BS.BlueSpiceCategoryManager/TreePanel.js
2 files changed, 113 insertions(+), 98 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceCategoryManager 
refs/changes/67/356367/1

diff --git a/resources/BS.BlueSpiceCategoryManager/Model.js 
b/resources/BS.BlueSpiceCategoryManager/Model.js
index bd22d05..361c03d 100644
--- a/resources/BS.BlueSpiceCategoryManager/Model.js
+++ b/resources/BS.BlueSpiceCategoryManager/Model.js
@@ -3,17 +3,26 @@
fields: [
{ name: 'text', type: 'string' },
{
-   name: 'leaf', type: 'boolean', convert: function() {
+   name: 'leaf', type: 'boolean', convert: function ( 
value, record ) {
return false;
}
},
{
-   name: 'href', type: 'string', convert: function( value, 
record  ) {
-   var catTitle = mw.Title.makeTitle( 
bs.ns.NS_CATEGORY, record.get( 'text') );
-   return catTitle.getUrl();
+   name: 'loaded', type: 'boolean', convert: function ( 
value, record ) {
+   if( !record.data.root ) {
+   return record.raw.leaf;
+   }
+
+   return value;
}
},
{
+   name: 'href', type: 'string', convert: function ( 
value, record ) {
+   var catTitle = mw.Title.makeTitle( bs.ns.NS_CATEGORY, 
record.get( 'text' ) );
+   return catTitle.getUrl();
+   }
+   },
+   {
name: 'hrefTarget', type: 'string', defaultValue: 
'_blank'
}
]
diff --git a/resources/BS.BlueSpiceCategoryManager/TreePanel.js 
b/resources/BS.BlueSpiceCategoryManager/TreePanel.js
index cc0e076..ccaac3e 100644
--- a/resources/BS.BlueSpiceCategoryManager/TreePanel.js
+++ b/resources/BS.BlueSpiceCategoryManager/TreePanel.js
@@ -4,14 +4,15 @@
'BS.action.APIAddCategories',
'BS.action.APIRemoveCategories',
'BS.BlueSpiceCategoryManager.Model',
-   'BS.dialog.BatchActions'
+   'BS.dialog.BatchActions',
+   'Ext.data.TreeStore'
],
originalParent: undefined,
afterInitComponent: function () {
-   this.store = Ext.create( 'Ext.data.TreeStore', {
+   this.store = new Ext.data.TreeStore({
proxy: {
type: 'ajax',
-   url: mw.util.wikiScript('api'),
+   url: mw.util.wikiScript( 'api' ),
reader: {
type: 'json',
root: 'results',
@@ -30,7 +31,7 @@
model: 'BS.BlueSpiceCategoryManager.Model'
});
 
-   this.treePanel = new Ext.tree.Panel( {
+   this.treePanel = new Ext.tree.Panel({
useArrows: true,
height: 500,
rootVisible: false,
@@ -40,79 +41,11 @@
plugins: {
ptype: 'treeviewdragdrop',
dragText: mw.message( 
'bs-categorymanager-draganddrop-text' ).plain(),
-   enableDrop: true
-   },
-   listeners: {
-   beforedrop: function( node, data, 
overModel, dropPosition, dropHandler, eOpts ){
-   Ext.Array.each( data.records, 
function ( record ) {
-   this.originalParent = 
record.parentNode.get( 'text' );
-   });
-   },
-   drop: function ( node, data, overModel, 
dropPosition, dropHandler, eOpts ) {
-   function addCategories( page, 
categories ){
-   loaderMask.show();
-
-   return 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[REL1_27]: BlueSpiceFoundation: added APIDeletePage

2017-05-30 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/356175 )

Change subject: BlueSpiceFoundation: added APIDeletePage
..

BlueSpiceFoundation: added APIDeletePage

is used in CategoryManager to delete a category

Change-Id: I9ae48f97ce594de9203c9086a38cae9b368913dc
---
M extension.json
M resources/bluespice.extjs/BS/action/APIAddCategories.js
A resources/bluespice.extjs/BS/action/APIDeletePage.js
M resources/bluespice.extjs/BS/action/APIRemoveCategories.js
M resources/bluespice.extjs/BS/action/APISetCategories.js
5 files changed, 63 insertions(+), 10 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/75/356175/1

diff --git a/extension.json b/extension.json
index 12e9ff0..5733f51 100644
--- a/extension.json
+++ b/extension.json
@@ -294,7 +294,8 @@

"bs-deferred-action-apiaddcategories-description",

"bs-deferred-action-apisetcategories-description",

"bs-deferred-action-apiremovecategories-description",
-   "bs-deferred-action-apimovepage-description"
+   "bs-deferred-action-apimovepage-description",
+   "bs-deferred-action-apideletepage-description"
]
},
"ext.bluespice.extjs.BS.portal.css": {
diff --git a/resources/bluespice.extjs/BS/action/APIAddCategories.js 
b/resources/bluespice.extjs/BS/action/APIAddCategories.js
index e3bc019..e0490b0 100644
--- a/resources/bluespice.extjs/BS/action/APIAddCategories.js
+++ b/resources/bluespice.extjs/BS/action/APIAddCategories.js
@@ -3,7 +3,7 @@
categories: [],
pageTitle: '',
 
-   contructor: function(){
+   constructor: function(){
this.callParent( arguments );
},
 
diff --git a/resources/bluespice.extjs/BS/action/APIDeletePage.js 
b/resources/bluespice.extjs/BS/action/APIDeletePage.js
new file mode 100755
index 000..dddfacc
--- /dev/null
+++ b/resources/bluespice.extjs/BS/action/APIDeletePage.js
@@ -0,0 +1,50 @@
+Ext.define('BS.action.APIDeletePage', {
+   extend: 'BS.action.Base',
+
+   //Custom config
+   pageTitle: '',
+
+   constructor: function( cfg ) {
+   // this.addEvents( 'beforesaveedit' );
+   this.callParent(arguments);
+   },
+
+   execute: function() {
+   var dfd = $.Deferred();
+   this.actionStatus = BS.action.Base.STATUS_RUNNING;
+
+   this.doAPIDelete( dfd );
+
+   return dfd.promise();
+   },
+
+   doAPIDelete: function( dfd ) {
+   var me = this;
+   //this.fireEvent( 'beforesaveedit', this, edit );
+
+   var deletePageAPI = new mw.Api();
+   deletePageAPI.postWithToken( 'csrf', {
+   'action': 'delete',
+   'title': me.pageTitle
+   })
+   .fail(function( code, errResp ){
+
+   me.actionStatus = BS.action.Base.STATUS_ERROR;
+   dfd.reject( me, errResp );
+   })
+   .done(function( resp, jqXHR ){
+   if( resp.delete.title === undefined ) {
+   me.actionStatus = BS.action.Base.STATUS_ERROR;
+   dfd.reject( me, resp );
+   return;
+   }
+
+   me.actionStatus = BS.action.Base.STATUS_DONE;
+   dfd.resolve( me );
+   });
+   },
+
+   getDescription: function() {
+   return 
mw.message('bs-deferred-action-apideletepage-description', 
this.pageTitle).parse();
+   }
+});
\ No newline at end of file
diff --git a/resources/bluespice.extjs/BS/action/APIRemoveCategories.js 
b/resources/bluespice.extjs/BS/action/APIRemoveCategories.js
old mode 100644
new mode 100755
index 199cdd3..8f1c47b
--- a/resources/bluespice.extjs/BS/action/APIRemoveCategories.js
+++ b/resources/bluespice.extjs/BS/action/APIRemoveCategories.js
@@ -4,7 +4,7 @@
categories: [],
pageTitle: '',
 
-   contructor: function(){
+   constructor: function(){
this.callParent(arguments);
},
 
@@ -23,6 +23,8 @@
},
 
doAPIRemoveCategories: function( dfd, set ){
+   var me = this;
+
var taskData = {
page_title: set.page_title,
categories: set.categories
@@ -31,16 +33,16 @@
'wikipage', 'removeCategories', taskData
)
.fail(function( response ){
-   this.actionStatus = BS.action.Base.STATUS_ERROR;
-   dfd.reject( this, set, response );
+   

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_27]: ExtendedStatistics: added a user right to view the statistics.

2017-05-16 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/353957 )

Change subject: ExtendedStatistics: added a user right to view the statistics.
..

ExtendedStatistics: added a user right to view the statistics.

"right-statistic-viewspecialpage"

ERM#5741

Needs merge to master

Change-Id: I29e34af8fd934d7a60aca5e98906ec5503a017d3
---
M Statistics/Statistics.class.php
M Statistics/i18n/de.json
M Statistics/i18n/en.json
M Statistics/i18n/qqq.json
4 files changed, 8 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/57/353957/1

diff --git a/Statistics/Statistics.class.php b/Statistics/Statistics.class.php
index 2a8549a..6be616f 100644
--- a/Statistics/Statistics.class.php
+++ b/Statistics/Statistics.class.php
@@ -59,6 +59,8 @@
 * Initialization of Statistics extension
 */
protected function initExt() {
+   $this->mCore->registerPermission( 
'right-statistic-viewspecialpage', array( 'user' ), array( 'type' => 'global' ) 
);
+
wfProfileIn( 'BS::Statistics::initExt' );
$this->setHook( 'ParserFirstCallInit' );
$this->setHook( 'BeforePageDisplay' );
diff --git a/Statistics/i18n/de.json b/Statistics/i18n/de.json
index ed66908..c106267 100644
--- a/Statistics/i18n/de.json
+++ b/Statistics/i18n/de.json
@@ -61,5 +61,6 @@
"bs-statistics-portletconfig-periodday": "Gestern",
"apihelp-bs-statistics-tasks-description": "Bietet allgemeine Aufgaben 
für Statistiken",
"apihelp-bs-statistics-available-diagrams-store-description": "Bietet 
einen Speicher mit verfügbaren Diagrammen",
-   "apihelp-bs-statistics-search-options-store-description": "Bietet einen 
Speicher mit verfügbaren Suchoptionen"
+   "apihelp-bs-statistics-search-options-store-description": "Bietet einen 
Speicher mit verfügbaren Suchoptionen",
+   "right-statistic-viewspecialpage": "Zugriff auf die Erweiterte 
Statistik"
 }
diff --git a/Statistics/i18n/en.json b/Statistics/i18n/en.json
index 97a2e06..dce85ae 100644
--- a/Statistics/i18n/en.json
+++ b/Statistics/i18n/en.json
@@ -59,5 +59,6 @@
"bs-statistics-portletconfig-periodday": "Yesterday",
"apihelp-bs-statistics-tasks-description": "Provides common tasks for 
statistics",
"apihelp-bs-statistics-available-diagrams-store-description": "Provides 
a store with available diagrams",
-   "apihelp-bs-statistics-search-options-store-description": "Provides a 
store with available search options"
+   "apihelp-bs-statistics-search-options-store-description": "Provides a 
store with available search options",
+   "right-statistic-viewspecialpage": "Access to extended statistic"
 }
diff --git a/Statistics/i18n/qqq.json b/Statistics/i18n/qqq.json
index 5736d82..2457b8a 100644
--- a/Statistics/i18n/qqq.json
+++ b/Statistics/i18n/qqq.json
@@ -62,5 +62,6 @@
"bs-statistics-portletconfig-periodday": "Option in 
[[Special:AdminDashboard]] and [[Special:UserDashboard]], label for 
yesterday\n{{Identical|Yesterday}}",
"apihelp-bs-statistics-tasks-description": "Describes an API endpoint 
that provides common tasks for 
Statistics\n{{doc-apihelp-description|bs-statistics-tasks}}",
"apihelp-bs-statistics-available-diagrams-store-description": 
"Describes an API endpoint that provides a store with available 
diagrams\n{{doc-apihelp-description|bs-statistics-available-diagrams-store}}",
-   "apihelp-bs-statistics-search-options-store-description": "Describes an 
API endpoint that provides a store with available search 
options\n{{doc-apihelp-description|bs-statistics-search-options-store}}"
+   "apihelp-bs-statistics-search-options-store-description": "Describes an 
API endpoint that provides a store with available search 
options\n{{doc-apihelp-description|bs-statistics-search-options-store}}",
+   "right-statistic-viewspecialpage": 
"{{doc-right|statistic-viewspecialpage}}"
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/353957
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I29e34af8fd934d7a60aca5e98906ec5503a017d3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_27
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceInsertTemplate[master]: BlueSpiceInsertTemplate: name convention for I18N

2017-04-07 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/346950 )

Change subject: BlueSpiceInsertTemplate: name convention for I18N
..

BlueSpiceInsertTemplate: name convention for I18N

fixed some keys for I18N

Change-Id: Ia3ada3702f16f518aa44fda6bb50c95268ebebdc
---
M extension.json
M i18n/de.json
M i18n/en.json
M i18n/qqq.json
M resources/BS.BlueSpiceInsertTemplate/dialog/InsertTemplate.js
5 files changed, 21 insertions(+), 21 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceInsertTemplate 
refs/changes/50/346950/1

diff --git a/extension.json b/extension.json
index 2a11548..8062b39 100755
--- a/extension.json
+++ b/extension.json
@@ -6,7 +6,7 @@
"Josef Konrad",
"Robert Vogel"
],
-   "descriptionmsg": "bs-inserttemplate-desc",
+   "descriptionmsg": "bs-insertTemplate-description",
"type": "bluespice",
"license-name": "GPL-2.0+",
"bsgExtensions": {
@@ -22,7 +22,7 @@
},
"config": {
"_prefix": "bsgInsertTemplate",
-   "Favorites":[]
+   "Favorites": []
},
"APIModules": {
"bs-insertTemplate-data-store": 
"BSApiInsertTemplateTemplateStore"
@@ -43,9 +43,9 @@
"messages": [
"bs-insertTemplate-button-template-title",
"bs-insertTemplate-dialog-title",
-   "bs-insertTemplate-label-first",
-   "bs-insertTemplate-label-second",
-   "bs-insertTemplate-label-desc"
+   "bs-insertTemplate-dialog-label-choose",
+   "bs-insertTemplate-dialog-label-modify",
+   "bs-insertTemplate-dialog-label-preview"
],
"dependencies": [
"ext.bluespice"
diff --git a/i18n/de.json b/i18n/de.json
index 065af9e..f87d5ff 100755
--- a/i18n/de.json
+++ b/i18n/de.json
@@ -4,10 +4,10 @@
   "Josef Konrad "
 ]
   },
-  "bs-insertTemplate-desc": "Über ein Dialogfeld werden Vorlagen angehängt",
+  "bs-insertTemplate-description": "Ãœber ein Dialogfeld werden Vorlagen 
angehängt",
   "bs-insertTemplate-button-template-title": "Vorlage einfügen / bearbeiten",
   "bs-insertTemplate-dialog-title": "Vorlage einfügen",
-  "bs-insertTemplate-label-first": "Vorlage auswählen",
-  "bs-insertTemplate-label-second" : "Vorlage bearbeiten",
-  "bs-insertTemplate-label-desc" : "Vorschau"
+  "bs-insertTemplate-dialog-label-choose": "Vorlage auswählen",
+  "bs-insertTemplate-dialog-label-modify" : "Vorlage bearbeiten",
+  "bs-insertTemplate-dialog-label-preview" : "Vorschau"
 }
diff --git a/i18n/en.json b/i18n/en.json
index 98cc6c6..32e88b3 100755
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -4,10 +4,10 @@
   "Josef Konrad "
 ]
   },
-  "bs-insertTemplate-desc": "Dialog to insert a template",
+  "bs-insertTemplate-description": "Dialog to insert a template",
   "bs-insertTemplate-button-template-title": "Insert or edit template",
   "bs-insertTemplate-dialog-title": "Insert template",
-  "bs-insertTemplate-label-first": "Choose template",
-  "bs-insertTemplate-label-second" : "Modify template",
-  "bs-insertTemplate-label-desc" : "Preview"
+  "bs-insertTemplate-dialog-label-choose": "Choose template",
+  "bs-insertTemplate-dialog-label-modify" : "Modify template",
+  "bs-insertTemplate-dialog-label-preview" : "Preview"
 }
\ No newline at end of file
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 4a78cf7..159b7fb 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -4,10 +4,10 @@
   "Josef Konrad "
 ]
   },
-  "bs-insertTemplate-desc": 
"{{desc|name=BlueSpiceInsertTemplate|url=https://www.mediawiki.org/wiki/Extension:BlueSpiceInsertTemplate}};,
+  "bs-insertTemplate-description": 
"{{desc|name=BlueSpiceInsertTemplate|url=https://www.mediawiki.org/wiki/Extension:BlueSpiceInsertTemplate}};,
   "bs-insertTemplate-button-template-title": "Label for the editor toolbox 
button",
   "bs-insertTemplate-dialog-title": "Title text of the dialog window",
-  "bs-insertTemplate-label-first": "Label of the template selection combobox",
-  "bs-insertTemplate-label-second" : "Label of the textarea that allows 
modification to the template syntax",
-  "bs-insertTemplate-label-desc" : "Label of the preview area that shows the 
output of the template"
+  "bs-insertTemplate-dialog-label-choose": "Label of the template selection 
combobox",
+  "bs-insertTemplate-dialog-label-modify" : "Label of the textarea that allows 
modification to the template syntax",
+  "bs-insertTemplate-dialog-label-preview" : "Label of the preview area that 
shows the output of the template"
 }
\ No newline 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceInsertTemplate[master]: InsertTemplate: Code styling

2017-04-04 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/346250 )

Change subject: InsertTemplate: Code styling
..

InsertTemplate: Code styling

Change-Id: Ibfe87ab1320feaec7bbf8b5ddd1b42807a4504f0
---
M BlueSpiceInsertTemplate.class.php
M extension.json
M i18n/de.json
M i18n/en.json
R includes/api/BSApiInsertTemplateTemplateStore.php
M resources/BS.BlueSpiceInsertTemplate/dialog/InsertTemplate.js
M resources/bluespice.insertTemplate.css
M resources/bluespice.insertTemplate.js
8 files changed, 95 insertions(+), 139 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceInsertTemplate 
refs/changes/50/346250/1

diff --git a/BlueSpiceInsertTemplate.class.php 
b/BlueSpiceInsertTemplate.class.php
index d876f9e..9ac4baa 100755
--- a/BlueSpiceInsertTemplate.class.php
+++ b/BlueSpiceInsertTemplate.class.php
@@ -3,7 +3,7 @@
 /**
  * insertTemplate extension for BlueSpice
  *
- * Dialogbox to upload files and enter a file link.
+ * Dialogbox to insert templates.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -22,21 +22,15 @@
  * This file is part of BlueSpice for MediaWiki
  * For further information visit http://www.blue-spice.org
  *
- * @author Markus Glaser 
- * @author Sebastian Ulbricht
- * @author Tobias Weichart 
- * @version2.23.1
- * @packageBlueSpice_Extensions
- * @subpackage insertTemplate
- * @copyright  Copyright (C) 2016 Hallo Welt! GmbH, All rights reserved.
+ * @author Josef Konrad 
+ * @version2.27.0
+ * @copyright  Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved.
  * @licensehttp://www.gnu.org/copyleft/gpl.html GNU Public License v2 or 
later
  * @filesource
  */
 
 /**
- * Class for file upload and management assistent
- * @package BlueSpice_Extensions
- * @subpackage insertTemplate
+ * Class for insert templates.
  */
 class InsertTemplate extends BsExtensionMW {
/**
@@ -53,10 +47,10 @@
 
/**
 * Hook Handler for VisualEditorConfig Hook
-* @param Array $aConfigStandard reference
-* @param Array $aConfigOverwrite reference
-* @param Array &$aLoaderUsingDeps reference
-* @return boolean always true to keep hook alife
+* @param array $aConfigStandard reference
+* @param array $aConfigOverwrite reference
+* @param array &$aLoaderUsingDeps reference
+* @return boolean always true to keep hook alive
 */
public function onVisualEditorConfig( &$aConfigStandard, 
&$aConfigOverwrite, &$aLoaderUsingDeps ) {
$aLoaderUsingDeps[] = 'ext.bluespice.insertTemplate';
@@ -69,14 +63,20 @@
return true;
}
 
+   /**
+* Hook Handler to add the insert template button to the editor.
+* @param array $aRows
+* @param array $aButtonCfgs
+* @return boolean always true to keep hook alive
+*/
public function onBSExtendedEditBarBeforeEditToolbar( &$aRows, 
&$aButtonCfgs ) {
-   
$this->getOutput()->addModuleStyles('ext.bluespice.insertTemplate.styles');
-   $this->getOutput()->addModules('ext.bluespice.insertTemplate');
+   $this->getOutput()->addModuleStyles( 
'ext.bluespice.insertTemplate.styles' );
+   $this->getOutput()->addModules( 'ext.bluespice.insertTemplate' 
);
 
-   $aRows[0]['dialogs'][100] = 'bs-editbutton-inserttemplate';
+   $aRows[0]['dialogs'][100] = 'bs-editButton-insertTemplate';
 
-   $aButtonCfgs['bs-editbutton-inserttemplate'] = array(
-   'tip' => wfMessage( 'bs-inserttemplate-insert-template' 
)->plain()
+   $aButtonCfgs['bs-editButton-insertTemplate'] = array(
+   'tip' => wfMessage( 'bs-insertTemplate-insert-template' 
)->plain()
);
 
return true;
diff --git a/extension.json b/extension.json
index 5c1fa25..d1504a6 100755
--- a/extension.json
+++ b/extension.json
@@ -25,11 +25,11 @@
 "Favorites":  []
   },
   "APIModules": {
-"bs-inserttemplate-data-store": "BSApiInsertTemplateDataStore"
+"bs-insertTemplate-data-store": "BSApiInsertTemplateTemplateStore"
   },
   "AutoloadClasses": {
 "InsertTemplate": "BlueSpiceInsertTemplate.class.php",
-"BSApiInsertTemplateDataStore": 
"includes/api/BSApiInsertTemplateDataStore.php"
+"BSApiInsertTemplateTemplateStore": 
"includes/api/BSApiInsertTemplateTemplateStore.php"
   },
   "ResourceFileModulePaths": {
 "localBasePath": "resources",
@@ -44,13 +44,13 @@
 "bluespice.insertTemplate.css"
   ],
   "messages": [
-"bs-inserttemplate-desc",
-"bs-inserttemplate-insert-template",
-

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_27]: ExtendedSearch: Autocomplete was ignoring namespaces configu...

2017-03-31 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/345848 )

Change subject: ExtendedSearch: Autocomplete was ignoring namespaces 
configuration
..

ExtendedSearch: Autocomplete was ignoring namespaces configuration

The autocomplete field will now use the namespace filter.

Fixed issue: ERM4018

Needs merge to master

Change-Id: I299699d213b65ff85839222fbd26f866f09e6d0a
---
M ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
1 file changed, 17 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/48/345848/1

diff --git a/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php 
b/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
index 4f7d836..25e4cae 100644
--- a/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
+++ b/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
@@ -184,7 +184,7 @@
public function getSolrAutocompleteQuery( $sSearchString, 
$sSolrSearchString ) {
$aSearchOptions = array();
$aSearchOptions['fl'] = 'type,title,namespace';
-   $aSearchOptions['fq'] = array( 'wiki:(' . 
$this->getCustomerId() . ')' );
+   $aSearchOptions['fq'] = $this->makeAutoCompleteFilterQuery();
$aSearchOptions['sort'] = $this->aSearchOptions['sort'];
 
$vNamespace = $this->checkSearchstringForNamespace(
@@ -617,4 +617,20 @@
//'assembleSearchOptions' if 'MW::ExtendedSearch::ShowFacets' 
is true
$this->aFacetFields[] = $sFacetField;
}
+
+   protected function makeAutoCompleteFilterQuery() {
+   $oUser = RequestContext::getMain()->getUser();
+   $aOptions = $oUser->getOptions();
+   $aNamespaces = [ 1000 ]; //For some strange reason 1000 is 
NS_SPECIAL within the SOLR index
+   foreach ( $aOptions as $sOpt => $sValue ) {
+   if ( strpos( $sOpt, 'searchNs' ) !== false && $sValue 
== true ) {
+   $aNamespaces[] = '' . str_replace( 'searchNs', 
'', $sOpt );
+   }
+   }
+
+   return array(
+   'wiki:(' . $this->getCustomerId() . ')',
+   'namespace:("'.implode( '" OR "', $aNamespaces ).'")'
+   );
+   }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/345848
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I299699d213b65ff85839222fbd26f866f09e6d0a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_27
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceInsertTemplate[master]: InsertTemplate: initial commit

2017-03-31 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/345807 )

Change subject: InsertTemplate: initial commit
..

InsertTemplate: initial commit

ERM4775

Change-Id: I12983d0669c52acbeb426e82c1c6e8987076cae7
---
A BlueSpiceInsertTemplate.class.php
A InsertTemplate.setup.php
A extension.json
A i18n/de.json
A i18n/en.json
A includes/api/BSApiInsertTemplateDataStore.php
A resources/BS.BlueSpiceInsertTemplate/dialog/InsertTemplate.js
A resources/bluespice.insertTemplate.css
A resources/bluespice.insertTemplate.js
9 files changed, 683 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceInsertTemplate 
refs/changes/07/345807/1

diff --git a/BlueSpiceInsertTemplate.class.php 
b/BlueSpiceInsertTemplate.class.php
new file mode 100755
index 000..d876f9e
--- /dev/null
+++ b/BlueSpiceInsertTemplate.class.php
@@ -0,0 +1,84 @@
+http://www.blue-spice.org
+ *
+ * @author Markus Glaser 
+ * @author Sebastian Ulbricht
+ * @author Tobias Weichart 
+ * @version2.23.1
+ * @packageBlueSpice_Extensions
+ * @subpackage insertTemplate
+ * @copyright  Copyright (C) 2016 Hallo Welt! GmbH, All rights reserved.
+ * @licensehttp://www.gnu.org/copyleft/gpl.html GNU Public License v2 or 
later
+ * @filesource
+ */
+
+/**
+ * Class for file upload and management assistent
+ * @package BlueSpice_Extensions
+ * @subpackage insertTemplate
+ */
+class InsertTemplate extends BsExtensionMW {
+   /**
+* Initialise the insertTemplate extension
+*/
+   protected function initExt() {
+   wfProfileIn( 'BS::' . __METHOD__ );
+
+   $this->setHook( 'VisualEditorConfig' );
+   $this->setHook( 'BSExtendedEditBarBeforeEditToolbar' );
+
+   wfProfileOut( 'BS::' . __METHOD__ );
+   }
+
+   /**
+* Hook Handler for VisualEditorConfig Hook
+* @param Array $aConfigStandard reference
+* @param Array $aConfigOverwrite reference
+* @param Array &$aLoaderUsingDeps reference
+* @return boolean always true to keep hook alife
+*/
+   public function onVisualEditorConfig( &$aConfigStandard, 
&$aConfigOverwrite, &$aLoaderUsingDeps ) {
+   $aLoaderUsingDeps[] = 'ext.bluespice.insertTemplate';
+
+   $iIndexStandard = array_search( 
'unlink',$aConfigStandard["toolbar1"] );
+   array_splice( $aConfigStandard["toolbar1"], $iIndexStandard + 
1, 0, "bstemplate" );
+
+   // Add context menu entry
+   $aConfigStandard["contextmenu"] = 
str_replace('bsContextMenuMarker', 'bsContextMenuMarker bsContextTemplate', 
$aConfigStandard["contextmenu"] );
+   return true;
+   }
+
+   public function onBSExtendedEditBarBeforeEditToolbar( &$aRows, 
&$aButtonCfgs ) {
+   
$this->getOutput()->addModuleStyles('ext.bluespice.insertTemplate.styles');
+   $this->getOutput()->addModules('ext.bluespice.insertTemplate');
+
+   $aRows[0]['dialogs'][100] = 'bs-editbutton-inserttemplate';
+
+   $aButtonCfgs['bs-editbutton-inserttemplate'] = array(
+   'tip' => wfMessage( 'bs-inserttemplate-insert-template' 
)->plain()
+   );
+
+   return true;
+   }
+}
\ No newline at end of file
diff --git a/InsertTemplate.setup.php b/InsertTemplate.setup.php
new file mode 100755
index 000..03c644a
--- /dev/null
+++ b/InsertTemplate.setup.php
@@ -0,0 +1,2 @@
+"
+]
+  },
+  "bs-inserttemplate-desc": "Über ein Dialogfeld werden Vorlagen angehängt",
+  "bs-inserttemplate-insert-template": "Vorlage einfügen",
+  "bs-inserttemplate-button-template-title": "Vorlage einfügen / bearbeiten",
+  "bs-inserttemplate-dialog-title": "Vorlage einfügen",
+  "bs-inserttemplate-label-first": "Vorlage auswählen",
+  "bs-inserttemplate-label-second" : "Vorlage bearbeiten",
+  "bs-inserttemplate-label-desc" : "Vorschau",
+}
diff --git a/i18n/en.json b/i18n/en.json
new file mode 100755
index 000..7ca0ceb
--- /dev/null
+++ b/i18n/en.json
@@ -0,0 +1,14 @@
+{
+  "@metadata": {
+"authors": [
+  "Josef Konrad "
+]
+  },
+  "bs-inserttemplate-desc": "Dialog to insert a template",
+  "bs-inserttemplate-insert-template": "Insert template",
+  "bs-inserttemplate-button-template-title": "Insert or edit template",
+  "bs-inserttemplate-dialog-title": "Insert template",
+  "bs-inserttemplate-label-first": "Choose template",
+  "bs-inserttemplate-label-second" : "Modify template",
+  "bs-inserttemplate-label-desc" : "Preview"
+}
\ No newline at end of file
diff --git a/includes/api/BSApiInsertTemplateDataStore.php 
b/includes/api/BSApiInsertTemplateDataStore.php
new file mode 100644
index 000..e0eece7
--- /dev/null
+++ b/includes/api/BSApiInsertTemplateDataStore.php
@@ -0,0 +1,120 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: ExtendedSearch: search with namespaces was broken

2017-03-16 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/343050 )

Change subject: ExtendedSearch: search with namespaces was broken
..

ExtendedSearch: search with namespaces was broken

Fix for issue ERM5838#note-25

Revert change gerrit 333594

Change-Id: Ic89373fbc2e232fd3be64e2c1455900be3c2d6c1
---
M ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/50/343050/1

diff --git a/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php 
b/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
index 4f7d836..1958e88 100644
--- a/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
+++ b/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
@@ -194,7 +194,7 @@
);
 
$aOptions = array();
-   $sWildcardedSearchString = SearchService::wildcardSearchstring( 
$sSolrSearchString );
+   $sWildcardedSearchString = $sSolrSearchString; 
//SearchService::wildcardSearchstring( $sSolrSearchString );
$aOptions['searchString'] = 
'titleEdge:('.$sWildcardedSearchString.') OR 
title:('.$sWildcardedSearchString.')';
$aOptions['searchLimit'] = BsConfig::get( 
'MW::ExtendedSearch::AcEntries' );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/343050
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic89373fbc2e232fd3be64e2c1455900be3c2d6c1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_27]: ExtendedSearch: search with namespaces was broken

2017-03-16 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/342996 )

Change subject: ExtendedSearch: search with namespaces was broken
..

ExtendedSearch: search with namespaces was broken

Fix for issue ERM5838#note-25

A search for "File:xxx" did not get the right response.

Change-Id: Ifefacd0b73d1db37bc79c37107c3dbef11c1ac87
---
M ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/96/342996/1

diff --git a/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php 
b/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
index 0a4b799..4f7d836 100644
--- a/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
+++ b/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
@@ -194,7 +194,7 @@
);
 
$aOptions = array();
-   $sWildcardedSearchString = SearchService::wildcardSearchstring( 
$sSearchString );
+   $sWildcardedSearchString = SearchService::wildcardSearchstring( 
$sSolrSearchString );
$aOptions['searchString'] = 
'titleEdge:('.$sWildcardedSearchString.') OR 
title:('.$sWildcardedSearchString.')';
$aOptions['searchLimit'] = BsConfig::get( 
'MW::ExtendedSearch::AcEntries' );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/342996
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifefacd0b73d1db37bc79c37107c3dbef11c1ac87
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_27
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: ExtendedSearch: ShowCreSugInAc changed to LEVEL_PRIVATE

2017-03-14 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/342617 )

Change subject: ExtendedSearch: ShowCreSugInAc changed to LEVEL_PRIVATE
..

ExtendedSearch: ShowCreSugInAc changed to LEVEL_PRIVATE

ShowCreateSugg switched back to LEVEL_USER

Change-Id: I58bd0e78ff781ee0a86d990651194f921cef74d2
---
M ExtendedSearch/ExtendedSearch.class.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/17/342617/1

diff --git a/ExtendedSearch/ExtendedSearch.class.php 
b/ExtendedSearch/ExtendedSearch.class.php
index 4a34eb9..d663e69 100644
--- a/ExtendedSearch/ExtendedSearch.class.php
+++ b/ExtendedSearch/ExtendedSearch.class.php
@@ -70,10 +70,10 @@
BsConfig::registerVar( 'MW::ExtendedSearch::LimitResults', 25, 
BsConfig::TYPE_INT|BsConfig::LEVEL_USER,  
'bs-extendedsearch-pref-limitresultdef', 'int' );
BsConfig::registerVar( 'MW::ExtendedSearch::SearchFiles', true, 
BsConfig::TYPE_BOOL|BsConfig::LEVEL_USER|BsConfig::RENDER_AS_JAVASCRIPT, 
'bs-extendedsearch-pref-searchfiles', 'toggle' );
BsConfig::registerVar( 'MW::ExtendedSearch::JumpToTitle', 
false, BsConfig::TYPE_BOOL|BsConfig::LEVEL_USER, 
'bs-extendedsearch-pref-jumptotitle', 'toggle' );
-   BsConfig::registerVar( 'MW::ExtendedSearch::ShowCreateSugg', 
true, BsConfig::TYPE_BOOL|BsConfig::LEVEL_PRIVATE, 
'bs-extendedsearch-pref-showcreatesugg', 'toggle' );
+   BsConfig::registerVar( 'MW::ExtendedSearch::ShowCreateSugg', 
true, BsConfig::TYPE_BOOL|BsConfig::LEVEL_USER, 
'bs-extendedsearch-pref-showcreatesugg', 'toggle' );
BsConfig::registerVar( 'MW::ExtendedSearch::ShowFacets', true, 
BsConfig::TYPE_BOOL|BsConfig::LEVEL_USER, 'bs-extendedsearch-pref-showfacets', 
'toggle' );
BsConfig::registerVar( 'MW::ExtendedSearch::ShowAutocomplete', 
true, BsConfig::TYPE_BOOL|BsConfig::LEVEL_PUBLIC, 
'bs-extendedsearch-pref-showautocomplete', 'toggle' );
-   BsConfig::registerVar( 'MW::ExtendedSearch::ShowCreSugInAc', 
true, BsConfig::TYPE_BOOL|BsConfig::LEVEL_USER, 
'bs-extendedsearch-pref-showcresuginac', 'toggle' );
+   BsConfig::registerVar( 'MW::ExtendedSearch::ShowCreSugInAc', 
true, BsConfig::TYPE_BOOL|BsConfig::LEVEL_PRIVATE, 
'bs-extendedsearch-pref-showcresuginac', 'toggle' );
BsConfig::registerVar( 'MW::ExtendedSearch::AcEntries', 10, 
BsConfig::TYPE_INT|BsConfig::LEVEL_PUBLIC,  'bs-extendedsearch-pref-acentries', 
'int' );
BsConfig::registerVar( 'MW::ExtendedSearch::IndexTyLinked', 
true, BsConfig::TYPE_BOOL|BsConfig::LEVEL_PUBLIC, 
'bs-extendedsearch-pref-indextylinked', 'toggle' );
BsConfig::registerVar( 'MW::ExtendedSearch::IndexTypesRepo', 
true, BsConfig::TYPE_BOOL|BsConfig::LEVEL_PUBLIC, 
'bs-extendedsearch-pref-indextypesrepo', 'toggle' );

-- 
To view, visit https://gerrit.wikimedia.org/r/342617
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I58bd0e78ff781ee0a86d990651194f921cef74d2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: ExtendedSearch: set option ShowCreateSugg to LEVEL_PRIVATE

2017-03-14 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/342599 )

Change subject: ExtendedSearch: set option ShowCreateSugg to LEVEL_PRIVATE
..

ExtendedSearch: set option ShowCreateSugg to LEVEL_PRIVATE

Fix for ERM5838

Change-Id: Ic89760bb74176035016c8f09bc6fff7af03ed3ca
---
M ExtendedSearch/ExtendedSearch.class.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/99/342599/1

diff --git a/ExtendedSearch/ExtendedSearch.class.php 
b/ExtendedSearch/ExtendedSearch.class.php
index 82bc414..4a34eb9 100644
--- a/ExtendedSearch/ExtendedSearch.class.php
+++ b/ExtendedSearch/ExtendedSearch.class.php
@@ -70,7 +70,7 @@
BsConfig::registerVar( 'MW::ExtendedSearch::LimitResults', 25, 
BsConfig::TYPE_INT|BsConfig::LEVEL_USER,  
'bs-extendedsearch-pref-limitresultdef', 'int' );
BsConfig::registerVar( 'MW::ExtendedSearch::SearchFiles', true, 
BsConfig::TYPE_BOOL|BsConfig::LEVEL_USER|BsConfig::RENDER_AS_JAVASCRIPT, 
'bs-extendedsearch-pref-searchfiles', 'toggle' );
BsConfig::registerVar( 'MW::ExtendedSearch::JumpToTitle', 
false, BsConfig::TYPE_BOOL|BsConfig::LEVEL_USER, 
'bs-extendedsearch-pref-jumptotitle', 'toggle' );
-   BsConfig::registerVar( 'MW::ExtendedSearch::ShowCreateSugg', 
true, BsConfig::TYPE_BOOL|BsConfig::LEVEL_USER, 
'bs-extendedsearch-pref-showcreatesugg', 'toggle' );
+   BsConfig::registerVar( 'MW::ExtendedSearch::ShowCreateSugg', 
true, BsConfig::TYPE_BOOL|BsConfig::LEVEL_PRIVATE, 
'bs-extendedsearch-pref-showcreatesugg', 'toggle' );
BsConfig::registerVar( 'MW::ExtendedSearch::ShowFacets', true, 
BsConfig::TYPE_BOOL|BsConfig::LEVEL_USER, 'bs-extendedsearch-pref-showfacets', 
'toggle' );
BsConfig::registerVar( 'MW::ExtendedSearch::ShowAutocomplete', 
true, BsConfig::TYPE_BOOL|BsConfig::LEVEL_PUBLIC, 
'bs-extendedsearch-pref-showautocomplete', 'toggle' );
BsConfig::registerVar( 'MW::ExtendedSearch::ShowCreSugInAc', 
true, BsConfig::TYPE_BOOL|BsConfig::LEVEL_USER, 
'bs-extendedsearch-pref-showcresuginac', 'toggle' );

-- 
To view, visit https://gerrit.wikimedia.org/r/342599
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic89760bb74176035016c8f09bc6fff7af03ed3ca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: Refactor to remove raw queries.

2017-03-06 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/341305 )

Change subject: Refactor to remove raw queries.
..

Refactor to remove raw queries.

Fixed issue from ERM5474 and T152910

Change-Id: Ib2de9fa09e3f37611f2f39a88b81e807fbcd5f17
---
M RSSStandards/RSSStandards.class.php
1 file changed, 70 insertions(+), 76 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/05/341305/1

diff --git a/RSSStandards/RSSStandards.class.php 
b/RSSStandards/RSSStandards.class.php
index 9894e78..0d90d0f 100644
--- a/RSSStandards/RSSStandards.class.php
+++ b/RSSStandards/RSSStandards.class.php
@@ -150,7 +150,7 @@
'http://' . $_SERVER['HTTP_HOST'] . 
$_SERVER['PHP_SELF'],
wfMessage( 'bs-rssstandards-desc-page' )->plain()
);
-   while( $row = $res->fetchObject() ) {
+   foreach ( $res as $row ) {
$title = Title::makeTitle( $row->rc_namespace, 
$row->rc_title );
$entry = RSSItemCreator::createItem(
wfMessage( 'bs-rssstandards-changes-from', 
$row->rc_user_text )->text(),
@@ -170,23 +170,31 @@
$user = $wgRequest->getInt( 'u', 0 );
 
$dbr = wfGetDB( DB_SLAVE );
-   $tbl_rc = $dbr->tableName( 'recentchanges' );
 
-   $res = $dbr->query( "SELECT rc_id
-   FROM {$tbl_rc}
-   WHERE rc_user = {$user}
- AND rc_timestamp > 
'".$dbr->timestamp( time() - intval( 7 * 86400 ) )."'" );
+   $res = $dbr->select(
+   array( 'recentchanges' ),
+   array( 'rc_id' ),
+   array(
+   'rc_user' => $user,
+   'rc_timestamp > '. $dbr->timestamp( time() - 
intval( 7 * 86400 ) )
+   )
+   );
+
$ids = array();
-   while ( $row = $res->fetchObject() ) {
+   foreach ( $res as $row ) {
$ids[] = $row->rc_id;
}
 
if ( count( $ids ) ) {
-   $res = $dbr->query( "SELECT *
-   FROM {$tbl_rc}
-   WHERE rc_id IN 
(".implode(',', $ids).")
- AND rc_timestamp > 
'".$dbr->timestamp( time() - intval( 7 * 86400 ) )."'
-   ORDER BY rc_timestamp 
DESC" );
+   $res = $dbr->select(
+   array( 'recentchanges' ),
+   array( 'rc_id' ),
+   array(
+   'rc_timestamp > '. $dbr->timestamp( 
time() - intval( 7 * 86400 ) )
+   ),
+   __METHOD__,
+   array( 'ORDER BY' => 'rc_timestamp DESC' )
+   );
} else {
$res = false;
}
@@ -197,7 +205,7 @@
wfMessage( 'bs-rssstandards-desc-own' )->plain()
);
if ( $res ) {
-   while ( $obj = $res->fetchObject() ) {
+   foreach ( $res as $obj ) {
$title = Title::makeTitle( $obj->rc_namespace, 
$obj->rc_title );
$entry = RSSItemCreator::createItem(
wfMessage( 
'bs-rssstandards-changes-from', $obj->rc_user_text )->text(),
@@ -214,7 +222,7 @@
}
 
public function buildRssCat() {
-   global $wgRequest, $wgSitename, $wgDBprefix;
+   global $wgRequest, $wgSitename;
 
$dbr = wfGetDB( DB_SLAVE );
 
@@ -248,6 +256,7 @@
"r.rev_timestamp",
"r.rev_user_text"
);
+
$aConditions = array( "r.rev_page" => $entryIds );
$aOptions = array(
"group by" => array(
@@ -332,8 +341,8 @@
);
 
$entryIds = Array();
-   while ($row = $dbr->fetchRow($res)) {
-   $entryIds[] = $row['page_id'];
+   foreach ( $res as $row ) {
+   $entryIds[] = $row->page_id;
}
 
if ( count( $entryIds ) ) {
@@ -362,8 +371,8 @@
 
$res = $dbr->select( $aTable, $aFields, $aConditions, 
__METHOD__, $aOptions );
 
-   while ( $row = 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: fixed new entities not getting saved

2017-02-16 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/338105 )

Change subject: fixed new entities not getting saved
..

fixed new entities not getting saved

Change-Id: I28e135f450dc0d2687b417b95e22679a8fccf5ff
---
M includes/Entity.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/05/338105/1

diff --git a/includes/Entity.php b/includes/Entity.php
index aa78320..9f0e9aa 100644
--- a/includes/Entity.php
+++ b/includes/Entity.php
@@ -239,8 +239,8 @@
if( !$oUser instanceof User ) {
return Status::newFatal( 'No User' );
}
-   if( !$this->hasUnsavedChanges() ) {
-   return Status::newGood('success');
+   if( $this->exists() && !$this->hasUnsavedChanges() ) {
+   return Status::newGood( $this );
}
if( empty($this->getID()) ) {
$this->generateID();
@@ -512,4 +512,4 @@
static::detachCache( $this );
return $this;
}
-}
\ No newline at end of file
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/338105
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I28e135f450dc0d2687b417b95e22679a8fccf5ff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: fixed prefix of default options by pwirth.

2017-02-16 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/338092 )

Change subject: fixed prefix of default options by pwirth.
..

fixed prefix of default options by pwirth.

Change-Id: Ife0462dc7e128803501457845469fb35d4c4c449
---
M includes/entityconfigs/EntityConfig.php
1 file changed, 8 insertions(+), 7 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/92/338092/1

diff --git a/includes/entityconfigs/EntityConfig.php 
b/includes/entityconfigs/EntityConfig.php
index c19fdc9..29abd3d 100644
--- a/includes/entityconfigs/EntityConfig.php
+++ b/includes/entityconfigs/EntityConfig.php
@@ -62,23 +62,24 @@
return static::$aEntityConfigs[$sType];
}
 
-   protected static function getDefault( $sMethod ) {
-   if( !isset(static::$aDefaults[$sMethod]) ) {
+
+   protected static function getDefault( $sOption ) {
+   if( !isset(static::$aDefaults[$sOption]) ) {
return false;
}
-   return static::$aDefaults[$sMethod];
+   return static::$aDefaults[$sOption];
}
 
/**
 * Getter for config methods
-* @param string $sMethod
+* @param string $sOption
 * @return mixed - The return value of the internaly called method or 
the
 * default
 */
-   public function get( $sMethod ) {
-   $sMethod = "get_$sMethod";
+   public function get( $sOption ) {
+   $sMethod = "get_$sOption";
if( !is_callable( array($this, $sMethod) ) ) {
-   return static::getDefault( $sMethod );
+   return static::getDefault( $sOption );
}
return $this->$sMethod();
}

-- 
To view, visit https://gerrit.wikimedia.org/r/338092
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ife0462dc7e128803501457845469fb35d4c4c449
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: Added missing return.

2017-02-16 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/338090 )

Change subject: Added missing return.
..

Added missing return.

Change-Id: I4426b1dec0b5a95058b86981c11f59e9b93b8a8c
---
M includes/entityconfigs/EntityConfig.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/90/338090/1

diff --git a/includes/entityconfigs/EntityConfig.php 
b/includes/entityconfigs/EntityConfig.php
index 9cd028e..c19fdc9 100644
--- a/includes/entityconfigs/EntityConfig.php
+++ b/includes/entityconfigs/EntityConfig.php
@@ -78,7 +78,7 @@
public function get( $sMethod ) {
$sMethod = "get_$sMethod";
if( !is_callable( array($this, $sMethod) ) ) {
-   static::getDefault( $sMethod );
+   return static::getDefault( $sMethod );
}
return $this->$sMethod();
}
@@ -116,4 +116,4 @@
protected function get_ContentClass() {
return 'BSEntityContent';
}
-}
\ No newline at end of file
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/338090
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4426b1dec0b5a95058b86981c11f59e9b93b8a8c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
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 hook listener for user delete and gro...

2017-02-15 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/337799 )

Change subject: PageAssignments: added hook listener for user delete and group 
delete/rename.
..

PageAssignments: added hook listener for user delete and group delete/rename.

Fix for issue ERM5343

Change-Id: I27651884c06705b9339054c3944193547e97a5ad
---
M PageAssignments/extension.json
M PageAssignments/includes/PageAssignmentsHooks.php
2 files changed, 61 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/99/337799/1

diff --git a/PageAssignments/extension.json b/PageAssignments/extension.json
index 5ffb03f..b0774d7 100644
--- a/PageAssignments/extension.json
+++ b/PageAssignments/extension.json
@@ -188,7 +188,10 @@
"WikiExplorer::buildDataSets": 
"PageAssignmentsWikiExplorerHooks::onWikiExplorerBuildDataSets",
"BSDashboardsUserDashboardPortalConfig": 
"PageAssignmentsDashboardHooks::onBSDashboardsUserDashboardPortalConfig",
"BSDashboardsUserDashboardPortalPortlets": 
"PageAssignmentsDashboardHooks::onBSDashboardsUserDashboardPortalPortlets",
-   "BSUsageTrackerRegisterCollectors": 
"PageAssignmentsHooks::onBSUsageTrackerRegisterCollectors"
+   "BSUsageTrackerRegisterCollectors": 
"PageAssignmentsHooks::onBSUsageTrackerRegisterCollectors",
+   "BSUserManagerAfterDeleteUser": 
"PageAssignmentsHooks::onBSUserManagerAfterDeleteUser",
+   "BSGroupManagerGroupNameChanged": 
"PageAssignmentsHooks::onBSGroupManagerGroupNameChanged",
+   "BSGroupManagerGroupDeleted": 
"PageAssignmentsHooks::onBSGroupManagerGroupDeleted"
},
"manifest_version": 1
 }
diff --git a/PageAssignments/includes/PageAssignmentsHooks.php 
b/PageAssignments/includes/PageAssignmentsHooks.php
index 3b84f2f..53213b8 100644
--- a/PageAssignments/includes/PageAssignmentsHooks.php
+++ b/PageAssignments/includes/PageAssignmentsHooks.php
@@ -145,4 +145,61 @@
);
return true;
}
+
+   /**
+* Deletes all page assignments on user deleted.
+* @param UserManager $oUserManager
+* @param User $oUser
+* @param &$oStatus
+* @return bool
+*/
+   public static function onBSUserManagerAfterDeleteUser( $oUserManager, 
$oUser, &$oStatus, $oPerformer ) {
+   $dbr = wfGetDB( DB_MASTER );
+   $dbr->delete(
+   'bs_pageassignments',
+   array(
+   'pa_assignee_key' => $oUser->getName(),
+   'pa_assignee_type' => 'user'
+   )
+   );
+   return true;
+   }
+
+   /**
+* Updates all page assignments on group name change.
+* @param string $sGroup
+* @param string $sNewGroup
+* @return bool
+*/
+   public static function onBSGroupManagerGroupNameChanged( $sGroup, 
$sNewGroup ) {
+   $dbr = wfGetDB( DB_MASTER );
+   $dbr->update(
+   'bs_pageassignments',
+   array(
+   'pa_assignee_key' => $sNewGroup,
+   ),
+   array(
+   'pa_assignee_key' => $sGroup,
+   'pa_assignee_type' => 'group'
+   )
+   );
+   return true;
+   }
+
+   /**
+* Deletes all page assignments on group deleted.
+* @param string $sGroup
+* @return bool
+*/
+   public static function onBSGroupManagerGroupDeleted( $sGroup) {
+   $dbr = wfGetDB( DB_MASTER );
+   $dbr->delete(
+   'bs_pageassignments',
+   array(
+   'pa_assignee_key' => $sGroup,
+   'pa_assignee_type' => 'group'
+   )
+   );
+   return true;
+   }
 }
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/337799
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I27651884c06705b9339054c3944193547e97a5ad
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_27
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: PageAssignments: added hook listener for user delete and gro...

2017-02-15 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/337796 )

Change subject: PageAssignments: added hook listener for user delete and group 
delete/rename.
..

PageAssignments: added hook listener for user delete and group delete/rename.

Fix for issue ERM5343

Change-Id: I25fbd862c9e0faa8b5f6518ccc8bf607f649d315
---
M PageAssignments/extension.json
M PageAssignments/includes/PageAssignmentsHooks.php
2 files changed, 61 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/96/337796/1

diff --git a/PageAssignments/extension.json b/PageAssignments/extension.json
index 39666bc..dde01be 100644
--- a/PageAssignments/extension.json
+++ b/PageAssignments/extension.json
@@ -67,7 +67,10 @@
"ViewPAStateBarBodyElement": 
"includes/views/ViewPAStateBarBodyElement.php",
"PageAssignmentsNotificationFormatter": 
"includes/notifications/PageAssignmentsNotificationFormatter.php",
"PageAssignmentsEmailSingle": 
"includes/notifications/PageAssignmentsEmailSingle.php",
-   "BSPageAssignmentsMigrateRespEditors": 
"maintenance/BSPageAssignmentsMigrateRespEditors.php"
+   "BSPageAssignmentsMigrateRespEditors": 
"maintenance/BSPageAssignmentsMigrateRespEditors.php",
+   "BSUserManagerAfterDeleteUser": 
"PageAssignmentsHooks::onBSUserManagerAfterDeleteUser",
+   "BSGroupManagerGroupNameChanged": 
"PageAssignmentsHooks::onBSGroupManagerGroupNameChanged",
+   "BSGroupManagerGroupDeleted": 
"PageAssignmentsHooks::onBSGroupManagerGroupDeleted"
},
"ResourceModules": {
"ext.pageassignments.styles": {
diff --git a/PageAssignments/includes/PageAssignmentsHooks.php 
b/PageAssignments/includes/PageAssignmentsHooks.php
index 3b84f2f..53213b8 100644
--- a/PageAssignments/includes/PageAssignmentsHooks.php
+++ b/PageAssignments/includes/PageAssignmentsHooks.php
@@ -145,4 +145,61 @@
);
return true;
}
+
+   /**
+* Deletes all page assignments on user deleted.
+* @param UserManager $oUserManager
+* @param User $oUser
+* @param &$oStatus
+* @return bool
+*/
+   public static function onBSUserManagerAfterDeleteUser( $oUserManager, 
$oUser, &$oStatus, $oPerformer ) {
+   $dbr = wfGetDB( DB_MASTER );
+   $dbr->delete(
+   'bs_pageassignments',
+   array(
+   'pa_assignee_key' => $oUser->getName(),
+   'pa_assignee_type' => 'user'
+   )
+   );
+   return true;
+   }
+
+   /**
+* Updates all page assignments on group name change.
+* @param string $sGroup
+* @param string $sNewGroup
+* @return bool
+*/
+   public static function onBSGroupManagerGroupNameChanged( $sGroup, 
$sNewGroup ) {
+   $dbr = wfGetDB( DB_MASTER );
+   $dbr->update(
+   'bs_pageassignments',
+   array(
+   'pa_assignee_key' => $sNewGroup,
+   ),
+   array(
+   'pa_assignee_key' => $sGroup,
+   'pa_assignee_type' => 'group'
+   )
+   );
+   return true;
+   }
+
+   /**
+* Deletes all page assignments on group deleted.
+* @param string $sGroup
+* @return bool
+*/
+   public static function onBSGroupManagerGroupDeleted( $sGroup) {
+   $dbr = wfGetDB( DB_MASTER );
+   $dbr->delete(
+   'bs_pageassignments',
+   array(
+   'pa_assignee_key' => $sGroup,
+   'pa_assignee_type' => 'group'
+   )
+   );
+   return true;
+   }
 }
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/337796
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I25fbd862c9e0faa8b5f6518ccc8bf607f649d315
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: UserManager: Hook BSUserManagerAfterDeleteUser was sending a...

2017-02-15 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/337786 )

Change subject: UserManager: Hook BSUserManagerAfterDeleteUser was sending an 
emtpy user object.
..

UserManager: Hook BSUserManagerAfterDeleteUser was sending an emtpy user object.

$oUser->getUserPage()->exists() was called after user was deleted.

Change-Id: I68bb63a3d184a873dc4583acdf9889ed63a8627f
---
M UserManager/UserManager.class.php
1 file changed, 6 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/86/337786/1

diff --git a/UserManager/UserManager.class.php 
b/UserManager/UserManager.class.php
index b44a6b4..ae31139 100644
--- a/UserManager/UserManager.class.php
+++ b/UserManager/UserManager.class.php
@@ -390,6 +390,12 @@
}
 
$oStatus = Status::newGood( $oUser );
+   $oUser->load( User::READ_LATEST );
+   if ( $oUser->getUserPage()->exists() ) {
+   $oUserPageArticle = new Article( $oUser->getUserPage() 
);
+   $oUserPageArticle->doDelete( wfMessage( 
'bs-usermanager-db-error' )->plain() );
+   }
+
$dbw = wfGetDB( DB_MASTER );
$res = $dbw->delete( 'user',
array( 'user_id' => $oUser->getId() )
@@ -405,11 +411,6 @@
array( 'ss_users' => $iUsers ),
array( 'ss_row_id' => 1 )
);
-
-   if ( $oUser->getUserPage()->exists() ) {
-   $oUserPageArticle = new Article( $oUser->getUserPage() 
);
-   $oUserPageArticle->doDelete( wfMessage( 
'bs-usermanager-db-error' )->plain() );
-   }
 
if ( ( $res === false ) || ( $res1 === false ) || ( $res2 === 
false ) || ( $res3 === false ) ) {
$oStatus->merge( Status::newFatal( 
'bs-usermanager-db-error' ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/337786
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I68bb63a3d184a873dc4583acdf9889ed63a8627f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: Refactor to remove raw queries.

2017-02-15 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/337781 )

Change subject: Refactor to remove raw queries.
..

Refactor to remove raw queries.

Fixed issue from ERM5474 and T152910

Change-Id: Ifd13adaa5bc53751344cce93db7ff5c893bb9549
---
M RSSStandards/RSSStandards.class.php
1 file changed, 54 insertions(+), 24 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/81/337781/1

diff --git a/RSSStandards/RSSStandards.class.php 
b/RSSStandards/RSSStandards.class.php
index c082671..683ccd3 100644
--- a/RSSStandards/RSSStandards.class.php
+++ b/RSSStandards/RSSStandards.class.php
@@ -228,28 +228,54 @@
wfMessage( 'bs-rssstandards-desc-cat' )->plain()
);
 
-   $res = $dbr->query( "select cl_from FROM " . 
$wgDBprefix."categorylinks WHERE cl_to = '" . addslashes( $cat ). "'" );
+   $res = $dbr->select(
+   "categorylinks",
+   "cl_from",
+   array( "cl_to" => $cat )
+   );
 
$entryIds = Array();
-   while ( $row = $dbr->fetchRow( $res ) ) {
-   $entryIds[] = $row['cl_from'];
+
+   foreach ( $res as $row ) {
+   $entryIds[] = $row->cl_from;
}
 
if ( count( $entryIds ) ) {
-   $query = "SELECT Min(r.rev_id) as rid, r.rev_page, 
r.rev_timestamp, r.rev_user_text FROM " .
-   $wgDBprefix ."revision as r WHERE r.rev_page In ("
-   . implode( ", ", $entryIds ) .
-   ") GROUP BY r.rev_page, r.rev_timestamp, 
r.rev_user_text ORDER BY rid DESC";
-   $res = $dbr->query( $query );
+// $query = "SELECT Min(r.rev_id) as rid, r.rev_page, 
r.rev_timestamp, r.rev_user_text FROM " .
+// $wgDBprefix ."revision as r WHERE r.rev_page In ("
+// . implode( ", ", $entryIds ) .
+// ") GROUP BY r.rev_page, r.rev_timestamp, 
r.rev_user_text ORDER BY rid DESC";
+// $res = $dbr->query( $query );
+
+   $aTable = array( 'r' => 'revision' );
+   $aFields = array(
+   'rid' => "MIN(r.rev_id)",
+   "r.rev_page",
+   "r.rev_timestamp",
+   "r.rev_user_text"
+   );
+   $aConditions = array( "r.rev_page" => $entryIds );
+   $aOptions = array(
+   "group by" => array(
+   "r.rev_page",
+   "r.rev_timestamp",
+   "r.rev_user_text"
+   ),
+   "order by" => "rid DESC"
+   );
+
+   $res = $dbr->select( $aTable, $aFields, $aConditions, 
__METHOD__, $aOptions );
$numberOfEntries = $dbr->numRows( $res );
-
$paramShowAll = $wgRequest->getFuzzyBool( 'showall', 
false ); // Sole importance is the existence of param 'showall'
-   if ( !$paramShowAll ) $query .= ' LIMIT '.$_showLimit; 
// if (!$_REQUEST['showall']) $query .= ' LIMIT '.$_showLimit;
 
-   $res = $dbr->query( $query );
+   if ( !$paramShowAll ) {
+   $aOptions['LIMIT'] = $_showLimit;
+   }
 
-   while ( $row = $dbr->fetchRow( $res ) ) {
-   $title = Title::newFromID( $row['rev_page'] );
+   $res = $dbr->select( $aTable, $aFields, $aConditions, 
__METHOD__, $aOptions );
+
+   foreach ( $res as $row ) {
+   $title = Title::newFromID( $row->rev_page );
$page = WikiPage::factory( $title );
if ( !$title->userCan( 'read' ) ) {
$numberOfEntries--;
@@ -258,16 +284,20 @@
 
$_title = str_replace( "_", " ", 
$title->getText() );
$_link  = $title->getFullURL();
-   $_description = 
SecureFileStore::secureFilesInText(
-   preg_replace(
-   "#\[(.*)<\/a>\]#",
-   "",
-   $this->mCore->parseWikiText( 
$page->getContent()->getNativeData(), $this->getTitle() )
-   )
+
+ 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: Refactor to remove raw queries.

2017-02-14 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/337570 )

Change subject: Refactor to remove raw queries.
..

Refactor to remove raw queries.

Fixed issue from ERM5474 and T152910

Change-Id: Iafa50459dc60d65a70f9101b572e5e70247c99dd
---
M RSSStandards/RSSStandards.class.php
1 file changed, 64 insertions(+), 62 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/70/337570/1

diff --git a/RSSStandards/RSSStandards.class.php 
b/RSSStandards/RSSStandards.class.php
index c082671..e963fa1 100644
--- a/RSSStandards/RSSStandards.class.php
+++ b/RSSStandards/RSSStandards.class.php
@@ -55,8 +55,13 @@
}
 
/**
-* Hook-Handler for BlueSpice hook BSRSSFeederGetRegisteredFeeds
-* @param Array $aFeed Feed array.
+* Hook-Handler for MediaWiki hook MediaWikiPerformAction
+* @param OutputPage $wgOut MediaWiki Outpupage object.
+* @param Article $article MediaWiki article object.
+* @param Title $title MediaWiki title object.
+* @param User $user MediaWiki user object.
+* @param Request $request MediaWiki request object.
+* @param mediaWiki $mediaWiki MediaWiki mediaWiki object.
 * @return bool Always true.
 */
public function onBSRSSFeederGetRegisteredFeeds( $aFeeds ) {
@@ -145,11 +150,7 @@
)
);
 
-   $oChannel = RSSCreator::createChannel(
-   RSSCreator::xmlEncode( $wgSitename . ' - ' . $sPageName 
),
-   'http://' . $_SERVER['HTTP_HOST'] . 
$_SERVER['PHP_SELF'],
-   wfMessage( 'bs-rssstandards-desc-page' )->plain()
-   );
+   $oChannel = RSSCreator::createChannel(RSSCreator::xmlEncode( 
$wgSitename . ' - ' . $sPageName), 
'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'], wfMessage( 
'bs-rssstandards-desc-page' )->plain() );
while( $row = $res->fetchObject() ) {
$title = Title::makeTitle( $row->rc_namespace, 
$row->rc_title );
$entry = RSSItemCreator::createItem(
@@ -191,11 +192,7 @@
$res = false;
}
 
-   $channel = RSSCreator::createChannel(
-   RSSCreator::xmlEncode( $wgSitename . ' - ' . wfMessage( 
'bs-rssstandards-title-own' )->plain() ),
-   'http://' . $_SERVER['HTTP_HOST'] . 
$_SERVER['PHP_SELF'],
-   wfMessage( 'bs-rssstandards-desc-own' )->plain()
-   );
+   $channel = RSSCreator::createChannel(RSSCreator::xmlEncode( 
$wgSitename . ' - ' . wfMessage( 'bs-rssstandards-title-own' )->plain() ), 
'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'], wfMessage( 
'bs-rssstandards-desc-own' )->plain() );
if ( $res ) {
while ( $obj = $res->fetchObject() ) {
$title = Title::makeTitle( $obj->rc_namespace, 
$obj->rc_title );
@@ -214,43 +211,58 @@
}
 
public function buildRssCat() {
-   global $wgRequest, $wgSitename, $wgDBprefix;
-
+   global $wgRequest, $wgSitename;
$dbr = wfGetDB( DB_SLAVE );
 
$_showLimit = 10;
 
$cat = $wgRequest->getVal( 'cat', '' );
 
-   $channel = RSSCreator::createChannel(
-   $wgSitename . ' - ' . wfMessage( 
'bs-rssstandards-title-cat' )->plain() . ' ' . addslashes( $cat ),
-   'http://' . $_SERVER['HTTP_HOST'] . 
$_SERVER['PHP_SELF'],
-   wfMessage( 'bs-rssstandards-desc-cat' )->plain()
+   $channel = RSSCreator::createChannel($wgSitename . ' - ' . 
wfMessage( 'bs-rssstandards-title-cat' )->plain() . ' ' . addslashes( $cat ), 
'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'], wfMessage( 
'bs-rssstandards-desc-cat' )->plain() );
+
+   $res = $dbr->select(
+   "categorylinks",
+   "cl_from",
+   array( "cl_to" => $cat )
);
 
-   $res = $dbr->query( "select cl_from FROM " . 
$wgDBprefix."categorylinks WHERE cl_to = '" . addslashes( $cat ). "'" );
-
$entryIds = Array();
-   while ( $row = $dbr->fetchRow( $res ) ) {
-   $entryIds[] = $row['cl_from'];
+
+   foreach ( $res as $row ) {
+   $entryIds[] = $row->cl_from;
}
 
if ( count( $entryIds ) ) {
-   $query = "SELECT Min(r.rev_id) as rid, r.rev_page, 
r.rev_timestamp, r.rev_user_text FROM " .
-   $wgDBprefix ."revision as r WHERE r.rev_page In ("
-   . implode( ", ", $entryIds ) .
-   ") GROUP BY r.rev_page, 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_27]: Refactor to remove raw queries.

2017-02-14 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/337551 )

Change subject: Refactor to remove raw queries.
..

Refactor to remove raw queries.

Fixed issue from ERM5474

Needs merge to master

Change-Id: I6bf935805368ee8dbba642b8fd526d17e45486ef
---
M RSSStandards/RSSStandards.class.php
1 file changed, 47 insertions(+), 14 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/51/337551/1

diff --git a/RSSStandards/RSSStandards.class.php 
b/RSSStandards/RSSStandards.class.php
index 3f2f9c9..9c09dde 100644
--- a/RSSStandards/RSSStandards.class.php
+++ b/RSSStandards/RSSStandards.class.php
@@ -211,8 +211,7 @@
}
 
public function buildRssCat() {
-   global $wgRequest, $wgSitename, $wgDBprefix;
-
+   global $wgRequest, $wgSitename;
$dbr = wfGetDB( DB_SLAVE );
 
$_showLimit = 10;
@@ -221,25 +220,48 @@
 
$channel = RSSCreator::createChannel($wgSitename . ' - ' . 
wfMessage( 'bs-rssstandards-title-cat' )->plain() . ' ' . addslashes( $cat ), 
'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'], wfMessage( 
'bs-rssstandards-desc-cat' )->plain() );
 
-   $res = $dbr->query( "select cl_from FROM 
".$wgDBprefix."categorylinks WHERE cl_to = '".addslashes( $cat )."'" );
+   $res = $dbr->select(
+   "categorylinks",
+   "cl_from",
+   "cl_to = '".$cat."'"
+   );
 
$entryIds = Array();
-   while ( $row = $dbr->fetchRow( $res ) ) {
-   $entryIds[] = $row['cl_from'];
+
+   foreach ( $res as $row ) {
+   $entryIds[] = $row->cl_from;
}
 
if ( count( $entryIds ) ) {
-   $query = "SELECT Min(r.rev_id) as rid, r.rev_page, 
r.rev_timestamp, r.rev_user_text FROM ".$wgDBprefix."revision as r WHERE 
r.rev_page In (".implode(",",$entryIds).") GROUP BY r.rev_page, 
r.rev_timestamp, r.rev_user_text ORDER BY rid DESC";
-   $res = $dbr->query( $query );
+   $aTable = array( 'r' => 'revision' );
+   $aFields = array(
+   'rid' => "MIN(r.rev_id)",
+   "r.rev_page",
+   "r.rev_timestamp",
+   "r.rev_user_text"
+   );
+   $aConditions = array( "r.rev_page In ( ".implode( 
",",$entryIds )." )" );
+   $aOptions = array(
+   "group by" => array(
+   "r.rev_page",
+   "r.rev_timestamp",
+   "r.rev_user_text"
+   ),
+   "order by" => "rid DESC"
+   );
+
+   $res = $dbr->select( $aTable, $aFields, $aConditions, 
__METHOD__, $aOptions );
$numberOfEntries = $dbr->numRows( $res );
-
$paramShowAll = $wgRequest->getFuzzyBool( 'showall', 
false ); // Sole importance is the existence of param 'showall'
-   if ( !$paramShowAll ) $query .= ' LIMIT '.$_showLimit; 
// if (!$_REQUEST['showall']) $query .= ' LIMIT '.$_showLimit;
 
-   $res = $dbr->query( $query );
+   if ( !$paramShowAll ) {
+   $aOptions['LIMIT'] = $_showLimit;
+   }
 
-   while ( $row = $dbr->fetchRow( $res ) ) {
-   $title = Title::newFromID( $row['rev_page'] );
+   $res = $dbr->select( $aTable, $aFields, $aConditions, 
__METHOD__, $aOptions );
+
+   foreach ( $res as $row ) {
+   $title = Title::newFromID( $row->rev_page );
$article = new Article( $title );
if ( !$title->userCan( 'read' ) ) {
$numberOfEntries--;
@@ -248,10 +270,21 @@
 
$_title = str_replace( "_", " ", 
$title->getText() );
$_link  = $title->getFullURL();
-   $_description = 
SecureFileStore::secureFilesInText( preg_replace( "#\[(.*)<\/a>\]#", "", 
$this->mCore->parseWikiText( $article->getContent(), $this->getTitle() ) ) );
+
+   $_description = preg_replace(
+   "#\[(.*)<\/a>\]#",
+   "",
+   

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_23]: UserManager: backport from master.

2017-02-09 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336763 )

Change subject: UserManager: backport from master.
..

UserManager: backport from master.

Change-Id: Ie0bc5813ffc5a057fce253673203aa42ff9e0e95
---
M UserManager/UserManager.class.php
M UserManager/UserManager.setup.php
M UserManager/i18n/ar.json
M UserManager/i18n/ba.json
A UserManager/i18n/bn.json
M UserManager/i18n/de.json
A UserManager/i18n/dty.json
M UserManager/i18n/en.json
A UserManager/i18n/eo.json
M UserManager/i18n/es.json
M UserManager/i18n/eu.json
M UserManager/i18n/fr.json
M UserManager/i18n/gl.json
M UserManager/i18n/he.json
A UserManager/i18n/hu.json
M UserManager/i18n/it.json
M UserManager/i18n/ko.json
M UserManager/i18n/ksh.json
M UserManager/i18n/lb.json
A UserManager/i18n/lt.json
M UserManager/i18n/mai.json
A UserManager/i18n/mr.json
M UserManager/i18n/pl.json
M UserManager/i18n/pt.json
M UserManager/i18n/qqq.json
A UserManager/i18n/sd.json
M UserManager/i18n/sv.json
A UserManager/i18n/tcy.json
A UserManager/i18n/udm.json
A UserManager/i18n/yi.json
M UserManager/i18n/zh-hans.json
A UserManager/includes/api/BSApiChangeableGroupStore.php
M UserManager/includes/api/BSApiTasksUserManager.php
A UserManager/includes/specials/SpecialUserManager.alias.php
A UserManager/includes/specials/SpecialUserManager.class.php
A UserManager/resources/BS.UserManager/dialog/AddUser.js
A UserManager/resources/BS.UserManager/dialog/EditUser.js
A UserManager/resources/BS.UserManager/dialog/Password.js
M UserManager/resources/BS.UserManager/dialog/UserGroups.js
A UserManager/resources/BS.UserManager/form/field/GroupList.js
M UserManager/resources/BS.UserManager/panel/Manager.js
M UserManager/resources/bluespice.userManager.js
42 files changed, 1,516 insertions(+), 230 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/63/336763/1

diff --git a/UserManager/UserManager.class.php 
b/UserManager/UserManager.class.php
index cb55c67..d732651 100644
--- a/UserManager/UserManager.class.php
+++ b/UserManager/UserManager.class.php
@@ -45,24 +45,24 @@
// Base settings
$this->mExtensionFile = __FILE__;
$this->mExtensionType = EXTTYPE::VARIABLE;
-   $this->mInfo = array(
-   EXTINFO::NAME=> 'UserManager',
-   EXTINFO::DESCRIPTION => 'bs-usermanager-desc',
-   EXTINFO::AUTHOR  => 'Markus Glaser, Stephan Muggli',
-   EXTINFO::VERSION => 'default',
-   EXTINFO::STATUS  => 'default',
-   EXTINFO::PACKAGE => 'default',
-   EXTINFO::URL => 
'https://help.bluespice.com/index.php/UserManager',
-   EXTINFO::DEPS=> array( 'bluespice' => '2.22.0' )
-   );
 
WikiAdmin::registerModule( 'UserManager', array(
'image' => 
'/extensions/BlueSpiceExtensions/WikiAdmin/resources/images/bs-btn_usermanagement_v1.png',
'level' => 'wikiadmin',
-   'message' => 'bs-usermanager-label'
+   'message' => 'bs-usermanager-label',
+   'iconCls' => 'bs-icon-user-add'
) );
 
wfProfileOut( 'BS::'.__METHOD__ );
+   }
+
+   public function getForm( $firsttime = false ) {
+   $this->getOutput()->addModules( 'ext.bluespice.userManager' );
+   return '';
+   }
+
+   protected function initExt() {
+   $this->mCore->registerPermission( 
'usermanager-viewspecialpage', array( 'sysop' ), array( 'type' => 'global' ) );
}
 
/**
@@ -71,12 +71,18 @@
 * @param array $aMetaData
 * @return Status
 */
-   public static function addUser( $sUserName, $aMetaData = array() ) {
+   public static function addUser( $sUserName, $aMetaData = array(), User 
$oPerformer = null ) {
//This is to overcome username case issues with custom 
AuthPlugin (i.e. LDAPAuth)
//LDAPAuth woud otherwise turn the username to 
first-char-upper-rest-lower-case
//At the end of this method we switch $_SESSION['wsDomain'] 
back again
$tmpDomain = isset( $_SESSION['wsDomain'] ) ? 
$_SESSION['wsDomain'] : '';
$_SESSION['wsDomain'] = 'local';
+
+   $oStatus = Status::newGood();
+
+   if( !$oPerformer ) {
+   $oPerformer = RequestContext::getMain()->getUser();
+   }
 
$sUserName = ucfirst( $sUserName );
$oUser = User::newFromName( $sUserName, true );
@@ -87,51 +93,6 @@
return Status::newFatal( 'bs-usermanager-user-exists' );
}
 
-   $oStatus = self::editUser( 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[REL1_23]: UserManager: backport from MASTER.

2017-02-09 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336762 )

Change subject: UserManager: backport from MASTER.
..

UserManager: backport from MASTER.

Change-Id: I9fc34daf5b034a61f6ccb2cddd6321dd7262a957
---
M includes/api/BSApiGroupStore.php
M includes/api/BSApiUserStore.php
M resources/bluespice.extjs/BS/CRUDPanel.js
M resources/bluespice.extjs/BS/form/field/ItemList.js
M resources/bluespice/bluespice.icons.css
5 files changed, 156 insertions(+), 60 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/62/336762/1

diff --git a/includes/api/BSApiGroupStore.php b/includes/api/BSApiGroupStore.php
index 1fda0d6..770f6e1 100644
--- a/includes/api/BSApiGroupStore.php
+++ b/includes/api/BSApiGroupStore.php
@@ -27,15 +27,16 @@
  * Example request parameters of an ExtJS store
  */
 class BSApiGroupStore extends BSApiExtJSStoreBase {
+
+   protected $sLcQuery = '';
+
/**
-* @param string $sQuery Potential query provided by ExtJS component.
-* This is some kind of preliminary filtering. Subclass has to decide if
-* and how to process it
-* @return array - Full list of of data objects. Filters, paging, 
sorting
-* will be done by the base class
+* @param string $sQuery
+* @return array - List of of groups
 */
protected function makeData( $sQuery = '' ) {
global $wgAdditionalGroups, $wgImplicitGroups;
+   $this->sLcQuery = strtolower( $sQuery );
 
$aData = array();
foreach ( BsGroupHelper::getAvailableGroups() as $sGroup ) {
@@ -46,6 +47,10 @@
$oMsg = wfMessage( "group-$sGroup" );
if( $oMsg->exists() ) {
$sDisplayName = $oMsg->plain()." ($sGroup)";
+   }
+
+   if( !$this->queryApplies( $sGroup, $sDisplayName ) ) {
+   continue;
}
 
$aData[] = (object) array(
@@ -62,4 +67,16 @@
'wikiadmin'
);
}
+
+   protected function queryApplies( $sGroup, $sDisplayName ) {
+   if( empty( $this->sLcQuery ) ) {
+   return true;
+   }
+
+   $sLcGroup = strtolower( $sGroup );
+   $sLcDisplayname = strtolower( $sDisplayName );
+
+   return strpos( $sLcGroup, $this->sLcQuery ) !== false
+   || strpos( $sLcDisplayname, $this->sLcQuery ) !== false;
+   }
 }
diff --git a/includes/api/BSApiUserStore.php b/includes/api/BSApiUserStore.php
index bd398f9..9dce8d6 100644
--- a/includes/api/BSApiUserStore.php
+++ b/includes/api/BSApiUserStore.php
@@ -2,16 +2,25 @@
 
 class BSApiUserStore extends BSApiExtJSStoreBase {
 
+   protected $aGroups = array();
+   protected $aBlocks = array();
+
protected function makeData($sQuery = '') {
$dbr = $this->getDB();
 
-   $aGroups = array();
+   $this->aGroups = array();
$groupsRes = $dbr->select( 'user_groups', '*' );
foreach( $groupsRes as $row ) {
-   if( !isset( $aGroups[$row->ug_user] ) ) {
-   $aGroups[$row->ug_user] = array();
+   if( !isset( $this->aGroups[$row->ug_user] ) ) {
+   $this->aGroups[$row->ug_user] = array();
}
-   $aGroups[$row->ug_user][] = $row->ug_group;
+   $this->aGroups[$row->ug_user][] = $row->ug_group;
+   }
+
+   $this->aBlocks = array();
+   $blocksRes = $dbr->select( 'ipblocks', '*' );
+   foreach( $blocksRes as $row ) {
+   $this->aBlocks[$row->ipb_user] = $row->ipb_address;
}
 
//TODO: It would be very cool to have the permissions as a 
filterable
@@ -23,7 +32,7 @@
$aData = array();
$userRes = $dbr->select( 'user', '*' );
foreach( $userRes as $aRow ) {
-   $aResRow = $this->makeResultRow( $aRow, $aGroups );
+   $aResRow = $this->makeResultRow( $aRow );
if( !$aResRow ) {
continue;
}
@@ -36,18 +45,18 @@
/**
 * Builds a single result set
 * @param stdClass $row
-* @param array $aGroups
 * @return array
 */
-   protected function makeResultRow( $row, $aGroups = array() ) {
+   protected function makeResultRow( $row ) {
$oUserPageTitle = Title::makeTitle( NS_USER, $row->user_name );
return array(
-   'user_id' => $row->user_id,

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[REL1_27]: UserManager: backport from master to REL1_27

2017-02-08 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336628 )

Change subject: UserManager: backport from master to REL1_27
..

UserManager: backport from master to REL1_27

Change-Id: I0850c21e21ae2a672a57a6182ba76a2d75dce380
---
M resources/bluespice.extjs/BS/form/field/ItemList.js
1 file changed, 10 insertions(+), 8 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/28/336628/1

diff --git a/resources/bluespice.extjs/BS/form/field/ItemList.js 
b/resources/bluespice.extjs/BS/form/field/ItemList.js
index 9c0ac67..1e9df15 100644
--- a/resources/bluespice.extjs/BS/form/field/ItemList.js
+++ b/resources/bluespice.extjs/BS/form/field/ItemList.js
@@ -12,8 +12,9 @@
 
//model: null,
apiFields: [],
-   apiStore: 'bs-pageassignable-store',
-
+   idProperty: 'id',
+   inputDisplayField: 'text',
+   listDisplayField: 'anchor',
itemGridConfig: null,
 
initComponent: function() {
@@ -34,14 +35,14 @@
},
 
makeItemChooser: function() {
-
+   var me = this;
//var combo = new Ext.ux.form.field.GridPicker({
var combo = new Ext.form.field.ComboBox({
anchor: '100%',
-   displayField: 'text',
+   displayField: this.inputDisplayField,
listConfig: {
getInnerTpl: function() {
-   return '{[""+values.text]}';
+   return '{[""+values.' + 
me.inputDisplayField + ']}';
}
},
 
@@ -97,12 +98,12 @@
width: 30,
renderer: function( value ) {
return mw.html.element( 
'span', {
-   class: 'icon-' 
+ value
+   class: 
'bs-icon-' + value
} );
}
},
{
-   dataIndex: 'anchor',
+   dataIndex: 
this.listDisplayField,
flex: 1
},
deleteCol
@@ -138,8 +139,9 @@
},
 
makeFindByIdFunction: function( currentRecord ) {
+   var me = this;
return function( record, id ) {
-   if( record.get('id') === currentRecord.get('id') ) {
+   if( record.get( me.idProperty ) === currentRecord.get( 
me.idProperty ) ) {
return true;
}
return false;

-- 
To view, visit https://gerrit.wikimedia.org/r/336628
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0850c21e21ae2a672a57a6182ba76a2d75dce380
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: REL1_27
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_27]: BSUserManager: Separating "edit user" dialog

2017-02-08 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336592 )

Change subject: BSUserManager: Separating "edit user" dialog
..

BSUserManager: Separating "edit user" dialog

... into edit groups, edit info and change
password

Changed input method of 'edit groups' ans 'add user' dialog to use
'BS.form.field.ItemList'

PatchSet 12:
* Implemented CR by mglaser

ATTENTION: This change from BlueSpiceFoundation is required:
https://gerrit.wikimedia.org/r/328878

Divided permissions, BSF CHANGE IS ALSO NEEDED:
https://gerrit.wikimedia.org/r/#/c/328896/

Change-Id: I4ea4f8e5955a26f5be560cfd13ea4818f399eac1
(cherry picked from commit d5af2d6b8cac3641ee9e5b61748f1512c432ff9a)
---
M UserManager/UserManager.class.php
M UserManager/extension.json
M UserManager/i18n/de.json
M UserManager/i18n/en.json
M UserManager/includes/api/BSApiChangeableGroupStore.php
M UserManager/includes/api/BSApiTasksUserManager.php
R UserManager/resources/BS.UserManager/dialog/AddUser.js
A UserManager/resources/BS.UserManager/dialog/EditUser.js
A UserManager/resources/BS.UserManager/dialog/Password.js
M UserManager/resources/BS.UserManager/dialog/UserGroups.js
A UserManager/resources/BS.UserManager/form/field/GroupList.js
M UserManager/resources/BS.UserManager/panel/Manager.js
M UserManager/resources/bluespice.userManager.js
13 files changed, 627 insertions(+), 233 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/92/336592/1

diff --git a/UserManager/UserManager.class.php 
b/UserManager/UserManager.class.php
index 063cc7a..b44a6b4 100644
--- a/UserManager/UserManager.class.php
+++ b/UserManager/UserManager.class.php
@@ -73,6 +73,8 @@
$tmpDomain = isset( $_SESSION['wsDomain'] ) ? 
$_SESSION['wsDomain'] : '';
$_SESSION['wsDomain'] = 'local';
 
+   $oStatus = Status::newGood();
+
if( !$oPerformer ) {
$oPerformer = RequestContext::getMain()->getUser();
}
@@ -86,55 +88,6 @@
return Status::newFatal( 'bs-usermanager-user-exists' );
}
 
-   $oStatus = self::editUser( $oUser, $aMetaData, true, 
$oPerformer );
-   if( !$oStatus->isOK() ) {
-   return $oStatus;
-   }
-
-   $_SESSION['wsDomain'] = $tmpDomain;
-
-   $oUser = $oStatus->getValue();
-   $oUserManager = BsExtensionManager::getExtension( 'UserManager' 
);
-   Hooks::run(
-   'BSUserManagerAfterAddUser',
-   array(
-   $oUserManager,
-   $oUser,
-   $aMetaData,
-   &$oStatus,
-   $oPerformer
-   )
-   );
-
-   $ssUpdate = new SiteStatsUpdate( 0, 0, 0, 0, 1 );
-   $ssUpdate->doUpdate();
-
-   return $oStatus;
-   }
-
-   /**
-* Edits or adds an user
-* @param User $oUser
-* @param array $aMetaData
-* @param boolean $bCreateIfNotExists
-* @return Status
-*/
-   public static function editUser( User $oUser, $aMetaData = array(), 
$bCreateIfNotExists = false, User $oPerformer = null ) {
-   $oStatus = Status::newGood();
-   $bNew = false;
-   if( !$oPerformer ) {
-   $oPerformer = RequestContext::getMain()->getUser();
-   }
-
-   if ( $oUser->getId() === 0  ) {
-   if( !$bCreateIfNotExists ) {
-   $oStatus->merge(
-   Status::newFatal( 
'bs-usermanager-idnotexist' )
-   );
-   return $oStatus;
-   }
-   $bNew = true;
-   }
$sPass = $aMetaData['password'];
if ( !empty( $aMetaData['password'] ) || $bNew ) {
if( !$oUser->isValidPassword( $sPass ) ) {
@@ -172,10 +125,8 @@
return $oStatus;
}
 
-   if( $bNew ) {
-   $oUser->addToDatabase();
-   $oUser->setToken();
-   }
+   $oUser->addToDatabase();
+   $oUser->setToken();
 
if( !empty($sPass) ) {
$oUser->setPassword( $sPass );
@@ -207,6 +158,135 @@
}
}
 
+   $_SESSION['wsDomain'] = $tmpDomain;
+
+   $oStatus = Status::newGood( $oUser );
+
+   $oUserManager = BsExtensionManager::getExtension( 'UserManager' 
);
+   Hooks::run(
+   'BSUserManagerAfterAddUser',
+  

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[REL1_27]: opPermitted method now checks for any operation set in opera...

2017-02-07 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336581 )

Change subject: opPermitted method now checks for any operation set in 
operationPermissions, not just create, update and delete
..

opPermitted method now checks for any operation set in
operationPermissions, not just create, update and delete

Change-Id: I65d9ac2a8d34707064fa9efd6c819343736d523a
(cherry picked from commit 9664971918ae6cd701f77fb73d53c27a0ea5b168)
---
M resources/bluespice.extjs/BS/CRUDPanel.js
1 file changed, 10 insertions(+), 13 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/81/336581/1

diff --git a/resources/bluespice.extjs/BS/CRUDPanel.js 
b/resources/bluespice.extjs/BS/CRUDPanel.js
index 3404668..77fbda0 100644
--- a/resources/bluespice.extjs/BS/CRUDPanel.js
+++ b/resources/bluespice.extjs/BS/CRUDPanel.js
@@ -130,18 +130,15 @@
setData: function( obj ) {
this.currentData = obj;
},
-   //return boolean if param exists, otherwise null
-   opPermitted: function ( operation ) {
-   switch( operation ) {
-   case 'create':
-   return this.operationPermissions.create;
-   case 'update':
-   return this.operationPermissions.update;
-   case 'delete':
-   return this.operationPermissions.delete;
-   default:
-   return null;
-   }
 
+   /**
+   * @return boolean if param exists, otherwise null
+   */
+   opPermitted: function ( operation ) {
+   if( operation in this.operationPermissions ) {
+   return this.operationPermissions[operation];
+   } else {
+   return null;
+   }
}
-});
\ No newline at end of file
+});

-- 
To view, visit https://gerrit.wikimedia.org/r/336581
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I65d9ac2a8d34707064fa9efd6c819343736d523a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: REL1_27
Gerrit-Owner: Nasty 
Gerrit-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]: BSApiGroupStore: Implemented use of "query" parameter

2017-02-07 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336580 )

Change subject: BSApiGroupStore: Implemented use of "query" parameter
..

BSApiGroupStore: Implemented use of "query" parameter

... also minor bugfix in 'BS.form.field.ItemList': When 'reset' got called
on the fields a null value was provided to 'setValue'.

Change-Id: Ic646cfc435bb4f4c450e7f439e063315009033cb
(cherry picked from commit 8f596f410f00e736f4b7b34c13fda9ca50cde7ba)
---
M includes/api/BSApiGroupStore.php
M resources/bluespice.extjs/BS/form/field/ItemList.js
2 files changed, 23 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/80/336580/1

diff --git a/includes/api/BSApiGroupStore.php b/includes/api/BSApiGroupStore.php
index 1fda0d6..770f6e1 100644
--- a/includes/api/BSApiGroupStore.php
+++ b/includes/api/BSApiGroupStore.php
@@ -27,15 +27,16 @@
  * Example request parameters of an ExtJS store
  */
 class BSApiGroupStore extends BSApiExtJSStoreBase {
+
+   protected $sLcQuery = '';
+
/**
-* @param string $sQuery Potential query provided by ExtJS component.
-* This is some kind of preliminary filtering. Subclass has to decide if
-* and how to process it
-* @return array - Full list of of data objects. Filters, paging, 
sorting
-* will be done by the base class
+* @param string $sQuery
+* @return array - List of of groups
 */
protected function makeData( $sQuery = '' ) {
global $wgAdditionalGroups, $wgImplicitGroups;
+   $this->sLcQuery = strtolower( $sQuery );
 
$aData = array();
foreach ( BsGroupHelper::getAvailableGroups() as $sGroup ) {
@@ -46,6 +47,10 @@
$oMsg = wfMessage( "group-$sGroup" );
if( $oMsg->exists() ) {
$sDisplayName = $oMsg->plain()." ($sGroup)";
+   }
+
+   if( !$this->queryApplies( $sGroup, $sDisplayName ) ) {
+   continue;
}
 
$aData[] = (object) array(
@@ -62,4 +67,16 @@
'wikiadmin'
);
}
+
+   protected function queryApplies( $sGroup, $sDisplayName ) {
+   if( empty( $this->sLcQuery ) ) {
+   return true;
+   }
+
+   $sLcGroup = strtolower( $sGroup );
+   $sLcDisplayname = strtolower( $sDisplayName );
+
+   return strpos( $sLcGroup, $this->sLcQuery ) !== false
+   || strpos( $sLcDisplayname, $this->sLcQuery ) !== false;
+   }
 }
diff --git a/resources/bluespice.extjs/BS/form/field/ItemList.js 
b/resources/bluespice.extjs/BS/form/field/ItemList.js
index 0a93fac..9c0ac67 100644
--- a/resources/bluespice.extjs/BS/form/field/ItemList.js
+++ b/resources/bluespice.extjs/BS/form/field/ItemList.js
@@ -180,6 +180,7 @@
},
 
setValue: function( data ) {
+   data = data || {};
this.gdItems.getStore().loadData( data );
}
 });
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/336580
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic646cfc435bb4f4c450e7f439e063315009033cb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: REL1_27
Gerrit-Owner: Nasty 
Gerrit-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]: ExtendedSearch: revert changes from #331970

2017-01-24 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333876 )

Change subject: ExtendedSearch: revert changes from #331970
..

ExtendedSearch: revert changes from #331970

Change-Id: Ic2893a0099182825ba85962b769b79e8f0b50b44
---
M ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/76/333876/1

diff --git a/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php 
b/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
index 377355c..15a16b7 100644
--- a/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
+++ b/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
@@ -184,6 +184,7 @@
public function getSolrAutocompleteQuery( $sSearchString, 
$sSolrSearchString ) {
$aSearchOptions = array();
$aSearchOptions['fl'] = 'type,title,namespace';
+   $aSearchOptions['fq'] = array( 'wiki:(' . 
$this->getCustomerId() . ')' );
$aSearchOptions['sort'] = $this->aSearchOptions['sort'];
 
$vNamespace = $this->checkSearchstringForNamespace(

-- 
To view, visit https://gerrit.wikimedia.org/r/333876
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic2893a0099182825ba85962b769b79e8f0b50b44
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_23
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceSkin[REL1_27]: Watchlist: add / remove from watchlist changed to ajax.

2017-01-23 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333630 )

Change subject: Watchlist: add / remove from watchlist changed to ajax.
..

Watchlist: add / remove from watchlist changed to ajax.

Fixed issue from ERM4954

Needs merge to master

Change-Id: I002dbf5f677f8b7bbb8f6411645d6ae05991401c
---
D resources/components/skin.ajaxwatchlist.less
M resources/components/skin.contentActions.js
A resources/components/skin.watch.js
A resources/components/skin.watch.less
M skin.json
5 files changed, 32 insertions(+), 50 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/BlueSpiceSkin 
refs/changes/30/333630/1

diff --git a/resources/components/skin.ajaxwatchlist.less 
b/resources/components/skin.ajaxwatchlist.less
deleted file mode 100644
index d368a5a..000
--- a/resources/components/skin.ajaxwatchlist.less
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Code from /skins/vector/screen.css */
-
-li#ca-unwatch.icon,
-li#ca-watch.icon {
-   float:none;
-   margin-left: -4px
-}
-
-
-/* Watch/Unwatch Icon Styling */
-#ca-unwatch.icon a,
-#ca-watch.icon a {
-   outline: none;
-   display: inline-block;
-   width: 16px;
-   height: 16px;
-   margin: 0;
-   text-indent: px;
-   white-space: nowrap;
-   /* @embed */
-   background-image: url("../../vector/images/watch-icons.png");
-}
-#ca-unwatch.icon a {
-   background-position: -48px;
-}
-#ca-watch.icon a {
-   background-position: 0px;
-}
-#ca-unwatch.icon a:hover,
-#ca-unwatch.icon a:focus {
-   background-position: -72px;
-}
-#ca-watch.icon a:hover,
-#ca-watch.icon a:focus {
-   background-position: -24px;
-}
-#ca-unwatch.icon a.loading,
-#ca-watch.icon a.loading {
-   /* @embed */
-   background-image: url("../../vector/images/watch-icon-loading.gif");
-   background-position: 0px;
-}
\ No newline at end of file
diff --git a/resources/components/skin.contentActions.js 
b/resources/components/skin.contentActions.js
index e18c9f2..f1226ff 100644
--- a/resources/components/skin.contentActions.js
+++ b/resources/components/skin.contentActions.js
@@ -10,13 +10,5 @@
}
});
}
-
-   $("#ca-watch, #ca-unwatch").click(function(e){
-   $(this).children().first().trigger('click');
-   if ($(this).hasClass("icon-star"))
-   
$(this).removeClass("icon-star").addClass("icon-star3");
-   else
-   
$(this).removeClass("icon-star3").addClass("icon-star");
-   });
});
 })( mediaWiki, jQuery );
\ No newline at end of file
diff --git a/resources/components/skin.watch.js 
b/resources/components/skin.watch.js
new file mode 100644
index 000..06525c1
--- /dev/null
+++ b/resources/components/skin.watch.js
@@ -0,0 +1,31 @@
+$( '#ca-watch, #ca-unwatch' ).on( 'click', function() {
+api = new mw.Api();
+
+var me = this;
+
+if ( $( this ).attr( "id" ) == "ca-watch") {
+api.watch( mw.config.get( 'wgPageName' ) ).done( function( result ) {
+doWatch(result, me, 'ca-unwatch');
+});
+} else {
+api.unwatch( mw.config.get( 'wgPageName' ) ).done( function ( result ) 
{
+doWatch(result, me, 'ca-watch');
+});
+}
+
+return false; // Do not follow the link if JS is enabled.
+});
+
+/**
+ * Adds or removes a page to watchlist and shows a notify.
+ *
+ * @param result jQuery.Promise.done()
+ * @param me this
+ * @param sWatch
+ */
+function doWatch(result, me, sWatch) {
+mw.notify( $(result.message) );
+$( me ).attr( "id", sWatch);
+$( 'a', me ).attr( 'title', mw.message( 'tooltip-'+sWatch ).plain() );
+$( 'a', me ).updateTooltipAccessKeys();
+}
\ No newline at end of file
diff --git a/resources/components/skin.watch.less 
b/resources/components/skin.watch.less
new file mode 100755
index 000..e69de29
--- /dev/null
+++ b/resources/components/skin.watch.less
diff --git a/skin.json b/skin.json
index 73627b8..71f4e59 100644
--- a/skin.json
+++ b/skin.json
@@ -55,6 +55,7 @@
"components/skin.closeMenu.js",
"components/skin.scrollToTop.js",
"components/skin.dataAfterContent.js",
+   "components/skin.watch.js",
"components/special.preferences.js"
],
"messages": [

-- 
To view, visit https://gerrit.wikimedia.org/r/333630
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I002dbf5f677f8b7bbb8f6411645d6ae05991401c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/BlueSpiceSkin
Gerrit-Branch: REL1_27
Gerrit-Owner: Nasty 


[MediaWiki-commits] [Gerrit] mediawiki...NSFileRepo[REL1_27]: NSFileRepo: deliver images without a file repository e.g. Ma...

2017-01-19 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333170 )

Change subject: NSFileRepo: deliver images without a file repository e.g. Math 
extension
..

NSFileRepo: deliver images without a file repository e.g. Math extension

Fixed issue from ERM5234

Needs merge to master

Change-Id: Ia6e0ed77cb9c0db6ab0e79252e2d1c190c045293
---
M nsfr_img_auth.php
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/NSFileRepo 
refs/changes/70/333170/1

diff --git a/nsfr_img_auth.php b/nsfr_img_auth.php
index 3ee839e..de9725c 100644
--- a/nsfr_img_auth.php
+++ b/nsfr_img_auth.php
@@ -154,8 +154,12 @@
if ( !$file->exists() || $file->isDeleted( File::DELETED_FILE ) 
) {
$file = wfFindFile( $name ); //Give other repos a 
chance to handle this
if( !$file || !$file->exists() || $file->isDeleted( 
File::DELETED_FILE ) ) {
-   wfForbidden( 'img-auth-accessdenied', 
'img-auth-nofile', $filename );
-   return;
+
+   global $wgUploadDirectory;
+   if( !file_exists( $wgUploadDirectory.$path ) ) {
+   wfForbidden( 'img-auth-accessdenied', 
'img-auth-nofile', $filename );
+   return;
+   }
}
}
}

-- 
To view, visit https://gerrit.wikimedia.org/r/333170
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6e0ed77cb9c0db6ab0e79252e2d1c190c045293
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/NSFileRepo
Gerrit-Branch: REL1_27
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_27]: ExtendedSearch: readded create page from search

2017-01-16 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332330 )

Change subject: ExtendedSearch: readded create page from search
..

ExtendedSearch: readded create page from search

Fixed issue from ERM4026

Change-Id: I526fb0f897613d459fee4abaeb5877ff91645cae
---
M ExtendedSearch/views/view.SearchSuggest.php
1 file changed, 45 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/30/332330/1

diff --git a/ExtendedSearch/views/view.SearchSuggest.php 
b/ExtendedSearch/views/view.SearchSuggest.php
index 90bbfb7..eb90401 100644
--- a/ExtendedSearch/views/view.SearchSuggest.php
+++ b/ExtendedSearch/views/view.SearchSuggest.php
@@ -32,11 +32,24 @@
public function execute( $aParam = false ) {
$sSearch = str_replace( 
BsCore::getForbiddenCharsInArticleTitle(), '', $this->getOption( 'search' ) );
$oTitle  = Title::newFromText( $sSearch );
+
+   $aLinks = [];
+   if( !$oTitle->exists() ) {
+   $aLinks['bs-extendedsearch-suggest'] = [
+   'href' => $oTitle->getLocalURL(),
+   'title' => wfMessage( 
'bs-extendedsearch-create-page', $oTitle->getPrefixedText() )->plain(),
+   'text' => wfMessage( 
'bs-extendedsearch-create-page', $oTitle->getPrefixedText() )->plain()
+   ];
+   }
+
+   Hooks::run( 'BSExtendedSearchSpecialPageTermLinks', [ &$aLinks 
] );
+
+   $sCreatesuggest  = '';
+   $sCreatesuggest .= $this->renderList( $aLinks );
+
$sSearchUrlencoded   = urlencode( $sSearch );
$sSearchHtmlEntities = htmlentities( $sSearch, ENT_QUOTES, 
'UTF-8' );
-   $sCreatesuggest  = '';
-
-   wfRunHooks( 'BSExtendedSearchAdditionalActions', array( 
&$sCreatesuggest, &$sSearchUrlencoded, &$sSearchHtmlEntities, &$oTitle ) );
+   Hooks::run( 'BSExtendedSearchAdditionalActions', array( 
&$sCreatesuggest, &$sSearchUrlencoded, &$sSearchHtmlEntities, &$oTitle ), 
'2.27' );
 
$sCreatesuggest .= '';
$sCreatesuggest .= '';
@@ -44,4 +57,33 @@
return $sCreatesuggest;
}
 
+   /**
+* Renders a given array to links in list items.
+*
+* @param $aLinks array An array of links.
+* @return string Returns the HTML from the given array.
+*/
+   private function renderList( $aLinks ) {
+   $sResult = '';
+
+   foreach ($aLinks as $sId => $aItem) {
+   $sResult .= Html::rawElement(
+   'li',
+   array(
+   ),
+   Html::element(
+   'a',
+   array(
+   'id' => $sId,
+   'title' => $aItem['title'],
+   'href' => $aItem['href'],
+   'text' => $aItem['text']
+   ),
+   $aItem['text']
+   )
+   );
+   }
+
+   return $sResult;
+   }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/332330
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I526fb0f897613d459fee4abaeb5877ff91645cae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_27
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_23]: ExtendedSearch: let autocomplete recognize namespace prefere...

2017-01-13 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331970 )

Change subject: ExtendedSearch: let autocomplete recognize namespace preferences
..

ExtendedSearch: let autocomplete recognize namespace preferences

Fixed issue from ERM4018

Change-Id: I40da3f079b2fbce27e3927a52bd7346425980176
---
M ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/70/331970/1

diff --git a/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php 
b/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
index 15a16b7..377355c 100644
--- a/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
+++ b/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
@@ -184,7 +184,6 @@
public function getSolrAutocompleteQuery( $sSearchString, 
$sSolrSearchString ) {
$aSearchOptions = array();
$aSearchOptions['fl'] = 'type,title,namespace';
-   $aSearchOptions['fq'] = array( 'wiki:(' . 
$this->getCustomerId() . ')' );
$aSearchOptions['sort'] = $this->aSearchOptions['sort'];
 
$vNamespace = $this->checkSearchstringForNamespace(

-- 
To view, visit https://gerrit.wikimedia.org/r/331970
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I40da3f079b2fbce27e3927a52bd7346425980176
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_23
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[REL1_27]: ExtendedSearch: readded namespace preferences

2017-01-13 Thread Nasty (Code Review)
Nasty has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331969 )

Change subject: ExtendedSearch: readded namespace preferences
..

ExtendedSearch: readded namespace preferences

Fixed issue from ERM4018
also let autocomplete recognize namespace preferences

Change-Id: Ie7580a597b562ce6cba809d929e3ce69b2787fad
---
M ExtendedSearch/ExtendedSearch.class.php
M ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
2 files changed, 37 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/69/331969/1

diff --git a/ExtendedSearch/ExtendedSearch.class.php 
b/ExtendedSearch/ExtendedSearch.class.php
index e52a460..bbfd2f8 100644
--- a/ExtendedSearch/ExtendedSearch.class.php
+++ b/ExtendedSearch/ExtendedSearch.class.php
@@ -111,6 +111,7 @@
$this->setHook( 'BSDashboardsAdminDashboardPortalPortlets' );
$this->setHook( 'SkinTemplateOutputPageBeforeExec' );
$this->setHook( 'BSExtendedSearchAutocomplete' );
+   $this->setHook( 'GetPreferences' );
 
$this->mCore->registerPermission( 'searchfiles', array( 'user' 
), array( 'type' => 'global' ) );
$this->mCore->registerPermission( 
'extendedsearch-viewspecialpage', array( 'user' ), array( 'type' => 'global' ) 
);
@@ -122,6 +123,42 @@
}
 
/**
+* Adds preferences for extended search, e.g. which namespaces should 
be searched by default.
+*
+* @param $user User
+* @param $preferences array
+* @return bool always true to keep hook running
+*/
+   public function onGetPreferences( $user, &$preferences ) {
+   $namespaces = $this->getLanguage()->getNamespaces();
+
+   $namespaceArray = array();
+
+   foreach( $namespaces as $namespaceId => $namespace ) {
+   $dummy = Title::makeTitle( $namespaceId, 'X' );
+
+   if( $namespaceId >= 0 && $dummy->userCan( 'read' ) ) {
+   $label = $dummy->getNsText();
+
+   if( $namespaceId === NS_MAIN ) {
+   $label = wfMessage( 'bs-ns_main' 
)->plain();
+   }
+
+   $namespaceArray[$label] = $namespaceId;
+   }
+   }
+
+   $preferences['searchNs'] = array(
+   'type' => 'multiselect',
+   'label' => wfMessage( 
'bs-extendedsearch-facet-namespace' )->plain(),
+   'section' => 'extendedsearch',
+   'options' => $namespaceArray
+   );
+
+   return true;
+   }
+
+   /**
 * extension.json callback
 * @global array $wgAjaxExportList
 */
diff --git a/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php 
b/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
index 15a16b7..377355c 100644
--- a/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
+++ b/ExtendedSearch/includes/SearchIndex/SearchOptions.class.php
@@ -184,7 +184,6 @@
public function getSolrAutocompleteQuery( $sSearchString, 
$sSolrSearchString ) {
$aSearchOptions = array();
$aSearchOptions['fl'] = 'type,title,namespace';
-   $aSearchOptions['fq'] = array( 'wiki:(' . 
$this->getCustomerId() . ')' );
$aSearchOptions['sort'] = $this->aSearchOptions['sort'];
 
$vNamespace = $this->checkSearchstringForNamespace(

-- 
To view, visit https://gerrit.wikimedia.org/r/331969
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie7580a597b562ce6cba809d929e3ce69b2787fad
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_27
Gerrit-Owner: Nasty 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits