You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1000 B

  1. <?php
  2. /**
  3. * Refbase entry renderer
  4. */
  5. abstract class RefbaseRenderer {
  6. /// Location of refbase installation (may differ from $dbHost if using https
  7. /// for instance)
  8. protected $refbaseURL = "";
  9. /**
  10. * Constructor
  11. */
  12. public function __construct() {
  13. global $wgRefbaseURL;
  14. $this->refbaseURL = $wgRefbaseURL;
  15. }
  16. /**
  17. * Instantiation subclass instances
  18. */
  19. public static function create( $outputType, $citationType = "" ) {
  20. if ( strtolower( $outputType ) == 'cite_journal' ) {
  21. return new RefbaseRendererCitationTemplate();
  22. } elseif ( strtolower( $outputType ) == 'link' ) {
  23. return new RefbaseRendererLink( $citationType );
  24. } elseif ( strtolower( $outputType ) == 'cite' ) {
  25. return new RefbaseRendererCite( $citationType );
  26. } else {
  27. return false;
  28. }
  29. }
  30. /**
  31. * Returns the list of fields to extract from the database
  32. */
  33. abstract public function getFieldList();
  34. /**
  35. * Render entries
  36. */
  37. abstract public function render( $entry, & $cite, $options );
  38. }