getTitle(); if ( $title->getNamespace() === NS_AV_ANNOT ) { $out = $editor->getContext()->getOutput(); $out->addModules('ext.annot.prev'); } return true; } /** * MWHook: Add preloaded text to editor on page creation * * @see https://www.mediawiki.org/wiki/Manual:Hooks/EditFormPreloadText * * @param string $text editor text * @param Title $Title title of the created page * @return bool|void True or no return value to continue or false to abort */ public static function onEditFormPreloadText( &$text, &$title ) { if ( $title->getNamespace() === NS_AV_ANNOT ) { $titleText = $title->getBaseText(); $text = <<getTitle(); if ($title->getNamespace() === NS_FILE) { $titleText = $title->getBaseText(); $extPos = strpos($titleText,'.'); if ($extPos !== false) { $imName = substr($titleText, 0, $extPos); } else { $imName = $titleText; } $findLoc = strpos($text, "

recursiveTagParseFully($mwLink); $newText = <<Annotated File

Click below to create or edit an annotated version of this image.
ANHEAD; $text = $text . $newText . $htmlLink; } } } /** * Small helper function to display information on the browser console * * Usage: * echo ''; * * @param $data information to display * @param bool $add_script_tags true to put information is inside complete script tag */ public static function console_log($data, $add_script_tags = false) { $command = 'console.log('. json_encode($data, JSON_HEX_TAG).');'; if ($add_script_tags) { $command = ''; } echo $command; } }