@@ -5,23 +5,23 @@ |
||
| 5 | 5 | include_spip('inc/actions'); |
| 6 | 6 | // http://doc.spip.org/@exec_info_plugin_dist |
| 7 | 7 | function exec_info_plugin_dist() { |
| 8 | - if (!autoriser('configurer', '_plugins')) { |
|
| 9 | - include_spip('inc/minipres'); |
|
| 10 | - echo minipres(); |
|
| 11 | - } else { |
|
| 12 | - $plug = _DIR_RACINE . _request('plugin'); |
|
| 13 | - $get_infos = charger_fonction('get_infos','plugins'); |
|
| 14 | - $dir = ""; |
|
| 15 | - if (strncmp($plug,_DIR_PLUGINS,strlen(_DIR_PLUGINS))==0) |
|
| 16 | - $dir = _DIR_PLUGINS; |
|
| 17 | - elseif (strncmp($plug,_DIR_PLUGINS_DIST,strlen(_DIR_PLUGINS_DIST))==0) |
|
| 18 | - $dir = _DIR_PLUGINS_DIST; |
|
| 19 | - if ($dir) |
|
| 20 | - $plug = substr($plug,strlen($dir)); |
|
| 21 | - $info = $get_infos($plug,false,$dir); |
|
| 22 | - $afficher_plugin = charger_fonction("afficher_plugin","plugins"); |
|
| 23 | - ajax_retour(affiche_bloc_plugin($plug, $info, $dir)); |
|
| 24 | - } |
|
| 8 | + if (!autoriser('configurer', '_plugins')) { |
|
| 9 | + include_spip('inc/minipres'); |
|
| 10 | + echo minipres(); |
|
| 11 | + } else { |
|
| 12 | + $plug = _DIR_RACINE . _request('plugin'); |
|
| 13 | + $get_infos = charger_fonction('get_infos','plugins'); |
|
| 14 | + $dir = ""; |
|
| 15 | + if (strncmp($plug,_DIR_PLUGINS,strlen(_DIR_PLUGINS))==0) |
|
| 16 | + $dir = _DIR_PLUGINS; |
|
| 17 | + elseif (strncmp($plug,_DIR_PLUGINS_DIST,strlen(_DIR_PLUGINS_DIST))==0) |
|
| 18 | + $dir = _DIR_PLUGINS_DIST; |
|
| 19 | + if ($dir) |
|
| 20 | + $plug = substr($plug,strlen($dir)); |
|
| 21 | + $info = $get_infos($plug,false,$dir); |
|
| 22 | + $afficher_plugin = charger_fonction("afficher_plugin","plugins"); |
|
| 23 | + ajax_retour(affiche_bloc_plugin($plug, $info, $dir)); |
|
| 24 | + } |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | ?> |
@@ -25,25 +25,25 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | function exec_base_repair_dist() |
| 27 | 27 | { |
| 28 | - $ok = false; |
|
| 29 | - if (!spip_connect()) |
|
| 30 | - $message = _T('titre_probleme_technique'); |
|
| 31 | - else { |
|
| 32 | - $version_sql = sql_version(); |
|
| 33 | - if (!$version_sql) |
|
| 34 | - $message = _T('avis_erreur_connexion_mysql'); |
|
| 35 | - else { |
|
| 36 | - $message = _T('texte_requetes_echouent'); |
|
| 37 | - $ok = true; |
|
| 38 | - } |
|
| 39 | - $action = _T('texte_tenter_reparation'); |
|
| 40 | - } |
|
| 41 | - if ($ok) { |
|
| 42 | - $admin = charger_fonction('admin', 'inc'); |
|
| 43 | - echo $admin('repair', $action, $message, true); |
|
| 44 | - } else { |
|
| 45 | - include_spip('inc/minipres'); |
|
| 46 | - echo minipres(_T('titre_reparation'), "<p>$message</p>"); |
|
| 47 | - } |
|
| 28 | + $ok = false; |
|
| 29 | + if (!spip_connect()) |
|
| 30 | + $message = _T('titre_probleme_technique'); |
|
| 31 | + else { |
|
| 32 | + $version_sql = sql_version(); |
|
| 33 | + if (!$version_sql) |
|
| 34 | + $message = _T('avis_erreur_connexion_mysql'); |
|
| 35 | + else { |
|
| 36 | + $message = _T('texte_requetes_echouent'); |
|
| 37 | + $ok = true; |
|
| 38 | + } |
|
| 39 | + $action = _T('texte_tenter_reparation'); |
|
| 40 | + } |
|
| 41 | + if ($ok) { |
|
| 42 | + $admin = charger_fonction('admin', 'inc'); |
|
| 43 | + echo $admin('repair', $action, $message, true); |
|
| 44 | + } else { |
|
| 45 | + include_spip('inc/minipres'); |
|
| 46 | + echo minipres(_T('titre_reparation'), "<p>$message</p>"); |
|
| 47 | + } |
|
| 48 | 48 | } |
| 49 | 49 | ?> |
@@ -17,31 +17,31 @@ |
||
| 17 | 17 | // http://doc.spip.org/@exec_puce_statut_dist |
| 18 | 18 | function exec_puce_statut_dist() |
| 19 | 19 | { |
| 20 | - exec_puce_statut_args(_request('id'), _request('type')); |
|
| 20 | + exec_puce_statut_args(_request('id'), _request('type')); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | // http://doc.spip.org/@exec_puce_statut_args |
| 24 | 24 | function exec_puce_statut_args($id, $type) |
| 25 | 25 | { |
| 26 | - if ($table_objet_sql = table_objet_sql($type) |
|
| 27 | - AND $d = lister_tables_objets_sql($table_objet_sql) |
|
| 28 | - AND isset($d['statut_textes_instituer']) |
|
| 29 | - AND $d['statut_textes_instituer']) { |
|
| 30 | - $prim = id_table_objet($type); |
|
| 31 | - $id = intval($id); |
|
| 32 | - if (isset($d['field']['id_rubrique'])) |
|
| 33 | - $select = "id_rubrique,statut"; |
|
| 34 | - else |
|
| 35 | - $select = "0 as id_rubrique,statut"; |
|
| 36 | - $r = sql_fetsel($select, $table_objet_sql, "$prim=$id"); |
|
| 37 | - $statut = $r['statut']; |
|
| 38 | - $id_rubrique = $r['id_rubrique']; |
|
| 39 | - } |
|
| 40 | - else { |
|
| 41 | - $id_rubrique = intval($id); |
|
| 42 | - $statut = 'prop'; // arbitraire |
|
| 43 | - } |
|
| 44 | - $puce_statut = charger_fonction('puce_statut', 'inc'); |
|
| 45 | - ajax_retour($puce_statut($id,$statut,$id_rubrique,$type, true)); |
|
| 26 | + if ($table_objet_sql = table_objet_sql($type) |
|
| 27 | + AND $d = lister_tables_objets_sql($table_objet_sql) |
|
| 28 | + AND isset($d['statut_textes_instituer']) |
|
| 29 | + AND $d['statut_textes_instituer']) { |
|
| 30 | + $prim = id_table_objet($type); |
|
| 31 | + $id = intval($id); |
|
| 32 | + if (isset($d['field']['id_rubrique'])) |
|
| 33 | + $select = "id_rubrique,statut"; |
|
| 34 | + else |
|
| 35 | + $select = "0 as id_rubrique,statut"; |
|
| 36 | + $r = sql_fetsel($select, $table_objet_sql, "$prim=$id"); |
|
| 37 | + $statut = $r['statut']; |
|
| 38 | + $id_rubrique = $r['id_rubrique']; |
|
| 39 | + } |
|
| 40 | + else { |
|
| 41 | + $id_rubrique = intval($id); |
|
| 42 | + $statut = 'prop'; // arbitraire |
|
| 43 | + } |
|
| 44 | + $puce_statut = charger_fonction('puce_statut', 'inc'); |
|
| 45 | + ajax_retour($puce_statut($id,$statut,$id_rubrique,$type, true)); |
|
| 46 | 46 | } |
| 47 | 47 | ?> |
@@ -22,84 +22,84 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | function exec_fond_monobloc_dist(){ |
| 24 | 24 | |
| 25 | - // pas d'autorisation |
|
| 26 | - // c'est au fond de les gerer avec #AUTORISER, et de renvoyer un fond vide le cas echeant |
|
| 27 | - // qui declenchera un minipres acces interdit |
|
| 28 | - $exec = _request('exec'); |
|
| 29 | - $fond = trim(recuperer_fond("prive/exec/$exec",$_REQUEST)); |
|
| 30 | - if (!$fond) { |
|
| 31 | - include_spip('inc/minipres'); |
|
| 32 | - echo minipres(); |
|
| 33 | - } else { |
|
| 34 | - |
|
| 35 | - $titre = "exec_$exec"; |
|
| 36 | - $hierarchie = ""; |
|
| 37 | - $navigation = ""; |
|
| 38 | - $extra = ""; |
|
| 39 | - |
|
| 40 | - // recuperer le titre dans le premier hn de la page |
|
| 41 | - if (preg_match(",<h[1-6][^>]*>(.+)</h[1-6]>,Uims",$fond,$match)){ |
|
| 42 | - $titre = $match[1]; |
|
| 43 | - } |
|
| 44 | - |
|
| 45 | - // recuperer la hierarchie (au-dessus du contenu) |
|
| 46 | - if (preg_match(",<!--#hierarchie-->.+<!--/#hierarchie-->,Uims",$fond,$match)){ |
|
| 47 | - $hierarchie = $match[0]; |
|
| 48 | - $fond = str_replace($hierarchie,"",$fond); |
|
| 49 | - } |
|
| 50 | - |
|
| 51 | - // recuperer la navigation (colonne de gauche) |
|
| 52 | - if (preg_match(",<!--#navigation-->.+<!--/#navigation-->,Uims",$fond,$match)){ |
|
| 53 | - $navigation = $match[0]; |
|
| 54 | - $fond = str_replace($navigation,"",$fond); |
|
| 55 | - } |
|
| 56 | - |
|
| 57 | - // recuperer les extras (colonne de droite) |
|
| 58 | - if (preg_match(",<!--#extra-->.+<!--/#extra-->,Uims",$fond,$match)){ |
|
| 59 | - $extra = $match[0]; |
|
| 60 | - $fond = str_replace($extra,"",$fond); |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini |
|
| 64 | - $commencer_page = charger_fonction('commencer_page','inc'); |
|
| 65 | - echo $commencer_page($titre); |
|
| 66 | - |
|
| 67 | - if ($hierarchie){ |
|
| 68 | - echo debut_grand_cadre(true); |
|
| 69 | - echo pipeline( |
|
| 70 | - 'affiche_hierarchie', |
|
| 71 | - array( |
|
| 72 | - 'args' => array( |
|
| 73 | - 'exec' => $exec |
|
| 74 | - ), |
|
| 75 | - 'data' => $hierarchie |
|
| 76 | - ) |
|
| 77 | - ); |
|
| 78 | - echo fin_grand_cadre(true); |
|
| 79 | - } |
|
| 80 | - |
|
| 81 | - echo debut_gauche("exec_$exec",true); |
|
| 82 | - |
|
| 83 | - $contexte = array('exec'=>$exec); |
|
| 84 | - if ($objet_exec = trouver_objet_exec($exec)){ |
|
| 85 | - $id = $objet_exec['id_table_objet']; |
|
| 86 | - if (_request($id)) |
|
| 87 | - $contexte[$id] = _request($id); |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - echo $navigation; |
|
| 91 | - echo pipeline('affiche_gauche',array('args'=>$contexte,'data'=>'')); |
|
| 92 | - |
|
| 93 | - echo creer_colonne_droite("exec_$exec",true); |
|
| 94 | - echo $extra; |
|
| 95 | - echo pipeline('affiche_droite',array('args'=>$contexte,'data'=>'')); |
|
| 96 | - |
|
| 97 | - echo debut_droite("exec_$exec",true); |
|
| 98 | - echo $fond; |
|
| 99 | - echo pipeline('affiche_milieu',array('args'=>$contexte,'data'=>'')); |
|
| 100 | - |
|
| 101 | - echo fin_gauche(),fin_page(); |
|
| 102 | - } |
|
| 25 | + // pas d'autorisation |
|
| 26 | + // c'est au fond de les gerer avec #AUTORISER, et de renvoyer un fond vide le cas echeant |
|
| 27 | + // qui declenchera un minipres acces interdit |
|
| 28 | + $exec = _request('exec'); |
|
| 29 | + $fond = trim(recuperer_fond("prive/exec/$exec",$_REQUEST)); |
|
| 30 | + if (!$fond) { |
|
| 31 | + include_spip('inc/minipres'); |
|
| 32 | + echo minipres(); |
|
| 33 | + } else { |
|
| 34 | + |
|
| 35 | + $titre = "exec_$exec"; |
|
| 36 | + $hierarchie = ""; |
|
| 37 | + $navigation = ""; |
|
| 38 | + $extra = ""; |
|
| 39 | + |
|
| 40 | + // recuperer le titre dans le premier hn de la page |
|
| 41 | + if (preg_match(",<h[1-6][^>]*>(.+)</h[1-6]>,Uims",$fond,$match)){ |
|
| 42 | + $titre = $match[1]; |
|
| 43 | + } |
|
| 44 | + |
|
| 45 | + // recuperer la hierarchie (au-dessus du contenu) |
|
| 46 | + if (preg_match(",<!--#hierarchie-->.+<!--/#hierarchie-->,Uims",$fond,$match)){ |
|
| 47 | + $hierarchie = $match[0]; |
|
| 48 | + $fond = str_replace($hierarchie,"",$fond); |
|
| 49 | + } |
|
| 50 | + |
|
| 51 | + // recuperer la navigation (colonne de gauche) |
|
| 52 | + if (preg_match(",<!--#navigation-->.+<!--/#navigation-->,Uims",$fond,$match)){ |
|
| 53 | + $navigation = $match[0]; |
|
| 54 | + $fond = str_replace($navigation,"",$fond); |
|
| 55 | + } |
|
| 56 | + |
|
| 57 | + // recuperer les extras (colonne de droite) |
|
| 58 | + if (preg_match(",<!--#extra-->.+<!--/#extra-->,Uims",$fond,$match)){ |
|
| 59 | + $extra = $match[0]; |
|
| 60 | + $fond = str_replace($extra,"",$fond); |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini |
|
| 64 | + $commencer_page = charger_fonction('commencer_page','inc'); |
|
| 65 | + echo $commencer_page($titre); |
|
| 66 | + |
|
| 67 | + if ($hierarchie){ |
|
| 68 | + echo debut_grand_cadre(true); |
|
| 69 | + echo pipeline( |
|
| 70 | + 'affiche_hierarchie', |
|
| 71 | + array( |
|
| 72 | + 'args' => array( |
|
| 73 | + 'exec' => $exec |
|
| 74 | + ), |
|
| 75 | + 'data' => $hierarchie |
|
| 76 | + ) |
|
| 77 | + ); |
|
| 78 | + echo fin_grand_cadre(true); |
|
| 79 | + } |
|
| 80 | + |
|
| 81 | + echo debut_gauche("exec_$exec",true); |
|
| 82 | + |
|
| 83 | + $contexte = array('exec'=>$exec); |
|
| 84 | + if ($objet_exec = trouver_objet_exec($exec)){ |
|
| 85 | + $id = $objet_exec['id_table_objet']; |
|
| 86 | + if (_request($id)) |
|
| 87 | + $contexte[$id] = _request($id); |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + echo $navigation; |
|
| 91 | + echo pipeline('affiche_gauche',array('args'=>$contexte,'data'=>'')); |
|
| 92 | + |
|
| 93 | + echo creer_colonne_droite("exec_$exec",true); |
|
| 94 | + echo $extra; |
|
| 95 | + echo pipeline('affiche_droite',array('args'=>$contexte,'data'=>'')); |
|
| 96 | + |
|
| 97 | + echo debut_droite("exec_$exec",true); |
|
| 98 | + echo $fond; |
|
| 99 | + echo pipeline('affiche_milieu',array('args'=>$contexte,'data'=>'')); |
|
| 100 | + |
|
| 101 | + echo fin_gauche(),fin_page(); |
|
| 102 | + } |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | ?> |
@@ -16,81 +16,81 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | // http://doc.spip.org/@exec_rechercher_dist |
| 18 | 18 | function exec_rechercher_dist(){ |
| 19 | - $id = intval(_request('id')); |
|
| 20 | - $exclus = intval(_request('exclus')); |
|
| 21 | - $rac = spip_htmlentities(_request('rac')); |
|
| 22 | - $type = _request('type'); |
|
| 23 | - $do = _request('do'); |
|
| 24 | - if (preg_match('/^\w*$/', $do)) |
|
| 25 | - $r = exec_rechercher_args($id, $type, $exclus, $rac, $do); |
|
| 26 | - else $r = ''; |
|
| 27 | - ajax_retour($r); |
|
| 19 | + $id = intval(_request('id')); |
|
| 20 | + $exclus = intval(_request('exclus')); |
|
| 21 | + $rac = spip_htmlentities(_request('rac')); |
|
| 22 | + $type = _request('type'); |
|
| 23 | + $do = _request('do'); |
|
| 24 | + if (preg_match('/^\w*$/', $do)) |
|
| 25 | + $r = exec_rechercher_args($id, $type, $exclus, $rac, $do); |
|
| 26 | + else $r = ''; |
|
| 27 | + ajax_retour($r); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | // http://doc.spip.org/@exec_rechercher_args |
| 31 | 31 | function exec_rechercher_args($id, $type, $exclus, $rac, $do){ |
| 32 | - if (!$do) $do = 'aff'; |
|
| 33 | - |
|
| 34 | - $where = preg_split(",\s+,", $type); |
|
| 35 | - if ($where){ |
|
| 36 | - foreach ($where as $k => $v){ |
|
| 37 | - $where[$k] = "'%" . substr(str_replace("%", "\%", sql_quote($v,'','string')), 1, -1) . "%'"; |
|
| 38 | - } |
|
| 39 | - $where_titre = ("(titre LIKE " . join(" AND titre LIKE ", $where) . ")"); |
|
| 40 | - $where_desc = ("(descriptif LIKE " . join(" AND descriptif LIKE ", $where) . ")"); |
|
| 41 | - $where_id = ("(id_rubrique = " . intval($type) . ")"); |
|
| 42 | - } else { |
|
| 43 | - $where_titre = " 1=2"; |
|
| 44 | - $where_desc = " 1=2"; |
|
| 45 | - $where_id = " 1=2"; |
|
| 46 | - } |
|
| 47 | - |
|
| 48 | - if ($exclus){ |
|
| 49 | - include_spip('inc/rubriques'); |
|
| 50 | - $where_exclus = " AND " . sql_in('id_rubrique', calcul_branche_in($exclus), 'NOT'); |
|
| 51 | - } else $where_exclus = ''; |
|
| 52 | - |
|
| 53 | - $res = sql_select("id_rubrique, id_parent, titre", "spip_rubriques", "$where_id$where_exclus"); |
|
| 54 | - |
|
| 55 | - $points = $rub = array(); |
|
| 56 | - |
|
| 57 | - while ($row = sql_fetch($res)){ |
|
| 58 | - $id_rubrique = $row["id_rubrique"]; |
|
| 59 | - $rub[$id_rubrique]["titre"] = typo($row["titre"]); |
|
| 60 | - $rub[$id_rubrique]["id_parent"] = $row["id_parent"]; |
|
| 61 | - $points[$id_rubrique] = $points[$id_rubrique]+3; |
|
| 62 | - } |
|
| 63 | - $res = sql_select("id_rubrique, id_parent, titre", "spip_rubriques", "$where_titre$where_exclus"); |
|
| 64 | - |
|
| 65 | - while ($row = sql_fetch($res)){ |
|
| 66 | - $id_rubrique = $row["id_rubrique"]; |
|
| 67 | - $rub[$id_rubrique]["titre"] = typo($row["titre"]); |
|
| 68 | - $rub[$id_rubrique]["id_parent"] = $row["id_parent"]; |
|
| 69 | - if (isset($points[$id_rubrique])) |
|
| 70 | - $points[$id_rubrique] += 2; |
|
| 71 | - else $points[$id_rubrique] = 0; |
|
| 72 | - } |
|
| 73 | - $res = sql_select("id_rubrique, id_parent, titre", "spip_rubriques", "$where_desc$where_exclus"); |
|
| 74 | - |
|
| 75 | - while ($row = sql_fetch($res)){ |
|
| 76 | - $id_rubrique = $row["id_rubrique"]; |
|
| 77 | - $rub[$id_rubrique]["titre"] = typo($row["titre"]); |
|
| 78 | - $rub[$id_rubrique]["id_parent"] = $row["id_parent"]; |
|
| 79 | - if (isset($points[$id_rubrique])) |
|
| 80 | - $points[$id_rubrique] += 1; |
|
| 81 | - else $points[$id_rubrique] = 0; |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - if ($points){ |
|
| 85 | - arsort($points); |
|
| 86 | - $style = " style='background-image: url(" . chemin_image('secteur-12.png') . ")'"; |
|
| 87 | - foreach ($rub as $k => $v){ |
|
| 88 | - $rub[$k]['atts'] = ($v["id_parent"] ? $style : '') |
|
| 89 | - . " class='petite-rubrique'"; |
|
| 90 | - } |
|
| 91 | - } |
|
| 92 | - |
|
| 93 | - return (proposer_item($points, $rub, $rac, $type, $do)); |
|
| 32 | + if (!$do) $do = 'aff'; |
|
| 33 | + |
|
| 34 | + $where = preg_split(",\s+,", $type); |
|
| 35 | + if ($where){ |
|
| 36 | + foreach ($where as $k => $v){ |
|
| 37 | + $where[$k] = "'%" . substr(str_replace("%", "\%", sql_quote($v,'','string')), 1, -1) . "%'"; |
|
| 38 | + } |
|
| 39 | + $where_titre = ("(titre LIKE " . join(" AND titre LIKE ", $where) . ")"); |
|
| 40 | + $where_desc = ("(descriptif LIKE " . join(" AND descriptif LIKE ", $where) . ")"); |
|
| 41 | + $where_id = ("(id_rubrique = " . intval($type) . ")"); |
|
| 42 | + } else { |
|
| 43 | + $where_titre = " 1=2"; |
|
| 44 | + $where_desc = " 1=2"; |
|
| 45 | + $where_id = " 1=2"; |
|
| 46 | + } |
|
| 47 | + |
|
| 48 | + if ($exclus){ |
|
| 49 | + include_spip('inc/rubriques'); |
|
| 50 | + $where_exclus = " AND " . sql_in('id_rubrique', calcul_branche_in($exclus), 'NOT'); |
|
| 51 | + } else $where_exclus = ''; |
|
| 52 | + |
|
| 53 | + $res = sql_select("id_rubrique, id_parent, titre", "spip_rubriques", "$where_id$where_exclus"); |
|
| 54 | + |
|
| 55 | + $points = $rub = array(); |
|
| 56 | + |
|
| 57 | + while ($row = sql_fetch($res)){ |
|
| 58 | + $id_rubrique = $row["id_rubrique"]; |
|
| 59 | + $rub[$id_rubrique]["titre"] = typo($row["titre"]); |
|
| 60 | + $rub[$id_rubrique]["id_parent"] = $row["id_parent"]; |
|
| 61 | + $points[$id_rubrique] = $points[$id_rubrique]+3; |
|
| 62 | + } |
|
| 63 | + $res = sql_select("id_rubrique, id_parent, titre", "spip_rubriques", "$where_titre$where_exclus"); |
|
| 64 | + |
|
| 65 | + while ($row = sql_fetch($res)){ |
|
| 66 | + $id_rubrique = $row["id_rubrique"]; |
|
| 67 | + $rub[$id_rubrique]["titre"] = typo($row["titre"]); |
|
| 68 | + $rub[$id_rubrique]["id_parent"] = $row["id_parent"]; |
|
| 69 | + if (isset($points[$id_rubrique])) |
|
| 70 | + $points[$id_rubrique] += 2; |
|
| 71 | + else $points[$id_rubrique] = 0; |
|
| 72 | + } |
|
| 73 | + $res = sql_select("id_rubrique, id_parent, titre", "spip_rubriques", "$where_desc$where_exclus"); |
|
| 74 | + |
|
| 75 | + while ($row = sql_fetch($res)){ |
|
| 76 | + $id_rubrique = $row["id_rubrique"]; |
|
| 77 | + $rub[$id_rubrique]["titre"] = typo($row["titre"]); |
|
| 78 | + $rub[$id_rubrique]["id_parent"] = $row["id_parent"]; |
|
| 79 | + if (isset($points[$id_rubrique])) |
|
| 80 | + $points[$id_rubrique] += 1; |
|
| 81 | + else $points[$id_rubrique] = 0; |
|
| 82 | + } |
|
| 83 | + |
|
| 84 | + if ($points){ |
|
| 85 | + arsort($points); |
|
| 86 | + $style = " style='background-image: url(" . chemin_image('secteur-12.png') . ")'"; |
|
| 87 | + foreach ($rub as $k => $v){ |
|
| 88 | + $rub[$k]['atts'] = ($v["id_parent"] ? $style : '') |
|
| 89 | + . " class='petite-rubrique'"; |
|
| 90 | + } |
|
| 91 | + } |
|
| 92 | + |
|
| 93 | + return (proposer_item($points, $rub, $rac, $type, $do)); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | // Resultat de la recherche interactive demandee par la fonction JS |
@@ -101,34 +101,34 @@ discard block |
||
| 101 | 101 | // http://doc.spip.org/@proposer_item |
| 102 | 102 | function proposer_item($ids, $titles, $rac, $type, $do){ |
| 103 | 103 | |
| 104 | - if (!$ids) |
|
| 105 | - return "<br /><br /><div style='padding: 5px; color: red;'><b>" |
|
| 106 | - . spip_htmlentities($type) |
|
| 107 | - . "</b> : " . _T('avis_aucun_resultat') . "</div>"; |
|
| 104 | + if (!$ids) |
|
| 105 | + return "<br /><br /><div style='padding: 5px; color: red;'><b>" |
|
| 106 | + . spip_htmlentities($type) |
|
| 107 | + . "</b> : " . _T('avis_aucun_resultat') . "</div>"; |
|
| 108 | 108 | |
| 109 | - $ret = ''; |
|
| 110 | - $info = generer_url_ecrire('informer', "type=rubrique&rac=$rac&id="); |
|
| 109 | + $ret = ''; |
|
| 110 | + $info = generer_url_ecrire('informer', "type=rubrique&rac=$rac&id="); |
|
| 111 | 111 | |
| 112 | - $onClick = "aff_selection(this.firstChild.title,'$rac" . "_selection','$info', event)"; |
|
| 112 | + $onClick = "aff_selection(this.firstChild.title,'$rac" . "_selection','$info', event)"; |
|
| 113 | 113 | |
| 114 | - $ondbClick = "$do(this.firstChild.firstChild.nodeValue,this.firstChild.title,'selection_rubrique', 'id_parent');"; |
|
| 114 | + $ondbClick = "$do(this.firstChild.firstChild.nodeValue,this.firstChild.title,'selection_rubrique', 'id_parent');"; |
|
| 115 | 115 | |
| 116 | - foreach ($ids as $id => $bof){ |
|
| 116 | + foreach ($ids as $id => $bof){ |
|
| 117 | 117 | |
| 118 | - $titre = strtr(str_replace("'", "’", str_replace('"', """, textebrut($titles[$id]["titre"]))), "\n\r", " "); |
|
| 118 | + $titre = strtr(str_replace("'", "’", str_replace('"', """, textebrut($titles[$id]["titre"]))), "\n\r", " "); |
|
| 119 | 119 | |
| 120 | - $ret .= "<div class='highlight off'\nonclick=\"changerhighlight(this); " |
|
| 121 | - . $onClick |
|
| 122 | - . "\"\nondblclick=\"" |
|
| 123 | - . $ondbClick |
|
| 124 | - . $onClick |
|
| 125 | - . " \"><div" |
|
| 126 | - . $titles[$id]["atts"] |
|
| 127 | - . " title='$id'> " |
|
| 128 | - . $titre |
|
| 129 | - . "</div></div>"; |
|
| 130 | - } |
|
| 131 | - return $ret; |
|
| 120 | + $ret .= "<div class='highlight off'\nonclick=\"changerhighlight(this); " |
|
| 121 | + . $onClick |
|
| 122 | + . "\"\nondblclick=\"" |
|
| 123 | + . $ondbClick |
|
| 124 | + . $onClick |
|
| 125 | + . " \"><div" |
|
| 126 | + . $titles[$id]["atts"] |
|
| 127 | + . " title='$id'> " |
|
| 128 | + . $titre |
|
| 129 | + . "</div></div>"; |
|
| 130 | + } |
|
| 131 | + return $ret; |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | ?> |
@@ -17,22 +17,22 @@ |
||
| 17 | 17 | $GLOBALS['delais'] = 0;// pas de cache ! |
| 18 | 18 | // Securite |
| 19 | 19 | if (strstr($fond, '/')) { |
| 20 | - if (!include_spip('inc/autoriser') |
|
| 21 | - OR !autoriser('webmestre')) { |
|
| 22 | - include_spip('inc/minipres'); |
|
| 23 | - echo minipres(); |
|
| 24 | - exit; |
|
| 25 | - } |
|
| 20 | + if (!include_spip('inc/autoriser') |
|
| 21 | + OR !autoriser('webmestre')) { |
|
| 22 | + include_spip('inc/minipres'); |
|
| 23 | + echo minipres(); |
|
| 24 | + exit; |
|
| 25 | + } |
|
| 26 | 26 | } |
| 27 | 27 | else |
| 28 | - $fond = "prive/squelettes/$fond"; |
|
| 28 | + $fond = "prive/squelettes/$fond"; |
|
| 29 | 29 | |
| 30 | 30 | // quelques inclusions et ini prealables |
| 31 | 31 | include_spip('inc/commencer_page'); |
| 32 | 32 | |
| 33 | 33 | function shutdown_error(){ |
| 34 | 34 | |
| 35 | - // si on arrive ici avec un tampon non ferme : erreur fatale |
|
| 35 | + // si on arrive ici avec un tampon non ferme : erreur fatale |
|
| 36 | 36 | /* if (ob_get_level()){ |
| 37 | 37 | // envoyer tous les tampons |
| 38 | 38 | while (ob_get_level()) |
@@ -17,20 +17,20 @@ |
||
| 17 | 17 | // http://doc.spip.org/@exec_plonger_dist |
| 18 | 18 | function exec_plonger_dist() |
| 19 | 19 | { |
| 20 | - include_spip('inc/actions'); |
|
| 20 | + include_spip('inc/actions'); |
|
| 21 | 21 | |
| 22 | - $rac = _request('rac'); |
|
| 23 | - $id = intval(_request('id')); |
|
| 24 | - $exclus = intval(_request('exclus')); |
|
| 25 | - $col = intval(_request('col')); |
|
| 26 | - $do = _request('do'); |
|
| 27 | - if (preg_match('/^\w*$/', $do)) { |
|
| 28 | - if (!$do) $do = 'aff'; |
|
| 22 | + $rac = _request('rac'); |
|
| 23 | + $id = intval(_request('id')); |
|
| 24 | + $exclus = intval(_request('exclus')); |
|
| 25 | + $col = intval(_request('col')); |
|
| 26 | + $do = _request('do'); |
|
| 27 | + if (preg_match('/^\w*$/', $do)) { |
|
| 28 | + if (!$do) $do = 'aff'; |
|
| 29 | 29 | |
| 30 | - $plonger = charger_fonction('plonger', 'inc'); |
|
| 31 | - $r = $plonger($id, spip_htmlentities($rac), array(), $col, $exclus, $do); |
|
| 32 | - } else $r = ''; |
|
| 30 | + $plonger = charger_fonction('plonger', 'inc'); |
|
| 31 | + $r = $plonger($id, spip_htmlentities($rac), array(), $col, $exclus, $do); |
|
| 32 | + } else $r = ''; |
|
| 33 | 33 | |
| 34 | - ajax_retour($r); |
|
| 34 | + ajax_retour($r); |
|
| 35 | 35 | } |
| 36 | 36 | ?> |
@@ -15,30 +15,30 @@ |
||
| 15 | 15 | |
| 16 | 16 | // http://doc.spip.org/@exec_demande_mise_a_jour_dist |
| 17 | 17 | function exec_demande_mise_a_jour_dist() { |
| 18 | - // on fait la verif du path avant tout, |
|
| 19 | - // et l'installation des qu'on est dans la colonne principale |
|
| 20 | - // si jamais la liste des plugins actifs change, il faut faire un refresh du hit |
|
| 21 | - // pour etre sur que les bons fichiers seront charges lors de l'install |
|
| 22 | - include_spip('inc/plugin'); |
|
| 23 | - if (actualise_plugins_actifs()){ |
|
| 24 | - include_spip('inc/headers'); |
|
| 25 | - redirige_par_entete(self()); |
|
| 26 | - } |
|
| 18 | + // on fait la verif du path avant tout, |
|
| 19 | + // et l'installation des qu'on est dans la colonne principale |
|
| 20 | + // si jamais la liste des plugins actifs change, il faut faire un refresh du hit |
|
| 21 | + // pour etre sur que les bons fichiers seront charges lors de l'install |
|
| 22 | + include_spip('inc/plugin'); |
|
| 23 | + if (actualise_plugins_actifs()){ |
|
| 24 | + include_spip('inc/headers'); |
|
| 25 | + redirige_par_entete(self()); |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - include_spip('inc/presentation'); |
|
| 29 | - include_spip('inc/filtres_boites'); |
|
| 30 | - $commencer_page = charger_fonction('commencer_page', 'inc'); |
|
| 31 | - echo $commencer_page('','','','',true,false,false); |
|
| 28 | + include_spip('inc/presentation'); |
|
| 29 | + include_spip('inc/filtres_boites'); |
|
| 30 | + $commencer_page = charger_fonction('commencer_page', 'inc'); |
|
| 31 | + echo $commencer_page('','','','',true,false,false); |
|
| 32 | 32 | |
| 33 | - echo debut_grand_cadre(true); |
|
| 34 | - echo boite_ouvrir(_T('info_message_technique'),'notice'); |
|
| 35 | - echo "<p>"._T('info_procedure_maj_version')."</p>", |
|
| 36 | - "<p>"._T('info_administrateur_site_01')."</p>"; |
|
| 37 | - echo bouton_action(_T('bouton_mettre_a_jour_base'),generer_url_ecrire("upgrade","reinstall=non")); |
|
| 38 | - echo boite_fermer(); |
|
| 39 | - // masquer les erreurs sql sur cette page car proviennent de la base pas a jour ! |
|
| 40 | - echo '<style type="text/css">#debug-nav {display: none;}</style>'; |
|
| 41 | - echo fin_grand_cadre(true); |
|
| 42 | - echo fin_page(); |
|
| 33 | + echo debut_grand_cadre(true); |
|
| 34 | + echo boite_ouvrir(_T('info_message_technique'),'notice'); |
|
| 35 | + echo "<p>"._T('info_procedure_maj_version')."</p>", |
|
| 36 | + "<p>"._T('info_administrateur_site_01')."</p>"; |
|
| 37 | + echo bouton_action(_T('bouton_mettre_a_jour_base'),generer_url_ecrire("upgrade","reinstall=non")); |
|
| 38 | + echo boite_fermer(); |
|
| 39 | + // masquer les erreurs sql sur cette page car proviennent de la base pas a jour ! |
|
| 40 | + echo '<style type="text/css">#debug-nav {display: none;}</style>'; |
|
| 41 | + echo fin_grand_cadre(true); |
|
| 42 | + echo fin_page(); |
|
| 43 | 43 | } |
| 44 | 44 | ?> |
@@ -19,18 +19,18 @@ |
||
| 19 | 19 | // http://doc.spip.org/@exec_selectionner_dist |
| 20 | 20 | function exec_selectionner_dist() |
| 21 | 21 | { |
| 22 | - $id = intval(_request('id')); |
|
| 23 | - $exclus = intval(_request('exclus')); |
|
| 24 | - $type = _request('type'); |
|
| 25 | - $rac = _request('racine'); |
|
| 26 | - $do = _request('do'); |
|
| 27 | - if (preg_match('/^\w*$/', $do)) { |
|
| 28 | - if (!$do) $do = 'aff'; |
|
| 22 | + $id = intval(_request('id')); |
|
| 23 | + $exclus = intval(_request('exclus')); |
|
| 24 | + $type = _request('type'); |
|
| 25 | + $rac = _request('racine'); |
|
| 26 | + $do = _request('do'); |
|
| 27 | + if (preg_match('/^\w*$/', $do)) { |
|
| 28 | + if (!$do) $do = 'aff'; |
|
| 29 | 29 | |
| 30 | - $selectionner = charger_fonction('selectionner', 'inc'); |
|
| 30 | + $selectionner = charger_fonction('selectionner', 'inc'); |
|
| 31 | 31 | |
| 32 | - $r = $selectionner($id, "choix_parent", $exclus, $rac, $type!='breve', $do); |
|
| 33 | - } else $r = ''; |
|
| 34 | - ajax_retour($r); |
|
| 32 | + $r = $selectionner($id, "choix_parent", $exclus, $rac, $type!='breve', $do); |
|
| 33 | + } else $r = ''; |
|
| 34 | + ajax_retour($r); |
|
| 35 | 35 | } |
| 36 | 36 | ?> |