Adding edittable version 2023-01-14 (66785d9).
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
51b386fcf7
commit
778f9ac0bf
101 changed files with 56770 additions and 0 deletions
38
plugins/55/edittable/action/sectionjump.php
Normal file
38
plugins/55/edittable/action/sectionjump.php
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue