summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Translate/utils/MessageGroupStates.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/Translate/utils/MessageGroupStates.php')
-rw-r--r--www/wiki/extensions/Translate/utils/MessageGroupStates.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/www/wiki/extensions/Translate/utils/MessageGroupStates.php b/www/wiki/extensions/Translate/utils/MessageGroupStates.php
new file mode 100644
index 00000000..de20f6c8
--- /dev/null
+++ b/www/wiki/extensions/Translate/utils/MessageGroupStates.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Wrapper class for using message group states.
+ *
+ * @file
+ * @author Niklas Laxström
+ * @author Siebrand Mazeland
+ * @copyright Copyright © 2012-2013 Niklas Laxström
+ * @license GPL-2.0-or-later
+ */
+
+/**
+ * Class for making the use of message group state easier.
+ * @since 2012-10-05
+ */
+class MessageGroupStates {
+ const CONDKEY = 'state conditions';
+
+ protected $config;
+
+ public function __construct( array $config = null ) {
+ $this->config = $config;
+ }
+
+ public function getStates() {
+ $conf = $this->config;
+ unset( $conf[self::CONDKEY] );
+
+ return $conf;
+ }
+
+ public function getConditions() {
+ $conf = $this->config;
+ if ( isset( $conf[self::CONDKEY] ) ) {
+ return $conf[self::CONDKEY];
+ } else {
+ return [];
+ }
+ }
+}