Swidmann has uploaded a new change for review.

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

Change subject: Config class change for preferences added method in config 
class to reduce code for preferences small fix in shm cache class
......................................................................

Config class change for preferences
added method in config class to reduce code for preferences
small fix in shm cache class

Change-Id: I89cc5f2a18e748bdff9c1f39e9f95c3a9cd09f8d
---
M includes/Config.class.php
M includes/cache/LCStore_SHM.php
2 files changed, 24 insertions(+), 1 deletion(-)


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

diff --git a/includes/Config.class.php b/includes/Config.class.php
index 838c962..6168f0a 100644
--- a/includes/Config.class.php
+++ b/includes/Config.class.php
@@ -779,6 +779,29 @@
        }
 
        /**
+        * Returns a field description/definition array for preferences
+        * @param string $sSection
+        * @return array
+        */
+       public function getFieldDefinition( $sSection) {
+               $aField = array(
+                       'type' => $this->getFieldMapping(),
+                       'label-message' => $this->getI18nName(), // a system 
message
+                       'section' => strtolower( $sSection ),
+                       'default' => $this->getValue()
+               );
+
+               // Field message and title for dialog
+               if ( $this->getFieldMapping() == 'multiselectplusadd' ) {
+                       $field['options'] = $this->getValue();
+                       $field['title'] = 'toc-' . $this->getName() . '-title';
+                       $field['message'] = 'toc-' . $this->getName() . 
'-message';
+               }
+
+               return $aField;
+       }
+
+       /**
         * returns an id for this variable, which can be used in html
         *
         * @return string
diff --git a/includes/cache/LCStore_SHM.php b/includes/cache/LCStore_SHM.php
index 0fd2702..602fd81 100644
--- a/includes/cache/LCStore_SHM.php
+++ b/includes/cache/LCStore_SHM.php
@@ -53,7 +53,7 @@
                        return;
                }
                $sFilename = $this->_sDirectory . DS . self::$_sCurrentLanguage 
. '.bscache';
-               $sSerializedData = serialize( $this->_aData[ 
self::$_sCurrentLanguage ] );
+               $sSerializedData = serialize( self::$_aData[ 
self::$_sCurrentLanguage ] );
                file_put_contents( $sFilename, $sSerializedData, LOCK_EX );
                if ( is_callable( 'ftok' ) ) {
                        $iShmKey = ftok( $sFilename, 'b' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I89cc5f2a18e748bdff9c1f39e9f95c3a9cd09f8d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Swidmann <widm...@hallowelt.biz>

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

Reply via email to