$return["item"] = array("id" => $item_id); } } print encoding_normalize::json_encode($return); break; case "itemIndex": $return = array(); $return["action"] = $action; $return["state"] = false; if ($item_id) { if ($charset != 'utf-8') { $data = utf8_encode($data); } $data = json_decode(stripslashes($data), true); $docwatch_item = new docwatch_item($item_id); if ($docwatch_item->index($data)) { $return["state"] = true; //$return["item"] = array("id" => $item_id,"descriptors_isbd" => $docwatch_item->get_descriptors_isbd(),"tags_isbd" => $docwatch_item->get_tags_isbd()); $return["item"] = $docwatch_item->get_normalized_item(); } } print encoding_normalize::json_encode($return); break; } break; case "sources": switch ($action) { case "get_sources": if ($watch_id) { $docwatch_watch = new docwatch_watch($watch_id); print encoding_normalize::json_encode($docwatch_watch->get_normalized_datasources());