1<?php
2/**
3 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
4 * @author     Terence J. Grant <tjgrant@tatewake.com>
5 */
6
7/**
8 * Return a permanent URL to a page
9 *
10 * @return string
11 * @deprecated 2020-09-19 If the template uses https://www.dokuwiki.org/devel:menus, the button to the cite page is added automatically
12 */
13function cite_getPermURL()
14{
15    global $INFO, $ID, $REV;
16
17    //get active revision
18    $rev = $REV; //$REV includes converted DATE_AT as well
19    if (!$rev) {
20        $rev = $INFO['lastmod'];
21    }
22
23    //return a URL with that
24    return wl($ID, ['rev' => $rev], true);
25}
26
27/**
28 * Return a URL to cite a page, based on the permanent URL
29 *
30 * @return string
31 * @deprecated 2020-09-19 If the template uses https://www.dokuwiki.org/devel:menus, the button to the cite page is added automatically
32 */
33function cite_getCiteURL()
34{
35    global $INFO, $ID, $REV;
36    //get active revision
37    $rev = $REV; //$REV includes converted DATE_AT as well
38    if (!$rev) {
39        $rev = $INFO['lastmod'];
40    }
41
42    //return a permanent link with citation
43    return wl($ID, ['rev' => $rev, 'do' => 'cite'], true);
44}
45