'iDo', 'email' => 'iDo@woow-fr.com', 'date' => '14/12/2005', 'name' => 'multinamespace Plugin', 'desc' => 'Now it`s possible to put a page in multiple namespace', 'url' => 'http://www.dokuwiki.org/plugin:multinamespace', ); } /** * What kind of syntax are we? */ function getType(){ return 'substition'; } /** * Where to sort in? */ function getSort(){ return 50; } /** * Connect pattern to lexer */ function connectTo($mode) { $this->Lexer->addSpecialPattern("{=.*=}",$mode,'plugin_multinamespace'); } /** * Handle the match */ function handle($match, $state, $pos, &$handler){ global $ID; $match = substr($match,2,-2); // Strip markup $match = explode('|',$match); // Split title from URL $filelist=array(); $e=explode(':',$ID); $e=$e[count($e)-1]; foreach ($match as $v) { if (strpos($ID,':')===false) $v.=':'.$ID; else $v.=':'.$e; $exists=file_exists(wikiFN($v)); // check for existence and permission if (($exists) || (auth_quickaclcheck($v) < 1)) continue; if (in_array($v, $filelist)) continue; array_push($filelist,$v); } return $filelist; } /** * Create output */ function render($mode, &$renderer, $data) { if($mode == 'xhtml'){ $this->_IncludeInNameSpace($data); $renderer->doc = ''; return true; } return false; } function _IncludeInNameSpace($data) { global $ID; foreach ($data as $v) { if ($ID!=$v) saveWikiText($v, '{{page>'.$ID.'}}', 'link from '.$ID); } } } //Setup VIM: ex: et ts=4 enc=utf-8 : ?>