Extension:MsLinks

This page is a translated version of the page Extension:MsLinks and the translation is 100% complete.
MediaWiki 拡張機能マニュアル
MsLinks
リリースの状態: 安定
実装 パーサー関数
説明 ファイルの種類に応じたアイコンを使って、ファイルの閲覧やダウンロードのためのリンクを作成することができます。
作者 Martin Schwindl, Martin Keyler
メンテナー Sophivorus
最新バージョン 5.3 (2021-11-15)
MediaWiki 1.23+
PHP 5.3+
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
  • $wgMSL_FileTypes
Quarterly downloads 21 (Ranked 127th)
translatewiki.net で翻訳を利用できる場合は、MsLinks 拡張機能の翻訳にご協力ください

The MsLinks extension adds a button to the editor that creates links to view or download files using icons appropriate to the file type.

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のMsLinksという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MsLinks
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'MsLinks' );
    
  •   完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。


Vagrant installation:

  • Vagrant を使用している場合は、vagrant roles enable MsLinks --provisionでインストールしてください。

設定

You can configure the icon that is associated with each file type, by adding the icon to the images folder of the MsLinks extension and setting the $wgMSL_FileTypes array appropriately. Below is the default configuration:

$wgMSL_FileTypes = [
	'no' => 'no_icon.png',
	'jpg' => 'image_icon.png',
	'gif' => 'image_icon.png',
	'bmp' => 'image_icon.png',
	'png' => 'image_icon.png',
	'tiff' => 'image_icon.png',
	'tif' => 'image_icon.png',
	'ai' => 'image_ai_icon.png',
	'psd' => 'image_ps_icon.png',
	'pdf' => 'pdf_icon.png',
	'pps' => 'pps_icon.png',
	'ppt' => 'pps_icon.png',
	'pptx' => 'pps_icon.png',
	'xls' => 'xls_icon.png',
	'xlsx' => 'xls_icon.png',
	'doc' => 'doc_icon.png',
	'docx' => 'doc_icon.png',
	'dot' => 'doc_icon.png',
	'dotx' => 'doc_icon.png',
	'rtf' => 'doc_icon.png',
	'txt' => 'txt_icon.png',
	'html' => 'code_icon.png',
	'php' => 'code_icon.png',
	'exe' => 'exe_icon.gif',
	'asc' => 'txt_icon.png',
	'dwg' => 'dwg_icon.gif',
	'zip' => 'zip_icon.png',
	'mov' => 'movie_icon.png',
	'mpeg' => 'movie_icon.png',
	'mpg' => 'movie_icon.png',
	'wmv' => 'movie_icon.png',
	'avi' => 'movie_icon.png',
	'mp4' => 'movie_icon.png',
	'flv' => 'movie_flash_icon.png',
	'wma' => 'music_icon.png',
	'mp3' => 'music_icon.png',
	'wav' => 'music_icon.png',
	'mid' => 'music_icon.png',
];

使用法

To insert a MsLink, simply edit a page and click on the new button in the toolbar. It will insert an empty MsLink, which you can then fill with the filename of the file you want to link to. You can also add some parameters to it, like in regular images. Below are some examples of usage:

説明 入力 結果
Basic MsLink {{#l:Testfile.pdf}}   Testfile.pdf
MsLink with description {{#l:Testfile.pdf|File description}}   File description
Icon on the right side {{#l:Testfile.pdf|File description|right}} File description  
Direct MsLink {{#l:dlink|Testfile.pdf|This file will be downloaded when clicked}}   This file will be downloaded when clicked

関連項目