function _handle_edit_post($event) { if (!isset($_POST['data_edit'])) { return; } global $TEXT; require_once 'syntax/entry.php'; $TEXT = syntax_plugin_data_entry::editToWiki($_POST['data_edit']); }
function test_editToWiki() { $data = array('classes' => 'projects', 'data' => array(array('title' => 'type', 'type' => '', 'multi' => '', 'value' => 'web development', 'comment' => ''), array('title' => 'volume', 'type' => '', 'multi' => '', 'value' => '1 Mrd', 'comment' => 'how much do they pay?'), array('title' => 'employee', 'type' => '', 'multi' => '1', 'value' => 'Joe, Jane, Jim', 'comment' => ''), array('title' => 'customer', 'type' => 'page', 'multi' => '', 'value' => 'customers:microsoft', 'comment' => ''), array('title' => 'deadline', 'type' => 'dt', 'multi' => '', 'value' => '2009-08-17', 'comment' => ''), array('title' => 'server', 'type' => 'page', 'multi' => '1', 'value' => 'servers:devel01, extern:microsoft', 'comment' => ''), array('title' => 'Website', 'type' => 'url', 'multi' => '', 'value' => 'http://www.microsoft.com', 'comment' => ''), array('title' => 'task', 'type' => 'tag', 'multi' => '1', 'value' => 'programming, coding, design, html', 'comment' => ''), array('title' => 'tests', 'type' => '', 'multi' => '', 'value' => '#5 done', 'comment' => ''), array('title' => '', 'type' => '', 'multi' => '', 'value' => '', 'comment' => ''))); $plugin = new syntax_plugin_data_entry(); $this->assertEquals($this->exampleEntry, $plugin->editToWiki($data)); }