*
* @author Daniel Kinzler
*/
+
+/**
+ * Base implementation for content objects.
+ *
+ * @ingroup Content
+ */
abstract class AbstractContent implements Content {
/**
*
* @author Daniel Kinzler
*/
+
+/**
+ * Base interface for content objects.
+ *
+ * @ingroup Content
+ */
interface Content {
/**
<?php
+/**
+ * Base class for content handling.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @since 1.21
+ *
+ * @file
+ * @ingroup Content
+ *
+ * @author Daniel Kinzler
+ */
/**
* Exception representing a failure to serialize or unserialize a content object.
+ *
+ * @ingroup Content
*/
class MWContentSerializationException extends MWException {
* type), but wikitext content may be represented by a DOM or AST structure in
* the future.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @since 1.21
- *
- * @file
* @ingroup Content
- *
- * @author Daniel Kinzler
*/
abstract class ContentHandler {
<?php
/**
+ * Content object for CSS pages.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
*
* @author Daniel Kinzler
*/
+
+/**
+ * Content object for CSS pages.
+ *
+ * @ingroup Content
+ */
class CssContent extends TextContent {
public function __construct( $text ) {
parent::__construct( $text, CONTENT_MODEL_CSS );
<?php
/**
+ * Content handler for CSS pages.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* http://www.gnu.org/copyleft/gpl.html
*
* @file
+ * @ingroup Content
*/
/**
+ * Content handler for CSS pages.
+ *
* @since 1.21
+ * @ingroup Content
*/
class CssContentHandler extends TextContentHandler {
<?php
-
/**
+ * Content for JavaScript pages.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
*
* @author Daniel Kinzler
*/
+
+/**
+ * Content for JavaScript pages.
+ *
+ * @ingroup Content
+ */
class JavaScriptContent extends TextContent {
public function __construct( $text ) {
parent::__construct( $text, CONTENT_MODEL_JAVASCRIPT );
return $html;
}
-}
\ No newline at end of file
+}
<?php
/**
+ * Content handler for JavaScript pages.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* @file
*/
-# XXX: make ScriptContentHandler base class, do highlighting stuff there?
-
/**
+ * Content handler for JavaScript pages.
+ *
* @since 1.21
+ * @ingroup Content
+ * @todo make ScriptContentHandler base class, do highlighting stuff there?
*/
class JavaScriptContentHandler extends TextContentHandler {
<?php
-
/**
- * Wrapper allowing us to handle a system message as a Content object. Note that this is generally *not* used
- * to represent content from the MediaWiki namespace, and that there is no MessageContentHandler. MessageContent
- * is just intended as glue for wrapping a message programatically.
+ * Wrapper content object allowing to handle a system message as a Content object.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* @author Daniel Kinzler
*/
+
+/**
+ * Wrapper allowing us to handle a system message as a Content object.
+ * Note that this is generally *not* used to represent content from the
+ * MediaWiki namespace, and that there is no MessageContentHandler.
+ * MessageContent is just intended as glue for wrapping a message programatically.
+ *
+ * @ingroup Content
+ */
class MessageContent extends AbstractContent {
/**
$po = new ParserOutput( $html );
return $po;
}
-}
\ No newline at end of file
+}
<?php
-
/**
* Content object implementation for representing flat text.
*
- * TextContent instances are immutable
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
*
* @author Daniel Kinzler
*/
+
+/**
+ * Content object implementation for representing flat text.
+ *
+ * TextContent instances are immutable
+ *
+ * @ingroup Content
+ */
class TextContent extends AbstractContent {
public function __construct( $text, $model_id = CONTENT_MODEL_TEXT ) {
<?php
/**
+ * Base content handler class for flat text contents.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @since 1.21
+ *
* @file
+ * @ingroup Content
*/
/**
- * @since 1.21
+ * Base content handler implementation for flat text contents.
+ *
+ * @ingroup Content
*/
class TextContentHandler extends ContentHandler {
<?php
/**
+ * Content object for wiki text pages.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
*
* @author Daniel Kinzler
*/
+
+/**
+ * Content object for wiki text pages.
+ *
+ * @ingroup Content
+ */
class WikitextContent extends TextContent {
public function __construct( $text ) {
<?php
/**
+ * Content handler for wiki text pages.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @since 1.21
+ *
* @file
+ * @ingroup Content
*/
/**
- * @since 1.21
+ * Content handler for wiki text pages.
+ *
+ * @ingroup Content
*/
class WikitextContentHandler extends TextContentHandler {