I created a custom module that can save nodes.
I want a checkbox that determines whether the node will be saved or not.
This is the node_save program :
global $user;
// IF (FORM_STATE [VALUE][CHECKBOX] == Checked ! ) {
$node = new stdClass();
$node->type = "services";
node_object_prepare($node);
$node->language = 'fr'; // Or e.g. 'en' if locale is enabled
$node->uid = $user->uid;
$node->status = 1; //(1 or 0): published or not
$node->promote = 0; //(1 or 0): promoted to front page
$node->comment = 1; // 0 = comments disabled, 1 = read only, 2 = read/write
$node->title = $form_state['values']['produit_de_client'];
$node->field_produit_dc['und'][0]['value'] = $produit;
$node->field_espace_dediee_categories[LANGUAGE_NONE][0]['tid']=$form_state['values']['espace_dediee'];
$node->body['und'][0]['value'] =$form_state['values']['text_service'];
$node->body['und'][0]['format'] ='full_html';
$aaz= array_filter($form_state['values']['wrapperrr']['id_offre']);
foreach($aaz as $of)
{
$node->field_offre[LANGUAGE_NONE][]['target_id'] = $of;
}
$node->field_id_prod['und'][0]['value'] = $produit;
$file = file_load($form_state['values']['image_dc']);
$file->status = FILE_STATUS_PERMANENT;
$uploaded = file_save($file);
$aaa = file_create_url($file->uri);
$node->field_produit_dc['und'][0]['value'] = $file->fid;
$url = $file->uri;
$node->field_image_serv[LANGUAGE_NONE][0]['fid'] = $file->fid;
node_object_prepare($node); // Sets some defaults. Invokes hook_prepare() and hook_node_prepare().
$node = node_submit($node); // Prepare node for saving
node_save($node);
//ELSE NO NODE WILL BE SAVED