@@ -11,32 +11,32 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | function formulaires_configurer_flux_charger_dist() { |
| 18 | - $valeurs = array(); |
|
| 19 | - foreach (array( |
|
| 20 | - 'syndication_integrale' |
|
| 21 | - ) as $m) { |
|
| 22 | - $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 23 | - } |
|
| 24 | - |
|
| 25 | - return $valeurs; |
|
| 18 | + $valeurs = array(); |
|
| 19 | + foreach (array( |
|
| 20 | + 'syndication_integrale' |
|
| 21 | + ) as $m) { |
|
| 22 | + $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 23 | + } |
|
| 24 | + |
|
| 25 | + return $valeurs; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | function formulaires_configurer_flux_traiter_dist() { |
| 30 | - $res = array('editable' => true); |
|
| 31 | - foreach (array( |
|
| 32 | - 'syndication_integrale', |
|
| 33 | - ) as $m) { |
|
| 34 | - if (!is_null($v = _request($m))) { |
|
| 35 | - ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 36 | - } |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - $res['message_ok'] = _T('config_info_enregistree'); |
|
| 40 | - |
|
| 41 | - return $res; |
|
| 30 | + $res = array('editable' => true); |
|
| 31 | + foreach (array( |
|
| 32 | + 'syndication_integrale', |
|
| 33 | + ) as $m) { |
|
| 34 | + if (!is_null($v = _request($m))) { |
|
| 35 | + ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 36 | + } |
|
| 37 | + } |
|
| 38 | + |
|
| 39 | + $res['message_ok'] = _T('config_info_enregistree'); |
|
| 40 | + |
|
| 41 | + return $res; |
|
| 42 | 42 | } |
@@ -11,52 +11,52 @@ discard block |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | function formulaires_configurer_multilinguisme_charger_dist() { |
| 18 | - $valeurs = array(); |
|
| 19 | - $valeurs['multi_secteurs'] = $GLOBALS['meta']['multi_secteurs']; |
|
| 20 | - foreach (array('multi_objets', 'gerer_trad_objets') as $m) { |
|
| 21 | - $valeurs[$m] = explode(',', isset($GLOBALS['meta'][$m]) ? $GLOBALS['meta'][$m] : ''); |
|
| 22 | - } |
|
| 23 | - |
|
| 24 | - if (count($valeurs['multi_objets']) |
|
| 25 | - or count(explode(',', $GLOBALS['meta']['langues_utilisees'])) > 1 |
|
| 26 | - ) { |
|
| 27 | - $selection = (is_null(_request('multi_objets')) ? |
|
| 28 | - explode(',', $GLOBALS['meta']['langues_multilingue']) : _request('langues_auth')); |
|
| 29 | - $valeurs['_langues'] = saisie_langues_utiles('langues_auth', $selection ? $selection : array()); |
|
| 30 | - $valeurs['_nb_langues_selection'] = count($selection); |
|
| 31 | - } |
|
| 32 | - |
|
| 33 | - return $valeurs; |
|
| 18 | + $valeurs = array(); |
|
| 19 | + $valeurs['multi_secteurs'] = $GLOBALS['meta']['multi_secteurs']; |
|
| 20 | + foreach (array('multi_objets', 'gerer_trad_objets') as $m) { |
|
| 21 | + $valeurs[$m] = explode(',', isset($GLOBALS['meta'][$m]) ? $GLOBALS['meta'][$m] : ''); |
|
| 22 | + } |
|
| 23 | + |
|
| 24 | + if (count($valeurs['multi_objets']) |
|
| 25 | + or count(explode(',', $GLOBALS['meta']['langues_utilisees'])) > 1 |
|
| 26 | + ) { |
|
| 27 | + $selection = (is_null(_request('multi_objets')) ? |
|
| 28 | + explode(',', $GLOBALS['meta']['langues_multilingue']) : _request('langues_auth')); |
|
| 29 | + $valeurs['_langues'] = saisie_langues_utiles('langues_auth', $selection ? $selection : array()); |
|
| 30 | + $valeurs['_nb_langues_selection'] = count($selection); |
|
| 31 | + } |
|
| 32 | + |
|
| 33 | + return $valeurs; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | function formulaires_configurer_multilinguisme_traiter_dist() { |
| 38 | - $res = array('editable' => true); |
|
| 39 | - // un checkbox seul de name X non coche n'est pas poste. |
|
| 40 | - // on verifie le champ X_check qui indique que la checkbox etait presente dans le formulaire. |
|
| 41 | - foreach (array('multi_secteurs') as $m) { |
|
| 42 | - if (!is_null(_request($m . '_check'))) { |
|
| 43 | - ecrire_meta($m, _request($m) ? 'oui' : 'non'); |
|
| 44 | - } |
|
| 45 | - } |
|
| 46 | - foreach (array('multi_objets', 'gerer_trad_objets') as $m) { |
|
| 47 | - if (!is_null($v = _request($m))) { |
|
| 48 | - // join et enlever la valeur vide '' |
|
| 49 | - ecrire_meta($m, implode(',', array_diff($v, array('')))); |
|
| 50 | - } |
|
| 51 | - } |
|
| 52 | - |
|
| 53 | - if ($i = _request('langues_auth') and is_array($i)) { |
|
| 54 | - $i = array_unique(array_merge($i, explode(',', $GLOBALS['meta']['langues_utilisees']))); |
|
| 55 | - ecrire_meta('langues_multilingue', implode(',', $i)); |
|
| 56 | - } |
|
| 57 | - $res['message_ok'] = _T('config_info_enregistree'); |
|
| 58 | - |
|
| 59 | - return $res; |
|
| 38 | + $res = array('editable' => true); |
|
| 39 | + // un checkbox seul de name X non coche n'est pas poste. |
|
| 40 | + // on verifie le champ X_check qui indique que la checkbox etait presente dans le formulaire. |
|
| 41 | + foreach (array('multi_secteurs') as $m) { |
|
| 42 | + if (!is_null(_request($m . '_check'))) { |
|
| 43 | + ecrire_meta($m, _request($m) ? 'oui' : 'non'); |
|
| 44 | + } |
|
| 45 | + } |
|
| 46 | + foreach (array('multi_objets', 'gerer_trad_objets') as $m) { |
|
| 47 | + if (!is_null($v = _request($m))) { |
|
| 48 | + // join et enlever la valeur vide '' |
|
| 49 | + ecrire_meta($m, implode(',', array_diff($v, array('')))); |
|
| 50 | + } |
|
| 51 | + } |
|
| 52 | + |
|
| 53 | + if ($i = _request('langues_auth') and is_array($i)) { |
|
| 54 | + $i = array_unique(array_merge($i, explode(',', $GLOBALS['meta']['langues_utilisees']))); |
|
| 55 | + ecrire_meta('langues_multilingue', implode(',', $i)); |
|
| 56 | + } |
|
| 57 | + $res['message_ok'] = _T('config_info_enregistree'); |
|
| 58 | + |
|
| 59 | + return $res; |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
@@ -66,13 +66,13 @@ discard block |
||
| 66 | 66 | * @return string |
| 67 | 67 | */ |
| 68 | 68 | function table_supporte_lang($table_sql) { |
| 69 | - $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 70 | - $desc = $trouver_table($table_sql); |
|
| 71 | - if (!$desc or !isset($desc['field']['lang'])) { |
|
| 72 | - return ''; |
|
| 73 | - } |
|
| 69 | + $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 70 | + $desc = $trouver_table($table_sql); |
|
| 71 | + if (!$desc or !isset($desc['field']['lang'])) { |
|
| 72 | + return ''; |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - return ' '; |
|
| 75 | + return ' '; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -82,67 +82,67 @@ discard block |
||
| 82 | 82 | * @return string |
| 83 | 83 | */ |
| 84 | 84 | function table_supporte_trad($table_sql) { |
| 85 | - $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 86 | - $desc = $trouver_table($table_sql); |
|
| 87 | - if (!$desc or !isset($desc['field']['id_trad'])) { |
|
| 88 | - return ''; |
|
| 89 | - } |
|
| 85 | + $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 86 | + $desc = $trouver_table($table_sql); |
|
| 87 | + if (!$desc or !isset($desc['field']['id_trad'])) { |
|
| 88 | + return ''; |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - return ' '; |
|
| 91 | + return ' '; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
| 95 | 95 | function saisie_langues_utiles($name, $selection) { |
| 96 | - include_spip('inc/lang_liste'); |
|
| 97 | - $langues = $GLOBALS['codes_langues']; |
|
| 98 | - |
|
| 99 | - $langues_installees = explode(',', $GLOBALS['meta']['langues_proposees']); |
|
| 100 | - $langues_trad = array_flip($langues_installees); |
|
| 101 | - |
|
| 102 | - $langues_bloquees = explode(',', $GLOBALS['meta']['langues_utilisees']); |
|
| 103 | - |
|
| 104 | - $res = ''; |
|
| 105 | - |
|
| 106 | - $i = 0; |
|
| 107 | - foreach ($langues_bloquees as $code_langue) { |
|
| 108 | - $nom_langue = $langues[$code_langue]; |
|
| 109 | - $res .= "<li class='choix " |
|
| 110 | - . alterner(++$i, 'odd', 'even') |
|
| 111 | - . (isset($langues_trad[$code_langue]) ? ' traduite' : '') |
|
| 112 | - . "'>" |
|
| 113 | - . "<input type='hidden' name='{$name}[]' value='$code_langue'>" // necessaire ... |
|
| 114 | - . "<input type='checkbox' name='{$name}[]' id='{$name}_$code_langue' value='$code_langue' checked='checked' disabled='disabled' />" |
|
| 115 | - . "<label for='{$name}_$code_langue'>" . $nom_langue . " <span class='code_langue'>[$code_langue]</span></label>" |
|
| 116 | - . '</li>'; |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - if ($res) { |
|
| 120 | - $res = "<ul id='langues_bloquees'>" . $res . "</ul><div class='nettoyeur'></div>"; |
|
| 121 | - } |
|
| 122 | - |
|
| 123 | - $res .= "<ul id='langues_proposees'>"; |
|
| 124 | - |
|
| 125 | - $i = 0; |
|
| 126 | - $langues_bloquees = array_flip($langues_bloquees); |
|
| 127 | - foreach ($langues as $code_langue => $nom_langue) { |
|
| 128 | - if (!isset($langues_bloquees[$code_langue])) { |
|
| 129 | - $checked = (in_array($code_langue, $selection) ? ' checked="checked"' : ''); |
|
| 130 | - $res .= "<li class='choix " |
|
| 131 | - . alterner(++$i, 'odd', 'even') |
|
| 132 | - . (isset($langues_trad[$code_langue]) ? ' traduite' : '') |
|
| 133 | - . "'>" |
|
| 134 | - . "<input type='checkbox' name='{$name}[]' id='{$name}_$code_langue' value='$code_langue'" |
|
| 135 | - . $checked |
|
| 136 | - . '/>' |
|
| 137 | - . "<label for='{$name}_$code_langue'" |
|
| 138 | - . ($checked ? " class='on'" : '') |
|
| 139 | - . '>' |
|
| 140 | - . $nom_langue . " <span class='code_langue'>[$code_langue]</span></label>" |
|
| 141 | - . '</li>'; |
|
| 142 | - } |
|
| 143 | - } |
|
| 144 | - |
|
| 145 | - $res .= "</ul><div class='nettoyeur'></div>"; |
|
| 146 | - |
|
| 147 | - return $res; |
|
| 96 | + include_spip('inc/lang_liste'); |
|
| 97 | + $langues = $GLOBALS['codes_langues']; |
|
| 98 | + |
|
| 99 | + $langues_installees = explode(',', $GLOBALS['meta']['langues_proposees']); |
|
| 100 | + $langues_trad = array_flip($langues_installees); |
|
| 101 | + |
|
| 102 | + $langues_bloquees = explode(',', $GLOBALS['meta']['langues_utilisees']); |
|
| 103 | + |
|
| 104 | + $res = ''; |
|
| 105 | + |
|
| 106 | + $i = 0; |
|
| 107 | + foreach ($langues_bloquees as $code_langue) { |
|
| 108 | + $nom_langue = $langues[$code_langue]; |
|
| 109 | + $res .= "<li class='choix " |
|
| 110 | + . alterner(++$i, 'odd', 'even') |
|
| 111 | + . (isset($langues_trad[$code_langue]) ? ' traduite' : '') |
|
| 112 | + . "'>" |
|
| 113 | + . "<input type='hidden' name='{$name}[]' value='$code_langue'>" // necessaire ... |
|
| 114 | + . "<input type='checkbox' name='{$name}[]' id='{$name}_$code_langue' value='$code_langue' checked='checked' disabled='disabled' />" |
|
| 115 | + . "<label for='{$name}_$code_langue'>" . $nom_langue . " <span class='code_langue'>[$code_langue]</span></label>" |
|
| 116 | + . '</li>'; |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + if ($res) { |
|
| 120 | + $res = "<ul id='langues_bloquees'>" . $res . "</ul><div class='nettoyeur'></div>"; |
|
| 121 | + } |
|
| 122 | + |
|
| 123 | + $res .= "<ul id='langues_proposees'>"; |
|
| 124 | + |
|
| 125 | + $i = 0; |
|
| 126 | + $langues_bloquees = array_flip($langues_bloquees); |
|
| 127 | + foreach ($langues as $code_langue => $nom_langue) { |
|
| 128 | + if (!isset($langues_bloquees[$code_langue])) { |
|
| 129 | + $checked = (in_array($code_langue, $selection) ? ' checked="checked"' : ''); |
|
| 130 | + $res .= "<li class='choix " |
|
| 131 | + . alterner(++$i, 'odd', 'even') |
|
| 132 | + . (isset($langues_trad[$code_langue]) ? ' traduite' : '') |
|
| 133 | + . "'>" |
|
| 134 | + . "<input type='checkbox' name='{$name}[]' id='{$name}_$code_langue' value='$code_langue'" |
|
| 135 | + . $checked |
|
| 136 | + . '/>' |
|
| 137 | + . "<label for='{$name}_$code_langue'" |
|
| 138 | + . ($checked ? " class='on'" : '') |
|
| 139 | + . '>' |
|
| 140 | + . $nom_langue . " <span class='code_langue'>[$code_langue]</span></label>" |
|
| 141 | + . '</li>'; |
|
| 142 | + } |
|
| 143 | + } |
|
| 144 | + |
|
| 145 | + $res .= "</ul><div class='nettoyeur'></div>"; |
|
| 146 | + |
|
| 147 | + return $res; |
|
| 148 | 148 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | // un checkbox seul de name X non coche n'est pas poste. |
| 40 | 40 | // on verifie le champ X_check qui indique que la checkbox etait presente dans le formulaire. |
| 41 | 41 | foreach (array('multi_secteurs') as $m) { |
| 42 | - if (!is_null(_request($m . '_check'))) { |
|
| 42 | + if (!is_null(_request($m.'_check'))) { |
|
| 43 | 43 | ecrire_meta($m, _request($m) ? 'oui' : 'non'); |
| 44 | 44 | } |
| 45 | 45 | } |
@@ -112,12 +112,12 @@ discard block |
||
| 112 | 112 | . "'>" |
| 113 | 113 | . "<input type='hidden' name='{$name}[]' value='$code_langue'>" // necessaire ... |
| 114 | 114 | . "<input type='checkbox' name='{$name}[]' id='{$name}_$code_langue' value='$code_langue' checked='checked' disabled='disabled' />" |
| 115 | - . "<label for='{$name}_$code_langue'>" . $nom_langue . " <span class='code_langue'>[$code_langue]</span></label>" |
|
| 115 | + . "<label for='{$name}_$code_langue'>".$nom_langue." <span class='code_langue'>[$code_langue]</span></label>" |
|
| 116 | 116 | . '</li>'; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | if ($res) { |
| 120 | - $res = "<ul id='langues_bloquees'>" . $res . "</ul><div class='nettoyeur'></div>"; |
|
| 120 | + $res = "<ul id='langues_bloquees'>".$res."</ul><div class='nettoyeur'></div>"; |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | $res .= "<ul id='langues_proposees'>"; |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | . "<label for='{$name}_$code_langue'" |
| 138 | 138 | . ($checked ? " class='on'" : '') |
| 139 | 139 | . '>' |
| 140 | - . $nom_langue . " <span class='code_langue'>[$code_langue]</span></label>" |
|
| 140 | + . $nom_langue." <span class='code_langue'>[$code_langue]</span></label>" |
|
| 141 | 141 | . '</li>'; |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -11,56 +11,56 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | function formulaires_configurer_identite_charger_dist() { |
| 18 | - // travailler sur des meta fraiches |
|
| 19 | - include_spip('inc/meta'); |
|
| 20 | - lire_metas(); |
|
| 18 | + // travailler sur des meta fraiches |
|
| 19 | + include_spip('inc/meta'); |
|
| 20 | + lire_metas(); |
|
| 21 | 21 | |
| 22 | - $valeurs = array(); |
|
| 23 | - foreach (array('nom_site', 'adresse_site', 'slogan_site', 'descriptif_site', 'email_webmaster') as $k) { |
|
| 24 | - $valeurs[$k] = isset($GLOBALS['meta'][$k]) ? $GLOBALS['meta'][$k] : ''; |
|
| 25 | - } |
|
| 22 | + $valeurs = array(); |
|
| 23 | + foreach (array('nom_site', 'adresse_site', 'slogan_site', 'descriptif_site', 'email_webmaster') as $k) { |
|
| 24 | + $valeurs[$k] = isset($GLOBALS['meta'][$k]) ? $GLOBALS['meta'][$k] : ''; |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - return $valeurs; |
|
| 27 | + return $valeurs; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | function formulaires_configurer_identite_verifier_dist() { |
| 31 | - $erreurs = array(); |
|
| 31 | + $erreurs = array(); |
|
| 32 | 32 | |
| 33 | - // adresse_site est obligatoire mais rempli automatiquement si absent ! |
|
| 34 | - foreach (array('nom_site'/*,'adresse_site'*/) as $obli) { |
|
| 35 | - if (!_request($obli)) { |
|
| 36 | - $erreurs[$obli] = _T('info_obligatoire'); |
|
| 37 | - } |
|
| 38 | - } |
|
| 33 | + // adresse_site est obligatoire mais rempli automatiquement si absent ! |
|
| 34 | + foreach (array('nom_site'/*,'adresse_site'*/) as $obli) { |
|
| 35 | + if (!_request($obli)) { |
|
| 36 | + $erreurs[$obli] = _T('info_obligatoire'); |
|
| 37 | + } |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - if ($email = _request('email_webmaster') and !email_valide($email)) { |
|
| 41 | - $erreurs['email_webmaster'] = _T('info_email_invalide'); |
|
| 42 | - } |
|
| 40 | + if ($email = _request('email_webmaster') and !email_valide($email)) { |
|
| 41 | + $erreurs['email_webmaster'] = _T('info_email_invalide'); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - return $erreurs; |
|
| 44 | + return $erreurs; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | function formulaires_configurer_identite_traiter_dist() { |
| 48 | - include_spip('inc/config'); |
|
| 49 | - $adresse_site = isset($GLOBALS['meta']['adresse_site']) ? $GLOBALS['meta']['adresse_site'] : ''; |
|
| 50 | - if (_request('adresse_site') != $adresse_site) { |
|
| 51 | - refuser_traiter_formulaire_ajax(); |
|
| 52 | - } |
|
| 48 | + include_spip('inc/config'); |
|
| 49 | + $adresse_site = isset($GLOBALS['meta']['adresse_site']) ? $GLOBALS['meta']['adresse_site'] : ''; |
|
| 50 | + if (_request('adresse_site') != $adresse_site) { |
|
| 51 | + refuser_traiter_formulaire_ajax(); |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - set_request('adresse_site', appliquer_adresse_site(_request('adresse_site'))); |
|
| 54 | + set_request('adresse_site', appliquer_adresse_site(_request('adresse_site'))); |
|
| 55 | 55 | |
| 56 | - include_spip('inc/meta'); |
|
| 57 | - foreach (array('nom_site', 'slogan_site', 'descriptif_site', 'email_webmaster') as $k) { |
|
| 58 | - ecrire_meta($k, _request($k)); |
|
| 59 | - } |
|
| 56 | + include_spip('inc/meta'); |
|
| 57 | + foreach (array('nom_site', 'slogan_site', 'descriptif_site', 'email_webmaster') as $k) { |
|
| 58 | + ecrire_meta($k, _request($k)); |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | - include_spip('inc/texte_mini'); |
|
| 62 | - $reload = texte_script(couper(_request('nom_site'), 35)); |
|
| 63 | - $reload = "<script type='text/javascript'>if (window.jQuery) jQuery('#bando_identite .nom_site_spip .nom').html('$reload');</script>"; |
|
| 61 | + include_spip('inc/texte_mini'); |
|
| 62 | + $reload = texte_script(couper(_request('nom_site'), 35)); |
|
| 63 | + $reload = "<script type='text/javascript'>if (window.jQuery) jQuery('#bando_identite .nom_site_spip .nom').html('$reload');</script>"; |
|
| 64 | 64 | |
| 65 | - return array('message_ok' => _T('config_info_enregistree') . $reload, 'editable' => true); |
|
| 65 | + return array('message_ok' => _T('config_info_enregistree') . $reload, 'editable' => true); |
|
| 66 | 66 | } |
@@ -62,5 +62,5 @@ |
||
| 62 | 62 | $reload = texte_script(couper(_request('nom_site'), 35)); |
| 63 | 63 | $reload = "<script type='text/javascript'>if (window.jQuery) jQuery('#bando_identite .nom_site_spip .nom').html('$reload');</script>"; |
| 64 | 64 | |
| 65 | - return array('message_ok' => _T('config_info_enregistree') . $reload, 'editable' => true); |
|
| 65 | + return array('message_ok' => _T('config_info_enregistree').$reload, 'editable' => true); |
|
| 66 | 66 | } |
@@ -11,68 +11,68 @@ discard block |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | function formulaires_configurer_metas_charger_dist($form) { |
| 18 | - $f = charger_fonction('charger', "formulaires/$form", true); |
|
| 19 | - if ($f) { |
|
| 20 | - return $f($form); |
|
| 21 | - } else { |
|
| 22 | - $infos = formulaires_configurer_metas_infos($form); |
|
| 23 | - if (!is_array($infos)) { |
|
| 24 | - return $infos; |
|
| 25 | - } |
|
| 18 | + $f = charger_fonction('charger', "formulaires/$form", true); |
|
| 19 | + if ($f) { |
|
| 20 | + return $f($form); |
|
| 21 | + } else { |
|
| 22 | + $infos = formulaires_configurer_metas_infos($form); |
|
| 23 | + if (!is_array($infos)) { |
|
| 24 | + return $infos; |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - return $GLOBALS[$infos['meta']]; |
|
| 28 | - } |
|
| 27 | + return $GLOBALS[$infos['meta']]; |
|
| 28 | + } |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | function formulaires_configurer_metas_verifier_dist($form) { |
| 32 | - $f = charger_fonction('verifier', "formulaires/$form", true); |
|
| 32 | + $f = charger_fonction('verifier', "formulaires/$form", true); |
|
| 33 | 33 | |
| 34 | - return $f ? $f($form) : array(); |
|
| 34 | + return $f ? $f($form) : array(); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | function formulaires_configurer_metas_traiter_dist($form) { |
| 38 | - $f = charger_fonction('traiter', "formulaires/$form", true); |
|
| 39 | - if ($f) { |
|
| 40 | - return $f($form); |
|
| 41 | - } else { |
|
| 42 | - $infos = formulaires_configurer_metas_infos($form); |
|
| 43 | - if (!is_array($infos)) { |
|
| 44 | - return $infos; |
|
| 45 | - } // fait ci-dessus en fait |
|
| 46 | - $vars = formulaires_configurer_metas_recense($infos['path'], PREG_PATTERN_ORDER); |
|
| 47 | - $meta = $infos['meta']; |
|
| 48 | - foreach (array_unique($vars[2]) as $k) { |
|
| 49 | - $v = _request($k); |
|
| 50 | - ecrire_meta($k, is_array($v) ? serialise($v) : $v, 'oui', $meta); |
|
| 51 | - } |
|
| 38 | + $f = charger_fonction('traiter', "formulaires/$form", true); |
|
| 39 | + if ($f) { |
|
| 40 | + return $f($form); |
|
| 41 | + } else { |
|
| 42 | + $infos = formulaires_configurer_metas_infos($form); |
|
| 43 | + if (!is_array($infos)) { |
|
| 44 | + return $infos; |
|
| 45 | + } // fait ci-dessus en fait |
|
| 46 | + $vars = formulaires_configurer_metas_recense($infos['path'], PREG_PATTERN_ORDER); |
|
| 47 | + $meta = $infos['meta']; |
|
| 48 | + foreach (array_unique($vars[2]) as $k) { |
|
| 49 | + $v = _request($k); |
|
| 50 | + ecrire_meta($k, is_array($v) ? serialise($v) : $v, 'oui', $meta); |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - return !isset($infos['prefix']) ? array() |
|
| 54 | - : array('redirect' => generer_url_ecrire($infos['prefix'])); |
|
| 55 | - } |
|
| 53 | + return !isset($infos['prefix']) ? array() |
|
| 54 | + : array('redirect' => generer_url_ecrire($infos['prefix'])); |
|
| 55 | + } |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | // version amelioree de la RegExp de cfg_formulaire. |
| 59 | 59 | define( |
| 60 | - '_EXTRAIRE_SAISIES', |
|
| 61 | - '#<(select|textarea|input)[^>]*\sname=["\'](\w+)(\[\w*\])?["\'](?: class=["\']([^\'"]*)["\'])?( multiple=)?[^>]*?>#ims' |
|
| 60 | + '_EXTRAIRE_SAISIES', |
|
| 61 | + '#<(select|textarea|input)[^>]*\sname=["\'](\w+)(\[\w*\])?["\'](?: class=["\']([^\'"]*)["\'])?( multiple=)?[^>]*?>#ims' |
|
| 62 | 62 | ); |
| 63 | 63 | |
| 64 | 64 | // determiner la liste des noms des saisies d'un formulaire |
| 65 | 65 | // (a refaire avec SAX) |
| 66 | 66 | function formulaires_configurer_metas_recense($form, $opt = '') { |
| 67 | - if (!$opt) { |
|
| 68 | - $opt = PREG_SET_ORDER; |
|
| 69 | - } |
|
| 70 | - $f = file_get_contents($form); |
|
| 71 | - if ($f and preg_match_all(_EXTRAIRE_SAISIES, $f, $r, $opt)) { |
|
| 72 | - return $r; |
|
| 73 | - } else { |
|
| 74 | - return array(); |
|
| 75 | - } |
|
| 67 | + if (!$opt) { |
|
| 68 | + $opt = PREG_SET_ORDER; |
|
| 69 | + } |
|
| 70 | + $f = file_get_contents($form); |
|
| 71 | + if ($f and preg_match_all(_EXTRAIRE_SAISIES, $f, $r, $opt)) { |
|
| 72 | + return $r; |
|
| 73 | + } else { |
|
| 74 | + return array(); |
|
| 75 | + } |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | // Repertoires potentiels des plugins, ce serait bien d'avoir ça ailleurs |
@@ -86,27 +86,27 @@ discard block |
||
| 86 | 86 | // Si ce n'est pas un plugin, dire qu'il faut prendre la table std des meta. |
| 87 | 87 | function formulaires_configurer_metas_infos($form) { |
| 88 | 88 | |
| 89 | - $path = find_in_path($form . '.' . _EXTENSION_SQUELETTES, 'formulaires/'); |
|
| 90 | - if (!$path) { |
|
| 91 | - return ''; |
|
| 92 | - } // cas traite en amont normalement. |
|
| 93 | - if (!preg_match(_EXTRAIRE_PLUGIN, $path, $m)) { |
|
| 94 | - return array('path' => $path, 'meta' => 'meta'); |
|
| 95 | - } |
|
| 96 | - $plugin = $m[2]; |
|
| 97 | - $get_infos = charger_fonction('get_infos', 'plugins'); |
|
| 98 | - $infos = $get_infos($plugin, false, $m[1]); |
|
| 99 | - if (!is_array($infos)) { |
|
| 100 | - return _T('erreur_plugin_nom_manquant'); |
|
| 101 | - } |
|
| 102 | - if (isset($infos['erreur'])) { |
|
| 103 | - return $infos['erreur'][0]; |
|
| 104 | - } |
|
| 105 | - $prefix = $infos['prefix']; |
|
| 106 | - $infos['path'] = $path; |
|
| 107 | - if (!isset($infos['meta'])) { |
|
| 108 | - $infos['meta'] = ($prefix . '_metas'); |
|
| 109 | - } |
|
| 89 | + $path = find_in_path($form . '.' . _EXTENSION_SQUELETTES, 'formulaires/'); |
|
| 90 | + if (!$path) { |
|
| 91 | + return ''; |
|
| 92 | + } // cas traite en amont normalement. |
|
| 93 | + if (!preg_match(_EXTRAIRE_PLUGIN, $path, $m)) { |
|
| 94 | + return array('path' => $path, 'meta' => 'meta'); |
|
| 95 | + } |
|
| 96 | + $plugin = $m[2]; |
|
| 97 | + $get_infos = charger_fonction('get_infos', 'plugins'); |
|
| 98 | + $infos = $get_infos($plugin, false, $m[1]); |
|
| 99 | + if (!is_array($infos)) { |
|
| 100 | + return _T('erreur_plugin_nom_manquant'); |
|
| 101 | + } |
|
| 102 | + if (isset($infos['erreur'])) { |
|
| 103 | + return $infos['erreur'][0]; |
|
| 104 | + } |
|
| 105 | + $prefix = $infos['prefix']; |
|
| 106 | + $infos['path'] = $path; |
|
| 107 | + if (!isset($infos['meta'])) { |
|
| 108 | + $infos['meta'] = ($prefix . '_metas'); |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - return $infos; |
|
| 111 | + return $infos; |
|
| 112 | 112 | } |
@@ -80,13 +80,13 @@ discard block |
||
| 80 | 80 | // Attention a l'ordre: |
| 81 | 81 | // si l'un des 3 est un sous-rep d'un autre, le mettre avant. |
| 82 | 82 | |
| 83 | -define('_EXTRAIRE_PLUGIN', '@(' . _DIR_PLUGINS_AUTO . '|' . _DIR_PLUGINS . '|' . _DIR_PLUGINS_DIST . ')/?([^/]+)/@'); |
|
| 83 | +define('_EXTRAIRE_PLUGIN', '@('._DIR_PLUGINS_AUTO.'|'._DIR_PLUGINS.'|'._DIR_PLUGINS_DIST.')/?([^/]+)/@'); |
|
| 84 | 84 | |
| 85 | 85 | // Recuperer la version compilee de plugin.xml et normaliser |
| 86 | 86 | // Si ce n'est pas un plugin, dire qu'il faut prendre la table std des meta. |
| 87 | 87 | function formulaires_configurer_metas_infos($form) { |
| 88 | 88 | |
| 89 | - $path = find_in_path($form . '.' . _EXTENSION_SQUELETTES, 'formulaires/'); |
|
| 89 | + $path = find_in_path($form.'.'._EXTENSION_SQUELETTES, 'formulaires/'); |
|
| 90 | 90 | if (!$path) { |
| 91 | 91 | return ''; |
| 92 | 92 | } // cas traite en amont normalement. |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $prefix = $infos['prefix']; |
| 106 | 106 | $infos['path'] = $path; |
| 107 | 107 | if (!isset($infos['meta'])) { |
| 108 | - $infos['meta'] = ($prefix . '_metas'); |
|
| 108 | + $infos['meta'] = ($prefix.'_metas'); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | return $infos; |
@@ -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 | /** |
@@ -33,19 +33,19 @@ discard block |
||
| 33 | 33 | * @return array Environnement du formulaire |
| 34 | 34 | **/ |
| 35 | 35 | function formulaires_recherche_ecrire_charger_dist($action = '', $class = '') { |
| 36 | - if ($GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site']) { |
|
| 37 | - $lang = $GLOBALS['spip_lang']; |
|
| 38 | - } else { |
|
| 39 | - $lang = ''; |
|
| 40 | - } |
|
| 36 | + if ($GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site']) { |
|
| 37 | + $lang = $GLOBALS['spip_lang']; |
|
| 38 | + } else { |
|
| 39 | + $lang = ''; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - return |
|
| 43 | - array( |
|
| 44 | - 'action' => ($action ? $action : generer_url_ecrire('recherche')), |
|
| 45 | - # action specifique, ne passe pas par Verifier, ni Traiter |
|
| 46 | - 'recherche' => _request('recherche'), |
|
| 47 | - 'lang' => $lang, |
|
| 48 | - 'class' => $class, |
|
| 49 | - '_id_champ' => 'rechercher_' . substr(md5($action . $class), 0, 4), |
|
| 50 | - ); |
|
| 42 | + return |
|
| 43 | + array( |
|
| 44 | + 'action' => ($action ? $action : generer_url_ecrire('recherche')), |
|
| 45 | + # action specifique, ne passe pas par Verifier, ni Traiter |
|
| 46 | + 'recherche' => _request('recherche'), |
|
| 47 | + 'lang' => $lang, |
|
| 48 | + 'class' => $class, |
|
| 49 | + '_id_champ' => 'rechercher_' . substr(md5($action . $class), 0, 4), |
|
| 50 | + ); |
|
| 51 | 51 | } |
@@ -46,6 +46,6 @@ |
||
| 46 | 46 | 'recherche' => _request('recherche'), |
| 47 | 47 | 'lang' => $lang, |
| 48 | 48 | 'class' => $class, |
| 49 | - '_id_champ' => 'rechercher_' . substr(md5($action . $class), 0, 4), |
|
| 49 | + '_id_champ' => 'rechercher_'.substr(md5($action.$class), 0, 4), |
|
| 50 | 50 | ); |
| 51 | 51 | } |
@@ -11,46 +11,46 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | include_spip('inc/presentation'); |
| 17 | 17 | |
| 18 | 18 | function formulaires_configurer_visiteurs_charger_dist() { |
| 19 | - $valeurs = array(); |
|
| 20 | - if (avoir_visiteurs(false, false)) { |
|
| 21 | - $valeurs['editable'] = false; |
|
| 22 | - } |
|
| 23 | - |
|
| 24 | - foreach (array( |
|
| 25 | - 'accepter_visiteurs' |
|
| 26 | - ) as $m) { |
|
| 27 | - $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 28 | - } |
|
| 29 | - |
|
| 30 | - return $valeurs; |
|
| 19 | + $valeurs = array(); |
|
| 20 | + if (avoir_visiteurs(false, false)) { |
|
| 21 | + $valeurs['editable'] = false; |
|
| 22 | + } |
|
| 23 | + |
|
| 24 | + foreach (array( |
|
| 25 | + 'accepter_visiteurs' |
|
| 26 | + ) as $m) { |
|
| 27 | + $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 28 | + } |
|
| 29 | + |
|
| 30 | + return $valeurs; |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | function formulaires_configurer_visiteurs_traiter_dist() { |
| 35 | - $res = array('editable' => true); |
|
| 36 | - // Modification du reglage accepter_inscriptions => vider le cache |
|
| 37 | - // (pour repercuter la modif sur le panneau de login) |
|
| 38 | - if (($i = _request('accepter_visiteurs') |
|
| 39 | - and $i != $GLOBALS['meta']['accepter_visiteurs']) |
|
| 40 | - ) { |
|
| 41 | - include_spip('inc/invalideur'); |
|
| 42 | - suivre_invalideur('1'); # tout effacer |
|
| 43 | - } |
|
| 44 | - |
|
| 45 | - foreach (array( |
|
| 46 | - 'accepter_visiteurs', |
|
| 47 | - ) as $m) { |
|
| 48 | - if (!is_null($v = _request($m))) { |
|
| 49 | - ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 50 | - } |
|
| 51 | - } |
|
| 52 | - |
|
| 53 | - $res['message_ok'] = _T('config_info_enregistree'); |
|
| 54 | - |
|
| 55 | - return $res; |
|
| 35 | + $res = array('editable' => true); |
|
| 36 | + // Modification du reglage accepter_inscriptions => vider le cache |
|
| 37 | + // (pour repercuter la modif sur le panneau de login) |
|
| 38 | + if (($i = _request('accepter_visiteurs') |
|
| 39 | + and $i != $GLOBALS['meta']['accepter_visiteurs']) |
|
| 40 | + ) { |
|
| 41 | + include_spip('inc/invalideur'); |
|
| 42 | + suivre_invalideur('1'); # tout effacer |
|
| 43 | + } |
|
| 44 | + |
|
| 45 | + foreach (array( |
|
| 46 | + 'accepter_visiteurs', |
|
| 47 | + ) as $m) { |
|
| 48 | + if (!is_null($v = _request($m))) { |
|
| 49 | + ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 50 | + } |
|
| 51 | + } |
|
| 52 | + |
|
| 53 | + $res['message_ok'] = _T('config_info_enregistree'); |
|
| 54 | + |
|
| 55 | + return $res; |
|
| 56 | 56 | } |
@@ -11,34 +11,34 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | function formulaires_configurer_logos_charger_dist() { |
| 18 | - $valeurs = array(); |
|
| 19 | - foreach (array( |
|
| 20 | - 'activer_logos', |
|
| 21 | - 'activer_logos_survol' |
|
| 22 | - ) as $m) { |
|
| 23 | - $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 24 | - } |
|
| 25 | - |
|
| 26 | - return $valeurs; |
|
| 18 | + $valeurs = array(); |
|
| 19 | + foreach (array( |
|
| 20 | + 'activer_logos', |
|
| 21 | + 'activer_logos_survol' |
|
| 22 | + ) as $m) { |
|
| 23 | + $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 24 | + } |
|
| 25 | + |
|
| 26 | + return $valeurs; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | function formulaires_configurer_logos_traiter_dist() { |
| 31 | - $res = array('editable' => true); |
|
| 32 | - foreach (array( |
|
| 33 | - 'activer_logos', |
|
| 34 | - 'activer_logos_survol', |
|
| 35 | - ) as $m) { |
|
| 36 | - if (!is_null($v = _request($m))) { |
|
| 37 | - ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 38 | - } |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - $res['message_ok'] = _T('config_info_enregistree'); |
|
| 42 | - |
|
| 43 | - return $res; |
|
| 31 | + $res = array('editable' => true); |
|
| 32 | + foreach (array( |
|
| 33 | + 'activer_logos', |
|
| 34 | + 'activer_logos_survol', |
|
| 35 | + ) as $m) { |
|
| 36 | + if (!is_null($v = _request($m))) { |
|
| 37 | + ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 38 | + } |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + $res['message_ok'] = _T('config_info_enregistree'); |
|
| 42 | + |
|
| 43 | + return $res; |
|
| 44 | 44 | } |
@@ -11,34 +11,34 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | function formulaires_configurer_rubriques_charger_dist() { |
| 18 | - $valeurs = array(); |
|
| 19 | - foreach (array( |
|
| 20 | - 'rubriques_descriptif', |
|
| 21 | - 'rubriques_texte' |
|
| 22 | - ) as $m) { |
|
| 23 | - $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 24 | - } |
|
| 25 | - |
|
| 26 | - return $valeurs; |
|
| 18 | + $valeurs = array(); |
|
| 19 | + foreach (array( |
|
| 20 | + 'rubriques_descriptif', |
|
| 21 | + 'rubriques_texte' |
|
| 22 | + ) as $m) { |
|
| 23 | + $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 24 | + } |
|
| 25 | + |
|
| 26 | + return $valeurs; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | function formulaires_configurer_rubriques_traiter_dist() { |
| 31 | - $res = array('editable' => true); |
|
| 32 | - foreach (array( |
|
| 33 | - 'rubriques_descriptif', |
|
| 34 | - 'rubriques_texte' |
|
| 35 | - ) as $m) { |
|
| 36 | - if (!is_null($v = _request($m))) { |
|
| 37 | - ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 38 | - } |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - $res['message_ok'] = _T('config_info_enregistree'); |
|
| 42 | - |
|
| 43 | - return $res; |
|
| 31 | + $res = array('editable' => true); |
|
| 32 | + foreach (array( |
|
| 33 | + 'rubriques_descriptif', |
|
| 34 | + 'rubriques_texte' |
|
| 35 | + ) as $m) { |
|
| 36 | + if (!is_null($v = _request($m))) { |
|
| 37 | + ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 38 | + } |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + $res['message_ok'] = _T('config_info_enregistree'); |
|
| 42 | + |
|
| 43 | + return $res; |
|
| 44 | 44 | } |
@@ -11,61 +11,61 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | function formulaires_configurer_articles_charger_dist() { |
| 18 | - $valeurs = array(); |
|
| 19 | - foreach (array( |
|
| 20 | - 'articles_surtitre', |
|
| 21 | - 'articles_soustitre', |
|
| 22 | - 'articles_descriptif', |
|
| 23 | - 'articles_chapeau', |
|
| 24 | - 'articles_texte', |
|
| 25 | - 'articles_ps', |
|
| 26 | - 'articles_redac', |
|
| 27 | - 'articles_urlref', |
|
| 28 | - 'post_dates', |
|
| 29 | - 'articles_redirection', |
|
| 30 | - ) as $m) { |
|
| 31 | - $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 32 | - } |
|
| 18 | + $valeurs = array(); |
|
| 19 | + foreach (array( |
|
| 20 | + 'articles_surtitre', |
|
| 21 | + 'articles_soustitre', |
|
| 22 | + 'articles_descriptif', |
|
| 23 | + 'articles_chapeau', |
|
| 24 | + 'articles_texte', |
|
| 25 | + 'articles_ps', |
|
| 26 | + 'articles_redac', |
|
| 27 | + 'articles_urlref', |
|
| 28 | + 'post_dates', |
|
| 29 | + 'articles_redirection', |
|
| 30 | + ) as $m) { |
|
| 31 | + $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - return $valeurs; |
|
| 34 | + return $valeurs; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | function formulaires_configurer_articles_traiter_dist() { |
| 39 | - $res = array('editable' => true); |
|
| 40 | - $purger_skel = false; |
|
| 41 | - // Purger les squelettes si un changement de meta les affecte |
|
| 42 | - if ($i = _request('post_dates') and ($i != $GLOBALS['meta']['post_dates'])) { |
|
| 43 | - $purger_skel = true; |
|
| 44 | - } |
|
| 39 | + $res = array('editable' => true); |
|
| 40 | + $purger_skel = false; |
|
| 41 | + // Purger les squelettes si un changement de meta les affecte |
|
| 42 | + if ($i = _request('post_dates') and ($i != $GLOBALS['meta']['post_dates'])) { |
|
| 43 | + $purger_skel = true; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - foreach (array( |
|
| 47 | - 'articles_surtitre', |
|
| 48 | - 'articles_soustitre', |
|
| 49 | - 'articles_descriptif', |
|
| 50 | - 'articles_chapeau', |
|
| 51 | - 'articles_texte', |
|
| 52 | - 'articles_ps', |
|
| 53 | - 'articles_redac', |
|
| 54 | - 'articles_urlref', |
|
| 55 | - 'post_dates', |
|
| 56 | - 'articles_redirection', |
|
| 57 | - ) as $m) { |
|
| 58 | - if (!is_null($v = _request($m))) { |
|
| 59 | - ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 60 | - } |
|
| 61 | - } |
|
| 46 | + foreach (array( |
|
| 47 | + 'articles_surtitre', |
|
| 48 | + 'articles_soustitre', |
|
| 49 | + 'articles_descriptif', |
|
| 50 | + 'articles_chapeau', |
|
| 51 | + 'articles_texte', |
|
| 52 | + 'articles_ps', |
|
| 53 | + 'articles_redac', |
|
| 54 | + 'articles_urlref', |
|
| 55 | + 'post_dates', |
|
| 56 | + 'articles_redirection', |
|
| 57 | + ) as $m) { |
|
| 58 | + if (!is_null($v = _request($m))) { |
|
| 59 | + ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 60 | + } |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - if ($purger_skel) { |
|
| 64 | - include_spip('inc/invalideur'); |
|
| 65 | - purger_repertoire(_DIR_SKELS); |
|
| 66 | - } |
|
| 63 | + if ($purger_skel) { |
|
| 64 | + include_spip('inc/invalideur'); |
|
| 65 | + purger_repertoire(_DIR_SKELS); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - $res['message_ok'] = _T('config_info_enregistree'); |
|
| 68 | + $res['message_ok'] = _T('config_info_enregistree'); |
|
| 69 | 69 | |
| 70 | - return $res; |
|
| 70 | + return $res; |
|
| 71 | 71 | } |