Migrate remaining usages of Title::userCan() to PermissionManager
[lhc/web/wiklou.git] / includes / widget / TitlesMultiselectWidget.php
index 3246e7d..ac34259 100644 (file)
@@ -11,10 +11,12 @@ namespace MediaWiki\Widget;
 class TitlesMultiselectWidget extends TagMultiselectWidget {
 
        protected $showMissing = null;
+       protected $excludeDynamicNamespaces = null;
 
        /**
         * @param array $config Configuration options
         *   - bool $config['showMissing'] Show missing pages
+        *   - bool $config['excludeDynamicNamespaces'] Exclude pages in negative namespaces
         */
        public function __construct( array $config = [] ) {
                parent::__construct( $config );
@@ -23,6 +25,9 @@ class TitlesMultiselectWidget extends TagMultiselectWidget {
                if ( isset( $config['showMissing'] ) ) {
                        $this->showMissing = $config['showMissing'];
                }
+               if ( isset( $config['excludeDynamicNamespaces'] ) ) {
+                       $this->excludeDynamicNamespaces = $config['excludeDynamicNamespaces'];
+               }
 
                $this->addClasses( [ 'mw-widgets-titlesMultiselectWidget' ] );
        }
@@ -35,6 +40,9 @@ class TitlesMultiselectWidget extends TagMultiselectWidget {
                if ( $this->showMissing !== null ) {
                        $config['showMissing'] = $this->showMissing;
                }
+               if ( $this->excludeDynamicNamespaces !== null ) {
+                       $config['excludeDynamicNamespaces'] = $this->excludeDynamicNamespaces;
+               }
 
                return parent::getConfig( $config );
        }