*/ class syntax_plugin_acknowledge_listing extends DokuWiki_Syntax_Plugin { /** @inheritDoc */ public function getType() { return 'substition'; } /** @inheritDoc */ public function getPType() { return 'block'; } /** @inheritDoc */ public function getSort() { return 155; } /** @inheritDoc */ public function connectTo($mode) { $this->Lexer->addSpecialPattern('~~ACKNOWLEDGE~~', $mode, 'plugin_acknowledge_listing'); } /** @inheritDoc */ public function handle($match, $state, $pos, Doku_Handler $handler) { } /** @inheritDoc */ public function render($mode, Doku_Renderer $renderer, $data) { if ($mode !== 'xhtml') { return false; } $renderer->info['cache'] = false; $renderer->doc .= '
'; $renderer->doc .= $this->getListing(); $renderer->doc .= '
'; return true; } /** * Returns the list of pages to be acknowledged by the user * * @return string */ protected function getListing() { global $INPUT; $user = $INPUT->server->str('REMOTE_USER'); if ($user === '') return ''; /** @var helper_plugin_acknowledge $helper */ $helper = plugin_load('helper', 'acknowledge'); $pending = $helper->getUserAssignments($user); $html = $this->getLang('ackNotFound'); if (!empty($pending)) { $html = ''; } return $html; } }