Changeset 34988 for _plugins_/couteau_suisse
- Timestamp:
- 02/08/10 01:23:54 (5 weeks ago)
- Location:
- _plugins_/couteau_suisse
- Files:
-
- 1 added
- 2 modified
-
fonds/type_urls.html (modified) (1 diff)
-
fonds/type_urls_liste.html (added)
-
outils/type_urls_action_rapide.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/couteau_suisse/fonds/type_urls.html
r34987 r34988 62 62 <BOUCLE_compte(URLS) /> 63 63 [(#TOTAL_BOUCLE|>{0}|oui) 64 [(#SET{total, #VAL{<a href="}|concat{#URL_ECRIRE{action_rapide,arg=type_urls|liste_ URLS&script=foo},'" target="_blank">',#TOTAL_BOUCLE,'</a>'}})]64 [(#SET{total, #VAL{<a href="}|concat{#URL_ECRIRE{action_rapide,arg=type_urls|liste_urls&script=foo},'" target="_blank">',#TOTAL_BOUCLE,'</a>'}})] 65 65 [(#SET{cpt, #VAL{couteauprive:urls_base_total}|_T|replace{@nb@,#GET{total}}})] 66 66 ] -
_plugins_/couteau_suisse/outils/type_urls_action_rapide.php
r34987 r34988 80 80 } 81 81 82 // Fonction appelee par exec/action_rapide : ?exec=action_rapide&arg=type_urls|liste_ URLS(pipe obligatoire)83 // Renvoie la liste de s URLs d'un objet (casSPIP >= 2.0)84 function type_urls_liste_ URLS_exec() {82 // Fonction appelee par exec/action_rapide : ?exec=action_rapide&arg=type_urls|liste_urls (pipe obligatoire) 83 // Renvoie la liste de toutes les URLs propres de la base (SPIP >= 2.0) 84 function type_urls_liste_urls_exec() { 85 85 global $type_urls; 86 86 $res = $id = ''; 87 // chercher dans la table des URLS88 87 include_spip('base/abstract_sql'); 89 88 if($s=_request('suppr')) { 90 $s = unserialize(base64_decode($s)); 91 sql_delete("spip_urls", $a="id_objet=$s[id_objet] AND type=".sql_quote($s['type']).' AND date='.sql_quote($s['date']).' AND url='.sql_quote($s['url'])); 92 } 93 // Recuperer une URL propre correspondant a l'objet. 94 $row = sql_allfetsel('*', 'spip_urls', '', '', 'type, id_objet, date DESC'); 95 $res .= _T('couteau:urls_propres_objet')."\n\n|{{"._T('couteau:urls_propres_titre').'}}|<'; 96 $self = str_replace('|', urlencode('|'), self()); 97 $fin = '" title='._T('lien_supprimer').'>x</a>'; 98 foreach($row as $r) { 99 $id2 = "$r[type] #$r[id_objet]"; 100 $s = parametre_url($self, 'suppr', base64_encode(serialize($r))); 101 $url = generer_url_entite($r['id_objet'], $r['type'], '', '', true); 102 $res .= ($id2==$id?"\n_ $r[url]":"|\n|[{$id2}->$url]|$r[url]").' <a href="'.$s.$fin; 103 $id = $id2; 89 $s = explode(',', base64_decode($s), 3); 90 sql_delete("spip_urls", $a="id_objet=$s[0] AND type=".sql_quote($s[1]).' AND url='.sql_quote($s[2])); 104 91 } 105 92 include_spip('inc/texte'); 106 93 include_spip('inc/presentation'); 107 echo '<html><head>'.envoi_link(_T('couteau:urls_propres_titre')).'</head><body style="text-align:center">'.propre($res."|\n").'</body></html>'; 94 include_spip('public/assembler'); 95 echo '<html><head>'.f_jQuery(envoi_link(_T('couteau:urls_propres_titre'))) 96 .'</head><body style="text-align:center">' 97 .propre(recuperer_fond('fonds/type_urls_liste', array('type'=>_request('type')))) 98 .'</body></html>'; 99 ; 108 100 } 109 101 … … 157 149 } 158 150 151 function cs_url_publique($id, $type) { 152 return generer_url_entite($id, $type, '', '', true); 153 } 159 154 ?>
