Index: trunk/extensions/Push/Push.i18n.php |
— | — | @@ -16,6 +16,8 @@ |
17 | 17 | */ |
18 | 18 | $messages['en'] = array( |
19 | 19 | 'push-desc' => 'Lightweight extension to push content to other wikis', |
| 20 | + |
| 21 | + // Tab |
20 | 22 | 'push-tab-text' => 'Push', |
21 | 23 | 'push-button-text' => 'Push', |
22 | 24 | 'push-button-desc' => 'This tab allows you to push the current revision of this page to one or more other wikis.', |
— | — | @@ -27,4 +29,7 @@ |
28 | 30 | 'push-add-target' => 'Add target', |
29 | 31 | 'push-import-revision-message' => 'Import from $1 by $2.$3', // $3 is 'push-import-revision-comment' or empty. 1360! |
30 | 32 | 'push-import-revision-comment' => ' Last comment: $1', |
| 33 | + |
| 34 | + // Special page |
| 35 | + 'special-push' => 'Push', |
31 | 36 | ); |
\ No newline at end of file |
Index: trunk/extensions/Push/specials/Push_Body.php |
— | — | @@ -0,0 +1,49 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * A special page that allows pushing one or more pages to one or more targets. |
| 6 | + * |
| 7 | + * @since 0.1 |
| 8 | + * |
| 9 | + * @author Jeroen De Dauw |
| 10 | + */ |
| 11 | +class SpecialPush extends SpecialPage { |
| 12 | + |
| 13 | + /** |
| 14 | + * Constructor. |
| 15 | + * |
| 16 | + * @since 0.1 |
| 17 | + */ |
| 18 | + public function __construct() { |
| 19 | + parent::__construct( 'Push', 'push' ); |
| 20 | + } |
| 21 | + |
| 22 | + /** |
| 23 | + * @see SpecialPage::getDescription |
| 24 | + */ |
| 25 | + public function getDescription() { |
| 26 | + return wfMsg( 'special-' . strtolower( $this->mName ) ); |
| 27 | + } |
| 28 | + |
| 29 | + /** |
| 30 | + * Main method. |
| 31 | + * |
| 32 | + * @since 0.1 |
| 33 | + * |
| 34 | + * @param string $arg |
| 35 | + */ |
| 36 | + public function execute( $arg ) { |
| 37 | + global $wgOut, $wgUser; |
| 38 | + |
| 39 | + $wgOut->setPageTitle( wfMsg( 'special-push' ) ); |
| 40 | + |
| 41 | + // If the user is authorized, display the page, if not, show an error. |
| 42 | + if ( !$this->userCanExecute( $wgUser ) ) { |
| 43 | + $this->displayRestrictionError(); |
| 44 | + return; |
| 45 | + } |
| 46 | + |
| 47 | + // TODO |
| 48 | + } |
| 49 | + |
| 50 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/Push/specials/Push_Body.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 51 | + native |
Index: trunk/extensions/Push/Push.php |
— | — | @@ -42,12 +42,19 @@ |
43 | 43 | |
44 | 44 | $wgExtensionMessagesFiles['Push'] = dirname( __FILE__ ) . '/Push.i18n.php'; |
45 | 45 | |
| 46 | +$wgAutoloadClasses['PushHooks'] = dirname( __FILE__ ) . '/Push.hooks.php'; |
46 | 47 | $wgAutoloadClasses['PushTab'] = dirname( __FILE__ ) . '/includes/Push_Tab.php'; |
| 48 | +$wgAutoloadClasses['SpecialPush'] = dirname( __FILE__ ) . '/specials/Push_Body.php'; |
47 | 49 | |
| 50 | +$wgSpecialPages['Push'] = 'SpecialPush'; |
| 51 | +$wgSpecialPageGroups['Push'] = 'pagetools'; |
| 52 | + |
48 | 53 | $wgHooks['UnknownAction'][] = 'PushTab::onUnknownAction'; |
49 | 54 | $wgHooks['SkinTemplateTabs'][] = 'PushTab::displayTab'; |
50 | 55 | $wgHooks['SkinTemplateNavigation'][] = 'PushTab::displayTab2'; |
51 | 56 | |
| 57 | +$wgHooks['AdminLinks'][] = 'PushHooks::addToAdminLinks'; |
| 58 | + |
52 | 59 | $wgAvailableRights[] = 'push'; |
53 | 60 | $wgAvailableRights[] = 'pushadmin'; |
54 | 61 | |
Index: trunk/extensions/Push/includes/Push_Tab.php |
— | — | @@ -203,18 +203,9 @@ |
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
207 | | - * Displays several configuration options for the push operations. |
| 207 | + * Displays a form via which a new push item can be added. |
208 | 208 | * |
209 | 209 | * @since 0.1 |
210 | | - */ |
211 | | - protected static function displayPushOptions() { |
212 | | - global $wgOut; |
213 | | - } |
214 | | - |
215 | | - /** |
216 | | - * Displays a form via which a new psuh item can be added. |
217 | | - * |
218 | | - * @since 0.1 |
219 | 210 | */ |
220 | 211 | protected static function displayNewPushItem() { |
221 | 212 | global $wgOut; |
Index: trunk/extensions/Push/Push.hooks.php |
— | — | @@ -12,6 +12,24 @@ |
13 | 13 | */ |
14 | 14 | final class PushHooks { |
15 | 15 | |
| 16 | + /** |
| 17 | + * Adds a link to Admin Links page. |
| 18 | + * |
| 19 | + * @since 0.1 |
| 20 | + * |
| 21 | + * @return true |
| 22 | + */ |
| 23 | + public static function addToAdminLinks( &$admin_links_tree ) { |
| 24 | + $displaying_data_section = $admin_links_tree->getSection( wfMsg( 'smw_adminlinks_displayingdata' ) ); |
16 | 25 | |
| 26 | + // Escape if SMW hasn't added links. |
| 27 | + if ( is_null( $displaying_data_section ) ) return true; |
| 28 | + $smw_docu_row = $displaying_data_section->getRow( 'smw' ); |
17 | 29 | |
| 30 | + $maps_docu_label = wfMsg( 'adminlinks_documentation', wfMsg( 'maps_name' ) ); |
| 31 | + $smw_docu_row->addItem( AlItem::newFromExternalLink( 'http://mapping.referata.com/wiki/Maps', $maps_docu_label ) ); |
| 32 | + |
| 33 | + return true; |
| 34 | + } |
| 35 | + |
18 | 36 | } |
\ No newline at end of file |