Index: trunk/extensions/BookManager/bookmanager.js |
— | — | @@ -0,0 +1 @@ |
| 2 | +/*Script here */ |
Property changes on: trunk/extensions/BookManager/bookmanager.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 3 | + native |
Index: trunk/extensions/BookManager/BookManager.body.php |
— | — | @@ -0,0 +1,312 @@ |
| 2 | +<?php |
| 3 | +/**** All the BookManager Variables Functions ****/ |
| 4 | +class BookManagerFunctions { |
| 5 | + |
| 6 | + const VERSION = "0.1.5 - unstable"; |
| 7 | + |
| 8 | + static function register( ) { |
| 9 | + global $wgParser; |
| 10 | + |
| 11 | + # optional SFH_NO_HASH to omit the hash from calls (e.g. {{int:...}} |
| 12 | + # instead of {{#int:...}}) |
| 13 | + $wgParser->setFunctionHook( 'prevpagename', array( __CLASS__, 'prevpagename' ), SFH_NO_HASH ); |
| 14 | + $wgParser->setFunctionHook( 'prevpagenamee', array( __CLASS__, 'prevpagenamee' ), SFH_NO_HASH ); |
| 15 | + $wgParser->setFunctionHook( 'nextpagename', array( __CLASS__, 'nextpagename' ), SFH_NO_HASH ); |
| 16 | + $wgParser->setFunctionHook( 'nextpagenamee', array( __CLASS__, 'nextpagenamee' ), SFH_NO_HASH ); |
| 17 | + $wgParser->setFunctionHook( 'rootpagename', array( __CLASS__, 'rootpagename' ), SFH_NO_HASH ); |
| 18 | + $wgParser->setFunctionHook( 'rootpagenamee', array( __CLASS__, 'rootpagenamee' ), SFH_NO_HASH ); |
| 19 | + $wgParser->setFunctionHook( 'chaptername', array( __CLASS__, 'chaptername' ), SFH_NO_HASH ); |
| 20 | + $wgParser->setFunctionHook( 'chapternamee', array( __CLASS__, 'chapternamee' ), SFH_NO_HASH ); |
| 21 | + } |
| 22 | + |
| 23 | + static function DeclareVarIds( &$aCustomVariableIds ) { |
| 24 | + # aCustomVariableIds is where MediaWiki wants to store its |
| 25 | + # list of custom variable ids. We oblige by adding ours: |
| 26 | + $aCustomVariableIds[] = MAG_PREVPAGENAME; |
| 27 | + $aCustomVariableIds[] = MAG_PREVPAGENAMEE; |
| 28 | + $aCustomVariableIds[] = MAG_NEXTPAGENAME; |
| 29 | + $aCustomVariableIds[] = MAG_NEXTPAGENAMEE; |
| 30 | + $aCustomVariableIds[] = MAG_ROOTPAGENAME; |
| 31 | + $aCustomVariableIds[] = MAG_ROOTPAGENAMEE; |
| 32 | + $aCustomVariableIds[] = MAG_CHAPTERNAME; |
| 33 | + $aCustomVariableIds[] = MAG_CHAPTERNAMEE; |
| 34 | + return true; |
| 35 | + } |
| 36 | + |
| 37 | + static function LanguageGetMagic( &$magicWords, $langCode = "en" ) { |
| 38 | + switch ( $langCode ) { |
| 39 | + default: |
| 40 | + # PREVPAGENAME |
| 41 | + $magicWords[MAG_PREVPAGENAME] = array ( 0, 'PREVPAGENAME' ); |
| 42 | + $magicWords['prevpagename'] = $magicWords[MAG_PREVPAGENAME]; |
| 43 | + # PREVPAGENAME |
| 44 | + $magicWords[MAG_PREVPAGENAMEE] = array ( 0, 'PREVPAGENAMEE' ); |
| 45 | + $magicWords['prevpagenamee'] = $magicWords[MAG_PREVPAGENAMEE]; |
| 46 | + # NEXTPAGENAME |
| 47 | + $magicWords[MAG_NEXTPAGENAME] = array ( 0, 'NEXTPAGENAME' ); |
| 48 | + $magicWords['nextpagename'] = $magicWords[MAG_NEXTPAGENAME]; |
| 49 | + # NEXTPAGENAMEE |
| 50 | + $magicWords[MAG_NEXTPAGENAMEE] = array ( 0, 'NEXTPAGENAMEE' ); |
| 51 | + $magicWords['nextpagenamee'] = $magicWords[MAG_NEXTPAGENAMEE]; |
| 52 | + # ROOTPAGENAME |
| 53 | + $magicWords[MAG_ROOTPAGENAME] = array ( 0, 'ROOTPAGENAME' , 'BOOKNAME' ); |
| 54 | + $magicWords['rootpagename'] = $magicWords[MAG_ROOTPAGENAME]; |
| 55 | + # ROOTPAGENAMEE |
| 56 | + $magicWords[MAG_ROOTPAGENAMEE] = array ( 0, 'ROOTPAGENAMEE' , 'BOOKNAMEE' ); |
| 57 | + $magicWords['rootpagenamee'] = $magicWords[MAG_ROOTPAGENAMEE]; |
| 58 | + # CHAPTERNAME |
| 59 | + $magicWords[MAG_CHAPTERNAME] = array ( 0, 'CHAPTERNAME' ); |
| 60 | + $magicWords['chaptername'] = $magicWords[MAG_CHAPTERNAME]; |
| 61 | + # CHAPTERNAMEE |
| 62 | + $magicWords[MAG_CHAPTERNAMEE] = array ( 0, 'CHAPTERNAMEE' ); |
| 63 | + $magicWords['chapternamee'] = $magicWords[MAG_CHAPTERNAMEE]; |
| 64 | + } |
| 65 | + return true; |
| 66 | + } |
| 67 | +/**** All the BookManager values functions ****/ |
| 68 | + |
| 69 | + private static function newTitleObject( &$parser, $text = null ) { |
| 70 | + $t = Title::newFromText( $text ); |
| 71 | + if ( is_null( $t ) ) { |
| 72 | + return $parser->getTitle(); |
| 73 | + } |
| 74 | + return $t; |
| 75 | + } |
| 76 | + |
| 77 | + |
| 78 | + /* |
| 79 | + * Cópia da função "getBookPagePrefixes" da extensão Collection |
| 80 | + * (http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Collection/Collection.body.php?revision=79895&view=markup#l440) |
| 81 | + */ |
| 82 | + private static function getBookPagePrefixes() { |
| 83 | + // global $wgUser; |
| 84 | + global $wgCommunityCollectionNamespace; |
| 85 | + |
| 86 | + $result = array(); |
| 87 | + /* |
| 88 | + $t = wfMsgForContent( 'coll-user_book_prefix', $wgUser->getName() ); |
| 89 | + if ( wfEmptyMsg( 'coll-user_book_prefix', $t ) || $t == '-' ) { |
| 90 | + $userPageTitle = $wgUser->getUserPage()->getPrefixedText(); |
| 91 | + $result['user-prefix'] = $userPageTitle . '/' |
| 92 | + . wfMsgForContent( 'coll-collections' ) . '/'; |
| 93 | + } else { |
| 94 | + $result['user-prefix'] = $t; |
| 95 | + } |
| 96 | + */ |
| 97 | + $t = wfMsgForContent( 'coll-community_book_prefix' ); |
| 98 | + if ( wfEmptyMsg( 'coll-community_book_prefix', $t ) || $t == '-' ) { |
| 99 | + $title = Title::makeTitle( |
| 100 | + $wgCommunityCollectionNamespace, |
| 101 | + wfMsgForContent( 'coll-collections' ) |
| 102 | + ); |
| 103 | + $result['community-prefix'] = $title->getPrefixedText() . '/'; |
| 104 | + } |
| 105 | + else { |
| 106 | + $result['community-prefix'] = $t; |
| 107 | + } |
| 108 | + return $result; |
| 109 | + } |
| 110 | + |
| 111 | + /* |
| 112 | + * Simplificação da função "parseCollectionLine" da extensão Collection |
| 113 | + * (http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Collection/Collection.body.php?revision=79895&view=markup#l709) |
| 114 | + */ |
| 115 | + private static function parseCollectionLine( /* Sem uso por enquanto: &$collection, */ $line ) { |
| 116 | + $line = trim( $line ); |
| 117 | + if ( substr( $line, 0, 1 ) == ':' ) { // article |
| 118 | + $pagename = trim( substr( $line, 1 ) ); |
| 119 | + if ( preg_match( '/^\[\[:?(.*?)(\|(.*?))?\]\]$/', $pagename, $match ) ) { |
| 120 | + $pagename = $match[1]; |
| 121 | + } |
| 122 | + elseif ( preg_match( '/^\[\{\{fullurl:(.*?)\|oldid=(.*?)\}\}\s+(.*?)\]$/', $pagename, $match ) ) { |
| 123 | + $pagename = $match[1]; |
| 124 | + } |
| 125 | + else { |
| 126 | + return null; |
| 127 | + } |
| 128 | + $pagetitle = Title::newFromText( $pagename ); |
| 129 | + if ( !$pagetitle ) { |
| 130 | + return null; |
| 131 | + } |
| 132 | + $d = $pagetitle->getPrefixedText(); |
| 133 | + return $d; |
| 134 | + } |
| 135 | + return null; |
| 136 | + } |
| 137 | + |
| 138 | + /* |
| 139 | + * Adaptação da função "loadCollection" da extensão Collection |
| 140 | + * (http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Collection/Collection.body.php?revision=79895&view=markup#l780) |
| 141 | + */ |
| 142 | + private static function loadListFromCollection( $collectiontitle ) { |
| 143 | + if ( is_null( $collectiontitle ) || !$collectiontitle->exists() ) { |
| 144 | + return false; |
| 145 | + } |
| 146 | + $caps = array(); |
| 147 | + |
| 148 | + $collectionpage = new Article( $collectiontitle ); |
| 149 | + |
| 150 | + foreach ( preg_split( '/[\r\n]+/', $collectionpage->getContent() ) as $line ) { |
| 151 | + $item = self::parseCollectionLine( $line ); |
| 152 | + if ( !is_null( $item ) ) { |
| 153 | + $caps[] = $item; |
| 154 | + } |
| 155 | + } |
| 156 | + return $caps; |
| 157 | + } |
| 158 | + |
| 159 | + |
| 160 | + private static function bookparts( &$parser, $text = null, $part = 1) { |
| 161 | + $t = self::newTitleObject( $parser, $text ); |
| 162 | + // No book should have '/' in it's name, so... |
| 163 | + $book = explode( "/", $t->getText(), 2 ); // ...given a page with title like 'Foo/Bar/Baz'... |
| 164 | + if ( count($book) > 1 ) { |
| 165 | + return $book[$part];//... $book[0] is Foo, the book name, and $book[1] is Bar/Baz, the chapter name. |
| 166 | + } |
| 167 | + else{ |
| 168 | + return $t; |
| 169 | + } |
| 170 | + |
| 171 | + } |
| 172 | + /** |
| 173 | + * Get the prefixed title of a page near the given page. |
| 174 | + * @param $text String Text for title of current page |
| 175 | + * @param $n Integer Position of wanted page. Next page is +1; Previous page is -1 |
| 176 | + * @return String The prefixed title or empty string if not found or found but not valid |
| 177 | + */ |
| 178 | + private static function pageText( &$parser, $text = null, $n = 0 ) { |
| 179 | + $pagetitle = self::newTitleObject( $parser, $text ); |
| 180 | + $prefixes = self::getBookPagePrefixes(); |
| 181 | + $booktitle = Title::newFromText( $prefixes['community-prefix'] . self::bookparts( $parser, $text, 0) ); // ...the book name will be 'Foo'. |
| 182 | + $cap = self::loadListFromCollection( $booktitle ); |
| 183 | + if ( $cap === false ) { |
| 184 | + return ''; |
| 185 | + } |
| 186 | + $current = array_search( $pagetitle, $cap ); |
| 187 | + if ( $current === false || !isset( $cap[ $current + $n ] ) ) { |
| 188 | + return ''; |
| 189 | + } |
| 190 | + $otherpagetitle = Title::newFromText( $cap[ $current + $n ] ); |
| 191 | + if ( is_null( $otherpagetitle ) ) { |
| 192 | + return ''; |
| 193 | + } |
| 194 | + return wfEscapeWikiText( $otherpagetitle->getText() ); |
| 195 | + } |
| 196 | + |
| 197 | + static function prevpagename( &$parser, $text = null ) { |
| 198 | + $t = self::pageText( $parser, $text, - 1 ); |
| 199 | + return $t; |
| 200 | + } |
| 201 | + |
| 202 | + static function prevpagenamee( &$parser, $text = null ) { |
| 203 | + $t = self::pageText( $parser, $text, - 1 ); |
| 204 | + return wfUrlEncode( $t ); |
| 205 | + } |
| 206 | + |
| 207 | + static function nextpagename( &$parser, $text = null ) { |
| 208 | + $t = self::pageText( $parser, $text, + 1 ); |
| 209 | + return $t; |
| 210 | + } |
| 211 | + |
| 212 | + static function nextpagenamee( &$parser, $text = null ) { |
| 213 | + $t = self::pageText( $parser, $text, + 1 ); |
| 214 | + return wfUrlEncode( $t ); |
| 215 | + } |
| 216 | + static function rootpagename( &$parser, $text = null ) { |
| 217 | + $t = self::bookparts( $parser, $text, 0); |
| 218 | + return $t; |
| 219 | + } |
| 220 | + static function rootpagenamee( &$parser, $text = null ) { |
| 221 | + $t = self::bookparts( $parser, $text, 0); |
| 222 | + return wfUrlEncode( $t ); |
| 223 | + } |
| 224 | + static function chaptername( &$parser, $text = null ) { |
| 225 | + $t = self::bookparts( $parser, $text, 1); |
| 226 | + return $t; |
| 227 | + } |
| 228 | + static function chapternamee( &$parser, $text = null ) { |
| 229 | + $t = self::bookparts( $parser, $text, 1); |
| 230 | + return wfUrlEncode( $t ); |
| 231 | + } |
| 232 | + |
| 233 | +/**** All the BookManagerFunctions for use with MW Variables on the current page ****/ |
| 234 | + |
| 235 | + static function AssignAValue( &$parser, &$cache, &$magicWordId, &$ret ) { |
| 236 | + switch( $magicWordId ) { |
| 237 | + case MAG_PREVPAGENAME: |
| 238 | + $ret = BookManagerFunctions::prevpagename( $parser ); |
| 239 | + return true; |
| 240 | + case MAG_PREVPAGENAMEE: |
| 241 | + $ret = BookManagerFunctions::prevpagenamee( $parser ); |
| 242 | + return true; |
| 243 | + case MAG_NEXTPAGENAME: |
| 244 | + $ret = BookManagerFunctions::nextpagename( $parser ); |
| 245 | + return true; |
| 246 | + case MAG_NEXTPAGENAMEE: |
| 247 | + $ret = BookManagerFunctions::nextpagenamee( $parser ); |
| 248 | + return true; |
| 249 | + case MAG_ROOTPAGENAME: |
| 250 | + $ret = BookManagerFunctions::rootpagename( $parser ); |
| 251 | + return true; |
| 252 | + case MAG_ROOTPAGENAMEE: |
| 253 | + $ret = BookManagerFunctions::rootpagenamee( $parser ); |
| 254 | + return true; |
| 255 | + case MAG_CHAPTERNAME: |
| 256 | + $ret = BookManagerFunctions::chaptername( $parser ); |
| 257 | + return true; |
| 258 | + case MAG_CHAPTERNAMEE: |
| 259 | + $ret = BookManagerFunctions::chapternamee( $parser ); |
| 260 | + return true; |
| 261 | + } |
| 262 | + return false; |
| 263 | + } |
| 264 | + |
| 265 | + |
| 266 | +/** |
| 267 | +* Function that adds navigation bar |
| 268 | +* inspired by extension PageNotice |
| 269 | +* (http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/PageNotice/PageNotice.php) |
| 270 | +*/ |
| 271 | + |
| 272 | + static function addText( &$out, &$text ) { |
| 273 | + global $wgTitle, $wgParser, $wgScriptPath; |
| 274 | + $ns = $wgTitle->getNamespace(); |
| 275 | + $opt = array( |
| 276 | + 'parseinline', |
| 277 | + ); |
| 278 | + $currenttitletext = $wgTitle->getText(); |
| 279 | + $prev = self::pageText( $wgParser, $currenttitletext, - 1 ); |
| 280 | + $next = self::pageText( $wgParser, $currenttitletext, + 1 ); |
| 281 | + $base = Title::newFromText( $currenttitletext )->getBaseText(); |
| 282 | + $basetext = ( $base !== '' ) ? Title::newFromText( $base )->getSubpageText(): '' ; |
| 283 | + $prevtext = ( $prev !== '' ) ? Title::newFromText( $prev )->getSubpageText(): '' ; |
| 284 | + $nexttext = ( $next !== '' ) ? Title::newFromText( $next )->getSubpageText(): '' ; |
| 285 | + |
| 286 | + if ( $ns === 0 ) { |
| 287 | + $BookManager = wfMsgExt( "BookManager", $opt, $prev, $prevtext, $base, $basetext, $next, $nexttext ); |
| 288 | + $BookManagerTop = wfMsgExt( "BookManager-top", $opt, $prev, $prevtext, $base, $basetext, $next, $nexttext ); |
| 289 | + $BookManagerBottom = wfMsgExt( "BookManager-bottom", $opt, $prev, $prevtext, $base, $basetext, $next, $nexttext ); |
| 290 | + if ( !wfEmptyMsg( "BookManager-top", $BookManagerTop ) ) { |
| 291 | + $text = "<div>$BookManagerTop</div>\n$text"; |
| 292 | + } |
| 293 | + elseif ( !wfEmptyMsg( "BookManager", $BookManager ) ) { |
| 294 | + $text = "<div>$BookManager</div>\n$text"; |
| 295 | + } |
| 296 | + if ( !wfEmptyMsg( "BookManager-bottom", $BookManagerBottom ) ) { |
| 297 | + $text = "$text\n<div>$BookManagerBottom</div>"; |
| 298 | + } |
| 299 | + elseif ( !wfEmptyMsg( "BookManager", $BookManager ) ) { |
| 300 | + $text = "$text\n<div>$BookManager</div>"; |
| 301 | + } |
| 302 | + } |
| 303 | + return true; |
| 304 | + } |
| 305 | + |
| 306 | + static function injectStyleAndJS( &$out, &$sk ) { |
| 307 | + global $wgOut ; |
| 308 | + $wgOut->addModuleStyles('ext.BookManager'); |
| 309 | + $wgOut->addModules( 'ext.BookManager'); |
| 310 | + return true; |
| 311 | + } |
| 312 | +} |
| 313 | + |
Property changes on: trunk/extensions/BookManager/BookManager.body.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 314 | + native |
Added: svn:executable |
2 | 315 | + * |
Index: trunk/extensions/BookManager/BookManager.i18n.php |
— | — | @@ -0,0 +1,16 @@ |
| 2 | +<?php |
| 3 | +$messages = array(); |
| 4 | +$messages['en'] = array( |
| 5 | + 'BookManager' => '<ul class="book-navigation"> |
| 6 | +<li class="prev">[[$1|$2]]</li> |
| 7 | +<li class="index"> [[$3|$4]]</li> |
| 8 | +<li class="next">[[$5|$6]]</li> |
| 9 | +</ul>', |
| 10 | +); |
| 11 | +$messages['pt'] = array( |
| 12 | + 'BookManager' => '<ul class="book-navigation"> |
| 13 | +<li class="prev">[[$1|$2]]</li> |
| 14 | +<li class="index"> [[$3|$4]]</li> |
| 15 | +<li class="next">[[$5|$6]]</li> |
| 16 | +</ul>', |
| 17 | +); |
Property changes on: trunk/extensions/BookManager/BookManager.i18n.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 18 | + native |
Added: svn:executable |
2 | 19 | + * |
Index: trunk/extensions/BookManager/BookManager.php |
— | — | @@ -0,0 +1,82 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * This extension defines navigation in subpages. |
| 5 | + * |
| 6 | + * Defines the following functions: |
| 7 | + * - PREVPAGENAME (get prev page) |
| 8 | + * - PREVPAGENAMEE (get prev page encode) |
| 9 | + * - NEXTPAGENAME (get next page) |
| 10 | + * - NEXTPAGENAMEE (get next page encode) |
| 11 | + * - ROOTPAGENAME (get root page) |
| 12 | + * - ROOTPAGENAMEE (get root page encode) |
| 13 | + * - CHAPTERNAME (get root page) |
| 14 | + * - CHAPTERNAMEE (get root page encode) |
| 15 | + * @addtogroup Extensions |
| 16 | + * @author Raylton P. Sousa <raylton.sousa@gmail.com> |
| 17 | + * @license GNU General Public License 3.0 or later |
| 18 | +** |
| 19 | +** |
| 20 | + This program is free software; you can redistribute it and/or modify |
| 21 | + it under the terms of the GNU General Public License as published by |
| 22 | + the Free Software Foundation; either version 3 of the License, or |
| 23 | + (at your option) any later version. |
| 24 | + |
| 25 | + This program is distributed in the hope that it will be useful, |
| 26 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 27 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 28 | + GNU General Public License for more details. |
| 29 | + |
| 30 | + You should have received a copy of the GNU General Public License along |
| 31 | + with this program; if not, write to the Free Software Foundation, Inc., |
| 32 | + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 33 | + http://www.gnu.org/copyleft/gpl.html |
| 34 | +*/ |
| 35 | + |
| 36 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| 37 | + die( 'This file is a MediaWiki extension, it is not a valid entry point' ); |
| 38 | +} |
| 39 | + |
| 40 | +/* Copyied from extensions/Collection/Collection.php */ |
| 41 | +/** Namespace for "community books" */ |
| 42 | +$dir = dirname( __FILE__ ); |
| 43 | +$wgCommunityCollectionNamespace = NS_PROJECT; |
| 44 | +$wgAutoloadClasses['BookManagerFunctions'] = $dir . '/BookManager.body.php'; |
| 45 | +/**** extension basics ****/ |
| 46 | +$wgExtensionCredits['parserhook'][] = array( |
| 47 | + 'name' => 'BookManager', |
| 48 | + 'version' => BookManagerFunctions::VERSION, |
| 49 | + 'author' => 'Raylton P. Sousa & Helder.wiki', |
| 50 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:BookManager', |
| 51 | + 'description' => 'Tools for books', |
| 52 | +); |
| 53 | + |
| 54 | +/**** Register magic words ****/ |
| 55 | +$wgExtensionFunctions[] = 'BookManagerFunctions::register'; |
| 56 | + |
| 57 | +define( 'MAG_PREVPAGENAME', 'magicbookmanagercustomvar0' ); |
| 58 | +define( 'MAG_PREVPAGENAMEE', 'magicbookmanagercustomvar1' ); |
| 59 | +define( 'MAG_NEXTPAGENAME', 'magicbookmanagercustomvar2' ); |
| 60 | +define( 'MAG_NEXTPAGENAMEE', 'magicbookmanagercustomvar3' ); |
| 61 | +define( 'MAG_ROOTPAGENAME', 'magicbookmanagercustomvar4' ); |
| 62 | +define( 'MAG_ROOTPAGENAMEE', 'magicbookmanagercustomvar5' ); |
| 63 | +define( 'MAG_CHAPTERNAME', 'magicbookmanagercustomvar6' ); |
| 64 | +define( 'MAG_CHAPTERNAMEE', 'magicbookmanagercustomvar7' ); |
| 65 | +$wgResourceModules['ext.BookManager'] = array( |
| 66 | + 'scripts' => 'bookmanager.js', |
| 67 | + 'styles' => 'bookmanager.css', |
| 68 | + 'messages' => array( 'BookManager', 'BookManager-top', 'BookManager-bottom' ), |
| 69 | + 'dependencies' => array( 'jquery', 'mediawiki.util'), |
| 70 | + 'localBasePath' => $dir, |
| 71 | + 'remoteExtPath' => 'BookManager' |
| 72 | +); |
| 73 | +$wgHooks['LanguageGetMagic'][] = 'BookManagerFunctions::LanguageGetMagic'; |
| 74 | + |
| 75 | +$wgHooks['MagicWordwgVariableIDs'][] = 'BookManagerFunctions::DeclareVarIds'; |
| 76 | + |
| 77 | +$wgHooks['ParserGetVariableValueSwitch'][] = 'BookManagerFunctions::AssignAValue'; |
| 78 | + |
| 79 | +$wgHooks['OutputPageBeforeHTML'][] = 'BookManagerFunctions::addText'; |
| 80 | + |
| 81 | +$wgHooks['BeforePageDisplay'][] = 'BookManagerFunctions::injectStyleAndJS'; |
| 82 | + |
| 83 | +$wgExtensionMessagesFiles['BookManager'] = $dir . '/BookManager.i18n.php'; |
Property changes on: trunk/extensions/BookManager/BookManager.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 84 | + native |
Added: svn:executable |
2 | 85 | + * |
Index: trunk/extensions/BookManager/bookmanager.css |
— | — | @@ -0,0 +1,37 @@ |
| 2 | +.book-navigation{ |
| 3 | + -moz-border-radius:4px; /* Firefox, etc */ |
| 4 | + -khtml-border-radius:4px; /* Konqueror, etc */ |
| 5 | + -webkit-border-radius:4px; /* Safari, Google Chrome, etc */ |
| 6 | + -opera-border-radius:4px; /* Opera */ |
| 7 | + border-radius:4px; |
| 8 | + padding:8px; |
| 9 | + border: 1px solid #a7d7f9; |
| 10 | + background-color:#eaf2f8; |
| 11 | + margin:5px auto; |
| 12 | + font-size:95%; |
| 13 | + display:table; |
| 14 | + clear:both; |
| 15 | +} |
| 16 | +.book-navigation li{ |
| 17 | + list-style:none; |
| 18 | + display:inline; |
| 19 | + display:table-cell; |
| 20 | + } |
| 21 | +.book-navigation .prev, .book-navigation .next{ |
| 22 | + white-space:nowrap; |
| 23 | +} |
| 24 | +.book-navigation .index{ |
| 25 | + padding:0 5em; |
| 26 | +} |
| 27 | +.book-navigation .prev a{ |
| 28 | + background:url("images/18px-1leftarrow.png") no-repeat scroll left center transparent; |
| 29 | + padding:0 0 0 20px; |
| 30 | +} |
| 31 | +.book-navigation .index a{ |
| 32 | + background:url("images/18px-1uparrow.png") no-repeat scroll left center transparent; |
| 33 | + padding:0 0 0 20px; |
| 34 | +} |
| 35 | +.book-navigation .next a{ |
| 36 | + background:url("images/18px-1rightarrow.png") no-repeat scroll right center transparent; |
| 37 | + padding:0 20px 0 0; |
| 38 | +} |
Property changes on: trunk/extensions/BookManager/bookmanager.css |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 39 | + native |