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 Andreas Gohr <gohr@cosmocode.de>
*/
use dokuwiki\Extension\Event;
/**
* just intercepts ACTION_ACT_PREPROCESS and emits two new events
*
* We have two action components handling above event but need them to execute in a specific order.
* That's currently not possible to guarantee, so we catch the event only once and emit two of our own
* in the right order. Once DokuWiki supports a sort we can skip this.
*/
class action_plugin_edittable_preprocess extends DokuWiki_Action_Plugin
{
/**
* Register its handlers with the DokuWiki's event controller
*/
public function register(Doku_Event_Handler $controller)
{
// register preprocessing for accepting editor data
$controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this, 'handle_preprocess');
}
/**
* See class description for WTF we're doing here
*
* @param Doku_Event $event
*/
public function handle_preprocess(Doku_Event $event)
{
Event::createAndTrigger('PLUGIN_EDITTABLE_PREPROCESS_EDITOR', $event->data);
Event::createAndTrigger('PLUGIN_EDITTABLE_PREPROCESS_NEWTABLE', $event->data);
}
}