From 244c6e4739fac9a37b63b34c73121dce1c3cdada Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Fri, 8 Sep 2017 03:03:04 +0200 Subject: [PATCH] removes php7 warnings --- bibtexbrowser.php | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/bibtexbrowser.php b/bibtexbrowser.php index ead0c12..580f601 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -483,7 +483,7 @@ class StateBasedBibtexParser { var $delegate; - function StateBasedBibtexParser(&$delegate) { + function __construct(&$delegate) { $this->delegate = &$delegate; } @@ -773,7 +773,7 @@ class XMLPrettyPrinter extends ParserDelegate { /** represents @string{k=v} */ class StringEntry { - function StringEntry($k, $v, $filename) { + function __construct($k, $v, $filename) { $this->name=$k; $this->value=$v; $this->filename=$filename; @@ -1163,7 +1163,7 @@ class BibEntry { /** Creates an empty new bib entry. Each bib entry is assigned a unique * identification number. */ - function BibEntry() { + function __construct() { } /** Sets the name of the file containing this entry */ @@ -2344,7 +2344,7 @@ function DefaultBibliographyStyle(&$bibentry) { usage: Add the following line in "bibtexbrowser.local.php"
-define('BIBLIOGRAPHYSTYLE','JanosBibliographyStyle');
+@define('BIBLIOGRAPHYSTYLE','JanosBibliographyStyle');
 
*/ function JanosBibliographyStyle(&$bibentry) { @@ -2447,8 +2447,8 @@ function JanosBibliographyStyle(&$bibentry) { * * usage: Add the following lines to "bibtexbrowser.local.php"
-define('BIBLIOGRAPHYSTYLE','VancouverBibliographyStyle');
-define('USE_INITIALS_FOR_NAMES',true);
+@define('BIBLIOGRAPHYSTYLE','VancouverBibliographyStyle');
+@define('USE_INITIALS_FOR_NAMES',true);
 
*/ @@ -2624,7 +2624,7 @@ usage: */ class IndependentYearMenu { - function IndependentYearMenu($db) { + function __construct($db) { $yearIndex = $db->yearIndex(); echo '
Year: '; $formatedYearIndex = array(); @@ -2731,7 +2731,7 @@ class MenuManager { var $author_size = AUTHORS_SIZE; var $tag_size = TAGS_SIZE; - function MenuManager() { + function __construct() { } /** sets the database that is used to create the menu */ @@ -2773,7 +2773,7 @@ class MenuManager { ?>
- +
@@ -3075,6 +3075,8 @@ class SimpleDisplay { var $options = array(); + var $entries = array(); + var $headingLevel = BIBTEXBROWSER_HTMLHEADINGLEVEL; function incHeadingLevel ($by=1) { $this->headingLevel += $by; @@ -3328,7 +3330,7 @@ class BibEntryDisplay { /** the bib entry to display */ var $bib; - function BibEntryDisplay($bib=null) { + function __construct($bib=null) { $this->bib = $bib; } @@ -3686,7 +3688,7 @@ class BibDataBase { } /** Creates a new empty database */ - function BibDataBase() { + function __construct() { $this->bibdb = array(); $this->stringdb = array(); } @@ -4172,12 +4174,12 @@ usage: */ class BibtexDisplay { - function BibtexDisplay() {} + function __construct() {} function setTitle($title) { $this->title = $title; return $this; } /** sets the entries to be shown */ - function setEntries(&$entries) { + function setEntries($entries) { $this->entries = $entries; } @@ -4208,7 +4210,7 @@ class PagedDisplay { var $query = array(); - function PagedDisplay() { + function __construct() { $this->setPage(); } @@ -4298,7 +4300,7 @@ class RSSDisplay { var $title = 'RSS produced by bibtexbrowser'; - function RSSDisplay() { + function __construct() { // nothing by default } @@ -4348,8 +4350,8 @@ class RSSDisplay { <?php echo $this->title;?> - http:// - + http:// + bibtexbrowser v__GITHUB__ @@ -4407,7 +4409,7 @@ class Dispatcher { /** The BibDataBase object */ var $db = null; - function Dispatcher() {} + function __construct() {} /** returns the underlying BibDataBase object */ function getDB() {