Introducing ContentHandler::canBeUsedOn()
[lhc/web/wiklou.git] / includes / ContentHandler.php
index 6140824..584a6ad 100644 (file)
@@ -612,6 +612,23 @@ abstract class ContentHandler {
                return $pageLang;
        }
 
+       /**
+        * Determines whether the content type handled by this ContentHandler
+        * can be used on the given page.
+        *
+        * This default implementation always returns true.
+        * Subclasses may override this to restrict the use of this content model to specific locations,
+        * typically based on the namespace or some other aspect of the title, such as a special suffix
+        * (e.g. ".svg" for SVG content).
+        *
+        * @param Title $title the page's title.
+        *
+        * @return bool true if content of this kind can be used on the given page, false otherwise.
+        */
+       public function canBeUsedOn( Title $title ) {
+               return true;
+       }
+
        /**
         * Returns the name of the diff engine to use.
         *