1<?php 2/** 3 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 4 * @author LarsDW223 5 */ 6 7class helper_plugin_folded extends DokuWiki_Plugin { 8 function getMethods() { 9 $result = array(); 10 $result[] = array( 11 'name' => 'getNextID', 12 'desc' => 'Returns the next folded ID.', 13 ); 14 return $result; 15 } 16 17 /** 18 * Returns the next folded ID. 19 */ 20 function getNextID() { 21 static $ids_count = 0; 22 global $ID, $ACT; 23 24 $hash = md5($ID.$ACT); 25 $ids_count++; 26 $id = 'folded_'.$hash.'_'.$ids_count; 27 return $id; 28 } 29} 30// vim:ts=4:sw=4:et: 31