1<?php 2/** 3 * DokuWiki Plugin struct (Syntax Component) 4 * 5 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 6 * @author Andreas Gohr, Michael Große, Anna Dabrowska <dokuwiki@cosmocode.de> 7 */ 8 9use dokuwiki\plugin\struct\meta\AccessTableData; 10 11class syntax_plugin_struct_serial extends syntax_plugin_struct_lookup { 12 13 /** 14 * Connect serial pattern to lexer. 15 * 16 * @param string $mode Parser mode 17 */ 18 public function connectTo($mode) { 19 $this->Lexer->addSpecialPattern('----+ *struct serial *-+\n.*?\n----+', $mode, 'plugin_struct_serial'); 20 } 21 22 /** 23 * Filter based on primary key columns 24 * 25 * @param array $config 26 * @return array 27 */ 28 protected function addTypeFilter($config) 29 { 30 global $ID; 31 $config['filter'][] = ['%rowid%', '!=', (string)AccessTableData::DEFAULT_PAGE_RID, 'AND']; 32 $config['filter'][] = ['%pageid%', '=', $ID, 'AND']; 33 $config['withpid'] = 1; // flag for the editor to distinguish data types 34 return $config; 35 } 36} 37