mirror of
https://github.com/cosmocode/edittable.git
synced 2026-01-05 06:21:54 +00:00
fix deprecated JSON class
This commit is contained in:
@ -52,10 +52,9 @@ EOF;
|
||||
);
|
||||
|
||||
$renderer = $this->render($input);
|
||||
$json = new JSON(JSON_LOOSE_TYPE);
|
||||
|
||||
$this->assertEquals($data, $json->decode($renderer->getDataJSON()));
|
||||
$this->assertEquals($meta, $json->decode($renderer->getMetaJSON()));
|
||||
$this->assertEquals($data, json_decode($renderer->getDataJSON(), true));
|
||||
$this->assertEquals($meta, json_decode($renderer->getMetaJSON(), true));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -122,14 +122,14 @@ class action_plugin_edittable_editor extends DokuWiki_Action_Plugin {
|
||||
*
|
||||
* @author Andreas Gohr <gohr@cosmocode,de>
|
||||
*/
|
||||
public function handle_table_post($event) {
|
||||
public function handle_table_post(Doku_Event $event)
|
||||
{
|
||||
global $TEXT;
|
||||
global $INPUT;
|
||||
if(!$INPUT->post->has('edittable_data')) return;
|
||||
if (!$INPUT->post->has('edittable_data')) return;
|
||||
|
||||
$json = new JSON(JSON_LOOSE_TYPE);
|
||||
$data = $json->decode($INPUT->post->str('edittable_data'));
|
||||
$meta = $json->decode($INPUT->post->str('edittable_meta'));
|
||||
$data = json_decode($INPUT->post->str('edittable_data'), true);
|
||||
$meta = json_decode($INPUT->post->str('edittable_meta'), true);
|
||||
|
||||
$TEXT = $this->build_table($data, $meta);
|
||||
}
|
||||
|
||||
@ -35,8 +35,7 @@ class renderer_plugin_edittable_json extends renderer_plugin_edittable_inverse {
|
||||
* @return array
|
||||
*/
|
||||
public function getDataJSON() {
|
||||
$json = new JSON();
|
||||
return $json->encode($this->tdata);
|
||||
return json_encode($this->tdata);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -45,8 +44,7 @@ class renderer_plugin_edittable_json extends renderer_plugin_edittable_inverse {
|
||||
* @return array
|
||||
*/
|
||||
public function getMetaJSON() {
|
||||
$json = new JSON();
|
||||
return $json->encode($this->tmeta);
|
||||
return json_encode($this->tmeta);
|
||||
}
|
||||
|
||||
// renderer functions below
|
||||
|
||||
Reference in New Issue
Block a user