1
0
Fork 0

Adding edittable version 2023-01-14 (66785d9).

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2024-12-01 20:32:06 +01:00
parent 51b386fcf7
commit 778f9ac0bf
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
101 changed files with 56770 additions and 0 deletions

View file

@ -0,0 +1,38 @@
<?php
/**
* Table editor
*
* @author Adrian Lang <lang@cosmocode.de>
*/
/**
* redirect to the section containg the table
*/
class action_plugin_edittable_sectionjump extends DokuWiki_Action_Plugin
{
/**
* Register its handlers with the DokuWiki's event controller
*/
function register(Doku_Event_Handler $controller)
{
$controller->register_hook('ACTION_SHOW_REDIRECT', 'BEFORE', $this, 'jump_to_section');
}
/**
* Jump after save to the section containing this table
*
* @param Doku_Event $event
*/
function jump_to_section($event)
{
global $INPUT;
if (!$INPUT->has('edittable_data')) return;
global $PRE;
if (preg_match_all('/^\s*={2,}([^=\n]+)/m', $PRE, $match, PREG_SET_ORDER)) {
$check = false; //Byref
$match = array_pop($match);
$event->data['fragment'] = sectionID($match[1], $check);
}
}
}