'object', 'properties' => array_merge( DiviSchema::write(), ['id' => ['type' => 'string', 'description' => 'Pfad-ID des zu verschiebenden Knotens.']], DiviSchema::position() ), 'required' => ['post_id', 'tree_rev', 'id'], 'additionalProperties' => false, ]; } public function annotations(): array { return Annotations::write(false); } protected function change(DiviPage $page, array $input, DiviComposition $composition): DiviChange|WP_Error { $id = is_string($input['id'] ?? null) ? $input['id'] : ''; $node = $page->index->find($id); if ($node === null) { return DiviErrors::unknownNode($id, $page->post); } $editor = $composition->editor(); $position = $editor->position($page->index, $input); if (is_string($position)) { return DiviErrors::position($position); } $problem = $editor->move($page->index, $node, $position); if ($problem !== null) { return Errors::invalidInput( 'Verschieben nicht möglich; nichts wurde gespeichert.', ['position' => $problem] ); } return (new DiviChange(sprintf('Knoten %s verschoben', $id)))->record($node, 'moved'); } }