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/preprocess.php
Normal file
38
plugins/55/edittable/action/preprocess.php
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue