Merge "API: created a new api to flag messages as read"
[lhc/web/wiklou.git] / includes / content / JSONContentHandler.php
index 9d001da..33f2036 100644 (file)
@@ -16,6 +16,8 @@ class JSONContentHandler extends TextContentHandler {
        /**
         * The class name of objects that should be created
         *
+        * @deprecated override getContentClass instead
+        *
         * @var string
         */
        protected $contentClass = 'JSONContent';
@@ -25,33 +27,39 @@ class JSONContentHandler extends TextContentHandler {
        }
 
        /**
-        * Unserializes a JSONContent object.
-        *
-        * @param string $text Serialized form of the content
-        * @param null|string $format The format used for serialization
+        * Temporary back-compat until extensions
+        * are updated to override this
         *
-        * @return JSONContent
+        * @return string
         */
-       public function unserializeContent( $text, $format = null ) {
-               $this->checkFormat( $format );
-               return new $this->contentClass( $text );
+       protected function getContentClass() {
+               return $this->contentClass;
        }
 
        /**
-        * Creates an empty JSONContent object.
+        * Returns the english language, because JSON is english, and should be handled as such.
+        *
+        * @param Title $title
+        * @param Content|null $content
         *
-        * @return JSONContent
+        * @return Language Return of wfGetLangObj( 'en' )
+        *
+        * @see ContentHandler::getPageLanguage()
         */
-       public function makeEmptyContent() {
-               return new $this->contentClass( '' );
-       }
-
-       /** JSON is English **/
        public function getPageLanguage( Title $title, Content $content = null ) {
                return wfGetLangObj( 'en' );
        }
 
-       /** JSON is English **/
+       /**
+        * Returns the english language, because JSON is english, and should be handled as such.
+        *
+        * @param Title $title
+        * @param Content|null $content
+        *
+        * @return Language Return of wfGetLangObj( 'en' )
+        *
+        * @see ContentHandler::getPageLanguage()
+        */
        public function getPageViewLanguage( Title $title, Content $content = null ) {
                return wfGetLangObj( 'en' );
        }