15, 'list' => array(...)); /** * We imitate an AJAX request for the data and grab it with ob_get_clean(). * Then we decode JSON data and voilà! * */ function __construct($tab = 1) { $_GET['loadTasks'] = 1; $_GET['list'] = $tab; // which tab to display $_GET['compl'] = 0; $_GET['sort'] = 0; $_GET['tz'] = 120; $_GET['rnd'] = rand(); //debug($_GET); ob_start(); require_once('todo/init.php'); $GLOBALS['lang'] = Lang::instance(); require_once('todo/ajax.php'); $json = ob_get_clean(); $this->tasks = json_decode($json, TRUE); //debug($this->tasks); } /** * Modify this function in order to display data from $this->tasks['list']. * */ function render() { require('template/head.phtml'); echo '