get_display_list(); } function show_connector_out_form($connector_id) { global $msg; print '
'; } function show_sourceout_form($source_id=0, $connector_id, $name="", $comment="", $config_form=NULL) { global $msg; print ''; } /*$conn = new connecteur_out(0, "dummy"); highlight_string(print_r($conn, true)); echo $conn->ckeck_api_requirements();*/ /*$conns = new connecteurs_out(); highlight_string(print_r($conns, true));*/ switch ($action) { case "update": $daconn = instantiate_connecteur_out($id); if ($daconn) { $daconn->update_config_from_form(); $daconn->commit_to_db(); } list_connectors_out(); break; case "edit": show_connector_out_form($id); break; case "source_add": if (!$connector_id) { list_connectors_out(); break; } $daconn = instantiate_connecteur_out($connector_id); if (!$daconn) { list_connectors_out(); break; } $source_object = $daconn->instantiate_source_class(0); show_sourceout_form($id, $connector_id, "", "", array($source_object, 'get_config_form')); break; case "source_del": if (!$id) { list_connectors_out(); break; } connecteur_out_source::delete($id); list_connectors_out(); break; case "source_edit": if (!$connector_id || !$source_id) { list_connectors_out(); break; } $daconn = instantiate_connecteur_out($connector_id); if (!$daconn) { list_connectors_out(); break; } $source_object = $daconn->instantiate_source_class($source_id); show_sourceout_form($source_object->id, $connector_id, $source_object->name, $source_object->comment, array($source_object, 'get_config_form')); break; case "source_update": if (!$connector_id) { list_connectors_out(); break; } if (!$id) { //Création d'une nouvelle source //Récupération d'un nouvel id d'une nouvelle source générique vide $new_source = connecteur_out_source::add_new($connector_id); $new_source_id = $new_source->id; //Instantiation de cette nouvelle source en tant que source du connecteur $daconn = instantiate_connecteur_out($connector_id); if (!$daconn) { list_connectors_out(); break; } $source_object = $daconn->instantiate_source_class($new_source_id); //Mise à jour $source_object->update_config_from_form(); $source_object->commit_to_db(); } else { //Modification d'une source existante if (!$connector_id || !$id) { list_connectors_out(); break; } $daconn = instantiate_connecteur_out($connector_id); if (!$daconn) { list_connectors_out(); break; } $source_object = $daconn->instantiate_source_class($id); $source_object->update_config_from_form(); $source_object->commit_to_db(); } list_connectors_out(); break; default: list_connectors_out(); break; }