| /plugin/struct/ |
| H A D | helper.php | 14 use dokuwiki\plugin\struct\meta\Schema; alias 40 * Get the structured data of a given page 42 * @param string $page The page to get data for 43 * @param string|null $schema The schema to use null for all 45 * @return array ('schema' => ( 'fieldlabel' => 'value', ...)) 48 public function getData($page, $schema = null, $time = 0) argument 50 $page = cleanID($page); 55 if (is_null($schema)) { 57 $schemas = $assignments->getPageAssignments($page, false); 59 $schemas = [$schema]; [all …]
|
| H A D | remote.php | 35 * Get the structured data of a given page 37 * @param string $page The page to get data for 38 * @param string $schema The schema to use empty for all 40 * @return array ('schema' => ( 'fieldlabel' => 'value', ...)) 44 public function getData($page, $schema, $time) argument 46 $page = cleanID($page); 48 if (auth_quickaclcheck($page) < AUTH_READ) { 49 throw new AccessDeniedException('no permissions to access data of that page'); 52 if (!$schema) $schema = null; 55 return $this->hlp->getData($page, $schema, $time); [all …]
|
| /plugin/struct/action/ |
| H A D | move.php | 16 use dokuwiki\plugin\struct\meta\Schema; alias 19 use dokuwiki\plugin\struct\types\Page; alias 39 * Renames all occurrences of a page ID in the database 42 * @param bool $ispage is this a page move operation? 65 $schemas = Schema::getAll(); 67 $schema = new Schema($table); 68 foreach ($schema->getColumns() as $col) { 70 if (get_class($col->getType()) == Page::class) { 71 $this->updateColumnID($schema, $col, $old, $new, true); 73 $this->updateColumnLookup($schema, $col, $old, $new); [all …]
|
| H A D | output.php | 13 use dokuwiki\plugin\struct\meta\Schema; alias 18 * This action component handles the automatic output of all schema data that has been assigned 19 * to the current page by appending the appropriate instruction to the handler calls. 42 * Appends the instruction to render our syntax output component to each page 94 * If the page has a schema assigned, add its struct data 113 foreach ($data as $schema => $fields) { 114 $schemaObject = new Schema($schema); 123 … $placeholder = sprintf('@%s_%s_%s@', self::DW2PDF_PLACEHOLDER_PREFIX, $schema, $field);
|
| /plugin/struct/_test/ |
| H A D | StructTest.php | 40 * Creates a schema from one of the available schema files 42 * @param string $schema 43 * @param string $json base name of the JSON file optional, defaults to $schema 46 protected function loadSchemaJSON($schema, $json = '', $rev = 0) argument 48 if (!$json) $json = $schema; 54 $importer = new SchemaImporter($schema, file_get_contents($file)); 57 throw new \RuntimeException("build of $schema from $file failed"); 62 * Saves struct data for given page and schema 65 * not the page and changelog entries. 67 * @param string $page [all …]
|
| H A D | AssignmentsTest.php | 17 $this->assertTrue($ass->matchPagePattern('some:ns:page', 'some:ns:page')); 18 $this->assertTrue($ass->matchPagePattern('some:ns:*', 'some:ns:page')); 19 $this->assertTrue($ass->matchPagePattern('some:**', 'some:ns:page')); 20 $this->assertTrue($ass->matchPagePattern('**', 'some:ns:page')); 22 $this->assertFalse($ass->matchPagePattern('some:ns:page', 'some:ns:other')); 26 $this->assertTrue($ass->matchPagePattern('/page/', 'somepagehere')); 27 $this->assertFalse($ass->matchPagePattern('/:page/', 'somepagehere')); 28 $this->assertTrue($ass->matchPagePattern('/:page/', 'some:pagehere')); 29 $this->assertTrue($ass->matchPagePattern('/:page/', 'pagehere')); 47 // old page is still known [all …]
|
| H A D | AggregationResultsTest.php | 41 // assign a schema 62 * Test whether serial syntax produces a table of serial data limited to current page 68 $schema = 'schema1'; 69 $result = $this->fetchNonPageResults($schema, $id); 85 $schema = 'schema1'; 86 $result = $this->fetchNonPageResults($schema, 'test0'); 89 $result = $this->fetchNonPageResults($schema, 'test0', ['first', '=', 'foo0', 'AND']); 92 $result = $this->fetchNonPageResults($schema, 'test0', ['first', '!=', 'foo0', 'AND']); 99 $schema = 'schema1'; 100 $result = $this->fetchAllResults($schema, ''); [all …]
|
| /plugin/struct/_test/json/ |
| H A D | moves.struct.json | 3 "schema": "moves", string 12 "label": "page", 13 "class": "Page", 48 "class": "Page", 89 "schema": "moves", string 90 "field": "page", 119 "schema": "moves", string 120 "field": "page", 209 "class": "Page", 244 "class": "Page",
|
| H A D | tag.struct.json | 3 "schema": "tag", string 18 "page": "", string 51 "page": "", string
|
| H A D | pageschema.struct.json | 3 "schema": "pageschema", string 12 "class": "Page", 45 "class": "Page", 78 "class": "Page", 111 "class": "Page",
|
| /plugin/struct/meta/ |
| H A D | AccessTable.php | 17 /** @var Schema */ 18 protected $schema; variable in dokuwiki\\plugin\\struct\\meta\\AccessTable 59 $schema = new Schema($tablename, $ts); 60 return new AccessTablePage($schema, $pid, $ts, 0); 65 $schema = new Schema($tablename, 0); 66 return new AccessTableSerial($schema, $pid, 0, $rid); 71 $schema = new Schema($tablename, 0); 72 return new AccessTableGlobal($schema, '', 0, $rid); 76 * Factory method returning the appropriate data accessor (page, global or serial) 78 * @param Schema $schema schema to load [all …]
|
| H A D | CSVSerialImporter.php | 11 * Import page schema only when the pid header is present. 17 throw new StructException('There is no "pid" header in the CSV. Schema not imported.'); 27 // create new page 37 * Create a page with serial syntax, either from a namespace template with _serial suffix 53 $schema = $this->schema->getTable(); 56 schema: $schema 64 * Check if page id realy exists
|
| H A D | AccessTablePage.php | 9 * This class is for accessing the data stored for a page in a schema 16 public function __construct($schema, $pid, $ts = 0, $rid = 0) argument 19 parent::__construct($schema, $pid, $ts, $rid); 23 * adds an empty data set for this schema and page 25 * This is basically a delete for the schema fields of a page 33 foreach ($this->schema->getColumns() as $col) { 49 $table = 'data_' . $this->schema->getTable(); 77 * Remove latest status from previous page data
|
| H A D | CSVImporter.php | 5 use dokuwiki\plugin\struct\types\Page; alias 16 /** @var Schema */ 17 protected $schema; variable in dokuwiki\\plugin\\struct\\meta\\CSVImporter 38 * @var string data type, must be one of page, global, serial 54 $this->schema = new Schema($table); 55 if (!$this->schema->getId()) throw new StructException('Schema does not exist'); 104 * Read the CSV headers and match it with the Schema columns 112 // we might have to create a page column first 114 $pageType = new Page(null, 'pid'); 115 $pidCol = new Column(0, $pageType, 0, true, $this->schema->getTable()); [all …]
|
| H A D | InlineConfigParser.php | 10 * {{$schema.field}} 11 * {{$pageid.schema.field}} 16 * If no page ID or filter is supplied, filter: "%pageid% = $ID$" is added. 43 $filtering = false; // Whether to filter result to current page 81 // Check whether a page was specified 83 // At least page, schema and field supplied 84 $lines[] = 'schema: ' . trim($components[1]); 88 // At least schema and field supplied 89 $lines[] = 'schema: ' . trim($components[0]);
|
| H A D | CSVPageImporter.php | 13 * Import page schema only when the pid header is present. 19 throw new StructException('There is no "pid" header in the CSV. Schema not imported.'); 29 //create new page revision 34 // make sure this schema is assigned 38 $this->schema->getTable() 44 * Create a page from a namespace template and replace column-label-placeholders 121 * Check if page id realy exists 129 //check if page id exists and schema is bound to the page 133 $this->errors[] = 'Page "' . $pid . '" already imported. Skipping the row.'; 145 $this->errors[] = 'Page "' . $pid . '" does not exists. Skipping the row.';
|
| H A D | Assignments.php | 9 * An assignment is created when actual struct data is attached to the page. 119 * Rechecks all assignments of a given page against the current patterns 170 * Add page to assignments 172 * @param string $page 176 public function assignPageSchema($page, $table) argument 179 return (bool)$this->sqlite->query($sql, [$page, $table]); 183 * Remove page from assignments 185 * @param string $page 189 public function deassignPageSchema($page, $table) argument 192 return (bool)$this->sqlite->query($sql, [$page, $table]); [all …]
|
| /plugin/struct/_test/action/ |
| H A D | EditTest.php | 45 * @param string $schema 49 protected function checkField(Document $pq, $schema, $name, $value) argument 54 "Field $schema.$name not found" 58 $pq->find("input[name='struct_schema_data[$schema][$name]']")->attr('value'), 59 "Field $schema.$name has wrong value" 123 $page = 'test_edit_page_wo_schema'; 126 $response = $request->get(['id' => $page, 'do' => 'edit'], '/doku.php'); 135 $page = 'test_edit_page_with_schema'; 137 $schema = 'schema2'; 138 $assignment->addPattern($page, $schema); [all …]
|
| H A D | DiffTest.php | 30 $page = 'test_save_page_without_new_text'; 32 $schema = 'schema1'; 33 $assignment->addPattern($page, $schema); 39 $schema => [ 49 $request->post(['id' => $page, 'do' => 'save'], '/doku.php'); 56 $schema => [ 66 $request->post(array('id' => $page, 'do' => 'save'), '/doku.php'); 70 $response = $request->post(['id' => $page, 'do' => 'diff'], '/doku.php');
|
| /plugin/struct/admin/ |
| H A D | schemas.php | 17 use dokuwiki\plugin\struct\meta\Schema; alias 51 $table = Schema::cleanTableName($INPUT->str('table')); 53 $builder = new SchemaBuilder($table, $INPUT->arr('schema')); 61 $builder = new Schema($table); 117 $schema = new Schema($table); 118 $schema->delete(); 121 … send_redirect(wl($ID, ['do' => 'admin', 'page' => 'struct_schemas'], true, '&')); 134 $schema = new Schema($table); 135 $schema->clear(); 138 … send_redirect(wl($ID, ['do' => 'admin', 'page' => 'struct_schemas'], true, '&')); [all …]
|
| H A D | assignments.php | 81 send_redirect(wl($ID, ['do' => 'admin', 'page' => 'struct_assignments'], true, '&')); 104 echo '<input type="hidden" name="page" value="struct_assignments" />'; 117 $schema = $assignment['tbl']; 124 'page' => 'struct_assignments', 127 'assignment[tbl]' => $schema, 134 echo '<td>' . hsc($schema) . '</td>'; 145 foreach ($schemas as $schema) { 146 if ($schema->isInternal()) continue; 147 $table = $schema->getTable(); 160 * Copies the TOC from the Schema Editor
|
| /plugin/struct/script/ |
| H A D | SchemaEditor.js | 3 * Handle tabs in the Schema Editor 20 * Toggle the disabled class in the schema editor 28 * Confirm Schema Deletion 31 var schema = jQuery(this).closest('tr').find('td:nth-child(2)').text(); 32 var page = jQuery(this).closest('tr').find('td:nth-child(1)').text(); 33 …if (!window.confirm(formatString(LANG.plugins.struct['confirmAssignmentsDelete'], schema, page))) {
|
| H A D | AggregationEditor.js | 9 const schema = $table.parents('.structaggregation').data('schema'); 10 if (!schema) return; 40 if (rid === '') return; // skip button addition for page data 57 schema: schema, property 117 // if page id needs to be passed to backend, add pid 123 }).appendTo($form); // add the page id to the form
|
| /plugin/struct/helper/ |
| H A D | field.php | 4 use dokuwiki\plugin\struct\meta\Schema; alias 9 use dokuwiki\plugin\struct\types\Page; alias 155 * Special handling for Page and Lookup literal form values. 164 // page fields might need to be JSON encoded depending on usetitles config 166 $this->column->getType() instanceof Page 219 * Tries to find the correct column and schema 229 throw new StructException('Field \'%s\' not given in schema.field form', $colname); 231 $schema = new Schema($table); 232 return $schema->findColumn($label);
|
| /plugin/struct/types/ |
| H A D | Lookup.php | 11 use dokuwiki\plugin\struct\meta\Schema; alias 20 'schema' => '', 39 $this->config['schema'] = Schema::cleanTableName($this->config['schema']); 50 $this->column = $this->getColumn($this->config['schema'], $this->config['field']); 65 $table = new Schema($table); 67 // schema does not exist 68 msg(sprintf('Schema %s does not exist', $table), -1); 81 $column = new PageColumn(0, new Page(), $table); 84 $column = new PageColumn(0, new Page(['usetitles' => true]), $table); 121 $schema = $this->config['schema']; [all …]
|