function html_f3666965c018303599bb64189cbac96c($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { if (isset($Pile[0]["doublons"]) and is_array($Pile[0]["doublons"])) { $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); } $connect = ''; $page = ' <div' . (($t1 = strval(interdire_scripts(entites_html(sinon(table_valeur(@$Pile[0], (string) 'divclass', null), 'spip-admin-bloc'), true)))) !== '' ? ' class="' . $t1 . '"' : '') . ' id=\'spip-admin\' dir="' . lang_dir(@$Pile[0]['lang'], 'ltr', 'rtl') . '">' . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'analyser', null), true)))) !== '' ? ' <a href="' . $t1 . ('" class="spip-admin-boutons" id="analyser">' . _T('public|spip|ecrire:analyse_xml') . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'xhtml_error', null), true)))) !== '' ? ' (' . $t2 . ')' : '') . '</a>') : '') . ' ' . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'objet', null), true) ? ' ' : ''))) !== '' ? $t1 . (' ' . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id_objet', null), true)))) !== '' ? '<a href="' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) ('voir_' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'objet', null), true))), null), true)) . '" class="spip-admin-boutons" id="voir_' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'objet', null), true)) . '">' . interdire_scripts(_T(objet_info(entites_html(table_valeur(@$Pile[0], (string) 'objet', null), true), 'texte_objet'))) . ' (' . $t2 . ')</a>' : '') . ' ') : '') . '<!--extra-->' . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'ecrire', null), true)))) !== '' ? ' <a href="' . $t1 . ('" class="spip-admin-boutons" id="ecrire">' . _T('public|spip|ecrire:espace_prive') . '</a>') : '') . ' <a href="' . parametre_url(self(), 'var_mode', interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'calcul', null), true))) . '" class="spip-admin-boutons" id="var_mode">' . _T('public|spip|ecrire:admin_recalculer') . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'use_cache', null), true)) . '</a>' . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'preview', null), true)))) !== '' ? ' <a href="' . $t1 . ('" class="spip-admin-boutons" id="preview">' . _T('public|spip|ecrire:previsualisation') . '</a>') : '') . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'debug', null), true)))) !== '' ? ' <a href="' . $t1 . ('" class="spip-admin-boutons" id="debug">' . _T('public|spip|ecrire:admin_debug') . '</a>') : '') . ' </div> '; return analyse_resultat_skel('html_f3666965c018303599bb64189cbac96c', $Cache, $page, 'squelettes-dist/formulaires/administration.html'); }
function exec_articles_tous_args($id_rubrique, $aff_art, $sel_lang) { global $browser_layer,$spip_lang_right,$spip_lang_left; changer_typo(); // pour definir la direction de la langue if (!is_array($aff_art)) $aff_art = array('prop','publie'); $enfant = arbo_articles_tous(); $flag_trad = (($GLOBALS['meta']['multi_rubriques'] == 'oui' OR $GLOBALS['meta']['multi_articles'] == 'oui') AND $GLOBALS['meta']['gerer_trad'] == 'oui'); list($article,$text_article,$aff_statut) = texte_articles_tous($sel_lang, $flag_trad, $aff_art, lang_dir()); if (_AJAX AND $id_rubrique) { include_spip('inc/actions'); ajax_retour(afficher_contenu_rubrique($article, $enfant, $text_article, $id_rubrique, $flag_trad, 2)); } else { pipeline('exec_init',array('args'=>array('exec'=>'articles_tous'),'data'=>'')); $commencer_page = charger_fonction('commencer_page', 'inc'); echo $commencer_page(_T('titre_page_articles_tous'), "accueil", "tout-site"); echo http_script('var img_deplierhaut = "'. chemin_image('noeud_plus.gif') .'"; var img_deplierbas = "'. chemin_image('noeud_moins.gif') . '";'); echo http_script('', 'jquery-ui-1.8-drag-drop.min.js'); echo http_script('', 'articles_tous_edite.js'); echo http_script('', 'pause.js'); echo debut_gauche('', true); echo formulaire_affiche_tous($aff_art, $aff_statut, $sel_lang); echo pipeline('affiche_gauche',array('args'=>array('exec'=>'articles_tous'),'data'=>'')); echo creer_colonne_droite('', true); echo pipeline('affiche_droite',array('args'=>array('exec'=>'articles_tous'),'data'=>'')); echo debut_droite('', true); if ($enfant AND $browser_layer) echo couche_formulaire_tous(); $out = "<textarea cols='1' rows='1' id='deplacements' style='display:none;' name='deplacements'></textarea>" . "\n<div id='apply' style='display:none;text-align:$spip_lang_right'><input type='submit' value='"._T('bouton_changer')."' /></div>"; echo "\n<div id='cancel' class='verdana2' style='display:none;text-align:$spip_lang_left;float:$spip_lang_left'>", "<a href='javascript:annuler_deplacement();'>", _T('bouton_annuler'), "</a></div>", redirige_action_post("reorganiser","",'articles_tous', '', $out), "<ul id='articles_tous'><li id='rubrique-0' class='treeItem racine verdana2'>", "<span class='holder icone'> </span>", _T('info_racine_site'), "\n<ul class=''>\n", afficher_contenu_rubrique($article, $enfant, $text_article, 0, $flag_trad, 2), "</ul></li></ul>\n", fin_gauche(), fin_page(); } }
function affiche_stats_lang($critere) { global $spip_lang_right; $taille = 450; // // Statistiques par langue // $out = ""; $r = sql_fetsel("SUM({$critere}) AS total_visites", "spip_articles"); $visites = 1; // attention a '0.0' if ($r and $r['total_visites'] > 0) { $total_visites = $r['total_visites']; } else { $total_visites = 1; } $result = sql_select("lang, SUM(" . $critere . ") AS cnt", "spip_articles", "statut='publie' ", "lang"); $out .= "\n<table cellpadding='2' cellspacing='0' border='0' width='100%' style='border: 1px solid #aaaaaa;'>"; $ifond = 1; $visites_abs = 0; while ($row = sql_fetch($result)) { $lang = $row['lang']; if ($row['cnt']) { $visites = round($row['cnt'] / $total_visites * $taille); $pourcent = round($row['cnt'] / $total_visites * 100); } if ($visites > 0) { if ($ifond == 0) { $ifond = 1; $couleur = "white"; } else { $ifond = 0; $couleur = "eeeeee"; } $out .= "\n<tr style='background-color: {$couleur}'>"; $dir = lang_dir($lang, '', ' dir="rtl"'); $out .= "<td style='width: 100%; border-bottom: 1px solid #cccccc;'><p {$dir}><span style='float: {$spip_lang_right};'>{$pourcent}%</span>" . traduire_nom_langue($lang) . "</p></td>"; $out .= "<td style='border-bottom: 1px solid #cccccc;'>"; $out .= "\n<table cellpadding='0' cellspacing='0' border='0' width='" . ($taille + 5) . "'>"; $out .= "\n<tr><td style='align:{$spip_lang_right}; background-color: #eeeeee; border: 1px solid #999999; white-space: nowrap;'>"; if ($visites_abs > 0) { $out .= "<img src='" . chemin_image('rien.gif') . "' width='{$visites_abs}' height='10' alt=' ' />"; } if ($visites > 0) { $out .= "<img src='" . chemin_image('rien.gif') . "' class='couleur_langue' style='border: 0px;' width='{$visites}' height='8' alt=' ' />"; } $out .= "</td></tr></table>\n"; $out .= "</td>"; $out .= "</tr>"; $visites_abs += $visites; } } $out .= "</table>\n"; return $out; }
function definir_puce() { // Attention au sens, qui n'est pas defini de la meme facon dans // l'espace prive (spip_lang est la langue de l'interface, lang_dir // celle du texte) et public (spip_lang est la langue du texte) $dir = _DIR_RESTREINT ? lang_dir() : lang_dir($GLOBALS['spip_lang']); $p = 'puce' . (test_espace_prive() ? '_prive' : ''); if ($dir == 'rtl') { $p .= '_rtl'; } if (!isset($GLOBALS[$p])) { $img = find_in_path($p . '.gif'); list(, , , $size) = @getimagesize($img); $GLOBALS[$p] = '<img src="' . $img . '" ' . $size . ' class="puce" alt="-" />'; } return $GLOBALS[$p]; }
function BOUCLE_langueshtml_9491858aea5af6033788aa1936ebca8d(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) { static $command = array(); static $connect; $command['connect'] = $connect = ''; if (!isset($command['table'])) { $command['table'] = 'rubriques'; $command['id'] = '_langues'; $command['from'] = array('rubriques' => 'spip_rubriques'); $command['type'] = array(); $command['groupby'] = array(); $command['select'] = array("rubriques.lang", "rubriques.titre"); $command['orderby'] = array('rubriques.lang'); $command['join'] = array(); $command['limit'] = ''; $command['having'] = array(); } $command['where'] = array(quete_condition_statut('rubriques.statut', '!', 'publie', ''), array('=', 'rubriques.id_parent', 0), array('NOT', array('=', 'rubriques.lang', sql_quote(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'lang', null), true)), '', 'varchar(10) NOT NULL DEFAULT \'\'')))); if (defined("_BOUCLE_PROFILER")) { $timer = time() + microtime(); } $t0 = ""; // REQUETE $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-bas_menu-lang.html', 'html_9491858aea5af6033788aa1936ebca8d', '_langues', 18, $GLOBALS['spip_lang'])); if (!$iter->err()) { lang_select($GLOBALS['spip_lang']); $SP++; // RESULTATS while ($Pile[$SP] = $iter->fetch()) { lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']); $t0 .= ($t1 = strval(traduire_nom_langue(unique(spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']))))) !== '' ? ' <span lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" xml:lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '">| <a href="spip.php?action=converser&var_lang=' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '&redirect=/" rel="alternate" title="' . _T('public|spip|ecrire:accueil_site') . ' : ' . traduire_nom_langue(spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang'])) . '" dir="' . lang_dir($Pile[$SP]['lang'], 'ltr', 'rtl') . '">' . $t1 . '</a> </span> ' : ''; lang_select(); } lang_select(); $iter->free(); } if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) { spip_log(intval(1000 * $timer) . "ms BOUCLE_langues @ squelettes/inc/inc-bas_menu-lang.html", "profiler" . _LOG_AVERTISSEMENT); } return $t0; }
/** * Changer la langue courante * * Définit la langue utilisée par la langue désignée * si elle fait partie des langues utilisables dans le site. * * Cette fonction définit les globales : * spip_lang, spip_lang_rtl, spip_lang_right, spip_lang_left * * @param string $lang * La langue à utiliser * @return string|bool * string : La langue qui a été utilisée si trouvée * false : aucune langue ne correspondait à la demande **/ function changer_langue($lang) { $liste_langues = ',' . @$GLOBALS['meta']['langues_proposees'] . ',' . @$GLOBALS['meta']['langues_multilingue'] . ','; // Si la langue demandee n'existe pas, on essaie d'autres variantes // Exemple : 'pt-br' => 'pt_br' => 'pt' $lang = str_replace('-', '_', trim($lang)); if (!$lang) { return false; } if (strpos($liste_langues, ",{$lang},") !== false or $lang = preg_replace(',_.*,', '', $lang) and strpos($liste_langues, ",{$lang},") !== false) { $GLOBALS['spip_lang_rtl'] = lang_dir($lang, '', '_rtl'); $GLOBALS['spip_lang_right'] = $GLOBALS['spip_lang_rtl'] ? 'left' : 'right'; $GLOBALS['spip_lang_left'] = $GLOBALS['spip_lang_rtl'] ? 'right' : 'left'; return $GLOBALS['spip_lang'] = $lang; } else { return false; } }
function changer_langue($lang) { global $spip_lang_rtl, $spip_lang_right, $spip_lang_left; $liste_langues = ',' . @$GLOBALS['meta']['langues_proposees'] . ',' . @$GLOBALS['meta']['langues_multilingue'] . ','; // Si la langue demandee n'existe pas, on essaie d'autres variantes // Exemple : 'pt-br' => 'pt_br' => 'pt' $lang = str_replace('-', '_', trim($lang)); if (!$lang) return false; if (strpos($liste_langues,",$lang,")!==false OR ($lang = preg_replace(',_.*,', '', $lang) AND strpos($liste_langues,",$lang,")!==false)) { $spip_lang_rtl = lang_dir($lang, '', '_rtl'); $spip_lang_right = $spip_lang_rtl ? 'left' : 'right'; $spip_lang_left = $spip_lang_rtl ? 'right' : 'left'; return $GLOBALS['spip_lang'] = $lang; } else return false; }
function exec_mots_edit_args($id_mot, $id_groupe, $new, $table='', $table_id='', $titre='', $redirect='', $ajouter_id_article='') { global $spip_lang_right, $connect_statut, $les_notes; $autoriser_editer = $editer = false; if ($new=='oui') $autoriser_editer = true; if (($new=='oui') OR $autoriser_editer) $editer = true; $ok = false; $row = sql_fetsel("*", "spip_mots", "id_mot=$id_mot"); if ($row) { $id_mot = $row['id_mot']; $titre_mot = $row['titre']; $descriptif = $row['descriptif']; $texte = $row['texte']; $extra = $row['extra']; $id_groupe = $row['id_groupe']; $onfocus =''; $autoriser_editer = autoriser('modifier', 'mot', $id_mot, null, array('id_groupe' => $id_groupe)); if (!_request('edit')) $editer = false; else $editer = $autoriser_editer; $ok = true; } else { $row = sql_countsel('spip_groupes_mots', ($table ? "tables_liees REGEXP '(^|,)$table($|,)'" : '') //($table ? "$table='oui'" : '') ); if (!$new OR !autoriser('modifier', 'mot', $id_mot, null, array('id_groupe' => $id_groupe)) OR (!$row AND !$table)) { include_spip('inc/minipres'); echo minipres(_T('info_mot_sans_groupe')); } else { $id_mot = 0; $descriptif = $texte = ''; if (!$row) { // cas pathologique: // creation d'un mot sans groupe de mots cree auparavant // (ne devrait arriver qu'en cas d'appel explicite ou // destruction concomittante des groupes de mots idoines) if ($redirect) $redirect = '&redirect=' . $redirect; if ($titre) $titre = "&titre=".rawurlencode($titre); include_spip('inc/headers'); redirige_par_entete(redirige_action_auteur('instituer_groupe_mots', $table, 'mots_edit', "new=$new&table=$table&table_id=$table_id&ajouter_id_article=$ajouter_id_article$titre$redirect", true)); } $ok = true; } } if ($ok) { pipeline('exec_init',array('args'=>array('exec'=>'mots_edit','id_mot'=>$id_mot),'data'=>'')); $commencer_page = charger_fonction('commencer_page', 'inc'); $out = $commencer_page("« ".sinon($titre_mot,_T('texte_nouveau_mot'))." »", "naviguer", "mots") . debut_gauche('',true); ////////////////////////////////////////////////////// // Boite "voir en ligne" // if ($id_mot) { $out .= debut_boite_info(true); $out .= "\n<div style='font-weight: bold; text-align: center' class='verdana1 spip_xx-small'>" . _T('titre_gauche_mots_edit') . "<br /><span class='spip_xx-large'>" . $id_mot . '</span></div>'; $out .= voir_en_ligne ('mot', $id_mot, false, 'racine-24.gif', false, false); $out .= fin_boite_info(true); // Logos du mot-clef $flag_editable = autoriser('modifier', 'mot', $id_mot, null, array('id_groupe' => $id_groupe)); $iconifier = charger_fonction('iconifier', 'inc'); $out .= $iconifier('id_mot', $id_mot, 'mots_edit', false, $flag_editable); } else $flag_editable = false; // // Afficher les boutons de creation // $res =''; if ($id_groupe AND autoriser('modifier','groupemots',$id_groupe)) { $res = icone_horizontale(_T('icone_modif_groupe_mots'), generer_url_ecrire("mots_type","id_groupe=$id_groupe"), "groupe-mot-24.gif", "edit.gif", false) . icone_horizontale(_T('icone_creation_mots_cles'), generer_url_ecrire("mots_edit", "new=oui&id_groupe=$id_groupe&redirect=" . generer_url_retour('mots_tous')), "mot-cle-24.gif", "creer.gif", false); } $out .= pipeline('affiche_gauche',array('args'=>array('exec'=>'mots_edit','id_mot'=>$id_mot),'data'=>'')) . bloc_des_raccourcis($res . icone_horizontale(_T('icone_voir_tous_mots_cles'), generer_url_ecrire("mots_tous",""), "mot-cle-24.gif", "rien.gif", false)) . creer_colonne_droite('',true) . pipeline('affiche_droite',array('args'=>array('exec'=>'mots_edit','id_mot'=>$id_mot),'data'=>'')) . debut_droite('',true); // --- Voir le mot ---- $out .= debut_cadre_relief("mot-cle-24.gif",true,'','','mot-voir',$editer?'none':''); if ($flag_editable) $out .= icone_inline(_T('icone_modifier_mot'), generer_url_ecrire('mots_edit',"id_mot=$id_mot&edit=oui"), "mot-cle-24.gif", "rien.gif",$spip_lang_right,false," onclick=\"$('#mot-editer').show();$('#mot-voir').hide();return false;\""); $out .= gros_titre(sinon($titre_mot,_T('texte_nouveau_mot')),'',false); $out .= "<div class='nettoyeur'></div>"; $contenu_mot = ""; if ($descriptif) { $contenu_mot .= "<div style='border: 1px dashed #aaaaaa; ' class='verdana1 spip_small'>" . "<b>" . _T('info_descriptif') . "</b> " . propre($descriptif) . " " . "</div>"; } if (strlen($texte)>0){ $contenu_mot .= "<p class='verdana1 spip_small'>" . propre($texte) . "</p>"; } if ($les_notes) { $contenu_mot .= debut_cadre_relief('',true) . "<div dir='" . lang_dir() ."' class='arial11'>" . justifier("<b>"._T('info_notes')." :</b> ".$les_notes) . "</div>" . fin_cadre_relief(true); } $contexte = array('id'=>$id_mot); // permettre aux plugin de faire des modifs ou des ajouts $contenu_mot = pipeline('afficher_contenu_objet', array( 'args'=>array( 'type'=>'mot', 'id_objet'=>$id_mot, 'contexte'=>$contexte ), 'data'=> $contenu_mot ) ); $out .= $contenu_mot; if ($id_mot) { if ($connect_statut == "0minirezo") $aff_articles = "'prepa','prop','publie','refuse'"; else $aff_articles = "'prop','publie'"; $out .= afficher_objets('rubrique','<b>' . _T('info_rubriques_liees_mot') . '</b>', array("FROM" => 'spip_rubriques AS rubrique LEFT JOIN spip_mots_rubriques AS lien ON lien.id_rubrique=rubrique.id_rubrique', 'WHERE' => "lien.id_mot=$id_mot", 'ORDER BY' => "rubrique.titre")); $out .= afficher_objets('article',_T('info_articles_lies_mot'), array('FROM' => "spip_articles AS articles LEFT JOIN spip_mots_articles AS lien ON lien.id_article=articles.id_article", 'WHERE' => "lien.id_mot=$id_mot AND articles.statut IN ($aff_articles)", 'ORDER BY' => "articles.date DESC")); $out .= afficher_objets('breve','<b>' . _T('info_breves_liees_mot') . '</b>', array("FROM" => 'spip_breves AS breves LEFT JOIN spip_mots_breves AS lien ON lien.id_breve=breves.id_breve', 'WHERE' => "lien.id_mot=$id_mot", 'ORDER BY' => "breves.date_heure DESC")); $out .= afficher_objets('site','<b>' . _T('info_sites_lies_mot') . '</b>', array("FROM" => 'spip_syndic AS syndic LEFT JOIN spip_mots_syndic AS lien ON lien.id_syndic=syndic.id_syndic', 'WHERE' => "lien.id_mot=$id_mot", 'ORDER BY' => "syndic.nom_site DESC")); } $out .= pipeline('affiche_milieu',array('args'=>array('exec'=>'mots_edit','id_mot'=>$id_mot),'data'=>'')) . fin_cadre_relief(true); // --- Editer le mot ---- if ($autoriser_editer){ $out .= "<div id='mot-editer'".($editer?"":" class='none'").'>'; $contexte = array( 'icone_retour'=>icone_inline(_T('icone_retour'),($editer AND $redirect)?rawurldecode($redirect): generer_url_ecrire('mots_edit','id_mot='.$id_mot,false,true), "mot-cle-24.gif", "rien.gif",$GLOBALS['spip_lang_left'],false,($editer AND $redirect)?"":" onclick=\"$('#mot-editer').hide();$('#mot-voir').show();return false;\""), 'redirect'=>$redirect?rawurldecode($redirect):generer_url_ecrire('mots_edit','id_mot='.$id_mot,'&',true), 'titre'=>sinon($titre_mot,$titre), 'new'=>$new == "oui"?$new:$id_mot, 'id_groupe'=>$id_groupe, 'config_fonc'=>'mots_edit_config', 'ajouter_id_article' => $ajouter_id_article, 'table'=>$table, 'table_id'=>$table_id ); $out .= recuperer_fond("prive/editer/mot", $contexte); $out .= '</div>'; } echo $out, fin_gauche(), fin_page(); } }
function html_20bad19474852c2c1a99d7289d969071($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { if (isset($Pile[0]["doublons"]) and is_array($Pile[0]["doublons"])) { $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); } $connect = ''; $page = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . spip_htmlentities(@$Pile[0]['lang'] ? @$Pile[0]['lang'] : $GLOBALS['spip_lang']) . '" lang="' . spip_htmlentities(@$Pile[0]['lang'] ? @$Pile[0]['lang'] : $GLOBALS['spip_lang']) . '" dir="' . lang_dir(@$Pile[0]['lang'], 'ltr', 'rtl') . '"> <head> <title>[' . interdire_scripts(textebrut(typo($GLOBALS['meta']['nom_site'], "TYPO", $connect, $Pile[0]))) . ']</title> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-meta') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/sommaire.html\',\'html_20bad19474852c2c1a99d7289d969071\',\'\',6,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('styles') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/sommaire.html\',\'html_20bad19474852c2c1a99d7289d969071\',\'\',7,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> </head> <body dir="' . lang_dir(@$Pile[0]['lang'], 'ltr', 'rtl') . '" class="' . spip_htmlentities(@$Pile[0]['lang'] ? @$Pile[0]['lang'] : $GLOBALS['spip_lang']) . ' sommaire"> <div id="page" class="sommaire"> <!-- ***************************************************************** Bandeau, titre du site et menu langue Header and main menu (top and right) ************************************************************* --> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-bandeau') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/sommaire.html\',\'html_20bad19474852c2c1a99d7289d969071\',\'\',17,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> <!-- ***************************************************************** Contenu principal (centre) Main content (center) ************************************************************* --> <div id="bloc-contenu"> <div class="edito"> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-sommaire-edito') . ', array_merge(' . var_export($Pile[0], 1) . ',array(\'self\' => ' . argumenter_squelette(self()) . ', \'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . ')), array("compil"=>array(\'squelettes/sommaire.html\',\'html_20bad19474852c2c1a99d7289d969071\',\'\',25,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> </div><!-- edito --> <h2 class="structure">' . _T('public|spip|ecrire:articles_recents') . '</h2> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-sommaire-articles') . ', array_merge(' . var_export($Pile[0], 1) . ',array(\'self\' => ' . argumenter_squelette(self()) . ', \'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . ')), array("compil"=>array(\'squelettes/sommaire.html\',\'html_20bad19474852c2c1a99d7289d969071\',\'\',29,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> </div><!-- bloc-contenu--> <!-- ***************************************************************** Menus contextuels (droite) Contextual menus (right) ************************************************************* --> <div id="encart"> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-trad') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/sommaire.html\',\'html_20bad19474852c2c1a99d7289d969071\',\'\',40,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-annonces') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/sommaire.html\',\'html_20bad19474852c2c1a99d7289d969071\',\'\',42,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-breves') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/sommaire.html\',\'html_20bad19474852c2c1a99d7289d969071\',\'\',44,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-syndic') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/sommaire.html\',\'html_20bad19474852c2c1a99d7289d969071\',\'\',46,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> <!-- Inscription au site --> ' . (($t1 = strval(executer_balise_dynamique('FORMULAIRE_INSCRIPTION', array(), array('squelettes/sommaire.html', 'html_20bad19474852c2c1a99d7289d969071', '', 45, $GLOBALS['spip_lang'])))) !== '' ? '<div class="menu" id="inscription"> <ul> <li><b>' . _T('public|spip|ecrire:pass_vousinscrire') . '</b> <ul> <li> ' . $t1 . ' </li> </ul> </li> </ul> </div><!-- menu -->' : '') . ' </div><!-- encart --> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-menu') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/sommaire.html\',\'html_20bad19474852c2c1a99d7289d969071\',\'\',53,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-bas') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/sommaire.html\',\'html_20bad19474852c2c1a99d7289d969071\',\'\',54,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> </div><!-- page--> </body> </html>'; return analyse_resultat_skel('html_20bad19474852c2c1a99d7289d969071', $Cache, $page, 'squelettes/sommaire.html'); }
function changer_typo($lang = '', $source = '') { global $lang_typo, $lang_dir, $dir_lang; if (preg_match("/^(article|rubrique|breve|auteur)([0-9]+)/", $source, $regs)) { $r = lcm_fetch_array(lcm_query("SELECT lang FROM spip_" . $regs[1] . "s WHERE id_" . $regs[1] . "=" . $regs[2])); $lang = $r['lang']; } if (!$lang) { $lang = read_meta('default_language'); } $lang_typo = lang_typo($lang); $lang_dir = lang_dir($lang); $dir_lang = " dir='{$lang_dir}'"; }
function sous_enfant_rub($collection2){ global $spip_lang_left; $result3 = sql_select("id_rubrique, id_parent, titre, lang", "spip_rubriques", "id_parent=$collection2",'', '0+titre,titre'); $retour = ''; while($row=sql_fetch($result3)){ $id_rubrique2=$row['id_rubrique']; $id_parent2=$row['id_parent']; $titre2=$row['titre']; changer_typo($row['lang']); $lang_dir = lang_dir($row['lang']); if (autoriser('voir','rubrique',$id_rubrique2)) $retour.="\n<li class='arial11 rubrique_12' dir='$lang_dir'><a href='" . generer_url_ecrire("naviguer","id_rubrique=$id_rubrique2") . "'>".typo($titre2)."</a></li>\n"; } if (!$retour) return ''; return debut_block_depliable(false,"enfants$collection2") ."\n<ul style='margin: 0px; padding: 0px; padding-top: 3px;'>\n" . $retour . "</ul>\n\n".fin_block()."\n\n"; }
function BOUCLE_rubrique_principalhtml_0caead67327defaf94febb642f511490(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) { static $command = array(); static $connect; $command['connect'] = $connect = ''; if (!isset($command['table'])) { $command['table'] = 'rubriques'; $command['id'] = '_rubrique_principal'; $command['from'] = array('rubriques' => 'spip_rubriques'); $command['type'] = array(); $command['groupby'] = array(); $command['select'] = array("rubriques.id_rubrique", "rubriques.lang", "rubriques.titre", "rubriques.id_secteur", "rubriques.texte", "rubriques.descriptif"); $command['orderby'] = array(); $command['join'] = array(); $command['limit'] = ''; $command['having'] = array(); } $command['where'] = array(quete_condition_statut('rubriques.statut', '!', 'publie', ''), array('=', 'rubriques.id_rubrique', sql_quote(@$Pile[0]['id_rubrique'], '', 'bigint(21) NOT NULL AUTO_INCREMENT'))); if (defined("_BOUCLE_PROFILER")) { $timer = time() + microtime(); } $t0 = ""; // REQUETE $iter = IterFactory::create("SQL", $command, array('squelettes/rubrique.html', 'html_0caead67327defaf94febb642f511490', '_rubrique_principal', 1, $GLOBALS['spip_lang'])); if (!$iter->err()) { lang_select($GLOBALS['spip_lang']); $SP++; // RESULTATS while ($Pile[$SP] = $iter->fetch()) { lang_select_public($Pile[$SP]['lang'], 'oui', $Pile[$SP]['titre']); $t0 .= ' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" dir="' . lang_dir($Pile[$SP]['lang'], 'ltr', 'rtl') . '"> <head> <title>[' . interdire_scripts(textebrut(typo($GLOBALS['meta']['nom_site'], "TYPO", $connect, $Pile[0]))) . '] : ' . interdire_scripts(entites_html(textebrut(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))) . '</title> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-meta') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ', \'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',7,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> <link rel="alternate" type="application/rss+xml" title="' . _T('public|spip|ecrire:syndiquer_rubrique') . ' : ' . interdire_scripts(entites_html(textebrut(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))) . '" href="' . interdire_scripts(parametre_url(generer_url_public('backend', ''), 'id_rubrique', $Pile[$SP]['id_rubrique'])) . '" /> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('styles') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ', \'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',10,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> </head> <body dir="' . lang_dir($Pile[$SP]['lang'], 'ltr', 'rtl') . '" class="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . ' rubrique sect' . $Pile[$SP]['id_secteur'] . ' ' . BOUCLE_rubriques_bodyhtml_0caead67327defaf94febb642f511490($Cache, $Pile, $doublons, $Numrows, $SP) . ' rub' . $Pile[$SP]['id_rubrique'] . '"> <div id="page" class="rubrique rub' . $Pile[$SP]['id_rubrique'] . '"> <!-- ***************************************************************** Bandeau, titre du site et menu langue Header and main menu (top and right) ************************************************************* --> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-bandeau') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ', \'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',20,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> <!-- ***************************************************************** Contenu principal (centre) Main content (center) ************************************************************* --> <div id="bloc-contenu"> <h5> <a href="' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '" title="' . _T('public|spip|ecrire:accueil_site') . ' : ' . interdire_scripts(typo($GLOBALS['meta']['nom_site'], "TYPO", $connect, $Pile[0])) . '">' . _T('public|spip|ecrire:accueil_site') . '</a> ' . (($t1 = BOUCLE_rubriques_cheminhtml_0caead67327defaf94febb642f511490($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? ' ' . $t1 . ' ' : '') . ' ' . (($t1 = strval(interdire_scripts(couper(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])), '60')))) !== '' ? '<b class=\'separateur\'>></b> ' . $t1 : '') . ' </h5> <div class="ligne-debut"></div><!-- ligne-debut --> ' . (($t1 = strval(filtrer('image_graver', filtrer('image_reduire', !is_array($l = quete_logo('id_rubrique', 'ON', $Pile[$SP]['id_rubrique'], quete_parent($Pile[$SP]['id_rubrique']), 0)) ? '' : "<img class=\"spip_logo spip_logos\" alt=\"\" src=\"{$l['0']}\"" . $l[2] . ($l[1] ? " onmouseover=\"this.src='{$l['1']}'\" onmouseout=\"this.src='{$l['0']}'\"" : "") . ' />', '120', '0')))) !== '' ? '<div class="logo-liste-art"> ' . $t1 . ' </div>' : '') . ' <h1 class="titre-article">' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</h1> ' . (($t1 = strval(interdire_scripts(($a = filtrer('image_graver', filtrer('image_reduire', propre($Pile[$SP]['texte'], $connect, $Pile[0]), '560', '0')) or is_string($a) and strlen($a)) ? $a : interdire_scripts(propre($Pile[$SP]['descriptif'], $connect, $Pile[0]))))) !== '' ? '<div class="chapo ' . interdire_scripts($Pile[$SP]['texte'] ? '' : '') . '" id="description"> ' . $t1 . (' ' . (($t2 = strval(interdire_scripts(calculer_notes()))) !== '' ? '<div class="notes" style="padding: 0 1.5em;">' . $t2 . '</div>' : '') . ' </div><!-- chapo -->') : '') . ' ' . recuperer_fond('inc/inc-rub-documents', array_merge($Pile[0], array('id_rubrique' => $Pile[$SP]['id_rubrique'])), array('compil' => array('squelettes/rubrique.html', 'html_0caead67327defaf94febb642f511490', '_rubrique_principal', 43, $GLOBALS['spip_lang'])), _request('connect')) . ' ' . (($t1 = BOUCLE_type_miniplanhtml_0caead67327defaf94febb642f511490($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? $t1 . ' ' : ' ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-rub-articles') . ', array_merge(' . var_export($Pile[0], 1) . ',array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ', \'id_secteur\' => ' . argumenter_squelette($Pile[$SP]['id_secteur']) . ', \'self\' => ' . argumenter_squelette(self()) . ', \'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . ')), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',63,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> ') . ' <br class="nettoyeur" /> </div><!-- bloc-contenu --> <!-- ***************************************************************** Menus contextuels (droite) Contextual menus (right) ************************************************************* --> <div id="encart"> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-annonces') . ', array_merge(' . var_export($Pile[0], 1) . ',array(\'self\' => ' . argumenter_squelette(self()) . ', \'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . ')), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',76,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-breves') . ', array_merge(' . var_export($Pile[0], 1) . ',array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ', \'self\' => ' . argumenter_squelette(self()) . ', \'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . ')), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',78,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-syndic') . ', array_merge(' . var_export($Pile[0], 1) . ',array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ', \'self\' => ' . argumenter_squelette(self()) . ', \'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . ')), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',80,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> </div><!-- encart --> <!-- ***************************************************************** Navigation principale et rubriques (haut et/ou gauche) Main and Sections Navigation (top and/orleft) ************************************************************* --> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-menu') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ', \'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',88,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> <!-- ***************************************************************** Pied de page - Footer ************************************************************* --> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-bas') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ', \'id_secteur\' => ' . argumenter_squelette($Pile[$SP]['id_secteur']) . ', \'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',92,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> </div><!-- page --> </body> </html> '; lang_select(); } lang_select(); $iter->free(); } if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) { spip_log(intval(1000 * $timer) . "ms BOUCLE_rubrique_principal @ squelettes/rubrique.html", "profiler" . _LOG_AVERTISSEMENT); } return $t0; }
/** * Ajout des CSS du porte-plume au head public * * Appelé aussi depuis le privé avec $prive à true. * * @pipeline insert_head_css * @param string $flux Contenu du head * @param bool $prive Est-ce pour l'espace privé ? * @return string Contenu du head complété */ function porte_plume_insert_head_css($flux = '', $prive = false) { include_spip('inc/autoriser'); // toujours autoriser pour le prive. if ($prive or autoriser('afficher_public', 'porteplume')) { if ($prive) { $cssprive = find_in_path('css/barre_outils_prive.css'); $flux .= "<link rel='stylesheet' type='text/css' media='all' href='{$cssprive}' />\n"; } $css = direction_css(find_in_path('css/barre_outils.css'), lang_dir()); $css_icones = generer_url_public('barre_outils_icones.css'); if (defined('_VAR_MODE') and _VAR_MODE == "recalcul") { $css_icones = parametre_url($css_icones, 'var_mode', 'recalcul'); } $flux .= "<link rel='stylesheet' type='text/css' media='all' href='{$css}' />\n" . "<link rel='stylesheet' type='text/css' media='all' href='{$css_icones}' />\n"; } return $flux; }
function exec_articles_versions_args($id_article, $id_version, $id_diff) { global $spip_lang_left, $spip_lang_right; if (!autoriser('voirrevisions', 'article', $id_article) OR !$row = sql_fetsel("*", "spip_articles", "id_article=".sql_quote($id_article))){ include_spip('inc/minipres'); echo minipres(); return; } include_spip('inc/suivi_versions'); include_spip('inc/presentation'); include_spip('inc/revisions'); // recuperer les donnees actuelles de l'article $id_article = $row["id_article"]; $id_rubrique = $row["id_rubrique"]; $titre = $row["titre"]; $statut_article = $row["statut"]; $lang = $row["lang"]; // Afficher le debut de la page (y compris rubrique) $commencer_page = charger_fonction('commencer_page', 'inc'); echo $commencer_page(_T('info_historique')." « $titre »", "naviguer", "articles", $id_rubrique); echo debut_grand_cadre(true); echo afficher_hierarchie($id_rubrique); echo fin_grand_cadre(true); ////////////////////////////////////////////////////// // Affichage de la colonne de gauche // echo debut_gauche('', true); echo bloc_des_raccourcis(icone_horizontale(_T('icone_retour_article'), generer_url_ecrire("articles","id_article=$id_article"), "article-24.gif","rien.gif", false) . icone_horizontale(_T('icone_suivi_revisions'), generer_url_ecrire("suivi_revisions",""), "historique-24.gif","rien.gif", false)); ////////////////////////////////////////////////////// // Affichage de la colonne de droite // echo debut_droite('', true); $lang_dir = lang_dir(changer_typo($lang)); // // recuperer les donnees versionnees // $last_version = false; if (!$id_version) { $id_version = $row['id_version']; $last_version = true; } $textes = revision_comparee($id_article, $id_version, 'complet', $id_diff); unset($id_rubrique); # on n'en n'aura besoin que si on affiche un diff // // Titre, surtitre, sous-titre // $debut = $corps = ''; if (is_array($textes)) foreach ($textes as $var => $t) { switch ($var) { case 'id_rubrique': $debut .= "<div dir='$lang_dir' class='arial1 spip_x-small'>" . $t . "</div>\n"; break; case 'surtitre': case 'soustitre': $debut .= "<div dir='$lang_dir' class='arial1 spip_medium'><b>" . propre_diff($t) . "</b></div>\n"; break; case 'titre': $debut .= gros_titre(propre_diff($t), puce_statut($statut_article, " style='vertical-align: center'"), false); break; // trois champs a affichage combine case 'descriptif': case 'url_site': case 'nom_site': if (!$vudesc++) { $debut .= "<div style='text-align: $spip_lang_left; padding: 5px; border: 1px dashed #aaaaaa; background-color: #e4e4e4;' dir='$lang_dir'>"; $texte_case = ($textes['descriptif']) ? "{{"._T('info_descriptif')."}} ".$textes['descriptif']."\n\n" : ''; $texte_case .= ($textes['nom_site'].$textes['url_site']) ? "{{"._T('info_urlref')."}} [".$textes['nom_site']."->".$textes['url_site']."]" : ''; $debut .= "<span class='verdana1 spip_small'>" . propre($texte_case). "</span>"; $debut .= "</div>"; } break; default: $corps .= "<div dir='$lang_dir' class='champ contenu_$var'>" . "<div class='label'>$var</div>" . "<div class='$var'>" . propre_diff($t) . "</div></div>\n"; break; } } echo '<div id="contenu">'; echo debut_cadre_relief('', true); echo "\n<table id='diff' cellpadding='0' cellspacing='0' border='0' width='100%'>"; echo "<tr><td style='width: 100%' valign='top'>"; echo $debut; echo "</td><td>"; // Icone de modification if (autoriser('modifier', 'article', $id_article)) echo icone_inline( _T('icone_modifier_article').'<br />('._T('version')." $id_version)", generer_url_ecrire("articles_edit", "id_article=$id_article".((!$last_version)?"&id_version=$id_version":"")), "article-24.gif", "edit.gif", $spip_lang_right ); echo "</td>"; echo "</tr></table>"; echo fin_cadre_relief(true); ////////////////////////////////////////////////////// // Affichage des versions // $result = sql_select("id_version, titre_version, date, id_auteur", "spip_versions", "id_article=".sql_quote($id_article)." AND id_version>0", "", "id_version DESC"); echo debut_cadre_relief('', true); $zapn = 0; $lignes = array(); $points = '...'; $tranches = 10; while ($row = sql_fetch($result)) { $res = ''; // s'il y en a trop on zappe a partir de la 10e // et on s'arrete juste apres celle cherchee if ($zapn++ > $tranches AND abs($id_version - $row['id_version']) > $tranches<<1) { if ($points) { $lignes[]= $points; $points = ''; } if ($id_version > $row['id_version']) break; continue; } $date = affdate_heure($row['date']); $version_aff = $row['id_version']; $titre_version = typo($row['titre_version']); $titre_aff = $titre_version ? $titre_version : $date; if ($version_aff != $id_version) { $lien = parametre_url(self(), 'id_version', $version_aff); $lien = parametre_url($lien, 'id_diff', ''); $res .= "<a href='".($lien.'#diff')."' title=\""._T('info_historique_affiche')."\">$titre_aff</a>"; } else { $res .= "<b>$titre_aff</b>"; } if (is_numeric($row['id_auteur']) AND $t = sql_getfetsel('nom', 'spip_auteurs', "id_auteur=" . intval($row['id_auteur']))) { $res .= " (".typo($t).")"; } else { $res .= " (".$row['id_auteur'].")"; #IP edition anonyme } if ($version_aff != $id_version) { $res .= " <span class='verdana2'>"; if ($version_aff == $id_diff) { $res .= "<b>("._T('info_historique_comparaison').")</b>"; } else { $lien = parametre_url(self(), 'id_version', $id_version); $lien = parametre_url($lien, 'id_diff', $version_aff); $res .= "(<a href='".($lien.'#diff'). "'>"._T('info_historique_comparaison')."</a>)"; } $res .= "</span>"; } $lignes[]= $res; } if ($lignes) { echo "<ul class='verdana3'><li>\n"; echo join("\n</li><li>\n", $lignes); echo "</li></ul>\n"; } ////////////////////////////////////////////////////// // Corps de la version affichee // echo "\n\n<div id='wysiwyg' style='text-align: justify;'>$corps"; // notes de bas de page if (strlen($GLOBALS['les_notes'])) echo "<div class='champ contenu_notes'> <div class='label'>"._T('info_notes')."</div> <div class='notes' dir='$lang_dir'>" .$GLOBALS['les_notes'] ."</div></div>\n"; echo "</div>\n"; echo fin_cadre_relief(true); echo '</div>'; // /#contenu echo fin_gauche(), fin_page(); }
" ></a> </td></tr><tr><td valign="top" colspan="3" align="center"> <?php echo "<font size='-1'>\n"; echo "<i>" . _("Markup shortcuts") . ":</i>\n"; echo_tool_links($round->pi_tools['tool_links']); echo "\n<br>\n"; echo "<i>" . _('Pop-up tools') . ":</i>\n"; echo_popup_links($round->pi_tools['popup_links']); echo "\n<br>\n"; echo "<i>" . _("Reference Information") . ":</i> "; $url = "{$code_url}/faq/" . lang_dir() . $round->document; echo "[<a style=\"color:#0000FF; text-decoration: underline;\" href='{$url}' target='_blank'>"; echo _('Guidelines'); echo "</a>]\n"; $url = "{$code_url}/faq/InterfaceDiagram.png"; echo "[<a style=\"color:#0000FF; text-decoration: underline;\" href='{$url}' target='_blank'>"; echo _("Proofreading Diagram"); echo "</a>]\n"; ?> </font> </td> </tr> </table> </form> <?php
function afficher_articles_trad_boucle($row, $own='') { global $spip_lang_right, $spip_display; $id_article = $row['id_article']; if (!autoriser('voir','article',$id_article)) return ''; $titre = $row['titre']; $id_rubrique = $row['id_rubrique']; $statut = $row['statut']; $id_trad = $row['id_trad']; $lang = $row['lang']; $lang_dir = lang_dir($GLOBALS['lang_objet']); $dates_art = $langues_art = array(); $ligne = ""; $res_trad = sql_select("id_article, lang, date_modif", "spip_articles", "id_trad = $id_trad AND id_trad > 0"); while ($row_trad = sql_fetch($res_trad)) { $id_article_trad = $row_trad["id_article"]; $lang_trad = $row_trad["lang"]; $date = $row_trad['date_modif']; $dates_art[$lang_trad] = $date; $langues_art[$lang_trad] = $id_article_trad; if ($id_article_trad == $id_trad) $date_ref = $date; } // faudrait sortir ces invariants de boucle if (($GLOBALS['meta']['multi_rubriques'] == 'oui' AND (!isset($GLOBALS['id_rubrique']))) OR $GLOBALS['meta']['multi_articles'] == 'oui') { $langue_defaut = isset($GLOBALS['langue_rubrique']) ? $GLOBALS['meta']['langue_site'] : $GLOBALS['langue_rubrique']; if ($lang != $langue_defaut) $afficher_langue = " <span class='spip_xx-small' style='color: #666666' dir='$lang_dir'>(".traduire_nom_langue($lang).")</span>"; } else $afficher_langue = ''; foreach(explode(',', $GLOBALS['meta']['langues_multilingue']) as $k){ if (isset($langues_art[$k]) AND $langues_art[$k]<> $id_trad){ $h = generer_url_ecrire("articles", "id_article=".$langues_art[$k]); $style = strtotime($dates_art[$k]) < strtotime($date_ref); $style = $style ? 'claire' : 'foncee'; $ligne .= "<a href='$h' class='$style'>$k</a>"; } } if (acces_restreint_rubrique($id_rubrique)) $img = http_img_pack("admin-12.gif", _T('titre_image_administrateur'), "width='12' height='12'", _T('titre_image_admin_article')); else $img = ''; if (!$titre) $titre = _T('ecrire:info_sans_titre'); if ($id_article == $id_trad) $titre = "<b>$titre</b>"; $h = generer_url_ecrire("articles", "id_article=$id_article"); $titre = "\n<div>" . $img . "<a href='$h' dir='$lang_dir' style=\"display:block;\">" . typo(supprime_img($titre,'')) . "</a></div>"; if ($spip_display == 4) return array($ligne); $ligne .= "<a href='$h'><span class='lang_base'>$lang</span></a>"; // La petite puce de changement de statut $puce_statut = charger_fonction('puce_statut', 'inc'); $puce = $puce_statut($id_article, $statut, $id_rubrique,'article'); return array($puce, $titre, $afficher_langue, "<div style='float: $spip_lang_right; margin-right: -10px;'>" . $ligne . "</div>"); }
function statistiques_lang_ok() { global $spip_ecran, $spip_lang_right; $commencer_page = charger_fonction('commencer_page', 'inc'); echo $commencer_page(_T('onglet_repartition_lang'), "statistiques_visites", "repartition-langues"); if ($spip_ecran == "large") { $largeur_table = 974; } else { $largeur_table = 750; } $taille = $largeur_table - 200; echo "<table class='centered' width='$largeur_table'><tr><td style='width: $largeur_table" . "px; text-align:center;' class='verdana2'>"; echo "<br /><br />"; echo gros_titre(_T('onglet_repartition_lang'),'', false); //barre_onglets("repartition", "langues"); if (_request('critere') == "debut") { $critere = "visites"; // echo gros_titre(_T('onglet_repartition_debut','', false)); } else { $critere = "popularite"; // echo gros_titre(_T('onglet_repartition_actuelle','', false)); } echo ($critere == "popularite") ? barre_onglets("rep_depuis", "popularite"): barre_onglets("rep_depuis", "debut"); // // Statistiques par langue // echo debut_cadre_enfonce("langues-24.gif", true); $r = sql_fetsel("SUM($critere) AS total_visites", "spip_articles"); $visites = 1; if ($r) $total_visites = $r['total_visites']; else $total_visites = 1; $result = sql_select("lang, SUM(".$critere.") AS cnt", "spip_articles", "statut='publie' ", "lang"); $ifond = 1; $visites_abs = 0; $res = ''; while ($row = sql_fetch($result)) { $lang = $row['lang']; $visites = round($row['cnt'] / $total_visites * $taille); $pourcent = round($row['cnt'] / $total_visites * 100); if ($visites > 0) { if ($ifond==0){ $ifond=1; $couleur="white"; }else{ $ifond=0; $couleur="eeeeee"; } $res .= "\n<tr style='background-color: $couleur'>"; $dir=lang_dir($lang,'',' dir="rtl"'); $res .= "<td style='width: 100%; border-bottom: 1px solid #cccccc;'><span class='verdana2'$dir><span style='float: $spip_lang_right;'>$pourcent%</span>".traduire_nom_langue($lang)."</span></td>"; $res .= "<td style='border-bottom: 1px solid #cccccc;'>"; $res .= "\n<table cellpadding='0' cellspacing='0' border='0' width='".($taille+5)."'>"; $res .= "\n<tr><td style='align:$spip_lang_right; background-color: #eeeeee; border: 1px solid #999999; white-space: nowrap;'>"; if ($visites_abs > 0) $res .= "<img src='" . chemin_image('rien.gif') . "' width='$visites_abs' height='8' alt=' ' />"; if ($visites>0) $res .= "<img src='" . chemin_image('rien.gif') . "' class='couleur_langue' style='border: 0px;' width='$visites' height='8' alt=' ' />"; $res .= "</td></tr></table>\n"; $res .= "</td>"; $res .= "</tr>"; $visites_abs += $visites; } } if ($res) echo "\n<table cellpadding='2' cellspacing='0' border='0' width='100%' style='border: 1px solid #aaaaaa;'>", $res, "</table>\n"; //echo "<p><span class='verdana1 spip_medium'>"._T('texte_signification')."</span>"; echo fin_cadre_enfonce(true); echo "</td></tr></table>"; echo fin_page(); }
function afficher_hierarchie($id_parent, $message='',$id_objet=0,$type='',$id_secteur=0,$restreint='') { global $spip_lang_left,$spip_lang_right; $out = ""; $nav = ""; if ($id_objet) { # desactiver le selecteur de rubrique sur le chemin # $nav = chercher_rubrique($message,$id_objet, $id_parent, $type, $id_secteur, $restreint,true); $nav = $nav ?"<div class='none'>$nav</div>":""; } $parents = ''; $style1 = "$spip_lang_left center no-repeat; padding-$spip_lang_left: 15px"; $style2 = "margin-$spip_lang_left: 15px;"; $tag = "a"; $on = ' on'; $id_rubrique = $id_parent; while ($id_rubrique) { $res = sql_fetsel("id_parent, titre, lang", "spip_rubriques", "id_rubrique=".intval($id_rubrique)); if (!$res){ // rubrique inexistante $id_rubrique = 0; break; } $id_parent = $res['id_parent']; changer_typo($res['lang']); $class = (!$id_parent) ? "secteur" : (acces_restreint_rubrique($id_rubrique) ? "admin" : "rubrique"); $parents = "<ul><li><span class='bloc'><em> > </em><$tag class='$class$on'" . ($tag=='a'?" href='". generer_url_ecrire("naviguer","id_rubrique=$id_rubrique")."'":"") . ">" . supprimer_numero(typo(sinon($res['titre'], _T('ecrire:info_sans_titre')))) . "</$tag></span>" . $parents . "</li></ul>"; $id_rubrique = $id_parent; $tag = 'a'; $on = ''; } $out .= $nav . "\n<ul id='chemin' class='verdana3' dir='".lang_dir()."'" //. http_style_background("racine-site-12.gif", $style1) . "><li><span class='bloc'><$tag class='racine$on'" . ($tag=='a'?" href='". generer_url_ecrire("naviguer","id_rubrique=$id_rubrique")."'":"") . ">"._T('info_racine_site')."</$tag>" . "</span>" . $parents . aide ("rubhier") . "</li></ul>" . ($nav? " <a href='#' onclick=\"$(this).prev().prev().toggle('fast');return false;\" class='verdana2'>" . _T('bouton_changer') ."</a>" :""); $out = pipeline('affiche_hierarchie',array('args'=>array( 'id_parent'=>$id_parent, 'message'=>$message, 'id_objet'=>$id_objet, 'objet'=>$type, 'id_secteur'=>$id_secteur, 'restreint'=>$restreint), 'data'=>$out)); return $out; }
function html_76ddbc2b5f1671bea60186a8fa5bb500($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { if (isset($Pile[0]["doublons"]) and is_array($Pile[0]["doublons"])) { $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); } $connect = ''; $page = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . spip_htmlentities(@$Pile[0]['lang'] ? @$Pile[0]['lang'] : $GLOBALS['spip_lang']) . '" lang="' . spip_htmlentities(@$Pile[0]['lang'] ? @$Pile[0]['lang'] : $GLOBALS['spip_lang']) . '" dir="' . lang_dir(@$Pile[0]['lang'], 'ltr', 'rtl') . '"> <head> <title>[' . interdire_scripts(textebrut(typo($GLOBALS['meta']['nom_site'], "TYPO", $connect, $Pile[0]))) . '] : ' . _T('public|spip|ecrire:icone_agenda') . '</title> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-meta') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/agenda.html\',\'html_76ddbc2b5f1671bea60186a8fa5bb500\',\'\',6,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('styles') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/agenda.html\',\'html_76ddbc2b5f1671bea60186a8fa5bb500\',\'\',7,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> </head> <body dir="' . lang_dir(@$Pile[0]['lang'], 'ltr', 'rtl') . '" class="' . spip_htmlentities(@$Pile[0]['lang'] ? @$Pile[0]['lang'] : $GLOBALS['spip_lang']) . ' plan"> <div id="page"> <!-- ***************************************************************** Bandeau, titre du site et menu langue Header and main menu (top and right) ************************************************************* --> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-bandeau') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/agenda.html\',\'html_76ddbc2b5f1671bea60186a8fa5bb500\',\'\',17,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> <!-- ***************************************************************** Contenu principal (centre) Main content (center) ************************************************************* --> <div id="bloc-contenu"> ' . BOUCLE_langue_contexte_exclushtml_76ddbc2b5f1671bea60186a8fa5bb500($Cache, $Pile, $doublons, $Numrows, $SP) . ' ' . (($t1 = BOUCLE_langueshtml_76ddbc2b5f1671bea60186a8fa5bb500($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? ' <div id="sommaire"> <h4>' . _T('public|spip|ecrire:info_langues') . '</h4> <ul> ' . $t1 . ' </ul> </div> ' : '') . ' <h2>' . _T('public|spip|ecrire:icone_agenda') . '</h2> ' . (($t1 = BOUCLE_article_languehtml_76ddbc2b5f1671bea60186a8fa5bb500($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? ' ' . $t1 . ' ' : ' ') . ' <hr /> <h3>' . _T('public|spip|ecrire:info_visites_par_mois') . '</h3> ' . (($t1 = BOUCLE_archivehtml_76ddbc2b5f1671bea60186a8fa5bb500($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? $t1 . ' </ul> </li> </ul> </div><!-- plan --> ' : '') . ' </div><!-- bloc-contenu --> <!-- ***************************************************************** Menus contextuels (droite) Contextual menus (right) ************************************************************* --> <div id="encart"> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-annonces') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/agenda.html\',\'html_76ddbc2b5f1671bea60186a8fa5bb500\',\'\',107,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-breves') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/agenda.html\',\'html_76ddbc2b5f1671bea60186a8fa5bb500\',\'\',108,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-syndic') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/agenda.html\',\'html_76ddbc2b5f1671bea60186a8fa5bb500\',\'\',109,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> </div><!-- encart --> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-menu') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/agenda.html\',\'html_76ddbc2b5f1671bea60186a8fa5bb500\',\'\',112,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-bas') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/agenda.html\',\'html_76ddbc2b5f1671bea60186a8fa5bb500\',\'\',113,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> </div><!-- page --> </body> </html> '; return analyse_resultat_skel('html_76ddbc2b5f1671bea60186a8fa5bb500', $Cache, $page, 'squelettes/agenda.html'); }
function html_8bf8bdc0aa13e79e11d908f1699ff96f($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { if (isset($Pile[0]["doublons"]) and is_array($Pile[0]["doublons"])) { $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); } $connect = ''; $page = ' ' . (($t1 = BOUCLE_articles_rubriquehtml_8bf8bdc0aa13e79e11d908f1699ff96f($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? ' <h2 class="structure">' . _T('public|spip|ecrire:articles_rubrique') . '</h2> ' . filtre_pagination_dist($Numrows["_articles_rubrique"]["grand_total"], '_articles_rubrique', isset($Pile[0]['debut_articles_rubrique']) ? $Pile[0]['debut_articles_rubrique'] : intval(_request('debut_articles_rubrique')), 10, false, '', '', array()) . ' ' . $t1 . (' ' . (($t3 = strval(filtre_pagination_dist($Numrows["_articles_rubrique"]["grand_total"], '_articles_rubrique', isset($Pile[0]['debut_articles_rubrique']) ? $Pile[0]['debut_articles_rubrique'] : intval(_request('debut_articles_rubrique')), 10, true, '', '', array()))) !== '' ? '<div class="pagination"> <div class="ligne1"> <div dir="' . lang_dir(@$Pile[0]['lang'], 'ltr', 'rtl') . '">' . $Numrows['_articles_rubrique']['total'] . '/' . (isset($Numrows['_articles_rubrique']['grand_total']) ? $Numrows['_articles_rubrique']['grand_total'] : $Numrows['_articles_rubrique']['total']) . ' ' . _T('public|spip|ecrire:articles') . '</div> </div> <div class="ligne2"> ' . $t3 . ' </div> </div>' : '') . ' ') : ''); return analyse_resultat_skel('html_8bf8bdc0aa13e79e11d908f1699ff96f', $Cache, $page, 'squelettes/inc/inc-rub-articles.html'); }
/** * Affiche les enfants d'une sous rubrique dans un bloc dépliable * (Utilisé dans les pages du privé) * * @param int $collection2 * L'identifiant numérique de la rubrique parente * @return string * Le contenu du bloc dépliable */ function sous_enfant_rub($collection2) { $nb = sql_countsel('spip_rubriques', "id_parent={$collection2}"); $retour = ''; $pagination = ''; $debut = 0; $limite = 500; /** * On ne va afficher que 500 résultats max * Si > 500 on affiche une pagination */ if ($nb > $limite) { $debut = _request('debut_rubrique' . $collection2) ? _request('debut_rubrique' . $collection2) : $debut; $pagination = chercher_filtre('pagination'); $pagination = '<p class="pagination">' . $pagination($nb, '_rubrique' . $collection2, $debut, $limite, true, 'prive') . '</p>'; $limite = $debut + $limite; } $result = sql_select("id_rubrique, id_parent, titre, lang", "spip_rubriques", "id_parent={$collection2}", '', '0+titre,titre', "{$debut},{$limite}"); while ($row = sql_fetch($result)) { $id_rubrique2 = $row['id_rubrique']; $id_parent2 = $row['id_parent']; $titre2 = generer_info_entite($id_rubrique2, 'rubrique', 'titre'); // pour etre sur de passer par tous les traitements if ('' !== ($rang2 = recuperer_numero($row['titre']))) { $rang2 = "{$rang2}. "; } changer_typo($row['lang']); $lang_dir = lang_dir($row['lang']); if (autoriser('voir', 'rubrique', $id_rubrique2)) { $retour .= "\n<li class='item' dir='{$lang_dir}'><a href='" . generer_url_entite($id_rubrique2, 'rubrique') . "'>" . $rang2 . $titre2 . "</a></li>\n"; } } $retour = $pagination . $retour . $pagination; if (!$retour) { return ''; } return debut_block_depliable($debut > 0 ? true : false, "enfants{$collection2}") . "\n<ul class='liste-items sous-sous-rub'>\n" . $retour . "</ul>\n" . fin_block() . "\n\n"; }
function articles_traduction($row, $id_article) { global $connect_toutes_rubriques; $vals = array(); $id_rubrique_trad = $row["id_rubrique"]; $id_article_trad = $row["id_article"]; $id_trad = $row["id_trad"]; $titre_trad = $row["titre"]; $lang_trad = $row["lang"]; $statut_trad = $row["statut"]; changer_typo($lang_trad); $lang_dir = lang_dir($lang_trad); $titre_trad = "<span dir='$lang_dir'>$titre_trad</span>"; $puce_statut = charger_fonction('puce_statut', 'inc'); $vals[] = $puce_statut($id_article_trad, $statut_trad, $id_rubrique_trad, 'article'); if ($id_article_trad == $id_trad) { $vals[] = http_img_pack('langues-12.gif', "", " class='lang'"); $titre_trad = "<b>$titre_trad</b>"; } else { if (!$connect_toutes_rubriques) $vals[] = http_img_pack('langues-off-12.gif', "", " class='lang'"); else $vals[] = ajax_action_auteur("referencer_traduction", "$id_article,$id_trad,$id_article_trad", 'articles', "id_article=$id_article", array(http_img_pack('langues-off-12.gif', _T('trad_reference'), "class='lang'"), ' title="' . _T('trad_reference') . '"')); } $s = typo(supprime_img($titre_trad,'')); if ($id_article_trad != $id_article) $s = "<a href='" . generer_url_ecrire("articles","id_article=$id_article_trad") . "'>$s</a>"; if ($id_article_trad == $id_trad) $s .= " "._T('trad_reference'); $vals[] = $s; $vals[] = traduire_nom_langue($lang_trad); return $vals; }
function html_811e306b565ea1c1f639bf89bba154a7($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { if (isset($Pile[0]["doublons"]) and is_array($Pile[0]["doublons"])) { $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); } $connect = ''; $page = ' <br class="nettoyeur" /> <div class="edito"> <h3 class="edito-titre">' . _T('public|spip|ecrire:articles_recents') . '</h3> </div> ' . BOUCLE_articles_exclushtml_811e306b565ea1c1f639bf89bba154a7($Cache, $Pile, $doublons, $Numrows, $SP) . ' ' . (($t1 = BOUCLE_article_languehtml_811e306b565ea1c1f639bf89bba154a7($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? ' ' . filtre_pagination_dist($Numrows["_article_langue"]["grand_total"], '_article_langue', isset($Pile[0]['debut_article_langue']) ? $Pile[0]['debut_article_langue'] : intval(_request('debut_article_langue')), 10, false, '', '', array()) . ' ' . $t1 . (' ' . (($t3 = strval(filtre_pagination_dist($Numrows["_article_langue"]["grand_total"], '_article_langue', isset($Pile[0]['debut_article_langue']) ? $Pile[0]['debut_article_langue'] : intval(_request('debut_article_langue')), 10, true, 'page_precedent_suivant', '', array()))) !== '' ? '<div class="pagination"> <div class="ligne1"> <div dir="' . lang_dir(@$Pile[0]['lang'], 'ltr', 'rtl') . '">' . $Numrows['_article_langue']['total'] . '/' . (isset($Numrows['_article_langue']['grand_total']) ? $Numrows['_article_langue']['grand_total'] : $Numrows['_article_langue']['total']) . ' ' . _T('public|spip|ecrire:articles') . '</div> </div> <div class="ligne2"> ' . $t3 . ' </div> </div>' : '') . ' ') : ' '); return analyse_resultat_skel('html_811e306b565ea1c1f639bf89bba154a7', $Cache, $page, 'squelettes/inc/inc-sommaire-articles.html'); }
function puce_statut_site_dist($id, $statut, $id_rubrique, $type, $ajax=''){ global $lang_objet; static $coord = array('publie' => 1, 'prop' => 0, 'refuse' => 2, 'poubelle' => 3); if ($type=='syndic') $type='site'; $lang_dir = lang_dir($lang_objet); $puces = array( 0 => 'puce-orange-breve.gif', 1 => 'puce-verte-breve.gif', 2 => 'puce-rouge-breve.gif', 3 => 'puce-blanche-breve.gif'); $t = sql_getfetsel("syndication", "spip_syndic", "id_syndic=".sql_quote($id)); if ($t == 'off' OR $t == 'sus') $anim = 'anim'; else $anim = 'breve'; switch ($statut) { case 'publie': $puce = 'puce-verte-' . $anim .'.gif'; $title = _T('info_site_reference'); break; case 'prop': $puce = 'puce-orange-' . $anim .'.gif'; $title = _T('info_site_attente'); break; case 'refuse': default: $puce = 'puce-poubelle-' . $anim .'.gif'; $title = _T('info_site_refuse'); break; } $type1 = "statut$type$id"; $inser_puce = http_img_pack($puce, $title, "id='img$type1' style='margin: 1px;'"); if ($anim!='breve' OR !autoriser('publierdans','rubrique',$id_rubrique) OR !_ACTIVER_PUCE_RAPIDE) return $inser_puce; // c'est comme les breves : $titles = array( "blanche" => _T('texte_statut_en_cours_redaction'), "orange" => _T('texte_statut_propose_evaluation'), "verte" => _T('texte_statut_publie'), "rouge" => _T('texte_statut_refuse'), "poubelle" => _T('texte_statut_poubelle')); $clip = 1+ (11*$coord[$statut]); if ($ajax){ return "<span class='puce_site_fixe'>" . $inser_puce . "</span>" . "<span class='puce_site_popup' id='statutdecal$type$id' style='margin-left: -$clip"."px;'>" . afficher_script_statut($id, $type, -1, $puces[0], 'prop', $titles['orange']) . afficher_script_statut($id, $type, -10, $puces[1], 'publie', $titles['verte']) . afficher_script_statut($id, $type, -19, $puces[2], 'refuse', $titles['rouge']) . "</span>"; } $nom = "puce_statut_"; if ((! _SPIP_AJAX)) $over =''; else { $action = generer_url_ecrire('puce_statut',"",true); $action = "if (!this.puce_loaded) { this.puce_loaded = true; prepare_selec_statut('$nom', '$type', '$id', '$action'); }"; $over = "\nonmouseover=\"$action\""; } return "<span class='puce_$type' id='$nom$type$id' dir='$lang_dir'$over>" . $inser_puce . '</span>'; }
function afficher_suivi_versions ($debut = 0, $id_secteur = 0, $uniq_auteur = false, $lang = "", $court = false) { changer_typo($lang); $lang_dir = lang_dir($lang); $nb_aff = 10; $champs = array('surtitre', 'titre', 'soustitre', 'descriptif', 'nom_site', 'url_site', 'chapo', 'texte', 'ps'); if ($uniq_auteur) { $req_where = " AND articles.statut IN ('prepa','prop','publie')"; $req_where .= " AND versions.id_auteur = $uniq_auteur"; } else { $req_where = " AND articles.statut IN ('prop','publie')"; } if (strlen($lang) > 0) $req_where .= " AND articles.lang=" . sql_quote($lang); if ($id_secteur > 0) $req_where .= " AND articles.id_secteur = ".intval($id_secteur); $req_where = "versions.id_version > 1 $req_where"; $req_sel = "versions.id_version, versions.id_auteur, versions.date, versions.id_article, articles.statut, articles.titre"; $req_from = 'spip_versions AS versions LEFT JOIN spip_articles AS articles ON versions.id_article = articles.id_article'; $revisions = ''; $items = array(); $result = sql_select($req_sel, $req_from, $req_where, '', 'versions.date DESC', "$debut, $nb_aff"); while ($row = sql_fetch($result)) { $id_article = $row['id_article']; if (autoriser('voir','article',$id_article)){ $statut = $row['statut']; $id_version = $row['id_version']; $id_auteur = $row['id_auteur']; $date = $row['date']; $titre = typo(supprime_img($row['titre'],'')); // l'id_auteur peut etre un numero IP (edition anonyme) if ($id_auteur == intval($id_auteur) AND $row_auteur = sql_fetsel('nom,email', 'spip_auteurs', "id_auteur = ".sql_quote($id_auteur))) { $nom = typo($row_auteur["nom"]); $email = $row_auteur['email']; } else { $nom = $id_auteur; $email = ''; } $aff = revisions_bouton($id_article, $id_auteur, $id_version, $titre, $statut, $date, $lang_dir, $nom); if (!$court) { $bouton_id = "b$id_version-$id_article-$id_auteur"; $aff = bouton_block_depliable($aff,false,$bouton_id) . debut_block_depliable(false,$bouton_id) . safehtml(revisions_diff ($id_article, $id_version, $court)) . fin_block(); } $revisions .= "\n<div class='tr_liste' style='padding: 5px; border-top: 1px solid #aaaaaa;'>$aff</div>"; } } if (!$revisions) return ''; else return revisions_entete_boite($court, $debut, $id_secteur, $lang, $nb_aff, $req_from, $req_where, $uniq_auteur) . $revisions . fin_block() . fin_cadre(); }
function http_affiche_message($id_message, $expediteur, $statut, $type, $texte, $titre, $rv, $date_heure, $date_fin, $cherche_auteur, $forcer_dest) { global $connect_id_auteur,$connect_statut, $les_notes; if ($type == 'normal') { $le_type = _T('info_message_2').aide ("messut"); $la_couleur = "#02531b"; $fond = "#cffede"; } else if ($type == 'pb') { $le_type = _T('info_pense_bete').aide ("messpense"); $la_couleur = "#3874b0"; $fond = "#edf3fe"; } else if ($type == 'affich') { $le_type = _T('info_annonce'); $la_couleur = "#ccaa00"; $fond = "#ffffee"; } // affichage des caracteristiques du message echo "<div style='border: 1px solid $la_couleur; background-color: $fond; padding: 5px;'>"; // debut cadre de couleur //echo debut_cadre_relief("messagerie-24.gif", true); echo "\n<table width='100%' cellpadding='0' cellspacing='0' border='0'>"; echo "<tr><td>"; # uniques echo "<span style='color: $la_couleur' class='verdana1 spip_small'><b>$le_type</b></span><br />"; echo "<span class='verdana1 spip_large'><b>$titre</b></span>"; if ($statut == 'redac') { echo "<br /><span style='color: red;' class='verdana1 spip_small'><b>"._T('info_redaction_en_cours')."</b></span>"; } else if ($rv == 'non') { echo "<br /><span style='color: #666666;' class='verdana1 spip_small'><b>".nom_jour($date_heure).' '.affdate_heure($date_heure)."</b></span>"; } ////////////////////////////////////////////////////// // Message avec participants // if ($type == 'normal') $total_dest = http_message_avec_participants($id_message, $statut, $forcer_dest, $cherche_auteur, $expediteur); if ($rv != "non") http_afficher_rendez_vous($date_heure, $date_fin); ////////////////////////////////////////////////////// // Le message lui-meme // echo "\n<br />" . "<div class='serif'>$texte</div>"; if ($les_notes) { echo debut_cadre_relief('', true); echo "<div dir=" . lang_dir() ."' class='arial11'>"; echo justifier("<b>"._T('info_notes')." :</b> ".$les_notes); echo "</div>"; echo fin_cadre_relief(true); } if ($expediteur == $connect_id_auteur AND $statut == 'redac') { if ($type == 'normal' AND $total_dest < 2) { echo "<p style='color: #666666; text-align: right;' class='verdana1 spip_small'><b>"._T('avis_destinataire_obligatoire')."</b></p>"; } else { echo "\n<div class='centered'>"; echo icone_inline(_T('icone_envoyer_message'), redirige_action_auteur('editer_message', "$id_message/publie", "message","id_message=$id_message"), "messagerie-24.gif", "creer.gif"); echo "</div>"; } } echo "</td></tr></table>\n"; // echo "</td></tr></table>\n"; //echo fin_cadre_relief(true); echo "</div>"; // fin du cadre de couleur // Les boutons $aut = ($expediteur == $connect_id_auteur); $aff = ($type == 'affich' AND $connect_statut == '0minirezo'); echo "\n<table width='100%'><tr><td>"; // bouton de suppression if ($aut AND ($statut == 'redac' OR $type == 'pb') OR $aff) { echo icone_inline(_T('icone_supprimer_message'), redirige_action_auteur("editer_message","-$id_message", 'messagerie'), "messagerie-24.gif", "supprimer.gif", 'left'); } // bouton retrait de la discussion if ($statut == 'publie' AND $type == 'normal') { echo icone_inline(_T('icone_arret_discussion'), redirige_action_auteur("editer_message","$id_message/-$connect_id_auteur", 'messagerie', "id_message=$id_message"), "messagerie-24.gif", "supprimer.gif", 'left'); } // bouton modifier ce message if ($aut OR $aff) { echo icone_inline(_T('icone_modifier_message'), (generer_url_ecrire("message_edit","id_message=$id_message")), "messagerie-24.gif", "edit.gif", 'right'); } echo "</td></tr></table>"; }
function BOUCLE_auteur_principalhtml_ce97d1249b67fffb20134bd49b8a9e29(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) { static $command = array(); static $connect; $command['connect'] = $connect = ''; if (!isset($command['table'])) { $command['table'] = 'auteurs'; $command['id'] = '_auteur_principal'; $command['from'] = array('auteurs' => 'spip_auteurs'); $command['type'] = array(); $command['groupby'] = array(); $command['select'] = array("auteurs.id_auteur", "auteurs.lang", "auteurs.nom", "auteurs.bio", "auteurs.url_site", "auteurs.nom_site", "auteurs.email"); $command['orderby'] = array(); $command['join'] = array(); $command['limit'] = ''; $command['having'] = array(); } $command['where'] = array(quete_condition_statut('auteurs.statut', '!5poubelle', '!5poubelle', ''), array('=', 'auteurs.id_auteur', sql_quote(@$Pile[0]['id_auteur'], '', 'bigint(21) NOT NULL AUTO_INCREMENT'))); if (defined("_BOUCLE_PROFILER")) { $timer = time() + microtime(); } $t0 = ""; // REQUETE $iter = IterFactory::create("SQL", $command, array('squelettes/auteur.html', 'html_ce97d1249b67fffb20134bd49b8a9e29', '_auteur_principal', 1, $GLOBALS['spip_lang'])); if (!$iter->err()) { $SP++; // RESULTATS while ($Pile[$SP] = $iter->fetch()) { $t0 .= ' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" dir="' . lang_dir($Pile[$SP]['lang'], 'ltr', 'rtl') . '"> <head> <title>' . interdire_scripts(textebrut(typo(supprimer_numero($Pile[$SP]['nom']), "TYPO", $connect, $Pile[0]))) . ' - [' . interdire_scripts(textebrut(typo($GLOBALS['meta']['nom_site'], "TYPO", $connect, $Pile[0]))) . ']</title> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-meta') . ', array(\'id_auteur\' => ' . argumenter_squelette($Pile[$SP]['id_auteur']) . ', \'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/auteur.html\',\'html_ce97d1249b67fffb20134bd49b8a9e29\',\'\',7,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> <link rel="alternate" type="application/rss+xml" title="' . interdire_scripts(textebrut(typo(supprimer_numero($Pile[$SP]['nom']), "TYPO", $connect, $Pile[0]))) . '" href="' . interdire_scripts(parametre_url(generer_url_public('backend', ''), 'id_auteur', $Pile[$SP]['id_auteur'])) . '" /> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('styles') . ', array(\'id_auteur\' => ' . argumenter_squelette($Pile[$SP]['id_auteur']) . ', \'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/auteur.html\',\'html_ce97d1249b67fffb20134bd49b8a9e29\',\'\',9,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> </head> <body dir="' . lang_dir($Pile[$SP]['lang'], 'ltr', 'rtl') . '" class="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . ' auteur aut' . $Pile[$SP]['id_auteur'] . '"> <div id="page" class="auteur"> <!-- ***************************************************************** Bandeau, titre du site et menu langue Header and main menu (top and right) ************************************************************* --> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-bandeau') . ', array(\'id_auteur\' => ' . argumenter_squelette($Pile[$SP]['id_auteur']) . ', \'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/auteur.html\',\'html_ce97d1249b67fffb20134bd49b8a9e29\',\'\',19,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> <!-- ***************************************************************** Contenu principal (centre) Main content (center) ************************************************************* --> <div id="bloc-contenu"> <div class="cartouche"> ' . (($t1 = strval(filtrer('image_graver', filtrer('image_reduire', !is_array($l = quete_logo('id_auteur', 'ON', $Pile[$SP]['id_auteur'], '', 0)) ? '' : "<img class=\"spip_logo spip_logos\" alt=\"\" src=\"{$l['0']}\"" . $l[2] . ($l[1] ? " onmouseover=\"this.src='{$l['1']}'\" onmouseout=\"this.src='{$l['0']}'\"" : "") . ' />', '120', '0')))) !== '' ? '<span style="float:right;">' . $t1 . '</span>' : '') . ' <h1 class="">' . interdire_scripts(typo(supprimer_numero($Pile[$SP]['nom']), "TYPO", $connect, $Pile[0])) . '</h1> <div class="texte"> ' . (($t1 = strval(interdire_scripts(propre($Pile[$SP]['bio'], $connect, $Pile[0])))) !== '' ? '<div class="bio">' . $t1 . '</div>' : '') . ' ' . (($t1 = strval(calculer_url($Pile[$SP]['url_site'], '', 'url', $connect))) !== '' ? '<b>' . interdire_scripts(typo(supprimer_numero(calculer_url($Pile[$SP]['url_site'], $Pile[$SP]['nom_site'], 'titre', $connect, false)), "TYPO", $connect, $Pile[0])) . ' : <a href="' . $t1 . ('">' . calculer_url($Pile[$SP]['url_site'], '', 'url', $connect) . '</a></b><br />') : '') . ' ' . (($t1 = strval(interdire_scripts(calculer_notes()))) !== '' ? $t1 . '<br />' : '') . ' <br /> ' . (($t1 = strval(executer_balise_dynamique('FORMULAIRE_ECRIRE_AUTEUR', array($Pile[$SP]['id_auteur'], @$Pile[0]['id_article'], $Pile[$SP]['email']), array('squelettes/auteur.html', 'html_ce97d1249b67fffb20134bd49b8a9e29', '_auteur_principal', 27, $GLOBALS['spip_lang'])))) !== '' ? '<h2 id="message">' . _T('public|spip|ecrire:info_envoyer_message_prive') . '</h2>' . $t1 : '') . ' </div><!-- texte --> </div><!-- cartouche --> <!-- Articles de l\'auteur --> <h2>' . _T('public|spip|ecrire:articles_auteur') . '</h2> ' . (($t1 = BOUCLE_articleshtml_ce97d1249b67fffb20134bd49b8a9e29($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? $t1 : ' ') . ' </div><!-- bloc-contenu --> <!-- ***************************************************************** Menus contextuels (droite) Contextual menus (right) ************************************************************* --> <div id="encart"> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-annonces') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/auteur.html\',\'html_ce97d1249b67fffb20134bd49b8a9e29\',\'\',53,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> ' . (($t1 = BOUCLE_auteurshtml_ce97d1249b67fffb20134bd49b8a9e29($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? ' <!-- Tous les auteurs --> <div class="menu"> <ul class="titre"> <li><b>' . _T('public|spip|ecrire:icone_tous_auteur') . '</b> ' . $t1 . ' </li> </ul> </div><!-- menu --> ' : '') . ' </div><!-- encart --> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-menu') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/auteur.html\',\'html_ce97d1249b67fffb20134bd49b8a9e29\',\'\',72,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-bas') . ', array(\'id_auteur\' => ' . argumenter_squelette($Pile[$SP]['id_auteur']) . ', \'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/auteur.html\',\'html_ce97d1249b67fffb20134bd49b8a9e29\',\'\',73,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> </div><!-- page --> </body> </html> '; } $iter->free(); } if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) { spip_log(intval(1000 * $timer) . "ms BOUCLE_auteur_principal @ squelettes/auteur.html", "profiler" . _LOG_AVERTISSEMENT); } return $t0; }
function inc_formater_article_dist($row, $own='') { global $spip_lang_right, $spip_display; static $pret = false; static $chercher_logo, $img_admin, $formater_auteur, $nb, $langue_defaut, $afficher_langue, $puce_statut; $id_article = $row['id_article']; if (!autoriser('voir','article',$id_article)) return ''; if (!$pret) { $chercher_logo = ($spip_display != 1 AND $spip_display != 4 AND $GLOBALS['meta']['image_process'] != "non"); if ($chercher_logo) $chercher_logo = charger_fonction('chercher_logo', 'inc'); $formater_auteur = charger_fonction('formater_auteur', 'inc'); $img_admin = http_img_pack("admin-12.gif", "", " width='12' height='12'", _T('titre_image_admin_article')); if (($GLOBALS['meta']['multi_rubriques'] == 'oui' AND (!isset($GLOBALS['id_rubrique']))) OR $GLOBALS['meta']['multi_articles'] == 'oui') { $afficher_langue = true; $langue_defaut = !isset($GLOBALS['langue_rubrique']) ? $GLOBALS['meta']['langue_site'] : $GLOBALS['langue_rubrique']; } $puce_statut = charger_fonction('puce_statut', 'inc'); $pret = true; } if ($chercher_logo) { if ($logo = $chercher_logo($id_article, 'id_article', 'on')) { list($fid, $dir, $nom, $format) = $logo; include_spip('inc/filtres_images_mini'); $logo = "<span style='float: $spip_lang_right; margin-top: -2px; margin-bottom: -2px;'>" . image_reduire("<img src='$fid' alt='' />", 26, 20) . "</span>"; } else $logo = ''; } else $logo =''; $titre = supprime_img($row['titre'],''); $id_rubrique = $row['id_rubrique']; $date = $row['date']; $statut = $row['statut']; $descriptif = $row['descriptif']; $lang = $row['lang']; $dir = "dir='" . lang_dir($lang ? changer_typo($lang) : '') . "'"; if ($lang AND $afficher_langue AND $lang != $GLOBALS['meta']['langue_site']) $lang = " <span class='spip_xx-small' style='color: #666666' " . $dir . '>(' . traduire_nom_langue($lang) . ')</span>'; else $lang = ''; $arg = "id_article=$id_article"; $url_a = generer_url_ecrire("articles", $arg); if (!$row['petition']) $petition = ''; else $petition = " <a href='" . generer_url_ecrire('controle_petition', $arg) . "' class='spip_xx-small' style='color: red'>"._T('lien_petitions') . "</a>"; $lien = "<div>" . $logo . (acces_restreint_rubrique($id_rubrique) ? $img_admin : '') . "<a href='" . $url_a . "'" . (!$descriptif ? '': (' title="'.attribut_html(typo($descriptif)).'"')) . " $dir>" . typo(strlen($titre) ? $titre : _T('ecrire:info_sans_titre')) . "</a>" . $lang . $petition . "</div>"; if ($spip_display == 4) return array($lien); $puce = $puce_statut($id_article, $statut, $id_rubrique,'article'); $auteurs = auteurs_article($id_article); foreach ($auteurs as $k => $r) { list(, $mail, $nom,,) = $formater_auteur($r['id_auteur']); $auteurs[$k]= "$mail $nom"; } $date = affdate_jourcourt($date); if (!$date) $date = ' '; $num = afficher_numero_edit($id_article, 'id_article', 'article'); // Afficher le numero (JMB) return array($puce, $lien, join('<br />', $auteurs), $date, $num); }
function direction_css($css, $voulue = '') { if (!preg_match(',(_rtl)?\\.css$,i', $css, $r)) { return $css; } // si on a precise le sens voulu en argument, le prendre en compte if ($voulue = strtolower($voulue)) { if ($voulue != 'rtl' and $voulue != 'ltr') { $voulue = lang_dir($voulue); } } else { $voulue = lang_dir(); } $r = count($r) > 1; $right = $r ? 'left' : 'right'; // 'right' de la css lue en entree $dir = $r ? 'rtl' : 'ltr'; $ndir = $r ? 'ltr' : 'rtl'; if ($voulue == $dir) { return $css; } if (preg_match(",^http:,i", $css) or ($p = strpos($css, '?')) !== FALSE) { $distant = true; $cssf = parse_url($css); $cssf = $cssf['path'] . ($cssf['query'] ? "?" . $cssf['query'] : ""); $cssf = preg_replace(',[?:&=],', "_", $cssf); } else { $distant = false; $cssf = $css; // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi //propose (rien a faire dans ce cas) $f = preg_replace(',(_rtl)?\\.css$,i', '_' . $ndir . '.css', $css); if (@file_exists($f)) { return $f; } } // 2. $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); $f = $dir_var . preg_replace(',.*/(.*?)(_rtl)?\\.css,', '\\1', $cssf) . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; // la css peut etre distante (url absolue !) if ($distant) { include_spip('inc/distant'); $contenu = recuperer_page($css); if (!$contenu) { return $css; } } else { if (@filemtime($f) > @filemtime($css) and _VAR_MODE != 'recalcul') { return $f; } if (!lire_fichier($css, $contenu)) { return $css; } } $contenu = str_replace(array('right', 'left', '@@@@L E F T@@@@'), array('@@@@L E F T@@@@', 'right', 'left'), $contenu); // reperer les @import auxquels il faut propager le direction_css preg_match_all(",\\@import\\s*url\\s*\\(\\s*['\"]?([^'\"/][^:]*)['\"]?\\s*\\),Uims", $contenu, $regs); $src = array(); $src_direction_css = array(); $src_faux_abs = array(); $d = dirname($css); foreach ($regs[1] as $k => $import_css) { $css_direction = direction_css("{$d}/{$import_css}", $voulue); // si la css_direction est dans le meme path que la css d'origine, on tronque le path, elle sera passee en absolue if (substr($css_direction, 0, strlen($d) + 1) == "{$d}/") { $css_direction = substr($css_direction, strlen($d) + 1); } elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { $css_direction = substr($css_direction, strlen($dir_var)); $src_faux_abs["/@@@@@@/" . $css_direction] = $css_direction; $css_direction = "/@@@@@@/" . $css_direction; } $src[] = $regs[0][$k]; $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); } $contenu = str_replace($src, $src_direction_css, $contenu); $contenu = urls_absolues_css($contenu, $css); // virer les fausses url absolues que l'on a mis dans les import if (count($src_faux_abs)) { $contenu = str_replace(array_keys($src_faux_abs), $src_faux_abs, $contenu); } if (!ecrire_fichier($f, $contenu)) { return $css; } return $f; }
/** * Retourne le contenu d'une puce avec changement de statut possible * si on en a l'autorisation, sinon simplement l'image de la puce * * @param int $id * Identifiant de l'objet * @param string $statut * Statut actuel de l'objet * @param int $id_rubrique * Identifiant du parent, une rubrique * @param string $type * Type d'objet * @param bool $ajax * Indique s'il ne faut renvoyer que le coeur du menu car on est * dans une requete ajax suite à un post de changement rapide * @param bool $menu_rapide * Indique si l'on peut changer le statut, ou si on l'affiche simplement * @return string * Code HTML de l'image de puce de statut à insérer (et du menu de changement si présent) **/ function puce_statut_changement_rapide($id, $statut, $id_rubrique, $type = 'article', $ajax = false, $menu_rapide = _ACTIVER_PUCE_RAPIDE) { $src = statut_image($type, $statut); if (!$src) { return $src; } if (!$id or !_SPIP_AJAX or !$menu_rapide) { $ajax_node = ''; } else { $ajax_node = " class='imgstatut{$type}{$id}'"; } $t = statut_titre($type, $statut); $inser_puce = http_img_pack($src, $t, $ajax_node, $t); if (!$ajax_node) { return $inser_puce; } $table = table_objet_sql($type); $desc = lister_tables_objets_sql($table); if (!isset($desc['statut_textes_instituer'])) { return $inser_puce; } if (!function_exists('autoriser')) { include_spip('inc/autoriser'); } // cas ou l'on a un parent connu (devrait disparaitre au profit du second cas plus generique) if ($id_rubrique) { if (!autoriser('publierdans', 'rubrique', $id_rubrique)) { return $inser_puce; } } else { if (!autoriser('instituer', $type, $id, null, array('statut' => 'publie'))) { return $inser_puce; } } $coord = array_flip(array_keys($desc['statut_textes_instituer'])); if (!isset($coord[$statut])) { return $inser_puce; } $unit = 8 + 4; $margin = 4; /* marge a gauche + droite */ $zero = 1 + $margin / 2 + 2; $clip = $zero + $unit * $coord[$statut]; if ($ajax) { $width = $unit * count($desc['statut_textes_instituer']) + $margin; $out = "<span class='puce_objet_fixe {$type}'>" . $inser_puce . "</span>" . "<span class='puce_objet_popup {$type} statutdecal{$type}{$id}' style='width:{$width}px;margin-left:-{$clip}px;'>"; $i = 0; foreach ($desc['statut_textes_instituer'] as $s => $t) { $out .= afficher_script_statut($id, $type, -$zero - $i++ * $unit, statut_image($type, $s), $s, _T($t)); } $out .= "</span>"; return $out; } else { $nom = "puce_statut_"; $action = generer_url_ecrire('puce_statut', "", true); $action = "if (!this.puce_loaded) { this.puce_loaded = true; prepare_selec_statut(this, '{$nom}', '{$type}', '{$id}', '{$action}'); }"; $over = " onmouseover=\"{$action}\""; $lang_dir = lang_dir(lang_typo()); return "<span class='puce_objet {$type}' id='{$nom}{$type}{$id}' dir='{$lang_dir}'{$over}>" . $inser_puce . '</span>'; } }