Extension:NoTOC/ru

Category:Extensions which host their code in-wiki/ru Category:Unmaintained extensions/ru#NoTOC/ru Category:GPL licensed extensions/ru
Справка по расширениям MediaWiki
NoTOC
Статус релиза: не поддерживаетсяCategory:Unmaintained extensions/ru
Реализация Расширение парсера Category:Parser extensions/ru
Описание Turns off Table of Contents by default on all pages
Автор(ы) Andrew Fitzgerald (Frantikобсуждение)
Последняя версия 0.1.1 (2013-12-11)
MediaWiki Category:Extensions without MediaWiki version
Изменения в БД Нет
Лицензия GNU General Public License 2.0 или позднее
Скачать See the code section
Category:All extensions/ruCategory:Extensions not in ExtensionJson

Расширение NoTOC скрывает содержание по умолчанию. The magic word __TOC__ can still be used normally.

Установка

  • Copy the code into files и распакуйте файл(ы) в папку с названием NoTOC в вашей папке extensions/.
  • Добавьте следующий код в конце вашего файла LocalSettings.php :
    require_once "$IP/extensions/NoTOC/NoTOC.php";
    
  • Yes Готово – Перейдите на страницу Special:Version на своей вики, чтобы удостовериться в том, что расширение успешно установлено.Category:Extensions not using extension registration/ru

Код

NoTOC.php
<?php
/**
 * NoTOC extension - Turns off the Table of Contents (TOC) by default on all pages
 * @version 0.1.1 - 2013/12/11
 *
 * @link https://www.mediawiki.org/wiki/Extension:NoTOC Documentation
 * @link https://www.mediawiki.org/wiki/Extension_talk:NoTOC Support
 *
 * @ingroup Extensions
 * @package MediaWiki
 * @author Andrew Fitzgerald (Frantik)
 * @author Karsten Hoffmeyer (Kghbln)
 * @copyright (C) 2010 Andrew Fitzgerald
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 */

// check the call
if ( !defined( 'MEDIAWIKI' ) ) {
        die( 'This file is a MediaWiki extension and thus not a valid entry point.' );
}

// provide information
$wgExtensionCredits['parserhook'][] = array(
	'path' => __FILE__,
	'name' => 'NoTOC',
        'author' => array(
                'Andrew Fitzgerald', '...'
                ),
	'url' => 'https://www.mediawiki.org/wiki/Extension:NoTOC', 
	'descriptionmsg' => 'notoc-desc',
	'version' => '0.1.1'
);

// show way to files
$wgExtensionMessagesFiles['NoTOC'] = dirname( __FILE__ ) . '/NoTOC.i18n.php';

// register hooks
$wgHooks['ParserClearState'][] = 'efMWNoTOC';
 
// perform purpose
function efMWNoTOC($parser) {
    $parser->mShowToc = false;
    return true;
}
NoTOC.i18n.php
<?php
/**
 * Internationalization file for the NoTOC extension.
 *
 * @licence GNU GPL v2+
 * @author Karsten Hoffmeyer (Kghbln)
 */

$messages = array();

/** English
 * @author Frantik
 * @author Kghbln
 */
$messages['en'] = array(
        'notoc-desc' => 'Turns off the Table of Contents (TOC) by default on all pages',
);

/** Message documentation (Message documentation)
 * @author Kghbln
 */
$messages['qqq'] = array(
        'notoc-desc' => '{{desc|name=NoTOC|url=https://www.mediawiki.org/wiki/Extension:NoTOC}}',
);

/** German (Deutsch)
 * @author Kghbln
 */
$messages['de'] = array(
        'notoc-desc' => 'Unterdrückt die automatische Generierung des Inhaltsverzeichnisses',
);

См. также

Category:TOC extensions/ru
Category:All extensions/ru Category:Extensions not in ExtensionJson Category:Extensions not using extension registration/ru Category:Extensions which host their code in-wiki/ru Category:Extensions without MediaWiki version Category:GPL licensed extensions/ru Category:ParserClearState extensions/ru Category:Parser extensions/ru Category:TOC extensions/ru Category:Unmaintained extensions/ru