forked from dokufreaks/plugin-folded
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelper.php
More file actions
34 lines (29 loc) · 743 Bytes
/
helper.php
File metadata and controls
34 lines (29 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author LarsDW223
*/
// must be run within Dokuwiki
if (!defined('DOKU_INC')) die();
class helper_plugin_folded extends DokuWiki_Plugin {
static protected $ids_count = 0;
function getMethods() {
$result = array();
$result[] = array(
'name' => 'getNextID',
'desc' => 'Returns the next folded ID.',
);
return $result;
}
/**
* Returns the next folded ID.
*/
function getNextID() {
global $ID;
$hash = md5($ID);
$this->ids_count++;
$id = 'folded_'.$hash.'_'.$this->ids_count;
return $id;
}
}
// vim:ts=4:sw=4:et: