print $docwatch_logo->get_field(); break; } break; case "items": switch ($action) { case "get_items": if ($watch_id) { if (!is_object($autoloader)) { $autoloader = new autoloader(); } $autoloader->add_register("docwatch", true); $docwatch_watch = new docwatch_watch($watch_id); $docwatch_watch->sync(); $docwatch_watch->fetch_items(); if ($docwatch_watch->check_rights()) { $response = array('items' => $docwatch_watch->get_normalized_items(), 'formated_last_date' => date("c", strtotime($docwatch_watch->get_last_date())), 'sources_updated' => $docwatch_watch->get_synced_datasources()); print encoding_normalize::json_encode($response); } } break; case "markItemAsRead": $return = array(); $return["action"] = $action; $return["state"] = false; if ($item_id) { $docwatch_item = new docwatch_item($item_id); $docwatch_item->set_status(1); if ($docwatch_item->save()) { $return["state"] = true; $return["item"] = $docwatch_item->get_normalized_item();