public function get_datas()
 {
     global $dbh;
     //on commence par récupérer l'identifiant retourné par le sélecteur...
     $selector = $this->get_selected_selector();
     if ($selector) {
         $watch_id = $selector->get_value();
         if ($watch_id) {
             $docwatch_watch = new docwatch_watch($watch_id);
             $docwatch_watch->fetch_items();
             return $docwatch_watch->get_normalized_watch();
         }
     }
     return false;
 }
示例#2
0
             $docwatch_logo = new docwatch_logo($id);
             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;
示例#3
0
$base_noheader = 1;
$base_nobody = 1;
//Il me faut le charset pour la suite
require_once $base_path . "/includes/init.inc.php";
require_once $base_path . "/includes/error_report.inc.php";
require_once $base_path . '/includes/opac_config.inc.php';
// récupération paramètres MySQL et connection á la base
if (file_exists($base_path . '/includes/opac_db_param.inc.php')) {
    require_once $base_path . '/includes/opac_db_param.inc.php';
} else {
    die("Fichier opac_db_param.inc.php absent / Missing file Fichier opac_db_param.inc.php");
}
require_once $base_path . "/includes/global_vars.inc.php";
require_once $base_path . '/includes/opac_mysql_connect.inc.php';
$dbh = connection_mysql();
//Sessions !! Attention, ce doit être impérativement le premier include (à cause des cookies)
require_once $base_path . "/includes/session.inc.php";
require_once $base_path . '/includes/start.inc.php';
// à inclure?
require_once $base_path . "/includes/check_session_time.inc.php";
require_once $base_path . "/includes/rec_history.inc.php";
//le kit nécessaire aux veilles...
require_once $class_path . "/autoloader.class.php";
$autoloader = new autoloader();
$autoloader->add_register("docwatch", true);
//ca suffit...
if ($id) {
    $watch = new docwatch_watch($id);
    $watch->fetch_items(true);
    print $watch->get_xmlrss();
}