/** * Save config instance data * * @param $data * @param $pinned */ function instance_config_save($data, $pinned = false) { $newdata = new stdClass(); $newdata->reports = array(); foreach ($data as $key => $value) { if (strcmp($key, 'report_' . $value) == 0) { // make the requested reports into an array $report = new stdClass(); $report->id = $value; $report->params = array(); $newdata->reports[$value] = $report; } else { $newdata->{$key} = $value; } } return parent::instance_config_save($newdata, $pinned); }