Lines Matching +full:page +full:schema +(+path:plugin +path:struct) -(+path:plugin +path:struct +path:lang)
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];
63 foreach ($schemas as $schema) {
64 $schemaData = AccessTable::getPageAccess($schema, $page, $time);
65 $result[$schema] = $schemaData->getDataArray();
72 * Saves data for a given page (creates a new revision)
76 * the given schemas are no longer assigned to that page.
78 * Important: You have to check write permissions for the given page before calling
85 * @param string $page
86 * @param array $data ('schema' => ( 'fieldlabel' => 'value', ...))
90 * @todo should this try to lock the page?
94 public function saveData($page, $data, $summary = '', $minor = false) argument
96 $page = cleanID($page);
100 …if (!page_exists($page)) throw new StructException("Page does not exist. You can not attach struct…
103 $valid = AccessDataValidator::validateDataForPage($data, $page, $errors);
109 $newrevision = self::createPageRevision($page, $summary, $minor);
115 // make sure this schema is assigned
116 $assignments->assignPageSchema($page, $v->getAccessTable()->getSchema()->getTable());
129 throw new StructException('lookup save error: no permission for schema');
141 * Creates a new page revision with the same page content as before
143 * @param string $page
148 public static function createPageRevision($page, $summary = '', $minor = false) argument
151 // force a new page revision @see action_plugin_struct_entry::handle_pagesave_before()
153 saveWikiText($page, rawWiki($page), $summary, $minor);
155 $file = wikiFN($page);
163 * @param string|null $schema the schema to query, null for all
164 * @return Schema[]
167 public static function getSchema($schema = null) argument
169 if (is_null($schema)) {
170 $schemas = Schema::getAll();
172 $schemas = [$schema];
177 $result[$table] = new Schema($table);
187 * @param string|null $schema limit the result to a given schema
188 * @return array (page => (schema => true), ...)
191 public function getPages($schema = null) argument
194 return $assignments->getPages($schema);