Cite.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. if ( ! defined( 'MEDIAWIKI' ) )
  3. die();
  4. /**#@+
  5. * A parser extension that adds two tags, <ref> and <references> for adding
  6. * citations to pages
  7. *
  8. * @addtogroup Extensions
  9. *
  10. * @link http://meta.wikimedia.org/wiki/Cite/Cite.php Documentation
  11. * @link http://www.w3.org/TR/html4/struct/text.html#edef-CITE <cite> definition in HTML
  12. * @link http://www.w3.org/TR/2005/WD-xhtml2-20050527/mod-text.html#edef_text_cite <cite> definition in XHTML 2.0
  13. *
  14. * @bug 4579
  15. *
  16. * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
  17. * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
  18. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
  19. */
  20. if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
  21. $wgHooks['ParserFirstCallInit'][] = 'wfCite';
  22. } else {
  23. $wgExtensionFunctions[] = 'wfCite';
  24. }
  25. $wgExtensionCredits['parserhook'][] = array(
  26. 'name' => 'Cite',
  27. 'svn-date' => '$LastChangedDate: 2009-02-12 18:02:27 +0000 (Thu, 12 Feb 2009) $',
  28. 'svn-revision' => '$LastChangedRevision: 47190 $',
  29. 'author' => 'Ævar Arnfjörð Bjarmason',
  30. 'description' => 'Adds <nowiki><ref[ name=id]></nowiki> and <nowiki><references/></nowiki> tags, for citations', // kept for b/c
  31. 'descriptionmsg' => 'cite_desc',
  32. 'url' => 'http://www.mediawiki.org/wiki/Extension:Cite/Cite.php'
  33. );
  34. $wgParserTestFiles[] = dirname( __FILE__ ) . "/citeParserTests.txt";
  35. $wgExtensionMessagesFiles['Cite'] = dirname( __FILE__ ) . "/Cite.i18n.php";
  36. $wgAutoloadClasses['Cite'] = dirname( __FILE__ ) . "/Cite_body.php";
  37. $wgSpecialPageGroups['Cite'] = 'pagetools';
  38. define( 'CITE_DEFAULT_GROUP', '');
  39. /**
  40. * The emergency shut-off switch. Override in local settings to disable
  41. * groups; or remove all references from this file to enable unconditionally
  42. */
  43. $wgAllowCiteGroups = true;
  44. /**
  45. * An emergency optimisation measure for caching cite <references /> output.
  46. */
  47. $wgCiteCacheReferences = false;
  48. function wfCite() {
  49. new Cite;
  50. return true;
  51. }
  52. /**#@-*/