Beispiel #1
0
function affiche_block_initiale($initiale, $block, $block_actif)
{
    if (strlen($block)) {
        return "<li class='item'>" . bouton_block_depliable($initiale, $block_actif ? true : false) . debut_block_depliable($block_actif) . "<ul>{$block}</ul>" . fin_block() . "</li>";
    }
    return "";
}
Beispiel #2
0
function inc_iconifier_dist($id_objet, $id,  $script, $visible=false, $flag_modif=true) {
	if ($GLOBALS['spip_display'] == 4) return "";
	$texteon = $GLOBALS['logo_libelles'][($id OR $id_objet != 'id_rubrique') ? $id_objet : 'id_racine'];

	$chercher_logo = charger_fonction('chercher_logo', 'inc');
	
	// Add the redirect url when uploading via iframe
	$iframe_script = generer_url_ecrire('iconifier',"type=$id_objet&$id_objet=$id&script=$script",true);
	$iframe = "<input type='hidden' name='iframe_redirect' value='".rawurlencode($iframe_script)."' />\n";

	$logo = $chercher_logo($id, $id_objet, 'on');
	$logo_s = $chercher_logo($id, $id_objet, 'off');
	if (!$logo) {
		if ($flag_modif AND $GLOBALS['meta']['activer_logos'] != 'non') {
			$masque = indiquer_logo($texteon, $id_objet, 'on', $id, $script, $iframe);
			$masque = "<div class='cadre_padding'>$masque</div>";
			$bouton = bouton_block_depliable($texteon, $visible, "on-$id_objet-$id");
			$res = debut_block_depliable($visible,"on-$id_objet-$id") . $masque . fin_block();
		}
	} else {
		list($img, $clic) = decrire_logo($id_objet,'on',$id, 170, 170, $logo, $texteon, $script, $flag_modif AND !$logo_s);

		$bouton = bouton_block_depliable($texteon, $visible, "on-$id_objet-$id");

		$survol = '';
		$texteoff = _T('logo_survol');
		if (!$logo = $logo_s) {
			if ($flag_modif AND $GLOBALS['meta']['activer_logos_survol'] == 'oui') {
				$masque = "<br />".indiquer_logo($texteoff, $id_objet, 'off', $id, $script, $iframe);
				$survol .= "<br />".block_parfois_visible("off-$id_objet-$id", $texteoff, $masque, null, $visible);
			}
			$masque = debut_block_depliable($visible,"on-$id_objet-$id") 
				. "<div class='cadre_padding'>"
				. $clic . $survol . "</div>" . fin_block();
		} else {
			list($imgoff, $clicoff) = decrire_logo($id_objet, 'off', $id, 170, 170, $logo, $texteoff, $script, $flag_modif);
			$masque = debut_block_depliable($visible, "off-$id_objet-$id") .  $clicoff . fin_block();
			$survol .= "<br />".bouton_block_depliable($texteoff, $visible, "off-$id_objet-$id")
			. "<div class='cadre_padding'>".$imgoff.$masque."</div>";
			$masque = debut_block_depliable($visible,"on-$id_objet-$id") . $clic . fin_block() . $survol;
		}

		$res = "$img$masque";
	}

	if ($res) {
		$res = debut_cadre('r', 'image-24.gif', '', $bouton, '', '', false)
			. $res
			. fin_cadre_relief(true);

		if(_request("exec")!="iconifier") {
		  $js = http_script('',  'async_upload.js')
		    . http_script('$("form.form_upload_icon").async_upload(async_upload_icon)');

		} else $js = "";
		return ajax_action_greffe("iconifier", $id, $res).$js;
	}
	else return '';

}
Beispiel #3
0
function block_parfois_visible($nom, $invite, $masque, $style='', $visible=false){
	if (!$GLOBALS['browser_layer']) return '';

	return "\n"
	. bouton_block_depliable($invite,$visible,$nom)
	. debut_block_depliable($visible,$nom)
	. $masque
	. fin_block();
}
Beispiel #4
0
function inc_editer_mots_dist($objet, $id_objet, $cherche_mot, $select_groupe, $flag, $visible = false, $url_base='') {
	if ($GLOBALS['meta']["articles_mots"] == 'non')	return '';
	if (!preg_match('/^[0-9, ]*$/', $select_groupe)) return '';
	$trouver_table = charger_fonction('trouver_table', 'base');
	$nom = table_objet($objet);
	$desc = $trouver_table($nom);
	$table_id =  @$desc['key']["PRIMARY KEY"];

	$reponse = ($flag AND $cherche_mot)
		? chercher_inserer_mot($cherche_mot, $select_groupe, $objet, $id_objet, $nom, $table_id, $url_base)
		: '';

	list($liste, $mots) = afficher_mots_cles($flag, $objet, $id_objet, $nom, $table_id, $url_base);

	$aff =false;
	$bouton = _T('titre_mots_cles').aide ("artmots");

	if ($liste)
		$aff = true;

	if ($flag) { 	// si droit de modif donner le formulaire
		$visible = ($visible OR $cherche_mot OR ($flag === 'ajax'));
		list($visible, $res) = formulaire_mots_cles($id_objet, $mots, $nom, $table_id, $url_base, $visible, $objet);

		if ($res) {
			$liste .= debut_block_depliable($visible,"lesmots")
				. $res
				. creer_mot($nom, $id_objet, $table_id, $url_base, $cherche_mot, $select_groupe)
				. fin_block();
			$bouton = bouton_block_depliable($bouton, $visible,"lesmots");
			$aff = true;
		}
	}

	if (!$aff)
		return '';

	$res = debut_cadre_enfonce("mot-cle-24.gif", true, "", $bouton)
	  . $reponse
	  . $liste
	  . fin_cadre_enfonce(true);

	return ajax_action_greffe("editer_mots", $id_objet, $res);
}
Beispiel #5
0
function documenter_bloc($id, $res, $s, $script, $ancre, $tous, $type)
{
	// seulement s'il y a au moins un document dedans
	if (!$res) return "";

	if ($tous) {
		$tous = "<div class='lien_tout_supprimer'>"
			. ajax_action_auteur('documenter', "$s$id/$type", $appelant ? $appelant : _request('exec'), "id_$type=$id&s=$s&type=$type",array(_T('lien_tout_supprimer')))
			. "</div>\n";
	} else $tous = '';

	$bouton = bouton_block_depliable(majuscules(_T("info_$ancre")),true,"portfolio_$ancre");

	return debut_cadre("$ancre","","",$bouton)
		. debut_block_depliable(true,"portfolio_$ancre")
		. $tous
		. $res
		. fin_block()
		. fin_cadre();
}
/**
 * Crée l'affichage des listes de rubriques dans le privé
 *
 * @param int $collection
 *  L'identifiant numérique de la rubrique à lister
 * @param int $debut
 *  Le numéro de la pagination si paginé (> 500)
 * @param int $limite
 *  Le pas de pagination si paginé (> 500)
 * @return array $res
 *  Un tableau des sous rubriques
 */
