26,12 → 26,16 |
|
protected $_makeTooltip; |
|
public function __construct($defaultPrefix = '', $defaultSuffix = '', $makeTooltip = false) |
/* (non-PHPdoc) @see Footnote::_html4Compat */ |
protected $_html4Compat; |
|
public function __construct($defaultPrefix = '', $defaultSuffix = '', $makeTooltip = false, $html4Compatible = false) |
{ |
$this->clear(); |
$this->_defaultPrefix = $defaultPrefix; |
$this->_defaultSuffix = $defaultSuffix; |
$this->_makeTooltip = $makeTooltip; |
$this->_html4Compat = $html4Compatible; |
} |
|
public function __get($name) |
63,6 → 67,8 |
* Sign of the footnote. If empty, the next available number is used. |
* @param string $text |
* Text for the footnote |
* @param string $tooltip |
* Tooltip for the footnote |
* @return string |
* The code for printing the footnote reference. |
*/ |
83,7 → 89,8 |
|
$footnotes[$name] = new Footnote($name, $sign, $text, |
$this->_defaultSuffix, $this->_defaultPrefix, |
$this->_makeTooltip ? ($tooltip !== null ? $tooltip : $text) : ''); |
$this->_makeTooltip ? ($tooltip !== null ? $tooltip : $text) : '', |
$this->_html4Compat); |
} |
|
return $footnotes[$name]->getRef(); |
177,6 → 184,14 |
protected $_tooltip = ''; |
|
/** |
* HTML 4 compatibility: If <code>true</code>, generates |
* <code>name</code> attributes. Default: <code>false</code>. |
* |
* @var boolean |
*/ |
protected $_html4Compat = false; |
|
/** |
* The number of times this footnote has been referred |
* |
* @var int |
198,7 → 213,7 |
* The prefix for this footnote |
*/ |
public function __construct($name, $sign, $text, $suffix = '', $prefix = '', |
$tooltip = '') |
$tooltip = '', $html4Compatible = false) |
{ |
$this->_name = $name; |
$this->_sign = (is_numeric($sign) ? (int) $sign : $sign); |
206,6 → 221,7 |
$this->_suffix = $suffix; |
$this->_prefix = $prefix; |
$this->_tooltip = $tooltip; |
$this->_html4Compat = $html4Compatible; |
} |
|
/** |
240,7 → 256,7 |
|
$ret = "<sup><a href='#footnote-{$s}'" |
. ($this->_references === 0 |
? " name='fn-{$s}-ref' id='fn-{$s}-ref'" |
? (($this->_html4Compat ? " name='fn-{$s}-ref'" : "") . " id='fn-{$s}-ref'") |
: '') |
. ' class="footnote"' |
. ($this->_tooltip |
265,7 → 281,8 |
$s = $this->_name; |
|
echo " <tr> |
<th><sup><a name='footnote-{$s}' id='footnote-{$s}' class='footnote' |
<th><sup><a" . ($this->_html4Compat ? " name='footnote-{$s}'" : "") |
. " id='footnote-{$s}' class='footnote' |
>{$this->_sign}</a></sup><a |
href='#fn-{$s}-ref' class='backref'>↑</a></th> |
<td>{$this->_text}</td> |