Changeset 93645 in spip-zone
- Timestamp:
- Dec 13, 2015, 2:44:38 PM (5 years ago)
- Location:
- _core_/plugins/mots
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
_core_/plugins/mots/action/editer_groupe_mots.php
r93617 r93645 70 70 // support de la signature derogatoire pour compat 71 71 // groupe_mots_inserer($table='') 72 if (is_string($id_parent) ANDstrlen($id_parent)) {72 if (is_string($id_parent) and strlen($id_parent)) { 73 73 if (is_null($set)) { 74 74 $set = array(); … … 167 167 } 168 168 169 if (isset($c['tables_liees']) ANDis_array($c['tables_liees'])) {169 if (isset($c['tables_liees']) and is_array($c['tables_liees'])) { 170 170 $c['tables_liees'] = implode(',', array_diff($c['tables_liees'], array(''))); 171 171 } … … 242 242 return groupe_mots_modifier($id_groupe, $set); 243 243 } 244 245 ?> -
_core_/plugins/mots/action/editer_mot.php
r93617 r93645 43 43 44 44 $id_groupe = intval(_request('id_groupe')); 45 if (!$id_mot AND$id_groupe) {45 if (!$id_mot and $id_groupe) { 46 46 $id_mot = mot_inserer($id_groupe); 47 47 } … … 169 169 $champs = array(); 170 170 // regler le groupe 171 if (isset($c['id_groupe']) ORisset($c['type'])) {171 if (isset($c['id_groupe']) or isset($c['type'])) { 172 172 $row = sql_fetsel("titre", "spip_groupes_mots", "id_groupe=" . intval($c['id_groupe'])); 173 173 if ($row) { … … 416 416 return mot_modifier($id_mot, $c); 417 417 } 418 419 ?> -
_core_/plugins/mots/action/supprimer_groupe_mots.php
r93617 r93645 48 48 } 49 49 } 50 51 52 ?> -
_core_/plugins/mots/action/supprimer_mot.php
r93617 r93645 32 32 mot_supprimer($id_mot); 33 33 } 34 35 ?> -
_core_/plugins/mots/base/mots.php
r93617 r93645 212 212 return $tables; 213 213 } 214 215 ?> -
_core_/plugins/mots/formulaires/configurer_mots.php
r93617 r93645 62 62 return $res; 63 63 } 64 -
_core_/plugins/mots/formulaires/editer_groupe_mot.php
r93617 r93645 175 175 return $res; 176 176 } 177 178 179 ?> -
_core_/plugins/mots/formulaires/editer_mot.php
r93617 r93645 77 77 // Si nouveau et titre dans l'url : fixer le titre 78 78 if ($id_mot == 'oui' 79 ANDstrlen($titre = _request('titre'))79 and strlen($titre = _request('titre')) 80 80 ) { 81 81 $valeurs['titre'] = $titre; … … 186 186 // on ne fait la verification que si c'est une creation de mot ou un retitrage 187 187 if (!intval($id_mot) 188 ORsupprimer_numero(_request('titre')) !== supprimer_numero(sql_getfetsel('titre', 'spip_mots',188 or supprimer_numero(_request('titre')) !== supprimer_numero(sql_getfetsel('titre', 'spip_mots', 189 189 'id_mot=' . intval($id_mot))) 190 190 ) { 191 if (!count($erreurs) AND!_request('confirm_titre_mot')) {191 if (!count($erreurs) and !_request('confirm_titre_mot')) { 192 192 if (sql_countsel("spip_mots", 193 193 "titre REGEXP " . sql_quote("^([0-9]+[.] )?" . preg_quote(supprimer_numero(_request('titre'))) . "$") … … 265 265 list($objet, $id_objet) = explode('|', $associer_objet); 266 266 } 267 if ($objet AND $id_objet ANDautoriser('modifier', $objet, $id_objet)) {267 if ($objet and $id_objet and autoriser('modifier', $objet, $id_objet)) { 268 268 include_spip('action/editer_mot'); 269 269 mot_associer($id_mot, array($objet => $id_objet)); … … 278 278 return $res; 279 279 } 280 281 282 ?> -
_core_/plugins/mots/inc/mots.php
r93617 r93645 41 41 42 42 // calculer tous les liens du groupe d'un coup 43 if (!isset 43 if (!isset($occurrences[$id_groupe])) { 44 44 $occurrences[$id_groupe] = calculer_utilisations_mots($id_groupe); 45 45 } … … 81 81 $table_objet_sql = table_objet_sql($objet); 82 82 $infos = lister_tables_objets_sql($table_objet_sql); 83 if (isset($infos['field']) AND$infos['field']) {83 if (isset($infos['field']) and $infos['field']) { 84 84 // uniquement certains statut d'objet, 85 85 // et uniquement si la table dispose du champ statut. 86 86 $statuts = ""; 87 if (isset($infos['field']['statut']) ORisset($infos['statut'][0]['champ'])) {87 if (isset($infos['field']['statut']) or isset($infos['statut'][0]['champ'])) { 88 88 // on s'approche au mieux de la declaration de l'objet. 89 89 // il faudrait ameliorer ce point. … … 91 91 92 92 // bricoler les statuts d'apres la declaration de l'objet (champ previsu a defaut de mieux) 93 if (array_key_exists('previsu', $infos['statut'][0]) ANDstrlen($infos['statut'][0]['previsu']) > 1) {93 if (array_key_exists('previsu', $infos['statut'][0]) and strlen($infos['statut'][0]['previsu']) > 1) { 94 94 $str_statuts = $infos['statut'][0]['previsu']; 95 95 if ($GLOBALS['connect_statut'] != "0minirezo") { … … 122 122 return $retour; 123 123 } 124 125 ?> -
_core_/plugins/mots/mots_administrations.php
r93617 r93645 38 38 $trouver_table = charger_fonction('trouver_table', 'base'); 39 39 if ($desc = $trouver_table('spip_mots') 40 AND isset($desc['exist']) AND$desc['exist']41 AND$desc = $trouver_table('spip_mots_articles')42 AND isset($desc['exist']) AND$desc['exist']40 and isset($desc['exist']) and $desc['exist'] 41 and $desc = $trouver_table('spip_mots_articles') 42 and isset($desc['exist']) and $desc['exist'] 43 43 ) { 44 44 ecrire_meta($nom_meta_base_version, '1.0.0'); … … 105 105 effacer_meta($nom_meta_base_version); 106 106 } 107 108 ?> -
_core_/plugins/mots/mots_autoriser.php
r93617 r93645 39 39 function autoriser_mots_menu_dist($faire, $type, $id, $qui, $opt) { 40 40 if ($qui['statut'] == '0minirezo') { 41 return ($GLOBALS['meta']['articles_mots'] != 'non' ORsql_countsel('spip_groupes_mots'));41 return ($GLOBALS['meta']['articles_mots'] != 'non' or sql_countsel('spip_groupes_mots')); 42 42 } 43 43 $where = ""; … … 50 50 51 51 return ($where 52 AND$GLOBALS['meta']['articles_mots'] != 'non'53 ANDsql_countsel('spip_groupes_mots', $where));52 and $GLOBALS['meta']['articles_mots'] != 'non' 53 and sql_countsel('spip_groupes_mots', $where)); 54 54 } 55 55 … … 68 68 // car elle désigne l'activation ou non des mots clés, quelque soit l'objet. 69 69 return ($GLOBALS['meta']['articles_mots'] != 'non' 70 ANDsql_countsel('spip_groupes_mots')71 ANDautoriser('creer', 'mot', null, $qui, $opt));70 and sql_countsel('spip_groupes_mots') 71 and autoriser('creer', 'mot', null, $qui, $opt)); 72 72 } 73 73 … … 91 91 } 92 92 $acces = sql_fetsel("comite,forum", "spip_groupes_mots", "id_groupe=" . intval($id)); 93 if ($qui['statut'] == '1comite' AND ($acces['comite'] == 'oui' OR$acces['forum'] == 'oui')) {93 if ($qui['statut'] == '1comite' and ($acces['comite'] == 'oui' or $acces['forum'] == 'oui')) { 94 94 return true; 95 95 } 96 if ($qui['statut'] == '6forum' AND$acces['forum'] == 'oui') {96 if ($qui['statut'] == '6forum' and $acces['forum'] == 'oui') { 97 97 return true; 98 98 } … … 114 114 return 115 115 $qui['statut'] == '0minirezo' 116 AND!$qui['restreint'];116 and !$qui['restreint']; 117 117 } 118 118 … … 132 132 function autoriser_groupemots_modifier_dist($faire, $type, $id, $qui, $opt) { 133 133 return 134 $qui['statut'] == '0minirezo' AND!$qui['restreint']135 ANDautoriser('voir', 'groupemots', $id, $qui, $opt);134 $qui['statut'] == '0minirezo' and !$qui['restreint'] 135 and autoriser('voir', 'groupemots', $id, $qui, $opt); 136 136 } 137 137 … … 176 176 : ( 177 177 $t = sql_getfetsel("id_groupe", "spip_mots", "id_mot=" . intval($id)) 178 ANDautoriser('modifier', 'groupemots', $t, $qui, $opt)178 and autoriser('modifier', 'groupemots', $t, $qui, $opt) 179 179 ); 180 180 } … … 197 197 **/ 198 198 function autoriser_mot_creer_dist($faire, $type, $id, $qui, $opt) { 199 if ($qui['statut'] != '0minirezo' OR$qui['restreint']) {199 if ($qui['statut'] != '0minirezo' or $qui['restreint']) { 200 200 return false; 201 201 } … … 205 205 // a la table correspondante 206 206 if (isset($opt['associer_objet']) 207 AND$associer_objet = $opt['associer_objet']207 and $associer_objet = $opt['associer_objet'] 208 208 ) { 209 209 if (!preg_match(',^(\w+)\|[0-9]+$,', $associer_objet, $match)) { … … 270 270 $droit = substr($qui['statut'], 1); 271 271 272 if (!isset($opt['groupe_champs']) AND!isset($opt['id_groupe'])) {272 if (!isset($opt['groupe_champs']) and !isset($opt['id_groupe'])) { 273 273 // chercher si un groupe est autorise pour mon statut 274 274 // et pour la table demandee … … 292 292 return 293 293 ($droit == 'oui') 294 AND294 and 295 295 // on verifie que l'objet demande est bien dans les tables liees 296 296 in_array( … … 357 357 */ 358 358 function autoriser_mot_iconifier_dist($faire, $type, $id, $qui, $opt) { 359 return (($qui['statut'] == '0minirezo') AND!$qui['restreint']);359 return (($qui['statut'] == '0minirezo') and !$qui['restreint']); 360 360 } 361 361 … … 371 371 */ 372 372 function autoriser_groupemots_iconifier_dist($faire, $type, $id, $qui, $opt) { 373 return (($qui['statut'] == '0minirezo') AND !$qui['restreint']); 374 } 375 376 ?> 373 return (($qui['statut'] == '0minirezo') and !$qui['restreint']); 374 } -
_core_/plugins/mots/mots_ieconfig.php
r93617 r93645 27 27 return $table; 28 28 } 29 30 ?> -
_core_/plugins/mots/mots_pipelines.php
r93617 r93645 57 57 // si on est sur une page ou il faut inserer les mots cles... 58 58 if ($en_cours = trouver_objet_exec($flux['args']['exec']) 59 AND$en_cours['edition'] !== true // page visu60 AND$type = $en_cours['type']61 AND$id_table_objet = $en_cours['id_table_objet']62 ANDisset($flux['args'][$id_table_objet])63 AND($id = intval($flux['args'][$id_table_objet]))59 and $en_cours['edition'] !== true // page visu 60 and $type = $en_cours['type'] 61 and $id_table_objet = $en_cours['id_table_objet'] 62 and isset($flux['args'][$id_table_objet]) 63 and ($id = intval($flux['args'][$id_table_objet])) 64 64 ) { 65 65 $texte = recuperer_fond( … … 130 130 return $flux; 131 131 } 132 133 ?> -
_core_/plugins/mots/prive/objets/infos/mot_fonctions.php
r93617 r93645 22 22 23 23 include_spip('inc/mots'); 24 25 ?> -
_core_/plugins/mots/prive/objets/liste/mots-admin_fonctions.php
r93617 r93645 21 21 22 22 include_spip('inc/mots'); 23 24 ?>
Note: See TracChangeset
for help on using the changeset viewer.