dokuwikisnippets
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Last revision | |||
— | dokuwikisnippets [2014/07/16 08:52] – created andi | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== DokuWiki Snippets ====== | ||
+ | Extract a list from instructions | ||
+ | |||
+ | <code php> | ||
+ | public function parseList($page) { | ||
+ | $instructions = p_cached_instructions(wikiFN($page), | ||
+ | $max = count($instructions); | ||
+ | |||
+ | $list = $this-> | ||
+ | |||
+ | dbg($list); | ||
+ | } | ||
+ | |||
+ | |||
+ | function subList(& | ||
+ | $count = 0; | ||
+ | $list = array(); | ||
+ | |||
+ | |||
+ | for(; $i<$max; $i++){ | ||
+ | if($instructions[$i][0] == ' | ||
+ | $i++; | ||
+ | if($count) { | ||
+ | $list[$count-1][' | ||
+ | } | ||
+ | }elseif($instructions[$i][0] == ' | ||
+ | return $list; | ||
+ | }elseif($instructions[$i][0] == ' | ||
+ | |||
+ | }elseif($instructions[$i][0] == ' | ||
+ | $page = $instructions[$i][1][0]; | ||
+ | $list[$count] = array( | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ); | ||
+ | $count++; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | return $list; // shouldn' | ||
+ | } | ||
+ | </ |
dokuwikisnippets.txt · Last modified: 2019/07/08 08:57 by andi