continue # otherwise strcmp # If this is the last element in either list, it wins $n = 0; while(true) { if($n + 1 == $an) { return -1; } if($n + 1 == $bn) { return 1; } $s = strcmp($ac[$n], $bc[$n]); if($s != 0) { return $s; } $n += 1; } } class syntax_plugin_publish extends DokuWiki_Syntax_Plugin { function getInfo(){ return publish_getInfo(); } function pattern() { return '\[APPROVALS.*?\]'; } function getType() { return 'substition'; } function getSort() { return 20; } function PType() { return 'block'; } function connectTo($mode) { $this->Lexer->addSpecialPattern($this->pattern(),$mode,'plugin_publish'); } function handle($match, $state, $pos, &$handler){ $namespace = substr($match, 11, -1); return array($match, $state, $pos, $namespace); } function render($mode, &$renderer, $data) { global $conf; if($mode == 'xhtml'){ $ns = cleanID(getNS($data[3] . ":dummy")); $dir = $conf['datadir'] . '/' . str_replace(':', '/', $ns); $pages = array(); search($pages, $dir, 'search_helper', array($ns, $this->getConf('apr_namespaces'))); if(count($pages) == 0) { $renderer->doc .= '
' . $this->getLang('apr_p_none') . '
'; return true; } usort($pages, pagesorter); # Output Table $renderer->doc .= '' . $this->getLang('apr_p_hdr_page') . ' | '; $renderer->doc .= '' . $this->getLang('apr_p_hdr_previous') . ' | '; $renderer->doc .= '' . $this->getLang('apr_p_hdr_updated') . ' | '; $renderer->doc .= '
---|---|---|
'; $renderer->doc .= $name_ns; $renderer->doc .= ' | ||
'; $renderer->doc .= $page[0]; $renderer->doc .= ' | '; $renderer->doc .= $approved; $renderer->doc .= ' | '; $renderer->doc .= $updated; $renderer->doc .= ' |
' . print_r($page, true) . ' |