71 lines
1.5 KiB
PHP
71 lines
1.5 KiB
PHP
<?php
|
|
if (!defined('_ECRIRE_INC_VERSION')){
|
|
return;
|
|
}
|
|
|
|
|
|
function formulaires_bigform_charger_dist($objet, $id_objet, $mode = 'auto', $args = []) {
|
|
$valeurs = [
|
|
'_bigup_rechercher_fichiers' => true,
|
|
'id_objet' => $id_objet,
|
|
'objet' => $objet
|
|
];
|
|
|
|
|
|
$valeurs['objet_ok'] = '';
|
|
|
|
if (intval($id_objet) > 0 and $objet) {
|
|
$valeurs['objet_ok'] = 'ok';
|
|
}
|
|
|
|
return $valeurs;
|
|
}
|
|
|
|
function formulaires_bigform_verifier_dist($objet, $id_objet, $mode = 'auto', $args = []) {
|
|
$erreurs = [];
|
|
|
|
$options = pipeline('bigform_verifier', [
|
|
'args' => [
|
|
'id_objet' => $id_objet,
|
|
'objet' => $objet,
|
|
'mode' => $mode,
|
|
'args' => $args
|
|
],
|
|
'data' => []
|
|
]);
|
|
|
|
$bigform = charger_fonction('bigform_verifier','inc');
|
|
$bigform($options,$erreurs);
|
|
|
|
return $erreurs;
|
|
}
|
|
|
|
function formulaires_bigform_traiter_dist($objet = 'article', $id_objet = 0, $mode = 'auto', $args = []) {
|
|
|
|
$options_secu = [];
|
|
if (array_key_exists('proteger', $args)) {
|
|
$options_secu['proteger'] = true;
|
|
}
|
|
if (array_key_exists('obfusquer', $args)) {
|
|
$options_secu['obfusquer'] = true;
|
|
}
|
|
|
|
$bigform = charger_fonction('bigform_traiter','inc');
|
|
$T = $bigform($id_objet,$objet,$mode, $options_secu);
|
|
|
|
pipeline('bigform_post_insertion', [
|
|
'args' => [
|
|
'id_objet' => $id_objet,
|
|
'objet' => $objet,
|
|
'mode' => $mode,
|
|
'args' => $args,
|
|
'tId_doc' => $T
|
|
]
|
|
]);
|
|
|
|
if (!empty($args) and !empty($args['redirect'])) {
|
|
return ['redirect' => $args['redirect']];
|
|
} else {
|
|
return [];
|
|
}
|
|
}
|