@@ -20,18 +20,18 @@ |
||
| 20 | 20 | if (!preg_match('/^\w+$/', $type)) return; |
| 21 | 21 | if ($m = _request('var_mode')) { |
| 22 | 22 | // forcer la mise a jour de l'url de cet objet ! |
| 23 | - if (!defined('_VAR_URLS')) define('_VAR_URLS',true); |
|
| 23 | + if (!defined('_VAR_URLS')) define('_VAR_URLS', true); |
|
| 24 | 24 | $m = 'var_mode='.urlencode($m); |
| 25 | 25 | } |
| 26 | 26 | $h = generer_url_entite_absolue(intval(_request('id')), $type, $m, '', true); |
| 27 | 27 | $status = '302'; |
| 28 | - if (_request('status') AND _request('status')=='301') |
|
| 28 | + if (_request('status') AND _request('status') == '301') |
|
| 29 | 29 | $status = '301'; |
| 30 | 30 | |
| 31 | 31 | if ($h) |
| 32 | - redirige_par_entete(str_replace('&', '&', $h),'',$status); |
|
| 32 | + redirige_par_entete(str_replace('&', '&', $h), '', $status); |
|
| 33 | 33 | else |
| 34 | - redirige_par_entete('/','',$status); |
|
| 34 | + redirige_par_entete('/', '', $status); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | ?> |
@@ -24,8 +24,8 @@ |
||
| 24 | 24 | debloquer_tous($GLOBALS['visiteur_session']['id_auteur']); |
| 25 | 25 | } |
| 26 | 26 | else { |
| 27 | - $arg = explode("-",$arg); |
|
| 28 | - list($objet,$id_objet) = $arg; |
|
| 27 | + $arg = explode("-", $arg); |
|
| 28 | + list($objet, $id_objet) = $arg; |
|
| 29 | 29 | debloquer_edition($GLOBALS['visiteur_session']['id_auteur'], $id_objet, $objet); |
| 30 | 30 | } |
| 31 | 31 | } |
@@ -12,14 +12,14 @@ |
||
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) return; |
| 14 | 14 | |
| 15 | -function action_supprimer_lien_dist($arg=null){ |
|
| 16 | - if (is_null($arg)){ |
|
| 17 | - $securiser_action = charger_fonction('securiser_action','inc'); |
|
| 15 | +function action_supprimer_lien_dist($arg = null) { |
|
| 16 | + if (is_null($arg)) { |
|
| 17 | + $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 18 | 18 | $arg = $securiser_action(); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - $arg = explode("-",$arg); |
|
| 22 | - list($objet_source,$ids,$objet_lie,$idl) = $arg; |
|
| 21 | + $arg = explode("-", $arg); |
|
| 22 | + list($objet_source, $ids, $objet_lie, $idl) = $arg; |
|
| 23 | 23 | |
| 24 | 24 | include_spip('action/editer_liens'); |
| 25 | 25 | objet_dissocier(array($objet_source=>$ids), array($objet_lie=>$idl)); |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | function action_tester_taille_error_handler($output) |
| 17 | 17 | { |
| 18 | 18 | // on est ici, donc echec lors de la creation de l'image |
| 19 | - if ($GLOBALS['redirect']){ |
|
| 19 | + if ($GLOBALS['redirect']) { |
|
| 20 | 20 | return redirige_formulaire($GLOBALS['redirect']); |
| 21 | 21 | } |
| 22 | 22 | return $output; |
@@ -31,21 +31,21 @@ discard block |
||
| 31 | 31 | return; |
| 32 | 32 | |
| 33 | 33 | $taille = _request('arg'); |
| 34 | - $taille = explode('-',$taille); |
|
| 34 | + $taille = explode('-', $taille); |
|
| 35 | 35 | |
| 36 | 36 | $GLOBALS['taille_max'] = end($taille); |
| 37 | 37 | $GLOBALS['taille_min'] = 0; |
| 38 | - if (count($taille)>1) |
|
| 38 | + if (count($taille) > 1) |
|
| 39 | 39 | $GLOBALS['taille_min'] = reset($taille); |
| 40 | 40 | |
| 41 | 41 | // si l'intervalle est assez petit, on garde la valeur min |
| 42 | - if ($GLOBALS['taille_max']*$GLOBALS['taille_max']-$GLOBALS['taille_min']*$GLOBALS['taille_min']<50000){ |
|
| 43 | - ecrire_meta('max_taille_vignettes',$t=($GLOBALS['taille_min']*$GLOBALS['taille_min'])*0.9,'non'); |
|
| 44 | - echo round($t/1000000,3).' Mpx'; |
|
| 42 | + if ($GLOBALS['taille_max'] * $GLOBALS['taille_max'] - $GLOBALS['taille_min'] * $GLOBALS['taille_min'] < 50000) { |
|
| 43 | + ecrire_meta('max_taille_vignettes', $t = ($GLOBALS['taille_min'] * $GLOBALS['taille_min']) * 0.9, 'non'); |
|
| 44 | + echo round($t / 1000000, 3).' Mpx'; |
|
| 45 | 45 | die(); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - $taille = $GLOBALS['taille_test'] = round(($GLOBALS['taille_max']+$GLOBALS['taille_min'])/2); |
|
| 48 | + $taille = $GLOBALS['taille_test'] = round(($GLOBALS['taille_max'] + $GLOBALS['taille_min']) / 2); |
|
| 49 | 49 | |
| 50 | 50 | include_spip('inc/filtres'); |
| 51 | 51 | // des inclusions representatives d'un hit prive et/ou public pour la conso memoire |
@@ -67,16 +67,16 @@ discard block |
||
| 67 | 67 | include_spip('inc/header'); |
| 68 | 68 | propre("<doc1>"); // charger propre avec le trairement d'un modele |
| 69 | 69 | |
| 70 | - $i = _request('i')+1; |
|
| 70 | + $i = _request('i') + 1; |
|
| 71 | 71 | $image_source = chemin_image("test.png"); |
| 72 | 72 | $GLOBALS['redirect'] = generer_url_action("tester_taille", "i=$i&arg=".$GLOBALS['taille_min']."-".$GLOBALS['taille_test']); |
| 73 | 73 | |
| 74 | 74 | ob_start('action_tester_taille_error_handler'); |
| 75 | - filtrer('image_recadre',$image_source,$taille,$taille); |
|
| 75 | + filtrer('image_recadre', $image_source, $taille, $taille); |
|
| 76 | 76 | $GLOBALS['redirect'] = generer_url_action("tester_taille", "i=$i&arg=$taille-".$GLOBALS['taille_max']); |
| 77 | 77 | // si la valeur intermediaire a reussi, on teste la valeur maxi qui est peut etre sous estimee |
| 78 | 78 | $taille = $GLOBALS['taille_max']; |
| 79 | - filtrer('image_recadre',$image_source,$taille,$taille); |
|
| 79 | + filtrer('image_recadre', $image_source, $taille, $taille); |
|
| 80 | 80 | $GLOBALS['redirect'] = generer_url_action("tester_taille", "i=$i&arg=$taille-".$GLOBALS['taille_max']); |
| 81 | 81 | ob_end_clean(); |
| 82 | 82 | |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | $securiser_action = charger_fonction('securiser_action', 'inc'); |
| 24 | 24 | $time = $securiser_action(); |
| 25 | 25 | |
| 26 | - if (time()-$time<15*60 |
|
| 27 | - AND $GLOBALS['visiteur_session']['statut']=='0minirezo' |
|
| 28 | - AND $GLOBALS['visiteur_session']['webmestre']!=='oui') { |
|
| 26 | + if (time() - $time < 15 * 60 |
|
| 27 | + AND $GLOBALS['visiteur_session']['statut'] == '0minirezo' |
|
| 28 | + AND $GLOBALS['visiteur_session']['webmestre'] !== 'oui') { |
|
| 29 | 29 | $action = _T('info_admin_etre_webmestre'); |
| 30 | 30 | $admin = charger_fonction('admin', 'inc'); |
| 31 | 31 | // lance la verif par ftp et l'appel |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | function base_etre_webmestre_dist() { |
| 42 | - if ($GLOBALS['visiteur_session']['statut']=='0minirezo' AND $GLOBALS['visiteur_session']['webmestre']!=='oui') { |
|
| 42 | + if ($GLOBALS['visiteur_session']['statut'] == '0minirezo' AND $GLOBALS['visiteur_session']['webmestre'] !== 'oui') { |
|
| 43 | 43 | include_spip('action/editer_auteur'); |
| 44 | 44 | instituer_auteur($GLOBALS['visiteur_session']['id_auteur'], array('webmestre'=>'oui'), true); |
| 45 | 45 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $srcImage = @ImageCreateFromGIF(_ROOT_IMG_PACK."test.gif"); |
| 32 | 32 | if ($srcImage) { |
| 33 | 33 | $gd_formats_read_gif = ",gif"; |
| 34 | - ImageDestroy( $srcImage ); |
|
| 34 | + ImageDestroy($srcImage); |
|
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | } |
@@ -52,21 +52,21 @@ discard block |
||
| 52 | 52 | $srcImage = @ImageCreateFromJPEG(_ROOT_IMG_PACK."test.jpg"); |
| 53 | 53 | if ($srcImage) { |
| 54 | 54 | $gd_formats[] = "jpg"; |
| 55 | - ImageDestroy( $srcImage ); |
|
| 55 | + ImageDestroy($srcImage); |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | if (function_exists('ImageCreateFromGIF')) { |
| 59 | 59 | $srcImage = @ImageCreateFromGIF(_ROOT_IMG_PACK."test.gif"); |
| 60 | 60 | if ($srcImage) { |
| 61 | 61 | $gd_formats[] = "gif"; |
| 62 | - ImageDestroy( $srcImage ); |
|
| 62 | + ImageDestroy($srcImage); |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | if (function_exists('ImageCreateFromPNG')) { |
| 66 | 66 | $srcImage = @ImageCreateFromPNG(_ROOT_IMG_PACK."test.png"); |
| 67 | 67 | if ($srcImage) { |
| 68 | 68 | $gd_formats[] = "png"; |
| 69 | - ImageDestroy( $srcImage ); |
|
| 69 | + ImageDestroy($srcImage); |
|
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | else if ($arg == "netpbm") { |
| 81 | 81 | define('_PNMSCALE_COMMAND', 'pnmscale'); // chemin a changer dans mes_options |
| 82 | 82 | if (_PNMSCALE_COMMAND == '') return; |
| 83 | - $netpbm_formats= Array(); |
|
| 83 | + $netpbm_formats = Array(); |
|
| 84 | 84 | |
| 85 | 85 | $jpegtopnm_command = str_replace("pnmscale", |
| 86 | 86 | "jpegtopnm", _PNMSCALE_COMMAND); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | "pnmtojpeg", _PNMSCALE_COMMAND); |
| 89 | 89 | |
| 90 | 90 | $vignette = _ROOT_IMG_PACK."test.jpg"; |
| 91 | - $dest = _DIR_VAR . "test-jpg.jpg"; |
|
| 91 | + $dest = _DIR_VAR."test-jpg.jpg"; |
|
| 92 | 92 | $commande = "$jpegtopnm_command $vignette | "._PNMSCALE_COMMAND." -width 10 | $pnmtojpeg_command > $dest"; |
| 93 | 93 | spip_log($commande); |
| 94 | 94 | exec($commande); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $giftopnm_command = str_replace("pnmscale", "giftopnm", _PNMSCALE_COMMAND); |
| 99 | 99 | $pnmtojpeg_command = str_replace("pnmscale", "pnmtojpeg", _PNMSCALE_COMMAND); |
| 100 | 100 | $vignette = _ROOT_IMG_PACK."test.gif"; |
| 101 | - $dest = _DIR_VAR . "test-gif.jpg"; |
|
| 101 | + $dest = _DIR_VAR."test-gif.jpg"; |
|
| 102 | 102 | $commande = "$giftopnm_command $vignette | "._PNMSCALE_COMMAND." -width 10 | $pnmtojpeg_command > $dest"; |
| 103 | 103 | spip_log($commande); |
| 104 | 104 | exec($commande); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | $pngtopnm_command = str_replace("pnmscale", "pngtopnm", _PNMSCALE_COMMAND); |
| 110 | 110 | $vignette = _ROOT_IMG_PACK."test.png"; |
| 111 | - $dest = _DIR_VAR . "test-gif.jpg"; |
|
| 111 | + $dest = _DIR_VAR."test-gif.jpg"; |
|
| 112 | 112 | $commande = "$pngtopnm_command $vignette | "._PNMSCALE_COMMAND." -width 10 | $pnmtojpeg_command > $dest"; |
| 113 | 113 | spip_log($commande); |
| 114 | 114 | exec($commande); |
@@ -125,13 +125,13 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | // et maintenant envoyer la vignette de tests |
| 128 | - if (in_array($arg,array("gd1","gd2","imagick","convert","netpbm"))) { |
|
| 128 | + if (in_array($arg, array("gd1", "gd2", "imagick", "convert", "netpbm"))) { |
|
| 129 | 129 | include_spip('inc/filtres'); |
| 130 | 130 | include_spip('inc/filtres_images_mini'); |
| 131 | 131 | $taille_preview = 150; |
| 132 | - $image = _image_valeurs_trans(_DIR_IMG_PACK.'test_image.jpg',"reduire-$taille_preview-$taille_preview",'jpg'); |
|
| 132 | + $image = _image_valeurs_trans(_DIR_IMG_PACK.'test_image.jpg', "reduire-$taille_preview-$taille_preview", 'jpg'); |
|
| 133 | 133 | |
| 134 | - $image['fichier_dest']=_DIR_VAR."test_$arg"; |
|
| 134 | + $image['fichier_dest'] = _DIR_VAR."test_$arg"; |
|
| 135 | 135 | if ($preview = _image_creer_vignette($image, $taille_preview, $taille_preview, $arg, true) |
| 136 | 136 | AND ($preview['width'] * $preview['height'] > 0)) |
| 137 | 137 | redirige_par_entete($preview['fichier']); |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) return; |
| 14 | 14 | |
| 15 | -include_spip('inc/charsets'); # pour le nom de fichier |
|
| 15 | +include_spip('inc/charsets'); # pour le nom de fichier |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Effacer une rubrique |
@@ -22,14 +22,14 @@ discard block |
||
| 22 | 22 | * @param null $id_rubrique |
| 23 | 23 | * @return void |
| 24 | 24 | */ |
| 25 | -function action_supprimer_rubrique_dist($id_rubrique=null) { |
|
| 25 | +function action_supprimer_rubrique_dist($id_rubrique = null) { |
|
| 26 | 26 | |
| 27 | - if (is_null($id_rubrique)){ |
|
| 27 | + if (is_null($id_rubrique)) { |
|
| 28 | 28 | $securiser_action = charger_fonction('securiser_action', 'inc'); |
| 29 | 29 | $id_rubrique = $securiser_action(); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - if (intval($id_rubrique)){ |
|
| 32 | + if (intval($id_rubrique)) { |
|
| 33 | 33 | |
| 34 | 34 | sql_delete("spip_rubriques", "id_rubrique=".intval($id_rubrique)); |
| 35 | 35 | // Les admin restreints qui n'administraient que cette rubrique |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $n = sql_countsel("spip_auteurs_liens", "objet='rubrique' AND id_objet!=".intval($id_rubrique)." AND id_auteur=".intval($id_auteur)); |
| 45 | 45 | if (!$n) { |
| 46 | 46 | include_spip('action/editer_auteur'); |
| 47 | - auteurs_set($id_auteur,array("statut" => '1comite')); |
|
| 47 | + auteurs_set($id_auteur, array("statut" => '1comite')); |
|
| 48 | 48 | } |
| 49 | 49 | sql_delete("spip_auteurs_liens", "objet='rubrique' AND id_objet=".intval($id_rubrique)." AND id_auteur=".intval($id_auteur)); |
| 50 | 50 | } |
@@ -21,9 +21,9 @@ |
||
| 21 | 21 | if ($var = _request('var') |
| 22 | 22 | AND preg_match(',^[a-z_0-9-]+$,i', $var) |
| 23 | 23 | ) { |
| 24 | - if ($_SERVER['REQUEST_METHOD'] == 'POST'){ |
|
| 24 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 25 | 25 | include_spip('inc/session'); |
| 26 | - session_set('session_'.$var, $val=_request('val')); |
|
| 26 | + session_set('session_'.$var, $val = _request('val')); |
|
| 27 | 27 | #spip_log("autosave:$var:$val",'autosave'); |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -13,10 +13,10 @@ discard block |
||
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) return; |
| 14 | 14 | |
| 15 | 15 | // http://doc.spip.org/@action_editer_article_dist |
| 16 | -function action_editer_article_dist($arg=null) { |
|
| 16 | +function action_editer_article_dist($arg = null) { |
|
| 17 | 17 | include_spip('inc/autoriser'); |
| 18 | - $err=""; |
|
| 19 | - if (is_null($arg)){ |
|
| 18 | + $err = ""; |
|
| 19 | + if (is_null($arg)) { |
|
| 20 | 20 | $securiser_action = charger_fonction('securiser_action', 'inc'); |
| 21 | 21 | $arg = $securiser_action(); |
| 22 | 22 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $id_parent = _request('id_parent'); |
| 28 | 28 | if (!$id_parent) |
| 29 | 29 | $err = _L("creation interdite d'un article sans rubrique"); |
| 30 | - elseif(!autoriser('creerarticledans','rubrique',$id_parent)) |
|
| 30 | + elseif (!autoriser('creerarticledans', 'rubrique', $id_parent)) |
|
| 31 | 31 | $err = _T("info_creerdansrubrique_non_autorise"); |
| 32 | 32 | else |
| 33 | 33 | $id_article = article_inserer($id_parent); |
@@ -37,9 +37,9 @@ discard block |
||
| 37 | 37 | if ($id_article > 0) $err = article_modifier($id_article); |
| 38 | 38 | |
| 39 | 39 | if ($err) |
| 40 | - spip_log("echec editeur article: $err",_LOG_ERREUR); |
|
| 40 | + spip_log("echec editeur article: $err", _LOG_ERREUR); |
|
| 41 | 41 | |
| 42 | - return array($id_article,$err); |
|
| 42 | + return array($id_article, $err); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * @param null $set |
| 52 | 52 | * @return string |
| 53 | 53 | */ |
| 54 | -function article_modifier($id_article, $set=null) { |
|
| 54 | +function article_modifier($id_article, $set = null) { |
|
| 55 | 55 | |
| 56 | 56 | // unifier $texte en cas de texte trop long |
| 57 | 57 | trop_longs_articles(); |
@@ -60,9 +60,9 @@ discard block |
||
| 60 | 60 | include_spip('inc/filtres'); |
| 61 | 61 | $c = collecter_requests( |
| 62 | 62 | // white list |
| 63 | - objet_info('article','champs_editables'), |
|
| 63 | + objet_info('article', 'champs_editables'), |
|
| 64 | 64 | // black list |
| 65 | - array('date','statut','id_parent'), |
|
| 65 | + array('date', 'statut', 'id_parent'), |
|
| 66 | 66 | // donnees eventuellement fournies |
| 67 | 67 | $set |
| 68 | 68 | ); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | return $err; |
| 88 | 88 | |
| 89 | 89 | // Modification de statut, changement de rubrique ? |
| 90 | - $c = collecter_requests(array('date', 'statut', 'id_parent'),array(),$set); |
|
| 90 | + $c = collecter_requests(array('date', 'statut', 'id_parent'), array(), $set); |
|
| 91 | 91 | $err = article_instituer($id_article, $c); |
| 92 | 92 | |
| 93 | 93 | return $err; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | // Si id_rubrique vaut 0 ou n'est pas definie, creer l'article |
| 107 | 107 | // dans la premiere rubrique racine |
| 108 | 108 | if (!$id_rubrique = intval($id_rubrique)) { |
| 109 | - $row = sql_fetsel("id_rubrique, id_secteur, lang", "spip_rubriques", "id_parent=0",'', '0+titre,titre', "1"); |
|
| 109 | + $row = sql_fetsel("id_rubrique, id_secteur, lang", "spip_rubriques", "id_parent=0", '', '0+titre,titre', "1"); |
|
| 110 | 110 | $id_rubrique = $row['id_rubrique']; |
| 111 | 111 | } else $row = sql_fetsel("lang, id_secteur", "spip_rubriques", "id_rubrique=$id_rubrique"); |
| 112 | 112 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | // dans les rubriques, on essaie avec la langue de l'auteur, |
| 123 | 123 | // ou a defaut celle de la rubrique |
| 124 | 124 | // Sinon c'est la langue de la rubrique qui est choisie + heritee |
| 125 | - if (in_array('spip_articles',explode(',',$GLOBALS['meta']['multi_objets']))) { |
|
| 125 | + if (in_array('spip_articles', explode(',', $GLOBALS['meta']['multi_objets']))) { |
|
| 126 | 126 | lang_select($GLOBALS['visiteur_session']['lang']); |
| 127 | 127 | if (in_array($GLOBALS['spip_lang'], |
| 128 | 128 | explode(',', $GLOBALS['meta']['langues_multilingue']))) { |
@@ -167,11 +167,11 @@ discard block |
||
| 167 | 167 | ); |
| 168 | 168 | |
| 169 | 169 | // controler si le serveur n'a pas renvoye une erreur |
| 170 | - if ($id_article > 0){ |
|
| 171 | - $id_auteur = ((is_null(_request('id_auteur')) AND isset($GLOBALS['visiteur_session']['id_auteur']))? |
|
| 170 | + if ($id_article > 0) { |
|
| 171 | + $id_auteur = ((is_null(_request('id_auteur')) AND isset($GLOBALS['visiteur_session']['id_auteur'])) ? |
|
| 172 | 172 | $GLOBALS['visiteur_session']['id_auteur'] |
| 173 | 173 | :_request('id_auteur')); |
| 174 | - if ($id_auteur){ |
|
| 174 | + if ($id_auteur) { |
|
| 175 | 175 | include_spip('action/editer_auteur'); |
| 176 | 176 | auteur_associer($id_auteur, array('article'=>$id_article)); |
| 177 | 177 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | // statut et rubrique sont lies, car un admin restreint peut deplacer |
| 187 | 187 | // un article publie vers une rubrique qu'il n'administre pas |
| 188 | 188 | // http://doc.spip.org/@instituer_article |
| 189 | -function article_instituer($id_article, $c, $calcul_rub=true) { |
|
| 189 | +function article_instituer($id_article, $c, $calcul_rub = true) { |
|
| 190 | 190 | |
| 191 | 191 | include_spip('inc/autoriser'); |
| 192 | 192 | include_spip('inc/rubriques'); |
@@ -198,8 +198,8 @@ discard block |
||
| 198 | 198 | $date_ancienne = $date = $row['date']; |
| 199 | 199 | $champs = array(); |
| 200 | 200 | |
| 201 | - $d = isset($c['date'])?$c['date']:null; |
|
| 202 | - $s = isset($c['statut'])?$c['statut']:$statut; |
|
| 201 | + $d = isset($c['date']) ? $c['date'] : null; |
|
| 202 | + $s = isset($c['statut']) ? $c['statut'] : $statut; |
|
| 203 | 203 | |
| 204 | 204 | // cf autorisations dans inc/instituer_article |
| 205 | 205 | if ($s != $statut OR ($d AND $d != $date)) { |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | else if (autoriser('modifier', 'article', $id_article) AND $s != 'publie') |
| 209 | 209 | $statut = $champs['statut'] = $s; |
| 210 | 210 | else |
| 211 | - spip_log("editer_article $id_article refus " . join(' ', $c)); |
|
| 211 | + spip_log("editer_article $id_article refus ".join(' ', $c)); |
|
| 212 | 212 | |
| 213 | 213 | // En cas de publication, fixer la date a "maintenant" |
| 214 | 214 | // sauf si $c commande autre chose |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | if ($champs['statut'] == 'publie' |
| 218 | 218 | OR ($champs['statut'] == 'prop' AND ($d OR !in_array($statut_ancien, array('publie', 'prop')))) |
| 219 | 219 | ) { |
| 220 | - if ($d OR strtotime($d=$date)>time()) |
|
| 220 | + if ($d OR strtotime($d = $date) > time()) |
|
| 221 | 221 | $champs['date'] = $date = $d; |
| 222 | 222 | else |
| 223 | 223 | $champs['date'] = $date = date('Y-m-d H:i:s'); |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | // fabrique la requete de modification de l'article, avec champs herites |
| 299 | 299 | |
| 300 | 300 | // http://doc.spip.org/@editer_article_heritage |
| 301 | -function editer_article_heritage($id_article, $id_rubrique, $statut, $champs, $cond=true) { |
|
| 301 | +function editer_article_heritage($id_article, $id_rubrique, $statut, $champs, $cond = true) { |
|
| 302 | 302 | |
| 303 | 303 | // Si on deplace l'article |
| 304 | 304 | // changer aussi son secteur et sa langue (si heritee) |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | |
| 309 | 309 | $langue = $row_rub['lang']; |
| 310 | 310 | $champs['id_secteur'] = $row_rub['id_secteur']; |
| 311 | - if (sql_fetsel('1', 'spip_articles', "id_article=$id_article AND langue_choisie<>'oui' AND lang<>" . sql_quote($langue))) { |
|
| 311 | + if (sql_fetsel('1', 'spip_articles', "id_article=$id_article AND langue_choisie<>'oui' AND lang<>".sql_quote($langue))) { |
|
| 312 | 312 | $champs['lang'] = $langue; |
| 313 | 313 | } |
| 314 | 314 | } |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | |
| 322 | 322 | if ($cond) { |
| 323 | 323 | include_spip('inc/rubriques'); |
| 324 | - $postdate = ($GLOBALS['meta']["post_dates"] == "non" AND isset($champs['date']) AND (strtotime($champs['date']) < time()))?$champs['date']:false; |
|
| 324 | + $postdate = ($GLOBALS['meta']["post_dates"] == "non" AND isset($champs['date']) AND (strtotime($champs['date']) < time())) ? $champs['date'] : false; |
|
| 325 | 325 | calculer_rubriques_if($id_rubrique, $champs, $statut, $postdate); |
| 326 | 326 | } |
| 327 | 327 | } |
@@ -334,27 +334,27 @@ discard block |
||
| 334 | 334 | function trop_longs_articles() { |
| 335 | 335 | if (is_array($plus = _request('texte_plus'))) { |
| 336 | 336 | foreach ($plus as $n=>$t) { |
| 337 | - $plus[$n] = preg_replace(",<!--SPIP-->[\n\r]*,","", $t); |
|
| 337 | + $plus[$n] = preg_replace(",<!--SPIP-->[\n\r]*,", "", $t); |
|
| 338 | 338 | } |
| 339 | - set_request('texte', join('',$plus) . _request('texte')); |
|
| 339 | + set_request('texte', join('', $plus)._request('texte')); |
|
| 340 | 340 | } |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | |
| 344 | 344 | // obsoletes |
| 345 | -function revisions_articles ($id_article, $c=false) { |
|
| 346 | - return article_modifier($id_article,$c); |
|
| 345 | +function revisions_articles($id_article, $c = false) { |
|
| 346 | + return article_modifier($id_article, $c); |
|
| 347 | 347 | } |
| 348 | -function revision_article ($id_article, $c=false) { |
|
| 349 | - return article_modifier($id_article,$c); |
|
| 348 | +function revision_article($id_article, $c = false) { |
|
| 349 | + return article_modifier($id_article, $c); |
|
| 350 | 350 | } |
| 351 | -function articles_set($id_article, $set=null) { |
|
| 352 | - return article_modifier($id_article,$set); |
|
| 351 | +function articles_set($id_article, $set = null) { |
|
| 352 | + return article_modifier($id_article, $set); |
|
| 353 | 353 | } |
| 354 | 354 | function insert_article($id_rubrique) { |
| 355 | 355 | return article_inserer($id_rubrique); |
| 356 | 356 | } |
| 357 | -function instituer_article($id_article, $c, $calcul_rub=true) { |
|
| 358 | - return article_instituer($id_article,$c,$calcul_rub); |
|
| 357 | +function instituer_article($id_article, $c, $calcul_rub = true) { |
|
| 358 | + return article_instituer($id_article, $c, $calcul_rub); |
|
| 359 | 359 | } |
| 360 | 360 | ?> |