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