@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | foreach ($debug['sourcefile'] as $k => $v) { |
| 103 | 103 | if (strpos($v, 'administration.') !== false) { |
| 104 | - if (isset($debug['resultat'][$k . 'tout'])) { |
|
| 105 | - return $debug['resultat'][$k . 'tout']; |
|
| 104 | + if (isset($debug['resultat'][$k.'tout'])) { |
|
| 105 | + return $debug['resultat'][$k.'tout']; |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | } |
@@ -179,12 +179,12 @@ discard block |
||
| 179 | 179 | and $id = intval($id) |
| 180 | 180 | and $desc = $trouver_table(table_objet_sql($type)) |
| 181 | 181 | ) { |
| 182 | - $id = sql_getfetsel($_id_type, table_objet_sql($type), "$_id_type=" . intval($id)); |
|
| 182 | + $id = sql_getfetsel($_id_type, table_objet_sql($type), "$_id_type=".intval($id)); |
|
| 183 | 183 | if ($id) { |
| 184 | 184 | $env[$_id_type] = $id; |
| 185 | 185 | $env['objet'] = $type; |
| 186 | 186 | $env['id_objet'] = $id; |
| 187 | - $env['voir_' . $obj] = |
|
| 187 | + $env['voir_'.$obj] = |
|
| 188 | 188 | str_replace('&', '&', generer_url_entite($id, $obj, '', '', false)); |
| 189 | 189 | if (isset($desc['field']['id_rubrique']) |
| 190 | 190 | and $type != 'rubrique' |
@@ -237,10 +237,10 @@ discard block |
||
| 237 | 237 | $notpub = sql_in("statut", array('prop', 'prive')); |
| 238 | 238 | |
| 239 | 239 | if ($type == 'article' and $GLOBALS['meta']['post_dates'] != 'oui') { |
| 240 | - $notpub .= " OR (statut='publie' AND date>" . sql_quote(date('Y-m-d H:i:s')) . ")"; |
|
| 240 | + $notpub .= " OR (statut='publie' AND date>".sql_quote(date('Y-m-d H:i:s')).")"; |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - return sql_fetsel('1', table_objet_sql($type), id_table_objet($type) . "=" . $id . " AND ($notpub)"); |
|
| 243 | + return sql_fetsel('1', table_objet_sql($type), id_table_objet($type)."=".$id." AND ($notpub)"); |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | |
@@ -254,9 +254,9 @@ discard block |
||
| 254 | 254 | $alang = ''; |
| 255 | 255 | if (!empty($_COOKIE['spip_admin'])) { |
| 256 | 256 | $email_or_login = preg_replace(',^@,', '', $_COOKIE['spip_admin']); |
| 257 | - $alang = sql_getfetsel('lang', 'spip_auteurs', "email=" . sql_quote($email_or_login)); |
|
| 257 | + $alang = sql_getfetsel('lang', 'spip_auteurs', "email=".sql_quote($email_or_login)); |
|
| 258 | 258 | if (!$alang) { |
| 259 | - $alang = sql_getfetsel('lang', 'spip_auteurs', "login=" . sql_quote($email_or_login)); |
|
| 259 | + $alang = sql_getfetsel('lang', 'spip_auteurs', "login=".sql_quote($email_or_login)); |
|
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | 262 | if (!$alang) { |
@@ -281,9 +281,8 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | return ((!isset($GLOBALS['xhtml']) or $GLOBALS['xhtml'] !== 'true') ? |
| 283 | 283 | (parametre_url(self(), 'var_mode', 'debug', '&') |
| 284 | - . '&var_mode_affiche=validation') : |
|
| 285 | - ('http://validator.w3.org/check?uri=' |
|
| 286 | - . rawurlencode("http://" . $_SERVER['HTTP_HOST'] . nettoyer_uri()))); |
|
| 284 | + . '&var_mode_affiche=validation') : ('http://validator.w3.org/check?uri=' |
|
| 285 | + . rawurlencode("http://".$_SERVER['HTTP_HOST'].nettoyer_uri()))); |
|
| 287 | 286 | } |
| 288 | 287 | |
| 289 | 288 | /** |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | unset($erreurs['new_login']); |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | - $auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)); |
|
| 170 | + $auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur='.intval($id_auteur)); |
|
| 171 | 171 | $auth_methode = ($auth_methode ? $auth_methode : 'spip'); |
| 172 | 172 | include_spip('inc/auth'); |
| 173 | 173 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | if (!autoriser('modifier', 'auteur', $id_auteur, null, array('email' => '?')) |
| 183 | 183 | and $GLOBALS['visiteur_session']['id_auteur'] == $id_auteur |
| 184 | 184 | and !strlen(trim($email)) |
| 185 | - and $email != ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur=' . intval($id_auteur))) |
|
| 185 | + and $email != ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur='.intval($id_auteur))) |
|
| 186 | 186 | ) { |
| 187 | 187 | $erreurs['email'] = (($id_auteur == $GLOBALS['visiteur_session']['id_auteur']) ? _T('form_email_non_valide') : _T('form_prop_indiquer_email')); |
| 188 | 188 | } else { |
@@ -197,18 +197,18 @@ discard block |
||
| 197 | 197 | #Nouvel auteur |
| 198 | 198 | if (intval($id_auteur) == 0) { |
| 199 | 199 | #Un auteur existe deja avec cette adresse ? |
| 200 | - if (sql_countsel('spip_auteurs', 'email=' . sql_quote($email)) > 0) { |
|
| 200 | + if (sql_countsel('spip_auteurs', 'email='.sql_quote($email)) > 0) { |
|
| 201 | 201 | $erreurs['email'] = _T('erreur_email_deja_existant'); |
| 202 | 202 | } |
| 203 | 203 | } else { |
| 204 | 204 | #Un auteur existe deja avec cette adresse ? et n'est pas le user courant. |
| 205 | 205 | if ((sql_countsel( |
| 206 | 206 | 'spip_auteurs', |
| 207 | - 'email=' . sql_quote($email) |
|
| 207 | + 'email='.sql_quote($email) |
|
| 208 | 208 | ) > 0) and ($id_auteur != ($id_auteur_ancien = sql_getfetsel( |
| 209 | 209 | 'id_auteur', |
| 210 | 210 | 'spip_auteurs', |
| 211 | - 'email=' . sql_quote($email) |
|
| 211 | + 'email='.sql_quote($email) |
|
| 212 | 212 | )))) { |
| 213 | 213 | $erreurs['email'] = _T('erreur_email_deja_existant'); |
| 214 | 214 | } |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | // corriger un cas si frequent : www.example.org sans le http:// qui precede |
| 226 | 226 | if ($url = _request('url_site') and !tester_url_absolue($url)) { |
| 227 | 227 | if (strpos($url, ':') === false and strncasecmp($url, 'www.', 4) === 0) { |
| 228 | - $url = 'http://' . $url; |
|
| 228 | + $url = 'http://'.$url; |
|
| 229 | 229 | set_request('url_site', $url); |
| 230 | 230 | } |
| 231 | 231 | } |
@@ -238,11 +238,11 @@ discard block |
||
| 238 | 238 | $erreurs['message_erreur'] = ''; |
| 239 | 239 | if ( |
| 240 | 240 | $login = _request('login') and |
| 241 | - $login !== sql_getfetsel('login','spip_auteurs', 'id_auteur='.intval($id_auteur)) |
|
| 241 | + $login !== sql_getfetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur)) |
|
| 242 | 242 | ) { |
| 243 | 243 | // on verifie la meme chose que dans auteurs_edit_config() |
| 244 | - if ( ! auth_autoriser_modifier_login($auth_methode) |
|
| 245 | - or !autoriser('modifier', 'auteur', intval($id_auteur), null, array('email' => true))){ |
|
| 244 | + if (!auth_autoriser_modifier_login($auth_methode) |
|
| 245 | + or !autoriser('modifier', 'auteur', intval($id_auteur), null, array('email' => true))) { |
|
| 246 | 246 | $erreurs['login'] = _T('info_non_modifiable'); |
| 247 | 247 | } |
| 248 | 248 | } |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | |
| 321 | 321 | if ($restreintes = _request('restreintes')) { |
| 322 | 322 | foreach ($restreintes as $k => $v) { |
| 323 | - if(strpos($v, 'rubrique|') === 0) { |
|
| 323 | + if (strpos($v, 'rubrique|') === 0) { |
|
| 324 | 324 | $restreintes[$k] = substr($v, 9); |
| 325 | 325 | } |
| 326 | 326 | } |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | // et de revenir sur son profil |
| 344 | 344 | if ($GLOBALS['visiteur_session']['id_auteur'] == $id_auteur |
| 345 | 345 | and $email_nouveau != |
| 346 | - ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur=' . intval($id_auteur))) |
|
| 346 | + ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur='.intval($id_auteur))) |
|
| 347 | 347 | ) { |
| 348 | 348 | $envoyer_mail = charger_fonction('envoyer_mail', 'inc'); |
| 349 | 349 | $texte = _T( |
@@ -373,11 +373,11 @@ discard block |
||
| 373 | 373 | $erreurs = auteur_reset_password($res['id_auteur'], $erreurs); |
| 374 | 374 | if (isset($erreurs['message_ok'])) { |
| 375 | 375 | if (!isset($res['message_ok'])) $res['message_ok'] = ''; |
| 376 | - $res['message_ok'] = trim($res['message_ok'] . ' ' . $erreurs['message_ok']); |
|
| 376 | + $res['message_ok'] = trim($res['message_ok'].' '.$erreurs['message_ok']); |
|
| 377 | 377 | } |
| 378 | 378 | if (isset($erreurs['message_erreur']) and $erreurs['message_erreur']) { |
| 379 | 379 | if (!isset($res['message_erreur'])) $res['message_erreur'] = ''; |
| 380 | - $res['message_erreur'] = trim($res['message_erreur'] . ' ' . $erreurs['message_erreur']); |
|
| 380 | + $res['message_erreur'] = trim($res['message_erreur'].' '.$erreurs['message_erreur']); |
|
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | |
| 405 | 405 | |
| 406 | 406 | function auteur_reset_password($id_auteur, $erreurs = array()) { |
| 407 | - $auteur = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)); |
|
| 407 | + $auteur = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.intval($id_auteur)); |
|
| 408 | 408 | $config = auteurs_edit_config($auteur); |
| 409 | 409 | |
| 410 | 410 | if ($config['edit_pass']) { |
@@ -430,21 +430,21 @@ discard block |
||
| 430 | 430 | * @param array $contexte |
| 431 | 431 | * @return string |
| 432 | 432 | */ |
| 433 | -function auteur_regenerer_identifiants($id_auteur, $notifier=true, $contexte = array()) { |
|
| 434 | - if ($id_auteur){ |
|
| 433 | +function auteur_regenerer_identifiants($id_auteur, $notifier = true, $contexte = array()) { |
|
| 434 | + if ($id_auteur) { |
|
| 435 | 435 | $set = array(); |
| 436 | 436 | include_spip('inc/access'); |
| 437 | 437 | $set['pass'] = creer_pass_aleatoire(); |
| 438 | 438 | |
| 439 | 439 | include_spip('action/editer_auteur'); |
| 440 | - auteur_modifier($id_auteur,$set); |
|
| 440 | + auteur_modifier($id_auteur, $set); |
|
| 441 | 441 | |
| 442 | - $row = sql_fetsel('*','spip_auteurs','id_auteur='.intval($id_auteur)); |
|
| 442 | + $row = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.intval($id_auteur)); |
|
| 443 | 443 | include_spip('inc/filtres'); |
| 444 | 444 | if ($notifier |
| 445 | 445 | and $row['email'] |
| 446 | 446 | and email_valide($row['email']) |
| 447 | - and trouver_fond($fond = 'modeles/mail_nouveaux_identifiants')){ |
|
| 447 | + and trouver_fond($fond = 'modeles/mail_nouveaux_identifiants')) { |
|
| 448 | 448 | // envoyer l'email avec login/pass |
| 449 | 449 | $c = array( |
| 450 | 450 | 'id_auteur' => $id_auteur, |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | lang_select($contexte['lang']); |
| 469 | 469 | $message = recuperer_fond($fond, $contexte); |
| 470 | 470 | include_spip("inc/notifications"); |
| 471 | - notifications_envoyer_mails($row['email'],$message); |
|
| 471 | + notifications_envoyer_mails($row['email'], $message); |
|
| 472 | 472 | lang_select(); |
| 473 | 473 | |
| 474 | 474 | return $row['email']; |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | if ($notification = charger_fonction($quoi, 'notifications', true)) { |
| 41 | 41 | spip_log("$notification($quoi,$id" |
| 42 | - . ($options ? "," . serialize($options) : "") |
|
| 42 | + . ($options ? ",".serialize($options) : "") |
|
| 43 | 43 | . ")", 'notifications'); |
| 44 | 44 | $notification($quoi, $id, $options); |
| 45 | 45 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | ); |
| 156 | 156 | $email = $envoi['email']; |
| 157 | 157 | |
| 158 | - job_queue_add('envoyer_mail', ">$email : " . $envoi['sujet'], |
|
| 158 | + job_queue_add('envoyer_mail', ">$email : ".$envoi['sujet'], |
|
| 159 | 159 | array($email, $envoi['sujet'], $envoi['texte'], $envoi['from'], $envoi['headers']), 'inc/'); |
| 160 | 160 | } |
| 161 | 161 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | static $dirs = array(); |
| 42 | 42 | $liste = array(); |
| 43 | 43 | foreach (creer_chemin() as $dir) { |
| 44 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 44 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 45 | 45 | $dirs[$a] = (is_dir($a) || !$a); |
| 46 | 46 | } |
| 47 | 47 | if ($dirs[$a]) { |
@@ -67,20 +67,20 @@ discard block |
||
| 67 | 67 | **/ |
| 68 | 68 | function chercher_module_lang($module, $lang = '') { |
| 69 | 69 | if ($lang) { |
| 70 | - $lang = '_' . $lang; |
|
| 70 | + $lang = '_'.$lang; |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | // 1) dans un repertoire nomme lang/ se trouvant sur le chemin |
| 74 | 74 | if ($f = ($module == 'local' |
| 75 | - ? find_in_path($module . $lang . '.php', 'lang/') |
|
| 76 | - : find_langs_in_path($module . $lang . '.php', 'lang/')) |
|
| 75 | + ? find_in_path($module.$lang.'.php', 'lang/') |
|
| 76 | + : find_langs_in_path($module.$lang.'.php', 'lang/')) |
|
| 77 | 77 | ) { |
| 78 | 78 | return is_array($f) ? $f : array($f); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | // 2) directement dans le chemin (old style, uniquement pour local) |
| 82 | 82 | return (($module == 'local') or strpos($module, '/')) |
| 83 | - ? (($f = find_in_path($module . $lang . '.php')) ? array($f) : false) |
|
| 83 | + ? (($f = find_in_path($module.$lang.'.php')) ? array($f) : false) |
|
| 84 | 84 | : false; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | **/ |
| 105 | 105 | function charger_langue($lang, $module = 'spip') { |
| 106 | 106 | static $langs = array(); |
| 107 | - $var = 'i18n_' . $module . '_' . $lang; |
|
| 107 | + $var = 'i18n_'.$module.'_'.$lang; |
|
| 108 | 108 | if (!isset($langs[$lang])) { |
| 109 | 109 | $langs[$lang] = array(); |
| 110 | 110 | if ($lang) { |
@@ -119,13 +119,13 @@ discard block |
||
| 119 | 119 | } |
| 120 | 120 | foreach ($langs[$lang] as $l) { |
| 121 | 121 | if ($fichiers_lang = chercher_module_lang($module, $l)) { |
| 122 | - $GLOBALS['idx_lang'] = 'i18n_' . $module . '_' . $l; |
|
| 122 | + $GLOBALS['idx_lang'] = 'i18n_'.$module.'_'.$l; |
|
| 123 | 123 | include(array_shift($fichiers_lang)); |
| 124 | 124 | surcharger_langue($fichiers_lang); |
| 125 | 125 | if ($l !== $lang) { |
| 126 | - $GLOBALS[$var] = &$GLOBALS['i18n_' . $module . '_' . $l]; |
|
| 126 | + $GLOBALS[$var] = &$GLOBALS['i18n_'.$module.'_'.$l]; |
|
| 127 | 127 | } |
| 128 | - $GLOBALS['lang_' . $var] = $l; |
|
| 128 | + $GLOBALS['lang_'.$var] = $l; |
|
| 129 | 129 | #spip_log("module de langue : ${module}_$l.php", 'traduire'); |
| 130 | 130 | break; |
| 131 | 131 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | foreach ($fichiers as $fichier) { |
| 164 | 164 | if (!isset($surcharges[$fichier])) { |
| 165 | 165 | $idx_lang_normal = $GLOBALS['idx_lang']; |
| 166 | - $GLOBALS['idx_lang'] = $GLOBALS['idx_lang'] . '@temporaire'; |
|
| 166 | + $GLOBALS['idx_lang'] = $GLOBALS['idx_lang'].'@temporaire'; |
|
| 167 | 167 | include($fichier); |
| 168 | 168 | $surcharges[$fichier] = $GLOBALS[$GLOBALS['idx_lang']]; |
| 169 | 169 | unset($GLOBALS[$GLOBALS['idx_lang']]); |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | } |
| 172 | 172 | if (is_array($surcharges[$fichier])) { |
| 173 | 173 | $GLOBALS[$GLOBALS['idx_lang']] = array_merge( |
| 174 | - (isset($GLOBALS[$GLOBALS['idx_lang']]) ? (array)$GLOBALS[$GLOBALS['idx_lang']] : array()), |
|
| 174 | + (isset($GLOBALS[$GLOBALS['idx_lang']]) ? (array) $GLOBALS[$GLOBALS['idx_lang']] : array()), |
|
| 175 | 175 | $surcharges[$fichier] |
| 176 | 176 | ); |
| 177 | 177 | } |
@@ -249,27 +249,27 @@ discard block |
||
| 249 | 249 | } else { |
| 250 | 250 | $modules = array('spip', 'ecrire'); |
| 251 | 251 | $code = $ori; |
| 252 | - $ori_complet = implode('|', $modules) . ':' . $ori; |
|
| 252 | + $ori_complet = implode('|', $modules).':'.$ori; |
|
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | $desc = new SPIP_Traductions_Description(); |
| 256 | 256 | |
| 257 | 257 | // parcourir tous les modules jusqu'a ce qu'on trouve |
| 258 | 258 | foreach ($modules as $module) { |
| 259 | - $var = "i18n_" . $module . "_" . $lang; |
|
| 259 | + $var = "i18n_".$module."_".$lang; |
|
| 260 | 260 | |
| 261 | 261 | if (empty($GLOBALS[$var])) { |
| 262 | 262 | charger_langue($lang, $module); |
| 263 | 263 | // surcharges persos -- on cherche |
| 264 | 264 | // (lang/)local_xx.php et/ou (lang/)local.php ... |
| 265 | - if (!isset($local['local_' . $lang])) { |
|
| 265 | + if (!isset($local['local_'.$lang])) { |
|
| 266 | 266 | // redéfinir la langue en cours pour les surcharges (chercher_langue a pu le changer) |
| 267 | 267 | $GLOBALS['idx_lang'] = $var; |
| 268 | 268 | // ... (lang/)local_xx.php |
| 269 | - $local['local_' . $lang] = chercher_module_lang('local', $lang); |
|
| 269 | + $local['local_'.$lang] = chercher_module_lang('local', $lang); |
|
| 270 | 270 | } |
| 271 | - if ($local['local_' . $lang]) { |
|
| 272 | - surcharger_langue($local['local_' . $lang]); |
|
| 271 | + if ($local['local_'.$lang]) { |
|
| 272 | + surcharger_langue($local['local_'.$lang]); |
|
| 273 | 273 | } |
| 274 | 274 | // ... puis (lang/)local.php |
| 275 | 275 | if (!isset($local['local'])) { |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | if (isset($GLOBALS[$var][$code])) { |
| 284 | 284 | $desc->code = $code; |
| 285 | 285 | $desc->module = $module; |
| 286 | - $desc->langue = $GLOBALS['lang_' . $var]; |
|
| 286 | + $desc->langue = $GLOBALS['lang_'.$var]; |
|
| 287 | 287 | $desc->texte = $GLOBALS[$var][$code]; |
| 288 | 288 | break; |
| 289 | 289 | } |
@@ -337,13 +337,13 @@ discard block |
||
| 337 | 337 | if (!$desc->mode and $desc->texte) { |
| 338 | 338 | // ne pas modifier 2 fois l'affichage |
| 339 | 339 | $desc->mode = 'traduction'; |
| 340 | - $classe = 'debug-traduction' . ($desc->module == 'ecrire' ? '-prive' : ''); |
|
| 340 | + $classe = 'debug-traduction'.($desc->module == 'ecrire' ? '-prive' : ''); |
|
| 341 | 341 | $desc->texte = '<span ' |
| 342 | - . 'lang=' . $desc->langue |
|
| 343 | - . ' class=' . $classe |
|
| 344 | - . ' data-module=' . $desc->module |
|
| 345 | - . ' data-code=' . $desc->code |
|
| 346 | - . ' title=' . $modules . '(' . $desc->langue . ')>' |
|
| 342 | + . 'lang='.$desc->langue |
|
| 343 | + . ' class='.$classe |
|
| 344 | + . ' data-module='.$desc->module |
|
| 345 | + . ' data-code='.$desc->code |
|
| 346 | + . ' title='.$modules.'('.$desc->langue.')>' |
|
| 347 | 347 | . $desc->texte |
| 348 | 348 | . '</span>'; |
| 349 | 349 | $desc->texte = str_replace( |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | function generer_nom_fichier_cache($contexte, $page) { |
| 30 | 30 | $u = md5(var_export(array($contexte, $page), true)); |
| 31 | 31 | |
| 32 | - return $u . ".cache"; |
|
| 32 | + return $u.".cache"; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | function cache_chemin_fichier($nom_cache, $ecrire = false) { |
| 48 | 48 | static $l1, $l2; |
| 49 | 49 | if (is_null($l1)) { |
| 50 | - $length = (defined('_CACHE_PROFONDEUR_STOCKAGE') ? min(8,max(_CACHE_PROFONDEUR_STOCKAGE,2)) : 4); |
|
| 50 | + $length = (defined('_CACHE_PROFONDEUR_STOCKAGE') ? min(8, max(_CACHE_PROFONDEUR_STOCKAGE, 2)) : 4); |
|
| 51 | 51 | $l1 = intval(floor($length / 2)); |
| 52 | 52 | $l2 = $length - $l1; |
| 53 | 53 | } |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | else { |
| 63 | 63 | // en lecture on essaye pa de creer les repertoires, on va au plus vite |
| 64 | - $rep = _DIR_CACHE . "$d/"; |
|
| 64 | + $rep = _DIR_CACHE."$d/"; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - return $rep . $u . ".cache"; |
|
| 67 | + return $rep.$u.".cache"; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | ), 'non'); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - return crc32($GLOBALS['meta']['cache_signature'] . $page['texte']); |
|
| 114 | + return crc32($GLOBALS['meta']['cache_signature'].$page['texte']); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | // "cache sessionne" ; sa date indique la date de validite |
| 266 | 266 | // des caches sessionnes |
| 267 | 267 | if (!$tmp = lire_cache($chemin_cache)) { |
| 268 | - spip_log('Creation cache sessionne ' . $chemin_cache); |
|
| 268 | + spip_log('Creation cache sessionne '.$chemin_cache); |
|
| 269 | 269 | $tmp = array( |
| 270 | 270 | 'invalideurs' => array('session' => ''), |
| 271 | 271 | 'lastmodified' => $_SERVER['REQUEST_TIME'] |
@@ -289,8 +289,8 @@ discard block |
||
| 289 | 289 | // l'enregistrer, compresse ou non... |
| 290 | 290 | $ok = ecrire_cache($chemin_cache, $pagez); |
| 291 | 291 | |
| 292 | - spip_log((_IS_BOT ? "Bot:" : "") . "Creation du cache $chemin_cache pour " |
|
| 293 | - . $page['entetes']['X-Spip-Cache'] . " secondes" . ($ok ? '' : ' (erreur!)'), _LOG_INFO); |
|
| 292 | + spip_log((_IS_BOT ? "Bot:" : "")."Creation du cache $chemin_cache pour " |
|
| 293 | + . $page['entetes']['X-Spip-Cache']." secondes".($ok ? '' : ' (erreur!)'), _LOG_INFO); |
|
| 294 | 294 | |
| 295 | 295 | // Inserer ses invalideurs |
| 296 | 296 | include_spip('inc/invalideur'); |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | function nettoyer_petit_cache($prefix, $duree = 300) { |
| 313 | 313 | // determiner le repertoire a purger : 'tmp/CACHE/rech/' |
| 314 | 314 | $dircache = sous_repertoire(_DIR_CACHE, $prefix); |
| 315 | - if (spip_touch($dircache . 'purger_' . $prefix, $duree, true)) { |
|
| 315 | + if (spip_touch($dircache.'purger_'.$prefix, $duree, true)) { |
|
| 316 | 316 | foreach (preg_files($dircache, '[.]txt$') as $f) { |
| 317 | 317 | if ($_SERVER['REQUEST_TIME'] - (@file_exists($f) ? @filemtime($f) : 0) > $duree) { |
| 318 | 318 | spip_unlink($f); |
@@ -402,9 +402,9 @@ discard block |
||
| 402 | 402 | if (spip_connect()) { |
| 403 | 403 | include_spip('inc/invalideur'); |
| 404 | 404 | retire_caches($chemin_cache); # API invalideur inutile |
| 405 | - supprimer_fichier(_DIR_CACHE . $chemin_cache); |
|
| 405 | + supprimer_fichier(_DIR_CACHE.$chemin_cache); |
|
| 406 | 406 | if (isset($chemin_cache_session) and $chemin_cache_session) { |
| 407 | - supprimer_fichier(_DIR_CACHE . $chemin_cache_session); |
|
| 407 | + supprimer_fichier(_DIR_CACHE.$chemin_cache_session); |
|
| 408 | 408 | } |
| 409 | 409 | } |
| 410 | 410 | } |
@@ -419,9 +419,9 @@ discard block |
||
| 419 | 419 | $page = array('contexte_implicite' => $contexte_implicite); // ignorer le cache deja lu |
| 420 | 420 | include_spip('inc/invalideur'); |
| 421 | 421 | retire_caches($chemin_cache); # API invalideur inutile |
| 422 | - supprimer_fichier(_DIR_CACHE . $chemin_cache); |
|
| 422 | + supprimer_fichier(_DIR_CACHE.$chemin_cache); |
|
| 423 | 423 | if (isset($chemin_cache_session) and $chemin_cache_session) { |
| 424 | - supprimer_fichier(_DIR_CACHE . $chemin_cache_session); |
|
| 424 | + supprimer_fichier(_DIR_CACHE.$chemin_cache_session); |
|
| 425 | 425 | } |
| 426 | 426 | } |
| 427 | 427 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $champ = preg_replace(',[\s]+,ms', ' ', $champ); |
| 39 | 39 | $champ = str_replace('"', '""', $champ); |
| 40 | 40 | |
| 41 | - return '"' . $champ . '"'; |
|
| 41 | + return '"'.$champ.'"'; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -54,11 +54,11 @@ discard block |
||
| 54 | 54 | * @param callable $callback |
| 55 | 55 | * @return string |
| 56 | 56 | */ |
| 57 | -function exporter_csv_ligne_numerotee($nb, $ligne, $delim = ',', $importer_charset = null, $callback=null) { |
|
| 57 | +function exporter_csv_ligne_numerotee($nb, $ligne, $delim = ',', $importer_charset = null, $callback = null) { |
|
| 58 | 58 | if ($callback) { |
| 59 | 59 | $ligne = call_user_func($callback, $nb, $ligne, $delim, $importer_charset); |
| 60 | 60 | } |
| 61 | - $output = join($delim, array_map('exporter_csv_champ', $ligne)) . "\r\n"; |
|
| 61 | + $output = join($delim, array_map('exporter_csv_champ', $ligne))."\r\n"; |
|
| 62 | 62 | if ($importer_charset) { |
| 63 | 63 | $output = str_replace('’', '\'', $output); |
| 64 | 64 | $output = unicode2charset(html2unicode(charset2unicode($output)), $importer_charset); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * @param null $importer_charset |
| 75 | 75 | * @return string |
| 76 | 76 | */ |
| 77 | -function exporter_csv_ligne($ligne, $delim = ',', $importer_charset = null){ |
|
| 77 | +function exporter_csv_ligne($ligne, $delim = ',', $importer_charset = null) { |
|
| 78 | 78 | return exporter_csv_ligne_numerotee(null, $ligne, $delim, $importer_charset); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $fichier = "php://output"; |
| 176 | 176 | } |
| 177 | 177 | else { |
| 178 | - $fichier = sous_repertoire(_DIR_CACHE, 'export') . $filename; |
|
| 178 | + $fichier = sous_repertoire(_DIR_CACHE, 'export').$filename; |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | $fp = fopen($fichier, 'w'); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | if ($s = trouver_nom_serveur_distant($p)) { |
| 77 | 77 | |
| 78 | 78 | // si une fonction de generation des url a ete definie pour ce connect l'utiliser |
| 79 | - if (function_exists($f = 'generer_generer_url_' . $s)) { |
|
| 79 | + if (function_exists($f = 'generer_generer_url_'.$s)) { |
|
| 80 | 80 | return $f($type, $_id, $s); |
| 81 | 81 | } |
| 82 | 82 | if (!$GLOBALS['connexions'][strtolower($s)]['spip_connect_version']) { |
@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | # exception des urls de documents sur un serveur distant... |
| 87 | 87 | if ($type == 'document') { |
| 88 | 88 | return |
| 89 | - "quete_meta('adresse_site', $s) . '/' .\n\t" . |
|
| 90 | - "quete_meta('dir_img', $s) . \n\t" . |
|
| 89 | + "quete_meta('adresse_site', $s) . '/' .\n\t". |
|
| 90 | + "quete_meta('dir_img', $s) . \n\t". |
|
| 91 | 91 | "quete_fichier($_id,$s)"; |
| 92 | 92 | } |
| 93 | 93 | $s = ", '', '', $s, quete_meta('type_urls', $s)"; |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | function balise_URL_SITE_SPIP_dist($p) { |
| 233 | 233 | $p->code = "sinon(\$GLOBALS['meta']['adresse_site'],'.')"; |
| 234 | - $p->code = "spip_htmlspecialchars(" . $p->code . ")"; |
|
| 234 | + $p->code = "spip_htmlspecialchars(".$p->code.")"; |
|
| 235 | 235 | $p->interdire_scripts = false; |
| 236 | 236 | |
| 237 | 237 | return $p; |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | if ($s = trouver_nom_serveur_distant($p)) { |
| 273 | 273 | // si une fonction de generation des url a ete definie pour ce connect l'utiliser |
| 274 | 274 | // elle devra aussi traiter le cas derogatoire type=page |
| 275 | - if (function_exists($f = 'generer_generer_url_' . $s)) { |
|
| 275 | + if (function_exists($f = 'generer_generer_url_'.$s)) { |
|
| 276 | 276 | if ($args and $args !== "''") { |
| 277 | 277 | $code .= ", $args"; |
| 278 | 278 | } |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | $p->code = $code; |
| 281 | 281 | return $p; |
| 282 | 282 | } |
| 283 | - $s = 'connect=' . addslashes($s); |
|
| 283 | + $s = 'connect='.addslashes($s); |
|
| 284 | 284 | $args = (($args and $args !== "''") ? "$args . '&$s'" : "'$s'"); |
| 285 | 285 | } |
| 286 | 286 | |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | $code = "generer_url_public($code, $args$noentities)"; |
| 296 | 296 | } |
| 297 | 297 | $p->code = $code; |
| 298 | - spip_log("Calcul url page : connect vaut $s ca donne :" . $p->code . " args $args", _LOG_INFO); |
|
| 298 | + spip_log("Calcul url page : connect vaut $s ca donne :".$p->code." args $args", _LOG_INFO); |
|
| 299 | 299 | |
| 300 | 300 | #$p->interdire_scripts = true; |
| 301 | 301 | return $p; |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | $fonc .= ",$args$noentities"; |
| 340 | 340 | } |
| 341 | 341 | } |
| 342 | - $p->code = 'generer_url_ecrire(' . $fonc . ')'; |
|
| 342 | + $p->code = 'generer_url_ecrire('.$fonc.')'; |
|
| 343 | 343 | $p->interdire_scripts = false; |
| 344 | 344 | |
| 345 | 345 | return $p; |
@@ -374,17 +374,17 @@ discard block |
||
| 374 | 374 | |
| 375 | 375 | $args = interprete_argument_balise(2, $p); |
| 376 | 376 | if ($args != "''" && $args !== null) { |
| 377 | - $p->code .= "," . $args; |
|
| 377 | + $p->code .= ",".$args; |
|
| 378 | 378 | } |
| 379 | 379 | $redirect = interprete_argument_balise(3, $p); |
| 380 | 380 | if ($redirect != "''" && $redirect !== null) { |
| 381 | 381 | if ($args == "''" || $args === null) { |
| 382 | 382 | $p->code .= ",''"; |
| 383 | 383 | } |
| 384 | - $p->code .= "," . $redirect; |
|
| 384 | + $p->code .= ",".$redirect; |
|
| 385 | 385 | } |
| 386 | 386 | |
| 387 | - $p->code = "generer_action_auteur(" . $p->code . ")"; |
|
| 387 | + $p->code = "generer_action_auteur(".$p->code.")"; |
|
| 388 | 388 | $p->interdire_scripts = false; |
| 389 | 389 | |
| 390 | 390 | return $p; |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | // Si on est connecte, appeler traiter() |
| 136 | 136 | // et lancer la redirection si besoin |
| 137 | - if (!$valeurs['editable'] and $loge and _request('formulaire_action')!=='login') { |
|
| 137 | + if (!$valeurs['editable'] and $loge and _request('formulaire_action') !== 'login') { |
|
| 138 | 138 | $traiter = charger_fonction('traiter', 'formulaires/login'); |
| 139 | 139 | $res = $traiter($cible, $login, $prive); |
| 140 | 140 | $valeurs = array_merge($valeurs, $res); |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | # preparer un lien pour quand redirige_formulaire ne fonctionne pas |
| 145 | 145 | $m = redirige_formulaire($res['redirect']); |
| 146 | 146 | $valeurs['_deja_loge'] = inserer_attribut( |
| 147 | - '<a>' . _T('login_par_ici') . "</a>$m", |
|
| 147 | + '<a>'._T('login_par_ici')."</a>$m", |
|
| 148 | 148 | 'href', |
| 149 | 149 | $res['redirect'] |
| 150 | 150 | ); |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | function login_autoriser() { |
| 291 | 291 | include_spip('inc/autoriser'); |
| 292 | 292 | if (!autoriser('ecrire')) { |
| 293 | - $h = generer_url_action('logout', 'logout=prive&url=' . urlencode(self())); |
|
| 293 | + $h = generer_url_action('logout', 'logout=prive&url='.urlencode(self())); |
|
| 294 | 294 | |
| 295 | 295 | return array( |
| 296 | 296 | 'message_erreur' => '<h1>' |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | . '</h1><p>' |
| 299 | 299 | . _T('texte_erreur_visiteur') |
| 300 | 300 | . "</p><p class='retour'>[<a href='$h'>" |
| 301 | - . _T('icone_deconnecter') . '</a>]</p>' |
|
| 301 | + . _T('icone_deconnecter').'</a>]</p>' |
|
| 302 | 302 | ); |
| 303 | 303 | } |
| 304 | 304 | |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | // transformer la cible absolue en cible relative |
| 351 | 351 | // pour pas echouer quand la meta adresse_site est foireuse |
| 352 | 352 | if (strncmp($cible, $u = url_de_base(), strlen($u)) == 0) { |
| 353 | - $cible = './' . substr($cible, strlen($u)); |
|
| 353 | + $cible = './'.substr($cible, strlen($u)); |
|
| 354 | 354 | } elseif (tester_url_absolue($cible) and !defined('_AUTORISER_LOGIN_ABS_REDIRECT')) { |
| 355 | 355 | // si c'est une url absolue, refuser la redirection |
| 356 | 356 | // sauf si cette securite est levee volontairement par le webmestre |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | if ($cible and ($cible != self('&')) and ($cible != self())) { |
| 363 | 363 | $res['redirect'] = $cible; |
| 364 | 364 | $res['message_ok'] = inserer_attribut( |
| 365 | - '<a>' . _T('login_par_ici') . '</a>', |
|
| 365 | + '<a>'._T('login_par_ici').'</a>', |
|
| 366 | 366 | 'href', |
| 367 | 367 | $cible |
| 368 | 368 | ); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | // mais apres la fonction autoriser() |
| 115 | 115 | if ($f = find_in_path('mes_fonctions.php')) { |
| 116 | 116 | global $dossier_squelettes; |
| 117 | - include_once(_ROOT_CWD . $f); |
|
| 117 | + include_once(_ROOT_CWD.$f); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $qui = $GLOBALS['visiteur_session'] ? $GLOBALS['visiteur_session'] : array(); |
| 149 | 149 | $qui = array_merge(array('statut' => '', 'id_auteur' => 0, 'webmestre' => 'non'), $qui); |
| 150 | 150 | } elseif (is_numeric($qui)) { |
| 151 | - $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $qui); |
|
| 151 | + $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$qui); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | // Admins restreints, on construit ici (pas generique mais...) |
@@ -158,8 +158,8 @@ discard block |
||
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | spip_log( |
| 161 | - "autoriser $faire $type $id (" . (isset($qui['nom']) ? $qui['nom'] : '') . ') ?', |
|
| 162 | - 'autoriser' . _LOG_DEBUG |
|
| 161 | + "autoriser $faire $type $id (".(isset($qui['nom']) ? $qui['nom'] : '').') ?', |
|
| 162 | + 'autoriser'._LOG_DEBUG |
|
| 163 | 163 | ); |
| 164 | 164 | |
| 165 | 165 | // passer par objet_type pour avoir les alias |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | if ((isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) and autoriser_exception($faire, $type, $id, 'verifier')) |
| 171 | 171 | or (isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) and autoriser_exception($faire, $type, '*', 'verifier')) |
| 172 | 172 | ) { |
| 173 | - spip_log("autoriser ($faire, $type, $id, " . (isset($qui['nom']) ? $qui['nom'] : '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG); |
|
| 173 | + spip_log("autoriser ($faire, $type, $id, ".(isset($qui['nom']) ? $qui['nom'] : '').') : OK Exception', 'autoriser'._LOG_DEBUG); |
|
| 174 | 174 | return true; |
| 175 | 175 | } |
| 176 | 176 | |
@@ -179,18 +179,18 @@ discard block |
||
| 179 | 179 | // autoriser_faire[_dist], autoriser_defaut[_dist] |
| 180 | 180 | $fonctions = $type |
| 181 | 181 | ? array( |
| 182 | - 'autoriser_' . $type . '_' . $faire, |
|
| 183 | - 'autoriser_' . $type . '_' . $faire . '_dist', |
|
| 184 | - 'autoriser_' . $type, |
|
| 185 | - 'autoriser_' . $type . '_dist', |
|
| 186 | - 'autoriser_' . $faire, |
|
| 187 | - 'autoriser_' . $faire . '_dist', |
|
| 182 | + 'autoriser_'.$type.'_'.$faire, |
|
| 183 | + 'autoriser_'.$type.'_'.$faire.'_dist', |
|
| 184 | + 'autoriser_'.$type, |
|
| 185 | + 'autoriser_'.$type.'_dist', |
|
| 186 | + 'autoriser_'.$faire, |
|
| 187 | + 'autoriser_'.$faire.'_dist', |
|
| 188 | 188 | 'autoriser_defaut', |
| 189 | 189 | 'autoriser_defaut_dist' |
| 190 | 190 | ) |
| 191 | 191 | : array( |
| 192 | - 'autoriser_' . $faire, |
|
| 193 | - 'autoriser_' . $faire . '_dist', |
|
| 192 | + 'autoriser_'.$faire, |
|
| 193 | + 'autoriser_'.$faire.'_dist', |
|
| 194 | 194 | 'autoriser_defaut', |
| 195 | 195 | 'autoriser_defaut_dist' |
| 196 | 196 | ); |
@@ -203,8 +203,8 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | spip_log( |
| 206 | - "$f($faire, $type, $id, " . (isset($qui['nom']) ? $qui['nom'] : '') . ') : ' . ($a ? 'OK' : 'niet'), |
|
| 207 | - 'autoriser' . _LOG_DEBUG |
|
| 206 | + "$f($faire, $type, $id, ".(isset($qui['nom']) ? $qui['nom'] : '').') : '.($a ? 'OK' : 'niet'), |
|
| 207 | + 'autoriser'._LOG_DEBUG |
|
| 208 | 208 | ); |
| 209 | 209 | |
| 210 | 210 | return $a; |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | function autoriser_previsualiser_dist($faire, $type, $id, $qui, $opt) { |
| 333 | 333 | |
| 334 | 334 | // Le visiteur a-t-il un statut prevu par la config ? |
| 335 | - if (strpos($GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',') !== false) { |
|
| 335 | + if (strpos($GLOBALS['meta']['preview'], ','.$qui['statut'].',') !== false) { |
|
| 336 | 336 | return test_previsualiser_objet_champ($type, $id, $qui, $opt); |
| 337 | 337 | } |
| 338 | 338 | |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | } // pas de champ passe a la demande => NIET |
| 390 | 390 | $previsu = explode(',', $c['previsu']); |
| 391 | 391 | // regarder si ce statut est autorise pour l'auteur |
| 392 | - if (in_array($opt[$champ] . '/auteur', $previsu)) { |
|
| 392 | + if (in_array($opt[$champ].'/auteur', $previsu)) { |
|
| 393 | 393 | |
| 394 | 394 | // retrouver l’id_auteur qui a filé un lien de prévisu éventuellement, |
| 395 | 395 | // sinon l’auteur en session |
@@ -404,11 +404,11 @@ discard block |
||
| 404 | 404 | |
| 405 | 405 | if (!$id_auteur) { |
| 406 | 406 | return false; |
| 407 | - } elseif(autoriser('previsualiser' . $opt[$champ], $type, '', $id_auteur)) { |
|
| 407 | + } elseif (autoriser('previsualiser'.$opt[$champ], $type, '', $id_auteur)) { |
|
| 408 | 408 | // dans ce cas (admin en general), pas de filtrage sur ce statut |
| 409 | 409 | } elseif (!sql_countsel( |
| 410 | 410 | 'spip_auteurs_liens', |
| 411 | - 'id_auteur=' . intval($id_auteur) . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . intval($id) |
|
| 411 | + 'id_auteur='.intval($id_auteur).' AND objet='.sql_quote($type).' AND id_objet='.intval($id) |
|
| 412 | 412 | )) { |
| 413 | 413 | return false; |
| 414 | 414 | } // pas auteur de cet objet => NIET |
@@ -446,16 +446,16 @@ discard block |
||
| 446 | 446 | // multilinguisme par secteur et objet rattaché à une rubrique |
| 447 | 447 | $primary = id_table_objet($type); |
| 448 | 448 | if ($table != 'spip_rubriques') { |
| 449 | - $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=" . intval($id)); |
|
| 449 | + $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=".intval($id)); |
|
| 450 | 450 | } else { |
| 451 | 451 | $id_rubrique = $id; |
| 452 | 452 | } |
| 453 | - $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 453 | + $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 454 | 454 | if (!$id_secteur > 0) { |
| 455 | 455 | $id_secteur = $id_rubrique; |
| 456 | 456 | } |
| 457 | - $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_secteur)); |
|
| 458 | - $langue_objet = sql_getfetsel('lang', "$table", "$primary=" . intval($id)); |
|
| 457 | + $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_secteur)); |
|
| 458 | + $langue_objet = sql_getfetsel('lang', "$table", "$primary=".intval($id)); |
|
| 459 | 459 | if ($langue_secteur != $langue_objet) { |
| 460 | 460 | // configuration incohérente, on laisse l'utilisateur corriger la situation |
| 461 | 461 | return true; |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques |
| 464 | 464 | return false; |
| 465 | 465 | } else { |
| 466 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id)); |
|
| 466 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id)); |
|
| 467 | 467 | if ($id_parent != 0) { |
| 468 | 468 | // sous-rubriques : pas de choix de langue |
| 469 | 469 | return false; |
@@ -511,7 +511,7 @@ discard block |
||
| 511 | 511 | |
| 512 | 512 | if (!isset($opt['statut'])) { |
| 513 | 513 | if (isset($desc['field']['statut'])) { |
| 514 | - $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . intval($id)); |
|
| 514 | + $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.intval($id)); |
|
| 515 | 515 | } else { |
| 516 | 516 | $statut = 'publie'; |
| 517 | 517 | } // pas de statut => publie |
@@ -669,11 +669,11 @@ discard block |
||
| 669 | 669 | return false; |
| 670 | 670 | } |
| 671 | 671 | |
| 672 | - if (sql_countsel('spip_rubriques', 'id_parent=' . intval($id))) { |
|
| 672 | + if (sql_countsel('spip_rubriques', 'id_parent='.intval($id))) { |
|
| 673 | 673 | return false; |
| 674 | 674 | } |
| 675 | 675 | |
| 676 | - if (sql_countsel('spip_articles', 'id_rubrique=' . intval($id) . " AND (statut<>'poubelle')")) { |
|
| 676 | + if (sql_countsel('spip_articles', 'id_rubrique='.intval($id)." AND (statut<>'poubelle')")) { |
|
| 677 | 677 | return false; |
| 678 | 678 | } |
| 679 | 679 | |
@@ -705,7 +705,7 @@ discard block |
||
| 705 | 705 | * @return bool true s'il a le droit, false sinon |
| 706 | 706 | **/ |
| 707 | 707 | function autoriser_article_modifier_dist($faire, $type, $id, $qui, $opt) { |
| 708 | - $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id)); |
|
| 708 | + $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id)); |
|
| 709 | 709 | |
| 710 | 710 | return |
| 711 | 711 | $r |
@@ -716,7 +716,7 @@ discard block |
||
| 716 | 716 | (!isset($opt['statut']) or $opt['statut'] !== 'publie') |
| 717 | 717 | and in_array($qui['statut'], array('0minirezo', '1comite')) |
| 718 | 718 | and in_array($r['statut'], array('prop', 'prepa', 'poubelle')) |
| 719 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']) |
|
| 719 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']) |
|
| 720 | 720 | ) |
| 721 | 721 | ); |
| 722 | 722 | } |
@@ -764,7 +764,7 @@ discard block |
||
| 764 | 764 | if (!$id) { |
| 765 | 765 | return false; |
| 766 | 766 | } |
| 767 | - $statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id)); |
|
| 767 | + $statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id)); |
|
| 768 | 768 | } |
| 769 | 769 | |
| 770 | 770 | return |
@@ -775,7 +775,7 @@ discard block |
||
| 775 | 775 | or |
| 776 | 776 | ($id |
| 777 | 777 | and $qui['id_auteur'] |
| 778 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur'])); |
|
| 778 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur'])); |
|
| 779 | 779 | } |
| 780 | 780 | |
| 781 | 781 | |
@@ -793,8 +793,8 @@ discard block |
||
| 793 | 793 | **/ |
| 794 | 794 | function autoriser_voir_dist($faire, $type, $id, $qui, $opt) { |
| 795 | 795 | # securite, mais on aurait pas du arriver ici ! |
| 796 | - if (function_exists($f = 'autoriser_' . $type . '_voir') |
|
| 797 | - or function_exists($f = 'autoriser_' . $type . '_voir_dist')) { |
|
| 796 | + if (function_exists($f = 'autoriser_'.$type.'_voir') |
|
| 797 | + or function_exists($f = 'autoriser_'.$type.'_voir_dist')) { |
|
| 798 | 798 | return $f($faire, $type, $id, $qui, $opt); |
| 799 | 799 | } |
| 800 | 800 | |
@@ -912,7 +912,7 @@ discard block |
||
| 912 | 912 | $n = sql_fetsel( |
| 913 | 913 | 'A.id_article', |
| 914 | 914 | 'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)', |
| 915 | - "A.statut='publie' AND L.id_auteur=" . sql_quote($id) |
|
| 915 | + "A.statut='publie' AND L.id_auteur=".sql_quote($id) |
|
| 916 | 916 | ); |
| 917 | 917 | |
| 918 | 918 | return $n ? true : false; |
@@ -1118,7 +1118,7 @@ discard block |
||
| 1118 | 1118 | and $r = sql_allfetsel( |
| 1119 | 1119 | 'id_objet', |
| 1120 | 1120 | 'spip_auteurs_liens', |
| 1121 | - 'id_auteur=' . intval($id_auteur) . " AND objet='rubrique' AND id_objet!=0" |
|
| 1121 | + 'id_auteur='.intval($id_auteur)." AND objet='rubrique' AND id_objet!=0" |
|
| 1122 | 1122 | ) |
| 1123 | 1123 | and count($r) |
| 1124 | 1124 | ) { |
@@ -1733,8 +1733,8 @@ discard block |
||
| 1733 | 1733 | function auteurs_objet($objet, $id_objet, $cond = '') { |
| 1734 | 1734 | $objet = objet_type($objet); |
| 1735 | 1735 | $where = array( |
| 1736 | - 'objet=' . sql_quote($objet), |
|
| 1737 | - 'id_objet=' . intval($id_objet) |
|
| 1736 | + 'objet='.sql_quote($objet), |
|
| 1737 | + 'id_objet='.intval($id_objet) |
|
| 1738 | 1738 | ); |
| 1739 | 1739 | if (!empty($cond)) { |
| 1740 | 1740 | if (is_array($cond)) { |
@@ -1768,7 +1768,7 @@ discard block |
||
| 1768 | 1768 | return sql_allfetsel( |
| 1769 | 1769 | 'id_auteur', |
| 1770 | 1770 | 'spip_auteurs_liens', |
| 1771 | - "objet='article' AND id_objet=" . intval($id_article) . ($cond ? " AND $cond" : '') |
|
| 1771 | + "objet='article' AND id_objet=".intval($id_article).($cond ? " AND $cond" : '') |
|
| 1772 | 1772 | ); |
| 1773 | 1773 | } |
| 1774 | 1774 | |