@@ -1,3 +1,3 @@ |
||
| 1 | 1 | <?php |
| 2 | - # appel SPIP |
|
| 3 | - include('spip.php'); |
|
| 2 | + # appel SPIP |
|
| 3 | + include('spip.php'); |
|
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | include_spip('prive/objets/liste/auteurs_fonctions'); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | include_spip('inc/drapeau_edition'); |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 7 | - return; |
|
| 7 | + return; |
|
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | include_spip('inc/filtres_selecteur_generique'); |
@@ -142,5 +142,5 @@ |
||
| 142 | 142 | break; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - return generer_url_action('tester', "arg=$process&time=" . time()); |
|
| 145 | + return generer_url_action('tester', "arg=$process&time=".time()); |
|
| 146 | 146 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -27,24 +27,24 @@ discard block |
||
| 27 | 27 | * Environnement du formulaire |
| 28 | 28 | **/ |
| 29 | 29 | function formulaires_configurer_reducteur_charger_dist() { |
| 30 | - $valeurs = []; |
|
| 31 | - foreach ( |
|
| 32 | - [ |
|
| 33 | - 'image_process', |
|
| 34 | - 'formats_graphiques', |
|
| 35 | - 'creer_preview', |
|
| 36 | - 'taille_preview', |
|
| 37 | - ] as $m |
|
| 38 | - ) { |
|
| 39 | - $valeurs[$m] = $GLOBALS['meta'][$m] ?? null; |
|
| 40 | - } |
|
| 30 | + $valeurs = []; |
|
| 31 | + foreach ( |
|
| 32 | + [ |
|
| 33 | + 'image_process', |
|
| 34 | + 'formats_graphiques', |
|
| 35 | + 'creer_preview', |
|
| 36 | + 'taille_preview', |
|
| 37 | + ] as $m |
|
| 38 | + ) { |
|
| 39 | + $valeurs[$m] = $GLOBALS['meta'][$m] ?? null; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - $valeurs['taille_preview'] = (int) $valeurs['taille_preview']; |
|
| 43 | - if ($valeurs['taille_preview'] < 10) { |
|
| 44 | - $valeurs['taille_preview'] = 120; |
|
| 45 | - } |
|
| 42 | + $valeurs['taille_preview'] = (int) $valeurs['taille_preview']; |
|
| 43 | + if ($valeurs['taille_preview'] < 10) { |
|
| 44 | + $valeurs['taille_preview'] = 120; |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - return $valeurs; |
|
| 47 | + return $valeurs; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | |
@@ -55,53 +55,53 @@ discard block |
||
| 55 | 55 | * Retours des traitements |
| 56 | 56 | **/ |
| 57 | 57 | function formulaires_configurer_reducteur_traiter_dist() { |
| 58 | - $res = ['editable' => true]; |
|
| 58 | + $res = ['editable' => true]; |
|
| 59 | 59 | |
| 60 | - if (is_array($image_process = _request('image_process_'))) { |
|
| 61 | - $image_process = array_keys($image_process); |
|
| 62 | - $image_process = reset($image_process); |
|
| 60 | + if (is_array($image_process = _request('image_process_'))) { |
|
| 61 | + $image_process = array_keys($image_process); |
|
| 62 | + $image_process = reset($image_process); |
|
| 63 | 63 | |
| 64 | - // application du choix de vignette |
|
| 65 | - if ($image_process) { |
|
| 66 | - // mettre a jour les formats graphiques lisibles |
|
| 67 | - switch ($image_process) { |
|
| 68 | - case 'gd1': |
|
| 69 | - case 'gd2': |
|
| 70 | - $formats_graphiques = $GLOBALS['meta']['gd_formats_read']; |
|
| 71 | - break; |
|
| 72 | - case 'netpbm': |
|
| 73 | - $formats_graphiques = $GLOBALS['meta']['netpbm_formats']; |
|
| 74 | - break; |
|
| 75 | - case 'convert': |
|
| 76 | - case 'imagick': |
|
| 77 | - $formats_graphiques = 'gif,jpg,png,webp'; |
|
| 78 | - break; |
|
| 79 | - default: #debug |
|
| 80 | - $formats_graphiques = ''; |
|
| 81 | - $image_process = 'non'; |
|
| 82 | - break; |
|
| 83 | - } |
|
| 84 | - ecrire_meta('formats_graphiques', $formats_graphiques, 'non'); |
|
| 85 | - ecrire_meta('image_process', $image_process, 'non'); |
|
| 86 | - } |
|
| 87 | - } |
|
| 64 | + // application du choix de vignette |
|
| 65 | + if ($image_process) { |
|
| 66 | + // mettre a jour les formats graphiques lisibles |
|
| 67 | + switch ($image_process) { |
|
| 68 | + case 'gd1': |
|
| 69 | + case 'gd2': |
|
| 70 | + $formats_graphiques = $GLOBALS['meta']['gd_formats_read']; |
|
| 71 | + break; |
|
| 72 | + case 'netpbm': |
|
| 73 | + $formats_graphiques = $GLOBALS['meta']['netpbm_formats']; |
|
| 74 | + break; |
|
| 75 | + case 'convert': |
|
| 76 | + case 'imagick': |
|
| 77 | + $formats_graphiques = 'gif,jpg,png,webp'; |
|
| 78 | + break; |
|
| 79 | + default: #debug |
|
| 80 | + $formats_graphiques = ''; |
|
| 81 | + $image_process = 'non'; |
|
| 82 | + break; |
|
| 83 | + } |
|
| 84 | + ecrire_meta('formats_graphiques', $formats_graphiques, 'non'); |
|
| 85 | + ecrire_meta('image_process', $image_process, 'non'); |
|
| 86 | + } |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | - foreach ( |
|
| 90 | - [ |
|
| 91 | - 'creer_preview' |
|
| 92 | - ] as $m |
|
| 93 | - ) { |
|
| 94 | - if (!is_null($v = _request($m))) { |
|
| 95 | - ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 96 | - } |
|
| 97 | - } |
|
| 98 | - if (!is_null($v = _request('taille_preview'))) { |
|
| 99 | - ecrire_meta('taille_preview', (int) $v); |
|
| 100 | - } |
|
| 89 | + foreach ( |
|
| 90 | + [ |
|
| 91 | + 'creer_preview' |
|
| 92 | + ] as $m |
|
| 93 | + ) { |
|
| 94 | + if (!is_null($v = _request($m))) { |
|
| 95 | + ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 96 | + } |
|
| 97 | + } |
|
| 98 | + if (!is_null($v = _request('taille_preview'))) { |
|
| 99 | + ecrire_meta('taille_preview', (int) $v); |
|
| 100 | + } |
|
| 101 | 101 | |
| 102 | - $res['message_ok'] = _T('config_info_enregistree'); |
|
| 102 | + $res['message_ok'] = _T('config_info_enregistree'); |
|
| 103 | 103 | |
| 104 | - return $res; |
|
| 104 | + return $res; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -114,33 +114,33 @@ discard block |
||
| 114 | 114 | * URL d'action pour tester la librairie graphique en créant une vignette |
| 115 | 115 | **/ |
| 116 | 116 | function url_vignette_choix($process) { |
| 117 | - switch ($process) { |
|
| 118 | - case 'gd2': |
|
| 119 | - if (!function_exists('ImageCreateTrueColor')) { |
|
| 120 | - return ''; |
|
| 121 | - } |
|
| 122 | - break; |
|
| 123 | - case 'gd1': |
|
| 124 | - if (!function_exists('ImageGif') && !function_exists('ImageJpeg') && !function_exists('ImagePng')) { |
|
| 125 | - return ''; |
|
| 126 | - } |
|
| 127 | - break; |
|
| 128 | - case 'netpbm': |
|
| 129 | - if (defined('_PNMSCALE_COMMAND') && _PNMSCALE_COMMAND == '') { |
|
| 130 | - return ''; |
|
| 131 | - } |
|
| 132 | - break; |
|
| 133 | - case 'imagick': |
|
| 134 | - if (!method_exists(\Imagick::class, 'readImage')) { |
|
| 135 | - return ''; |
|
| 136 | - } |
|
| 137 | - break; |
|
| 138 | - case 'convert': |
|
| 139 | - if (defined('_CONVERT_COMMAND') && _CONVERT_COMMAND == '') { |
|
| 140 | - return ''; |
|
| 141 | - } |
|
| 142 | - break; |
|
| 143 | - } |
|
| 117 | + switch ($process) { |
|
| 118 | + case 'gd2': |
|
| 119 | + if (!function_exists('ImageCreateTrueColor')) { |
|
| 120 | + return ''; |
|
| 121 | + } |
|
| 122 | + break; |
|
| 123 | + case 'gd1': |
|
| 124 | + if (!function_exists('ImageGif') && !function_exists('ImageJpeg') && !function_exists('ImagePng')) { |
|
| 125 | + return ''; |
|
| 126 | + } |
|
| 127 | + break; |
|
| 128 | + case 'netpbm': |
|
| 129 | + if (defined('_PNMSCALE_COMMAND') && _PNMSCALE_COMMAND == '') { |
|
| 130 | + return ''; |
|
| 131 | + } |
|
| 132 | + break; |
|
| 133 | + case 'imagick': |
|
| 134 | + if (!method_exists(\Imagick::class, 'readImage')) { |
|
| 135 | + return ''; |
|
| 136 | + } |
|
| 137 | + break; |
|
| 138 | + case 'convert': |
|
| 139 | + if (defined('_CONVERT_COMMAND') && _CONVERT_COMMAND == '') { |
|
| 140 | + return ''; |
|
| 141 | + } |
|
| 142 | + break; |
|
| 143 | + } |
|
| 144 | 144 | |
| 145 | - return generer_url_action('tester', "arg=$process&time=" . time()); |
|
| 145 | + return generer_url_action('tester', "arg=$process&time=" . time()); |
|
| 146 | 146 | } |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | $checked = ($l == $selected) ? ' checked=\'checked\'' : ''; |
| 52 | 52 | $ret .= "<div class='choix'>" |
| 53 | 53 | . "<input type='radio' name='$name' id='{$id}_$l' value='$l'$checked />" |
| 54 | - . "<label for='{$id}_$l'>" . traduire_nom_langue($l) . '</label>' |
|
| 54 | + . "<label for='{$id}_$l'>".traduire_nom_langue($l).'</label>' |
|
| 55 | 55 | . '</div>'; |
| 56 | 56 | } |
| 57 | 57 | |
@@ -10,46 +10,46 @@ |
||
| 10 | 10 | \***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 13 | - return; |
|
| 13 | + return; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | function formulaires_configurer_langage_charger_dist() { |
| 17 | 17 | |
| 18 | - include_spip('inc/lang'); |
|
| 19 | - $GLOBALS['meta']['langues_proposees'] = ''; |
|
| 20 | - init_langues(); |
|
| 21 | - $langues = explode(',', $GLOBALS['meta']['langues_proposees']); |
|
| 18 | + include_spip('inc/lang'); |
|
| 19 | + $GLOBALS['meta']['langues_proposees'] = ''; |
|
| 20 | + init_langues(); |
|
| 21 | + $langues = explode(',', $GLOBALS['meta']['langues_proposees']); |
|
| 22 | 22 | |
| 23 | - return [ |
|
| 24 | - 'var_lang_ecrire' => $GLOBALS['spip_lang'], |
|
| 25 | - '_langues' => $langues |
|
| 26 | - ]; |
|
| 23 | + return [ |
|
| 24 | + 'var_lang_ecrire' => $GLOBALS['spip_lang'], |
|
| 25 | + '_langues' => $langues |
|
| 26 | + ]; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | function formulaires_configurer_langage_traiter_dist() { |
| 31 | - include_spip('action/converser'); |
|
| 32 | - action_converser_changer_langue(true); |
|
| 31 | + include_spip('action/converser'); |
|
| 32 | + action_converser_changer_langue(true); |
|
| 33 | 33 | |
| 34 | - refuser_traiter_formulaire_ajax(); |
|
| 34 | + refuser_traiter_formulaire_ajax(); |
|
| 35 | 35 | |
| 36 | - // on ne peut pas changer la langue pour tout le hit ici, |
|
| 37 | - // car CVT repasse derriere et retablit la langue avant l'appel a traiter() |
|
| 38 | - // il faut rediriger ! |
|
| 39 | - return ['message_ok' => _T('config_info_enregistree'), 'editable' => true, 'redirect' => self()]; |
|
| 36 | + // on ne peut pas changer la langue pour tout le hit ici, |
|
| 37 | + // car CVT repasse derriere et retablit la langue avant l'appel a traiter() |
|
| 38 | + // il faut rediriger ! |
|
| 39 | + return ['message_ok' => _T('config_info_enregistree'), 'editable' => true, 'redirect' => self()]; |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | function afficher_langues_choix($langues, $name, $id, $selected) { |
| 43 | - include_spip('inc/lang'); |
|
| 44 | - $ret = ''; |
|
| 45 | - sort($langues); |
|
| 46 | - foreach ($langues as $l) { |
|
| 47 | - $checked = ($l == $selected) ? ' checked=\'checked\'' : ''; |
|
| 48 | - $ret .= "<div class='choix'>" |
|
| 49 | - . "<input type='radio' name='$name' id='{$id}_$l' value='$l'$checked />" |
|
| 50 | - . "<label for='{$id}_$l'>" . traduire_nom_langue($l) . '</label>' |
|
| 51 | - . '</div>'; |
|
| 52 | - } |
|
| 53 | - |
|
| 54 | - return $ret; |
|
| 43 | + include_spip('inc/lang'); |
|
| 44 | + $ret = ''; |
|
| 45 | + sort($langues); |
|
| 46 | + foreach ($langues as $l) { |
|
| 47 | + $checked = ($l == $selected) ? ' checked=\'checked\'' : ''; |
|
| 48 | + $ret .= "<div class='choix'>" |
|
| 49 | + . "<input type='radio' name='$name' id='{$id}_$l' value='$l'$checked />" |
|
| 50 | + . "<label for='{$id}_$l'>" . traduire_nom_langue($l) . '</label>' |
|
| 51 | + . '</div>'; |
|
| 52 | + } |
|
| 53 | + |
|
| 54 | + return $ret; |
|
| 55 | 55 | } |
@@ -1,14 +1,14 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 4 | - return; |
|
| 4 | + return; |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | 7 | function job_queue_block_and_watch() { |
| 8 | - // bloquer la queue sur ce hit |
|
| 9 | - // pour avoir coherence entre l'affichage de la liste de jobs |
|
| 10 | - // et les jobs en base en fin de hit |
|
| 11 | - define('_DEBUG_BLOCK_QUEUE', true); |
|
| 12 | - include_spip('inc/genie'); |
|
| 13 | - genie_queue_watch_dist(); |
|
| 8 | + // bloquer la queue sur ce hit |
|
| 9 | + // pour avoir coherence entre l'affichage de la liste de jobs |
|
| 10 | + // et les jobs en base en fin de hit |
|
| 11 | + define('_DEBUG_BLOCK_QUEUE', true); |
|
| 12 | + include_spip('inc/genie'); |
|
| 13 | + genie_queue_watch_dist(); |
|
| 14 | 14 | } |
@@ -1,21 +1,21 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 4 | - return; |
|
| 4 | + return; |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | 7 | include_spip('inc/rechercher'); |
| 8 | 8 | include_spip('base/abstract_sql'); |
| 9 | 9 | |
| 10 | 10 | function inclure_liste_recherche_par_id($table, $id, $statut, $env) { |
| 11 | - if (is_string($env)) { |
|
| 12 | - $env = unserialize($env); |
|
| 13 | - } |
|
| 14 | - $env[id_table_objet($table)] = $id; |
|
| 15 | - if ($statut) { |
|
| 16 | - $env['statut'] = $statut; |
|
| 17 | - } |
|
| 18 | - unset($env['recherche']); |
|
| 11 | + if (is_string($env)) { |
|
| 12 | + $env = unserialize($env); |
|
| 13 | + } |
|
| 14 | + $env[id_table_objet($table)] = $id; |
|
| 15 | + if ($statut) { |
|
| 16 | + $env['statut'] = $statut; |
|
| 17 | + } |
|
| 18 | + unset($env['recherche']); |
|
| 19 | 19 | |
| 20 | - return recuperer_fond("prive/objets/liste/$table", $env); |
|
| 20 | + return recuperer_fond("prive/objets/liste/$table", $env); |
|
| 21 | 21 | } |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 4 | - return; |
|
| 4 | + return; |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | 7 | include_spip('inc/bandeau'); |