Index: trunk/extensions/ArchiveLinks/ArchiveLinks.alias.php |
— | — | @@ -0,0 +1,6 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Alias file to allow different languages to have a localized special page title. |
| 5 | + */ |
| 6 | + |
| 7 | +$aliases = array (); |
\ No newline at end of file |
Property changes on: trunk/extensions/ArchiveLinks/ArchiveLinks.alias.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 8 | + native |
Index: trunk/extensions/ArchiveLinks/SpecialArchiveBlacklist.php |
— | — | @@ -0,0 +1,29 @@ |
| 2 | +<?php |
| 3 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| 4 | + echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" ); |
| 5 | + die( 1 ); |
| 6 | +} |
| 7 | + |
| 8 | +class SpecialArchiveBlacklist extends SpecialPage { |
| 9 | + function __construct() { |
| 10 | + parent::__construct( 'ArchiveBlacklist' ); |
| 11 | + |
| 12 | + } |
| 13 | + |
| 14 | + public function execute ( $par ) { |
| 15 | + global $wgOut; |
| 16 | + $this->setHeaders(); |
| 17 | + $this->outputHeader(); |
| 18 | + |
| 19 | + $wgOut->addWikiText( wfMsg( 'archivelinks-archive-blacklist-desc' ) ); |
| 20 | + |
| 21 | + $wgOut->addHTML( |
| 22 | + HTML::openElement('form', array( 'method' => 'get', 'action' => '')) . |
| 23 | + HTML::openElement('fieldset') . |
| 24 | + HTML::element( 'legend', null, wfMsg( 'ArchiveBlacklist') ) . |
| 25 | + HTML::hidden( 'title', SpecialPage::getTitleFor( 'ArchiveBlacklist' )->getPrefixedText() ) . |
| 26 | + HTML::input( 'Blacklist' ) . |
| 27 | + HTML::closeElement('fieldset') . |
| 28 | + HTML::closeElement('form')); |
| 29 | + } |
| 30 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/ArchiveLinks/SpecialArchiveBlacklist.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 31 | + native |
Index: trunk/extensions/ArchiveLinks/ArchiveLinks.i18n.php |
— | — | @@ -7,5 +7,7 @@ |
8 | 8 | |
9 | 9 | //English |
10 | 10 | $messages['en'] = array ( |
11 | | - 'archive-links-cache-title' => '[cache]', |
| 11 | + 'archivelinks-cache-title' => '[cache]', |
| 12 | + 'ArchiveBlacklist' => 'Archive Blacklist', |
| 13 | + 'archivelinks-archive-blacklist-desc' => 'This page allows you to blacklist or whitelist URLs for the ArchiveLinks extension.', |
12 | 14 | ); |
\ No newline at end of file |
Index: trunk/extensions/ArchiveLinks/ArchiveLinks.php |
— | — | @@ -14,12 +14,16 @@ |
15 | 15 | $path = dirname( __FILE__ ); |
16 | 16 | |
17 | 17 | $wgExtensionMessagesFiles['ArchiveLinks'] = "$path/ArchiveLinks.i18n.php"; |
| 18 | +$wgExtensionMessagesFiles['ArchiveBlacklist'] = "$path/ArchiveLinks.i18n.php"; |
18 | 19 | |
19 | 20 | $wgAutoloadClasses['ArchiveLinks'] = "$path/ArchiveLinks.class.php"; |
| 21 | +$wgAutoloadClasses['SpecialArchiveBlacklist'] = "$path/SpecialArchiveBlacklist.php"; |
20 | 22 | |
21 | 23 | $wgHooks['ArticleSaveComplete'][] = 'ArchiveLinks::queueExternalLinks'; |
22 | 24 | $wgHooks['LinkerMakeExternalLink'][] = 'ArchiveLinks::rewriteLinks'; |
23 | 25 | |
| 26 | +$wgSpecialPages['ArchiveBlacklist'] = 'SpecialArchiveBlacklist'; |
| 27 | + |
24 | 28 | $wgArchiveLinksConfig = array ( |
25 | 29 | 'archive_service' => 'wikiwix', |
26 | 30 | 'use_multiple_archives' => false, |
Index: trunk/extensions/ArchiveLinks/SetupTables.sql |
Property changes on: trunk/extensions/ArchiveLinks/SetupTables.sql |
___________________________________________________________________ |
Added: svn:eol-style |
27 | 31 | + native |
Index: trunk/extensions/ArchiveLinks/ArchiveLinks.class.php |
— | — | @@ -76,9 +76,15 @@ |
77 | 77 | |
78 | 78 | } |
79 | 79 | } |
80 | | - //Note to self: need to fix this to use Html.php instead of direct html |
81 | | - $link = "<a rel=\"nofollow\" class=\"{$attributes['class']}\" href=\"{$url}\">{$text}</a> <sup><small><a href=\"" |
82 | | - . "{$link_to_archive}\">" . wfMsg( 'archive-links-cache-title' ) . '</a></small></sup> '; |
| 80 | + |
| 81 | + $link = HTML::element('a', array ( 'rel' => 'nofollow', 'class' => $attributes['class'], 'href' => $url ), $text ) |
| 82 | + . HTML::openElement('sup') |
| 83 | + . HTML::openElement('small') |
| 84 | + . ' ' |
| 85 | + . HTML::element('a', array ( 'href' => $link_to_archive ), wfMsg( 'archivelinks-cache-title') ) |
| 86 | + . HTML::closeElement('small') |
| 87 | + . HTML::closeElement('sup'); |
| 88 | + |
83 | 89 | return false; |
84 | 90 | } else { |
85 | 91 | return true; |