/** * Serializes the CollaborationHubContent object. * * @param $content Content * @param $format string|null * @return mixed */ public function serializeContent(Content $content, $format = null) { if ($format === self::FORMAT_WIKI) { return $content->convertToHumanEditable(); } return parent::serializeContent($content, $format); }
/** * @param string $format * @return bool */ public function isSupportedFormat($format) { // An error in an earlier version of Scribunto means we might see this. if ($format === 'CONTENT_FORMAT_TEXT') { $format = CONTENT_FORMAT_TEXT; } return parent::isSupportedFormat($format); }
public function __construct($modelId = CONTENT_MODEL_CSS) { parent::__construct($modelId, array(CONTENT_FORMAT_CSS)); }
public function __construct($modelId = CONTENT_MODEL_WIKITEXT) { parent::__construct($modelId, array(CONTENT_FORMAT_WIKITEXT)); }
public function __construct() { parent::__construct("RevisionTestModifyableContent", array(CONTENT_FORMAT_TEXT)); }
public function __construct() { parent::__construct('BackupTextPassTestModel'); }
public function getDataForSearchIndex(WikiPage $page, ParserOutput $parserOutput, SearchEngine $engine) { $fields = parent::getDataForSearchIndex($page, $parserOutput, $engine); $structure = new WikiTextStructure($parserOutput); $fields['heading'] = $structure->headings(); // text fields $fields['opening_text'] = $structure->getOpeningText(); $fields['text'] = $structure->getMainText(); // overwrites one from ContentHandler $fields['auxiliary_text'] = $structure->getAuxiliaryText(); $fields['defaultsort'] = $structure->getDefaultSort(); // Until we have full first-class content handler for files, we invoke it explicitly here if (NS_FILE == $page->getTitle()->getNamespace()) { $fields = array_merge($fields, $this->getFileHandler()->getDataForSearchIndex($page, $parserOutput, $engine)); } return $fields; }
public function testSupportsDirectEditing() { $handler = new TextContentHandler(); $this->assertTrue($handler->supportsDirectEditing(), 'direct editing is supported'); }
public function merge3(Content $oldContent, Content $myContent, Content $yourContent) { // You could implement smart DOM-based diff/merge here. // The default implementation is line-based, which isn't too great for XML. return parent::merge3($oldContent, $myContent, $yourContent); }
/** * Only allow this content handler to be used in the Module namespace * @param Title $title * @return bool */ public function canBeUsedOn(Title $title) { if ($title->getNamespace() !== NS_MODULE) { return false; } return parent::canBeUsedOn($title); }
public function __construct($modelId = 'JsonSchema') { parent::__construct($modelId, array(CONTENT_FORMAT_JSON)); }
/** * @param string $modelId */ public function __construct($modelId = CONTENT_MODEL_JAVASCRIPT) { parent::__construct($modelId, array(CONTENT_FORMAT_JAVASCRIPT)); }
public function __construct($modelId = 'Notebook') { parent::__construct($modelId); }