function enfant_rub($collection, $debut = 0, $limite = 500)
{
    $voir_logo = (isset($GLOBALS['meta']['image_process']) and $GLOBALS['meta']['image_process'] != "non");
    $logo = "";
    if ($voir_logo) {
        $chercher_logo = charger_fonction('chercher_logo', 'inc');
        include_spip('inc/filtres_images_mini');
    }
    $res = array();
    $result = sql_select("id_rubrique, id_parent, titre, descriptif, lang ", "spip_rubriques", "id_parent={$collection}", '', '0+titre,titre', "{$debut},{$limite}");
    while ($row = sql_fetch($result)) {
        $id_rubrique = $row['id_rubrique'];
        $id_parent = $row['id_parent'];
        $titre = generer_info_entite($id_rubrique, 'rubrique', 'titre');
        // pour etre sur de passer par tous les traitements
        if ('' !== ($rang = recuperer_numero($row['titre']))) {
            $rang = "{$rang}. ";
        }
        if (autoriser('voir', 'rubrique', $id_rubrique)) {
            $les_sous_enfants = sous_enfant_rub($id_rubrique);
            changer_typo($row['lang']);
            $lang_dir = lang_dir($row['lang']);
            $descriptif = propre($row['descriptif']);
            if ($voir_logo) {
                if ($logo = $chercher_logo($id_rubrique, 'id_rubrique', 'on')) {
                    list($fid, $dir, $nom, $format) = $logo;
                    $logo = image_reduire("<img src='{$fid}' alt='' />", 48, 36);
                    if ($logo) {
                        $logo = inserer_attribut($logo, 'class', 'logo');
                    }
                }
            }
            $lib_bouton = (!acces_restreint_rubrique($id_rubrique) ? "" : http_img_pack('auteur-0minirezo-16.png', '', " width='16' height='16'", _T('image_administrer_rubrique'))) . " <a dir='{$lang_dir}'" . ($row['lang'] !== $GLOBALS['spip_lang'] ? " hreflang='" . $row['lang'] . "'" : '') . " href='" . generer_url_entite($id_rubrique, 'rubrique') . "'>" . $rang . $titre . "</a>";
            $titre = (is_string($logo) ? $logo : '') . bouton_block_depliable($lib_bouton, $les_sous_enfants ? false : -1, "enfants{$id_rubrique}");
            $res[] = debut_cadre_sous_rub($id_parent ? "rubrique-24.png" : "secteur-24.png", true, "", $titre) . (!$descriptif ? '' : "\n<div class='descriptif'>{$descriptif}</div>") . $les_sous_enfants . fin_cadre_sous_rub(true);
        }
    }
    changer_typo($GLOBALS['spip_lang']);
    # remettre la typo de l'interface pour la suite
    return $res;
}
Beispiel #7
0
function http_message_avec_participants($id_message, $statut, $forcer_dest, $cherche_auteur, $expediteur='')
{
	global $connect_id_auteur ;

	if ($cherche_auteur) {
		echo "\n<div style='text-align: left' class='cadre-info'>"
		. http_auteurs_ressemblants($cherche_auteur , $id_message)
		. "\n</div>";
	  }
	$bouton = bouton_block_depliable(_T('info_nombre_partcipants'),true,"auteurs,ajouter_auteur");
	echo debut_cadre_enfonce("redacteurs-24.gif", true, '', $bouton, 'participants');

	//
	// Liste des participants
	//

	$result = sql_allfetsel("*", "spip_auteurs AS auteurs, spip_auteurs_messages AS lien", "lien.id_message=$id_message AND lien.id_auteur=auteurs.id_auteur");

	$total_dest = count($result);

	if ($total_dest > 0) {
		$ifond = 0;
		$res = '';
		$formater_auteur = charger_fonction('formater_auteur', 'inc');
		$t = _T('lien_retrait_particpant');
		foreach($result as $k => $row) {
			$id_auteur = $row["id_auteur"];
			list($status, $mail, $nom, $site,) = $formater_auteur($id_auteur, $row);
			if ($id_auteur == $expediteur) {

				$nom = "<span class='arial0' style='margin-left: 10px'>"
				.  _T('info_auteur_message')
				. "</span> $nom";
			}
			$class = alterner (++$ifond,'row_even','row_odd');
			$res .= "<tr class='$class'>\n<td class='nom'>$status $mail $nom $site$exp</td>"
			  . "\n<td align='right' class='lien'>"
			  . (($id_auteur == $connect_id_auteur) ?  "&nbsp;" : ("[<a href='" . redirige_action_auteur("editer_message","$id_message/-$id_auteur", 'message', "id_message=$id_message") . "'>$t</a>]")) .  "</td></tr>\n";
			$result[$k] = $id_auteur;
		
		}
		echo
			debut_block_depliable(true,"auteurs"),
			"\n<table class='spip' width='100%'>",
			$res,
			  "</table>\n",
			fin_block();
	}

	if ($statut == 'redac' OR $forcer_dest)
		echo http_ajouter_participants($result, $id_message);
	else {
		echo
		  debut_block_depliable(true,"ajouter_auteur"),
		  "<br />\n<div style='text-align: right' class='verdana1 spip_small'><a href='" . generer_url_ecrire("message","id_message=$id_message&forcer_dest=oui") . "'>"._T('lien_ajouter_participant')."</a></div>",
		  fin_block();
	}
	echo fin_cadre_enfonce(true);
	return $total_dest;
}
Beispiel #8
0
function editer_auteurs_objet($type, $id, $flag, $cherche_auteur, $ids, $les_auteurs, $futurs, $statut, $titre_boite,$script_edit_objet, $arg_ajax)
{
	global $spip_lang_left, $spip_lang_right;

	$bouton_creer_auteur =  $GLOBALS['connect_toutes_rubriques'];
	$clic = _T('icone_creer_auteur');

//
// complement de action/editer_auteurs.php pour notifier la recherche d'auteur
//
	if ($cherche_auteur) {

		$reponse ="<div style='text-align: $spip_lang_left'>"
		. debut_boite_info(true)
		. rechercher_auteurs_objet($cherche_auteur, $ids, $type, $id,$script_edit_objet, $arg_ajax);

		if ($type=='article' && $bouton_creer_auteur) { // pas generique pour le moment

			$legende = generer_url_ecrire("auteur_infos", "new=oui&lier_id_article=$id");
			if (isset($cherche_auteur))
				$legende = parametre_url($legende, 'nom', $cherche_auteur);
			$legende = parametre_url($legende, 'redirect',
				generer_url_ecrire('articles', "id_article=$id", '&'));

			$reponse .="<div style='width: 200px;'>"
			. icone_horizontale($clic, $legende, "redacteurs-24.gif", "creer.gif", false)
			. "</div> ";

			$bouton_creer_auteur = false;
		}

		$reponse .= fin_boite_info(true)
		. '</div>';
	} else $reponse ='';

	$reponse .= $les_auteurs;

//
// Ajouter un auteur
//

	$res = '';
	if ($flag) {

		if ($type=='article' && $bouton_creer_auteur) { // pas generique pour le moment

			$legende = generer_url_ecrire("auteur_infos", "new=oui&lier_id_article=$id");
			if (isset($cherche_auteur))
				$legende = parametre_url($legende, 'nom', $cherche_auteur);
			$legende = parametre_url($legende, 'redirect',
				generer_url_ecrire('articles', "id_article=$id", '&'));

			$clic = "<span class='verdana1'><b>$clic</b></span>";
			$res = icone_horizontale_display($clic, $legende, "redacteurs-24.gif", "creer.gif", false);
		}

		$res = "<div style='float:$spip_lang_right; width:280px;position:relative;display:inline;'>"
		. $futurs
		."</div>\n"
		. $res;
	}

	$idom = "auteurs_$type" . "_$id";
	$bouton = bouton_block_depliable($titre_boite,$flag ?($flag === 'ajax'):-1,$idom);
	$res = debut_cadre_enfonce("auteur-24.gif", true, "", $bouton)
	. $reponse
	. debut_block_depliable($flag === 'ajax',$idom)
	. $res
	. fin_block()
	. fin_cadre_enfonce(true);

	return ajax_action_greffe("editer_auteurs", $id, $res);
}
Beispiel #9
0
function skeleditor_tree_open_close_dir(&$current,$target,$current_file){
	if ($current == $target) return "";
	$tcur = explode("/",$current);
	$ttarg = explode("/",$target);
	$tcom = array();
	$output = "";
	// la partie commune
	while (reset($tcur)==reset($ttarg)){
		$tcom[] = array_shift($tcur);
		array_shift($ttarg);
	}
	// fermer les repertoires courant jusqu'au point de fork
	while($close = array_pop($tcur)){
		$output .= fin_block();
	}
	$chemin = implode("/",$tcom)."/";
	// ouvrir les repertoires jusqu'a la cible
	while($open = array_shift($ttarg)){
		$chemin .= $open . "/";
		$closed = ((strncmp($current_file, ltrim($chemin,'/'), strlen(ltrim($chemin,'/')))==0)?"":" closed");

		$output .= bouton_block_depliable("<img src='"._DIR_PLUGIN_SKELEDITOR."images/se-folder-16.png' alt='directory'/> $open",!$closed,md5($chemin));
		$output .= "<div class='dir$closed' id='".md5($chemin)."'>\n";
	}
	$current = $target;
	return $output;
}
function spiplistes_bouton_block_depliable ($titre = "", $deplie = true, $nom_block = "", $icone = "") {
	if(empty($titre)) {
		$titre = _T("info_sans_titre");
	}
	include_spip('inc/layer');
	if(spiplistes_spip_est_inferieur_193()) {
		$f = ($deplie ? "bouton_block_visible" : "bouton_block_invisible");
		$result = $f($nom_block, $icone);
	} else {
		$result = bouton_block_depliable($titre, $deplie, $nom_block);
	}
	return($result);
}
function enfants_aff($id_parent, $decalage, $taille, $critere, $gauche = 0)
{
    global $spip_lang_right, $spip_lang_left;
    static $total_site = null;
    static $niveau = 0;
    static $nombre_branche;
    static $nombre_rub;
    if (is_null($total_site)) {
        $nombre_branche = array();
        $nombre_rub = array();
        $total_site = enfants(0, $critere, $nombre_branche, $nombre_rub);
        if ($total_site < 1) {
            $total_site = 1;
        }
    }
    $visites_abs = 0;
    $out = "";
    $width = intval(floor($nombre_branche[$id_parent] / $total_site * $taille));
    $width = "width:{$width}px;float:{$spip_lang_left};";
    $result = sql_select("id_rubrique, titre, descriptif", "spip_rubriques", "id_parent={$id_parent}", '', '0+titre,titre');
    while ($row = sql_fetch($result)) {
        $id_rubrique = $row['id_rubrique'];
        $titre = typo($row['titre']);
        $descriptif = attribut_html(couper(typo($row['descriptif']), 80));
        if ($nombre_branche[$id_rubrique] > 0 or $nombre_rub[$id_rubrique] > 0) {
            $largeur_branche = floor(($nombre_branche[$id_rubrique] - $nombre_rub[$id_rubrique]) * $taille / $total_site);
            $largeur_rub = floor($nombre_rub[$id_rubrique] * $taille / $total_site);
            if ($largeur_branche + $largeur_rub > 0) {
                if ($niveau == 0) {
                    $couleur = "#cccccc";
                } else {
                    if ($niveau == 1) {
                        $couleur = "#eeeeee";
                    } else {
                        $couleur = "white";
                    }
                }
                $out .= "<table cellpadding='2' cellspacing='0' border='0' width='100%'>";
                $out .= "\n<tr style='background-color: {$couleur}'>";
                $out .= "\n<td style='border-bottom: 1px solid #aaaaaa; padding-{$spip_lang_left}: " . ($niveau * 20 + 5) . "px;'>";
                if ($largeur_branche > 2) {
                    $out .= bouton_block_depliable("<a href='" . generer_url_entite($id_rubrique, 'rubrique') . "' style='color: black;' title=\"{$descriptif}\">{$titre}</a>", "incertain", "stats{$id_rubrique}");
                } else {
                    $out .= "<div class='rubsimple' style='padding-left: 18px;'>" . "<a href='" . generer_url_entite($id_rubrique, 'rubrique') . "' style='color: black;' title=\"{$descriptif}\">{$titre}</a>" . "</div>";
                }
                $out .= "</td>";
                // pourcentage de visites dans la branche par rapport au total du site
                $pourcent = round($nombre_branche[$id_rubrique] / $total_site * 1000) / 10;
                $out .= "\n<td class='verdana1' style='text-align: {$spip_lang_right}; width: 40px; border-bottom: 1px solid #aaaaaa;'>{$pourcent}%</td>";
                $out .= "\n<td align='right' style='border-bottom: 1px solid #aaaaaa; width:" . ($taille + 5) . "px'>";
                $out .= "\n<table cellpadding='0' cellspacing='0' border='0' width='" . ($decalage + 1 + $gauche) . "'>";
                $out .= "\n<tr>";
                if ($gauche > 0) {
                    $out .= "<td style='width: " . $gauche . "px'></td>";
                }
                $out .= "\n<td style='border: 0px; white-space: nowrap;'>";
                $out .= "<div style='border: 1px solid #999999; background-color: #dddddd; height: 1em; padding: 0px; margin: 0px;{$width}'>";
                if ($visites_abs > 0) {
                    $out .= "<img src='" . chemin_image('rien.gif') . "' style='vertical-align: top; height: 1em; border: 0px; width: " . $visites_abs . "px;' alt= ' '/>";
                }
                if ($largeur_branche > 0) {
                    $out .= "<img src='" . chemin_image('rien.gif') . "' class='couleur_cumul' style='vertical-align: top; height: 1em; border: 0px; width: " . $largeur_branche . "px;' alt=' ' />";
                }
                if ($largeur_rub > 0) {
                    $out .= "<img src='" . chemin_image('rien.gif') . "' class='couleur_nombre' style='vertical-align: top; width: " . $largeur_rub . "px; height: 1em; border: 0px' alt=' ' />";
                }
                $out .= "</div>";
                $out .= "</td></tr></table>\n";
                $out .= "</td></tr></table>";
            }
        }
        if (isset($largeur_branche) && $largeur_branche > 0) {
            $niveau++;
            $out .= debut_block_depliable(false, "stats{$id_rubrique}");
            $out .= enfants_aff($id_rubrique, $largeur_branche, $taille, $critere, $visites_abs + $gauche);
            $out .= fin_block();
            $niveau--;
        }
        $visites_abs = $visites_abs + round($nombre_branche[$id_rubrique] / $total_site * $taille);
    }
    return $out;
}
Beispiel #12
0
function block_parfois_visible($nom, $invite, $masque, $style = '', $visible = false)
{
    return "\n" . bouton_block_depliable($invite, $visible, $nom) . debut_block_depliable($visible, $nom) . $masque . fin_block();
}
Beispiel #13
0
function inc_referencer_traduction_dist($id_article, $flag, $id_rubrique, $id_trad, $trad_err='')
{
	global $spip_display;

	if (! (($GLOBALS['meta']['multi_articles'] == 'oui')
		OR (($GLOBALS['meta']['multi_rubriques'] == 'oui') 
			AND ($GLOBALS['meta']['gerer_trad'] == 'oui'))) )
		return '';

	$langue_article = sql_fetsel("lang", "spip_articles", "id_article=$id_article");

	$langue_article = $langue_article['lang'];

	$reponse = '';
	// Choix langue article
	if ($GLOBALS['meta']['multi_articles'] == 'oui' AND $flag) {

		$row = sql_fetsel("lang", "spip_rubriques", "id_rubrique=$id_rubrique");
		$langue_parent = $row['lang'];

		if (!$langue_parent)
			$langue_parent = $GLOBALS['meta']['langue_site'];
		if (!$langue_article)
			$langue_article = $langue_parent;

		if ($menu = liste_options_langues('changer_lang', $langue_article, $langue_parent)) {
// attention ce onchange doit etre suivi de <span><input type='submit'
			$lien = "\nonchange=\"this.nextSibling.firstChild.style.visibility='visible';\"";
			$menu =  select_langues('changer_lang', $lien, $menu, _T('info_multi_cet_article'));
			
			$menu = ajax_action_post('referencer_traduction', "$id_article,$id_rubrique","articles","id_article=$id_article", $menu, _T('bouton_changer'), " class='visible_au_chargement'");

			$reponse .= debut_cadre_couleur('',true)
			. "\n<div style='text-align: center;'>"
			. $menu
			. "</div>\n"
			. fin_cadre_couleur(true);
		}
	}

	if ($trad_err)
		$reponse .= "<div><span style='color: red' size='2' face='Verdana, Geneva, helvetica, sans-serif'>"._T('trad_deja_traduit'). "</span></div>";

	// Afficher la liste des traductions

	if ($id_trad) {
		$requete = array('SELECT' => "id_article, id_rubrique, titre, lang, statut, id_trad", 'FROM' => "spip_articles", 'WHERE' => "id_trad = $id_trad");
		$styles = array(array('',7), array('', 12), array('arial2'), array('arial2', 100));
		$presenter_liste = charger_fonction('presenter_liste', 'inc');
		$tableau = array();
		$liste = $presenter_liste($requete, 'articles_traduction', $tableau,  $id_article, false, $styles, '',_T('trad_article_traduction'));
	} else $liste = '';

	// changer les globales de direction de langue
	changer_typo($langue_article);

	// Participation aux Traductions pas pour Mal-voyant. A completer
	if ($spip_display == 4) $form =''; else {
	$form = "<table width='100%'><tr>";

	if ($flag  AND !$liste) {
			// Formulaire pour lier a un article
		$form .= "<td style='width: 60%' class='arial2'>"
		. ajax_action_post("referencer_traduction",
				$id_article,
				'articles',
				"id_article=$id_article",
				("<label for='lier_trad'>" . _T('trad_lier') . "</label>" .
				 "\n<input type='text' name='lier_trad' id='lier_trad' size='5' />\n"),
				_T('bouton_valider'),
				"")
		. "</td>\n"
		. "<td style='width: 10px'> &nbsp; </td>"
		. "<td style='width: 2px; background: url(" . chemin_image("tirets-separation.gif") . ")'>". http_img_pack('rien.gif', " ", "width='2' height='2'") . "</td>"
		. "<td style='width: 10px'> &nbsp; </td>";
	}

	$form .= "<td>"
	. icone_horizontale(_T('trad_new'), generer_url_ecrire("articles_edit","new=oui&lier_trad=$id_article&id_rubrique=$id_rubrique"), "traductions-24.gif", "creer.gif", false)
	. "</td>";

	if ($flag AND $liste) {
		$clic = _T('trad_delier');
		$form .= "<td style='width: 10px'> &nbsp; </td>"
		. "<td style='width: 2px; background: url(" . chemin_image("tirets-separation.gif") . ")'>". http_img_pack('rien.gif', " ", "width='2' height='2'") . "</td>"
		. "<td style='width: 10px'> &nbsp; </td>"
		. "<td>"
		  // la 1ere occurrence de clic ne sert pas en Ajax
		. icone_horizontale($clic, ajax_action_auteur("referencer_traduction","$id_article,-$id_trad",'articles', "id_article=$id_article",array($clic)), "traductions-24.gif", "supprimer.gif", false)
		. "</td>\n";
	}

	$form .= "</tr></table>";
	}
	if ($GLOBALS['meta']['gerer_trad'] == 'oui')
		$bouton = _T('titre_langue_trad_article');
	else
		$bouton = _T('titre_langue_article');

	if ($langue_article)
		$bouton .= "&nbsp; (".traduire_nom_langue($langue_article).")";

	$res = debut_cadre_enfonce('langues-24.gif', true, "", 
			bouton_block_depliable($bouton,$flag === 'ajax','languearticle,lier_traductions'))
		. debut_block_depliable($flag === 'ajax','languearticle')
		. $reponse
		. fin_block()
		. $liste
		. debut_block_depliable($flag === 'ajax','lier_traductions')
		. $form
		. fin_block()
		. fin_cadre_enfonce(true);
	return ajax_action_greffe("referencer_traduction", $id_article, $res);
}
Beispiel #14
0
function referers_group($nbvisites, $id_article, $lesliensracine, $lesreferermd5, $lesreferers, $lesurls)
{
	global $spip_lang_right, $source_vignettes;
	$vign = ((strlen($source_vignettes) > 0) && 
		 $GLOBALS['meta']["activer_captures_referers"]!='non');
	$aff = array();
	foreach($nbvisites as $numero => $visites) {
		if (!$numero) next;
		$referermd5 = $lesreferermd5[$numero];
		$bouton = $ret = "";

		if ($vign)
			$ret = "\n<a href=\"http://".$lesurls[$numero]."\"><img src=\"$source_vignettes".rawurlencode($lesurls[$numero])."\"\nstyle=\"float: $spip_lang_right; margin-bottom: 3px; margin-left: 3px;\" alt='' /></a>";

		if ($visites > 5) $bouton .= "<span class='visites visites3'>$visites "._T('info_visites')."</span> ";
		else if ($visites > 1) $bouton .= "<span class='visites visites2'>$visites "._T('info_visites')."</span> ";
		else $bouton .= "<span class='visites visites1'>$visites "._T('info_visite')."</span> ";

		if ($numero == "(email)") {
			$ret .=  $bouton . "<b>".$numero."</b>";
		} else {
			$n = count($lesreferers[$numero]);
			if (($n > 1) || ($n > 0 && substr(supprimer_tags($lesreferers[$numero][0]),0,1) != '/')) {
				$rac = $lesliensracine[$numero];
				$bouton .= "<a href=\"http://".attribut_html($lesurls[$numero])."\" style='font-weight: bold;'>".$numero."</a>"
				  . (!$rac ? '': (" <span class='spip_x-small'>(" . $rac .")</span>"));
				 $ret .= bouton_block_depliable($bouton,false)
				  . debut_block_depliable(false)
				  . "\n<ul><li>"
				  . join ("</li><li>",$lesreferers[$numero])
				  . "</li></ul>"
				  . fin_block();
			} else {
				$ret .= $bouton;
				$lien = $n ? $lesreferers[$numero][0] : '';
				if (preg_match(",^(<a [^>]+>)([^ ]*)( \([0-9]+\))?,i", $lien, $regs)) {
					$lien = quote_amp($regs[1]).$numero.$regs[2];
					if (!strpos($lien, '</a>')) $lien .= '</a>';
				} else
					$lien = "<a href=\"http://".attribut_html($numero)."\">".$numero."</a>";
				$ret .= "<b>".quote_amp($lien)."</b>"
				  . ($id_article ? '' : referes($referermd5));
			}
		}
		$aff[]= $ret;
	}
	return $aff;
}
Beispiel #15
0
function tree_open_close_dir(&$current, $target, $deplie = array())
{
    if ($current == $target) {
        return "";
    }
    $tcur = explode("/", $current);
    $ttarg = explode("/", $target);
    $tcom = array();
    $output = "";
    // la partie commune
    while (reset($tcur) == reset($ttarg)) {
        $tcom[] = array_shift($tcur);
        array_shift($ttarg);
    }
    // fermer les repertoires courant jusqu'au point de fork
    while ($close = array_pop($tcur)) {
        $output .= "</ul>\n";
        $output .= fin_block();
        $output .= "</li>\n";
    }
    $chemin = "";
    if (count($tcom)) {
        $chemin .= implode("/", $tcom) . "/";
    }
    // ouvrir les repertoires jusqu'a la cible
    while ($open = array_shift($ttarg)) {
        $visible = @isset($deplie[$chemin . $open]);
        $chemin .= $open . "/";
        $output .= "<li>";
        $output .= bouton_block_depliable($chemin, $visible);
        $output .= debut_block_depliable($visible);
        $output .= "<ul>\n";
    }
    $current = $target;
    return $output;
}
Beispiel #16
0
function revisions_entete_boite($court, $debut, $id_secteur, $lang, $nb_aff, $req_from, $req_where, $uniq_auteur)
{

	$titre_table =  '<b>' . _T('icone_suivi_revisions').aide('suivimodif')  . '</b>';
	if ($court)
		$titre_table = afficher_plus(generer_url_ecrire("suivi_revisions"))
		. $titre_table;

	$total = sql_countsel($req_from, $req_where);
	if ($total >= 150) $total = 149;
	$id_liste = 't'.substr(md5("$req_where 149"),0,8);
	$bouton = bouton_block_depliable($titre_table,true,$id_liste);
	$revisions = debut_cadre('liste',"historique-24.gif",'',$bouton)
	. debut_block_depliable(true,$id_liste);
		
	if ($total > $nb_aff) {
		$nb_tranches = ceil($total / $nb_aff);
			
		$revisions .= "\n<div class='arial2' style='background-color: #dddddd; padding: 5px;'>\n";
		
		for ($i = 0; $i < $nb_tranches; $i++) {
			if ($i > 0) $revisions .= " | ";
			if ($i*$nb_aff == $debut)
				$revisions .= "<b>";
			else {
				$next = ($i * $nb_aff);
				$revisions .= "<a href='".generer_url_ecrire('suivi_revisions', "debut=$next&id_secteur=$id_secteur&id_auteur=$uniq_auteur&lang_choisie=$lang")."'>";
			}
			$revisions .= (($i * $nb_aff) + 1);
			if ($i*$nb_aff == $debut) $revisions .= "</b>";
			else $revisions .= "</a>";
		}
		$revisions .= "</div>";
	}
	return $revisions;
}
Beispiel #17
0
function cs_formatspip($id_article){
	include_spip('public/assembler');
	if(!$txt = recuperer_fond('fonds/format_spip', array('id_article'=>$id_article))) return '';
	$txt = explode('@TITRE@=', $txt, 2);
	// compatibilite SPIP < 2.0
	$compat = function_exists('bouton_block_depliable');
	$bouton = $compat?bouton_block_depliable(cs_div_configuration().$txt[1], 'invisible', "formatspip")
		:bouton_block_invisible("formatspip").cs_div_configuration().$txt[1];
	$bloc = $compat?debut_block_depliable(false, "formatspip")
		:debut_block_invisible("formatspip");
	return debut_cadre_enfonce(find_in_path('/img/formatspip-24.png'), true, '', $bouton)
		. $bloc	. $txt[0] . fin_block()
		. fin_cadre_enfonce(true);
}
Beispiel #18
0
function debut_cadre($style, $icone = "", $fonction = "", $titre = "", $id="", $class="", $padding=true) {
	global $spip_display;
	static $accesskey = 97; // a

	//zoom:1 fixes all expanding blocks in IE, see authors block in articles.php
	//being not standard, next step can be putting this kind of hacks in a different stylesheet
	//visible to IE only using conditional comments.

	// accesskey pour accessibilite espace prive
	if ($accesskey <= 122) // z
	{
		$accesskey_c = chr($accesskey++);
		$ret = "<a id='access-$accesskey_c' href='#access-$accesskey_c' accesskey='$accesskey_c'></a>";
	} else $ret ='';

	$ret .= "\n<div "
	. ($id?"id='$id' ":"")
	."class='cadre cadre-$style"
	. ($class?" $class":"")
	."'>";

	if ($spip_display != 1 AND $spip_display != 4 AND strlen($icone) > 1) {
		if ($fonction) {
			
			$ret .= http_img_pack("$fonction", "", " class='cadre-icone' ".http_style_background($icone, "no-repeat; padding: 0px; margin: 0px"));
		}
		else $ret .=  http_img_pack("$icone", "", " class='cadre-icone'");
	}

	if (strlen($titre) > 0) {
		if (strpos($titre,'titrem')!==false) {
			$ret .= $titre;
		} elseif ($spip_display == 4) {
			$ret .= "\n<h3 class='cadre-titre'>$titre</h3>";
		} else {
			$ret .= bouton_block_depliable($titre,-1);
		}
	}

	$ret .= "<div". ($padding ?" class='cadre_padding'" : '') .">";

	return $ret;
}
function enfants_aff($id_parent,$decalage, $critere, $gauche=0) {

	global $niveau;
	global $nombre_vis;
	global $nombre_abs;
	global $spip_lang_right, $spip_lang_left;
	global $abs_total;
	global $taille;
	$visites_abs = 0;

	$result = sql_select("id_rubrique, titre, descriptif", "spip_rubriques", "id_parent=$id_parent",'', '0+titre,titre');

	while($row = sql_fetch($result)){
		$id_rubrique = $row['id_rubrique'];
		$titre = typo($row['titre']);
		$descriptif = attribut_html(couper(typo($row['descriptif']),80));

		if ($nombre_vis[$id_rubrique]>0 OR $nombre_abs[$id_rubrique]>0){
			$largeur_rouge = floor(($nombre_vis[$id_rubrique] - $nombre_abs[$id_rubrique]) * $taille / $abs_total);
			$largeur_vert = floor($nombre_abs[$id_rubrique] * $taille / $abs_total);
			
			if ($largeur_rouge+$largeur_vert>0){
					
				if ($niveau == 0) {
					$couleur="#cccccc";
				}

				else if ($niveau == 1) {
					$couleur="#eeeeee";
				}
				else {
					$couleur="white";
				}
				echo "<table cellpadding='2' cellspacing='0' border='0' width='100%'>";
				echo "\n<tr style='background-color: $couleur'>";
				echo "\n<td style='border-bottom: 1px solid #aaaaaa; padding-$spip_lang_left: ".($niveau*20+5)."px;'>";

				
				if ( $largeur_rouge > 2) 
					echo bouton_block_depliable("<a href='" . generer_url_ecrire("naviguer","id_rubrique=$id_rubrique") . "' style='color: black;' title=\"$descriptif\">$titre</a>","incertain", "stats$id_rubrique");
				else
					echo 	"<div class='verdana1' style='padding-left: 18px; padding-top: 4px; padding-bottom: 3px;'>",
					  "<a href='" . generer_url_ecrire("naviguer","id_rubrique=$id_rubrique") . "' style='color: black;' title=\"$descriptif\">$titre</a>",
					  "</div>";
				echo "</td>";
				
				
				if ($niveau==0 OR 1==1){
					$pourcent = round($nombre_vis[$id_rubrique]/$abs_total*1000)/10;
					echo "\n<td class='verdana1' style='text-align: $spip_lang_right; width: 40px; border-bottom: 1px solid #aaaaaa;'>$pourcent%</td>";
				}
				else { echo "<td style='width: 10px; border-bottom: 1px solid #aaaaaa;'></td>"; }
				
				
				echo "\n<td align='right' style='border-bottom: 1px solid #aaaaaa; width:" . ($taille+5) ."px'>";
				
				
				echo "\n<table cellpadding='0' cellspacing='0' border='0' width='".($decalage+1+$gauche)."'>";
				echo "\n<tr>";
				if ($gauche > 0) echo "<td style='width: " .$gauche."px'></td>";
				echo "\n<td style='border: 0px; white-space: nowrap;'>";
				echo "<div style='border: 1px solid #999999; background-color: #dddddd; height: 12px; padding: 0px; margin: 0px;'>";
				if ($visites_abs > 0) echo "<img src='" . chemin_image('rien.gif') . "' style='vertical-align: top; height: 12px; border: 0px; width: ".$visites_abs."px;' alt= ' '/>";
				if ($largeur_rouge>0) echo "<img src='" . chemin_image('rien.gif') . "' class='couleur_cumul' style='vertical-align: top; height: 12px; border: 0px; width: " . $largeur_rouge . "px;' alt=' ' />";
				if ($largeur_vert>0) echo "<img src='" . chemin_image('rien.gif') . "' class='couleur_nombre' style='vertical-align: top; width: " . $largeur_vert ."px; height: 12px; border: 0px' alt=' ' />";
				echo "</div>";
				echo "</td></tr></table>\n";
				echo "</td></tr></table>";
			}	
		}
		
		if (isset($largeur_rouge) && ($largeur_rouge > 0)) {
			$niveau++;
			echo debut_block_depliable(false,"stats$id_rubrique");
			enfants_aff($id_rubrique,$largeur_rouge, $critere, $visites_abs+$gauche);
			echo fin_block();
			$niveau--;
		}
		$visites_abs = $visites_abs + round($nombre_vis[$id_rubrique]/$abs_total*$taille);
	}
}
Beispiel #20
0
function inc_meme_rubrique_dist($id_rubrique, $id, $type, $order='', $limit=NULL, $ajax=false)
{
	global $spip_lang_right, $spip_lang_left;
	include_spip('inc/presentation');
	include_spip('inc/afficher_objets');

	$table = table_objet_sql($type);
	if (!id_table_objet($table)) {
		spip_log("meme_rubrique: $type table inconnue");
		$type = 'article';
		$table = 'spip_articles';
	}
	$prim = 'id_' . $type;
	if (!$limit)
		$limit = defined('_MAX_ART_AFFICHES') ? _MAX_ART_AFFICHES : 10;

	$titre = ($type!='syndic'?'titre':'nom_site');
	$exec = array('article'=>'articles','breve'=>'breves_voir','syndic'=>'sites');

	$where = (($GLOBALS['visiteur_session']['statut'] == '0minirezo')
		  ? ''
		  :  "(statut = 'publie' OR statut = 'prop') AND ") 
	. "id_rubrique=$id_rubrique AND ($prim != $id)";

	$select = "$prim AS id, $titre AS titre, statut";

	$n = sql_countsel($table, $where);

	if (!$n) return '';

	if (!defined('_TRI_ARTICLES_RUBRIQUE')) define('_TRI_ARTICLES_RUBRIQUE', 'date DESC'); // surcharge possible dans mes_options.php
	$order = ($order == '') ? _TRI_ARTICLES_RUBRIQUE : "$order DESC";
	$voss = sql_select($select, $table, $where, '', "$order", $limit);

	$limit = $n - $limit;
	$retour = '';
	$puce_statut = charger_fonction('puce_statut', 'inc');
	$idom = 'rubrique_' . $type;

	while($row = sql_fetch($voss)) {
		$id = $row['id'];
		$num = afficher_numero_edit($id, $prim, $type);
		$statut = $row['statut'];
		
		// Exception pour les meme-rubrique de sites
		if ($type == "syndic") $type_statut = "site";
		else $type_statut = $type;
		
		$statut = $puce_statut($id, $statut, $id_rubrique, $type_statut);
		$href = "<a class='verdana1' href='"
		. generer_url_ecrire($exec[$type],"$prim=$id")
		. "'>"
		. sinon(typo($row['titre']), _T('info_sans_titre'))
		. "</a>";

		// Todo: refaire en css plus sains
		$retour .= "\n<div>"
				. "\n<div style='float:$spip_lang_right;width: 32%'>"
				. $num . "</div>"
				. "<div style='float:$spip_lang_left; padding-top:1px; width:18px;'>".$statut ."</div>"
				. "<div style='padding-$spip_lang_left:18px;'>".$href."</div>"
				. "<div style='clear:both; height: 3px;'></div>"
				. "</div>";
	}

	$icone =  '<b>' . _T('info_meme_rubrique')  . '</b>';
	$bouton = bouton_block_depliable(_T('info_meme_rubrique'),true,'memerub');

	$retour = 
		debut_cadre('meme-rubriques',"article-24.gif",'',$bouton)
		. debut_block_depliable(true,'memerub')
		. $retour;
	

	//	$retour .= (($limit <= 0) ? '' : "<tr><td colspan='3' style='text-align: center'>+ $limit</td></tr>");

	$retour .= fin_block()
		. fin_cadre('meme-rubriques');

	if ($ajax) return $retour;

	// id utilise dans puce_statut_article
	return "\n<div id='imgstatut$idom$id_rubrique'>$retour</div>";
}
Beispiel #21
0
function joindre_formulaire(&$v) {
	global $spip_lang_right;
	$depliable = false;

	$mode = $v['mode'];
	$vignette_de_doc = ($mode == 'vignette' AND $v['id_document']>0);
	$distant = (($mode == 'document' OR $mode == 'choix') AND $v['type']);

	# indiquer un choix d'upload FTP
	$dir_ftp = '';
	if (test_espace_prive()
	AND ($mode == 'document' OR $mode == 'choix') # si c'est pour un document
	AND !$vignette_de_doc		# pas pour une vignette (NB: la ligne precedente suffit, mais si on la supprime il faut conserver ce test-ci)
	AND $GLOBALS['flag_upload']) {
		if ($dir = determine_upload('documents')) {
			// quels sont les docs accessibles en ftp ?
			$l = texte_upload_manuel($dir, $mode);
			// s'il n'y en a pas, on affiche un message d'aide
			// en mode document, mais pas en mode image
			if ($l OR ($mode == 'document' OR $mode=='choix'))
				$dir_ftp = afficher_transferer_upload($l, $dir);
		}
	}
  
  // Add the redirect url when uploading via iframe

  $iframe = "";
  if($v['iframe_script'])
    $iframe = "<input type='hidden' name='iframe_redirect' value='".rawurlencode($v['iframe_script'])."' />\n";

	// Un menu depliant si on a une possibilite supplementaire

	if ($dir_ftp OR $distant OR $vignette_de_doc) {
		$bloc = "ftp_". $mode .'_'. intval($v['id_document']);

		if ($vignette_de_doc)
			$debut = bouton_block_depliable($v['intitule'],false,$bloc);
		else
			$debut = $v['intitule'];

		$milieu = debut_block_depliable(false,$bloc);
		$fin = "\n\t" . fin_block();
		$v['titre'] = bouton_block_depliable($v['titre'],false,$bloc);

	} else
		$debut = $milieu = $fin = '';

	// Lien document distant, jamais en mode image
	if ($distant) {
		$distant = "<br />\n<div style='border: 1px #303030 solid; padding: 4px; color: #505050;'>" .
			"\n\t<img src='". chemin_image('attachment.gif') .
			"' style='float: $spip_lang_right;' alt=\"\" />\n" .
			"<label for='url'>" .
			_T('info_referencer_doc_distant') .
			"</label><br />\n\t<input name='url' id='url' value='http://' />" .
			"\n\t<div style='text-align: $spip_lang_right'><input name='sousaction2' type='submit' value='".
			_T('bouton_choisir').
			"' /></div>" .
			"\n</div>";
	}

	$res = "<input name='fichier' id='fichier_$mode" .'_'. strval($v['id_document']) . "' type='file' class='forml spip_xx-small' size='15' />"
	. ($v['ancre']
		? "\n\t\t<input type='hidden' name='ancre' value='".$v['ancre']."' />"
		: ''
	)
	. "\n\t\t<div style='text-align: $spip_lang_right'><input name='sousaction1' type='submit' value='"
	. _T('bouton_telecharger')
	. "' /></div>";

	if ($vignette_de_doc)
		$res = $milieu . $res;
	else
		$res = $res . $milieu;

	return "$iframe$debut$res$dir_ftp$distant$fin";
}
Beispiel #22
0
function inc_presenter_liste_dist($requete, $fonc, &$prims, $own, $force, $styles, $idom='', $title='', $icone='', $url='', $cpt=NULL)
{
	global $spip_display, $spip_lang_left;

	// $requete est passe par reference, pour modifier l'index LIMIT
	if ($idom AND $spip_display != 4)
		$tranches = affiche_tranche_bandeau($requete, $idom, $url, $cpt, _TRANCHES);
	else $tranches = '';

	$prim = $prims;
	$prims = array();
	$result = sql_allfetsel((isset($requete["SELECT"]) ? $requete["SELECT"] : "*"), $requete['FROM'], $requete['WHERE'], $requete['GROUP BY'], $requete['ORDER BY'], $requete['LIMIT']);

	if (!count($result)) {
		if (!$force) return '';
	} else {
	if ($spip_display != 4) {
		$evt = !preg_match(",msie,i", $GLOBALS['browser_name']) ? ''
		: "
			onmouseover=\"changeclass(this,'tr_liste_over');\"
			onmouseout=\"changeclass(this,'tr_liste');\"" ;

		$table = $head = '';
		$th = 0;
		foreach ($result as $r) {
		  if ($prim) $prims[]= $r[$prim];
		  if ($vals = $fonc($r, $own)) {
			reset($styles);
			$res = '';
			foreach ($vals as $t) {
				$style = $largeur = $nom = "";
				list(,$s) = each($styles);
				if (count($s)) $style = array_shift($s);
				if (count($s)) $largeur = array_shift($s);
				if (count($s)) $nom = array_shift($s);
				if ($largeur) $largeur = " style='width: $largeur" ."px;'";
				if ($style) $style = " class=\"$style\"";
				$t = !trim($t) ? "&nbsp;" : lignes_longues($t);
				$res .= "\n<td$style$largeur>$t</td>";
				if (!$table) {
				  $th |= $nom ? 1 : 0;
				  $head .= "\n<th style='text-align:center'>$nom</th>";
				}
			}
			$table .= "\n<tr class='tr_liste'$evt>$res</tr>";
		  }
		}
		if (!$th) $head= '';
		$tranches .= "<table width='100%' cellpadding='2' cellspacing='0' border='0'>$head$table</table>";
	} else {
		foreach ($result as $r) {
			if ($prim) $prims[]= $r[$prim];
			if ($t = $fonc($r, $own)) {
			  	$tranches = '<li>' . join('</li><li>', $t) . '</li>';
		$tranches = "\n<ul style='text-align: $spip_lang_left; background-color: white;'>"
		. $tranches
		. "</ul>";
			}
		}
	}
	}

	$id = 't'.substr(md5(join('',$requete)),0,8);
	$bouton = !$icone ? '' : bouton_block_depliable($title, true, $id);

	return debut_cadre('liste', $icone, "", $bouton, "", "", false)
	  . debut_block_depliable(true,  $id)
	  . $tranches
	  . fin_block()
	  . fin_cadre('liste');
}
Beispiel #23
0
function enfant_rub($collection){
	global $spip_display, $spip_lang_left, $spip_lang_right, $spip_lang;

	$voir_logo = ($spip_display != 1 AND $spip_display != 4 AND isset($GLOBALS['meta']['image_process']) AND $GLOBALS['meta']['image_process'] != "non");

	if ($voir_logo) {
		$voir_logo = "float: $spip_lang_right; margin-$spip_lang_right: 0px; margin-top: 0px;";
		$chercher_logo = charger_fonction('chercher_logo', 'inc');
	} else $logo ='';

	$res = "";

	$result = sql_select("id_rubrique, id_parent, titre, descriptif, lang ", "spip_rubriques", "id_parent=$collection",'', '0+titre,titre');

	while($row=sql_fetch($result)){
		$id_rubrique=$row['id_rubrique'];
		$id_parent=$row['id_parent'];
		$titre=$row['titre'];

		if (autoriser('voir','rubrique',$id_rubrique)){

			$les_sous_enfants = sous_enfant_rub($id_rubrique);

			changer_typo($row['lang']);
			$lang_dir = lang_dir($row['lang']);
			$descriptif=propre($row['descriptif']);

			if ($voir_logo) {
				if ($logo = $chercher_logo($id_rubrique, 'id_rubrique', 'on')) {
					list($fid, $dir, $nom, $format) = $logo;
					include_spip('inc/filtres_images_mini');
					$logo = image_reduire("<img src='$fid' alt='' />", 48, 36);
					if ($logo)
						$logo =  "\n<div style='$voir_logo'>$logo</div>";
				}
			}

			$lib_bouton = (!acces_restreint_rubrique($id_rubrique) ? "" :
			   http_img_pack("admin-12.gif", '', " width='12' height='12'", _T('image_administrer_rubrique'))) .
			  " <span dir='$lang_dir'><a href='" .
			  generer_url_ecrire("naviguer","id_rubrique=$id_rubrique") .
			  "'>".
			  typo($titre) .
			  "</a></span>";

			  $titre = (is_string($logo) ? $logo : '') .
				  bouton_block_depliable($lib_bouton,$les_sous_enfants ?false:-1,"enfants$id_rubrique");

			$les_enfants = "\n<div class='enfants'>" .
			  debut_cadre_sous_rub(($id_parent ? "rubrique-24.gif" : "secteur-24.gif"), true, "", $titre) .
			  (!$descriptif ? '' : "\n<div class='verdana1'>$descriptif</div>") .
			  (($spip_display == 4) ? '' : $les_sous_enfants) .
			  "\n<div style='clear:both;'></div>"  .
			  fin_cadre_sous_rub(true) .
			  "</div>";

			$res .= ($spip_display != 4)
			? $les_enfants
			: "\n<li>$les_enfants</li>";
		}
	}

	changer_typo($spip_lang); # remettre la typo de l'interface pour la suite
	return (($spip_display == 4) ? "\n<ul>$res</ul>\n" :  $res);

}
Beispiel #24
0
function exec_messagerie_dist()
{

global $connect_id_auteur, $connect_statut, $spip_lang_rtl;


$commencer_page = charger_fonction('commencer_page', 'inc');
echo $commencer_page(_T('titre_page_messagerie'), "accueil", "messagerie");

echo debut_gauche("messagerie",true);


echo debut_boite_info(true);

echo _T('info_gauche_messagerie');

echo "<p>".http_img_pack("m_envoi$spip_lang_rtl.gif", 'V', "style='width: 14px; height: 7px; border: 0px'") .' ' . _T('info_symbole_vert'), '</p>';

 echo aide ("messut");

echo "<p>".http_img_pack("m_envoi_bleu$spip_lang_rtl.gif", 'B', "style='width: 14px; height: 7px; border: 0px'") .' ' . _T('info_symbole_bleu'), '</p>';

echo aide ("messpense");

echo "<p>".http_img_pack("m_envoi_jaune$spip_lang_rtl.gif", 'J', "style='width: 14px; height: 7px; border: 0px'") .' ' . _T('info_symbole_jaune'), '</p>';

echo fin_boite_info(true);

echo creer_colonne_droite('', true);

echo debut_cadre_relief("messagerie-24.gif", true);
echo icone_horizontale(_T('lien_nouvea_pense_bete'),generer_action_auteur("editer_message","pb"), "pense-bete.gif", "", false);
echo icone_horizontale(_T('lien_nouveau_message'),generer_action_auteur("editer_message","normal"), "message.gif", "", false);
		
		if ($connect_statut == "0minirezo") {
			echo icone_horizontale(_T('lien_nouvelle_annonce'),generer_action_auteur("editer_message","affich"), "annonce.gif", "", false);
		}
echo fin_cadre_relief(true);


# Affiche l'encadre "lien iCal"

 echo
    debut_cadre_enfonce('',true) .
    "<div class='verdana1'>"._T("calendrier_synchro") .
    "<table  class='cellule-h-table' cellpadding='0'><tr>\n" .
    "<td><a href='" . generer_url_ecrire("synchro") . "' class='ical'>&nbsp;</a></td>\n"
    . "<td class='cellule-h-lien'><br /><a href='" . generer_url_ecrire("synchro") . "' class='cellule-h'>" 
    . _T("icone_suivi_activite")
    . "</a></td>\n</tr></table>\n" ."</div>" .
    fin_cadre_enfonce(true);


 echo debut_droite("messagerie", true);

 $messages_vus = array();

 echo afficher_ses_messages('<b>' . _T('infos_vos_pense_bete') . '</b>', '', "id_auteur=$connect_id_auteur AND statut='publie' AND type='pb' AND (date_fin > DATE_SUB(".sql_quote(date('Y-m-d H:i:s')).", INTERVAL 1 DAY) OR rv != 'oui')", $messages_vus, false, true);


 echo afficher_ses_messages('<b>' . _T('info_nouveaux_message') . '</b>', ", spip_auteurs_messages AS lien", "lien.id_auteur=$connect_id_auteur AND vu='non' AND statut='publie' AND lien.id_message=messages.id_message", $messages_vus,  true, true);


 echo afficher_ses_messages('<b>' . _T('info_discussion_cours') . '</b>', ", spip_auteurs_messages AS lien", "lien.id_auteur=$connect_id_auteur AND statut='publie' AND type='normal' AND lien.id_message=messages.id_message AND (date_fin > DATE_SUB(".sql_quote(date('Y-m-d H:i:s')).", INTERVAL 1 DAY) OR rv != 'oui')",  $messages_vus, true, false);


// Afficher le lien RSS

echo bouton_spip_rss('messagerie', array('id_auteur' => $connect_id_auteur));



 echo afficher_ses_messages('<b>' . _T('info_message_en_redaction') . '</b>', '', "id_auteur=$connect_id_auteur AND statut='redac'",  $messages_vus, true, false);


 $result = sql_select('auteurs.id_auteur, auteurs.nom, COUNT(*) AS total', 'spip_auteurs AS auteurs,  spip_auteurs_messages AS lien2, spip_messages AS messages, spip_auteurs_messages AS lien', "(lien.id_auteur = $connect_id_auteur AND lien.id_message = messages.id_message AND messages.statut = 'publie' AND (messages.rv != 'oui' OR messages.date_fin > ".sql_quote(date('Y-m-d H:i:s'))." )) AND (lien2.id_auteur = lien2.id_auteur AND lien2.id_message = messages.id_message AND lien2.id_auteur != $connect_id_auteur AND auteurs.id_auteur = lien2.id_auteur)", "auteurs.id_auteur", 'total DESC', 10);

 $cor = array();
 while($row = sql_fetch($result)) {
		$id_auteur = $row['id_auteur'];
		$nom = typo($row["nom"]);
		$total = $row["total"];
		$cor[]= "<div class='tr_liste'\nonmouseover=\"changeclass(this,'tr_liste_over');\"\nonmouseout=\"changeclass(this,'tr_liste');\"\nstyle='padding: 2px; padding-left: 10px; border-bottom: 1px solid #cccccc;'><div class='verdana1'><img src='" . chemin_image('redac-12.gif') . "'\nstyle='border: 0px' alt=' ' /> <a href='" . generer_url_ecrire("auteur_infos","id_auteur=$id_auteur") . "'>$nom,</a> ($total)</div></div>";
 }

 if ($cor) {

	echo "<div style='height: 12px;'></div>";
	$bouton = bouton_block_depliable(_T('info_principaux_correspondants'),true,'principaux');
	echo debut_cadre('liste',"redacteurs-24.gif",'',$bouton);
	echo debut_block_depliable(true,'principaux');
	echo "<table width='100%' cellpadding='0' cellspacing='0'>";
	echo "<tr><td valign='top' style='width: 50%'>";
	$count = ceil(count($cor)/2);
	echo join("\n",array_slice($cor, 0, $count));
	echo "</td><td valign='top' style='width: 50%'>";
	echo join("\n",array_slice($cor, $count));
	echo "</td></tr></table>";
	echo fin_block();
	echo fin_cadre('liste');
 }

 echo afficher_ses_messages('<b>' . _T('info_pense_bete_ancien') . '</b>', '', "id_auteur=$connect_id_auteur AND statut='publie' AND type='pb' AND rv!='oui'",  $messages_vus, false, false);

 echo afficher_ses_messages('<b>' . _T('info_tous_redacteurs') . '</b>', '', "statut='publie' AND type='affich' AND (date_fin > DATE_SUB(".sql_quote(date('Y-m-d H:i:s')).", INTERVAL 1 DAY) OR rv != 'oui')",  $messages_vus, false, false);

echo fin_gauche(), fin_page();

}
Beispiel #25
0
function adhclub_imp_show_erreurs($erreur)
{
    $output = "";
    if (count($erreur) > 0) {
        $bouton = bouton_block_depliable(_T('adhintg:adh_erreurs'), false, "adh_erreurs");
        $output .= debut_cadre_enfonce("mot-cle-24.gif", true, "", $bouton);
        $output .= debut_block_depliable(false, "adh_erreurs");
        foreach ($erreur as $key => $val) {
            $output .= "<dl>";
            $output .= "<dt>" . _T('adhclub:champ_err', array('cher' => $key));
            $output .= "<dd>" . _T('adhintg:' . $key) . " : {$val}<dd>";
            $output .= "</dl>";
        }
        $output .= fin_block();
        $output .= fin_cadre_enfonce(true);
    }
    return $output;
}