Esempio n. 1
0
function exec_calendrier_args($time, $type, $echelle, $partie_cal)
{
	if ($time < 0) $time = time();

	if (!$type)
		$type = 'mois';
	elseif ($type == 'semaine')
		$GLOBALS['afficher_bandeau_calendrier_semaine'] = true;

	$ancre = 'calendrier-1';
	$r = generer_url_ecrire('calendrier', "type=$type") . "#$ancre";
	$r = http_calendrier_init($time, $type, $echelle, $partie_cal, $r);

	if (_AJAX) {
		ajax_retour($r);
	} else {
		$date = date("Y-m-d", $time);
		if ($type == 'jour') {
			$titre = nom_jour($date)." ". affdate_jourcourt($date);
		}  else {
			$titre = _T('titre_page_calendrier',
					array('nom_mois' => nom_mois($date),
						'annee' => annee($date)));
		}

		$commencer_page = charger_fonction('commencer_page', 'inc');
		echo $commencer_page($titre, "accueil", "calendrier");
// ne produit rien par defaut, mais est utilisee par le plugin agenda
		echo barre_onglets("calendrier", "calendrier"); 
		echo debut_grand_cadre(true);
		echo "\n<div>&nbsp;</div>\n<div id='", $ancre, "'>",$r,'</div>';
		echo fin_grand_cadre(true);
		echo fin_page();
	}
}
Esempio n. 2
0
/**
 * Afficher de facon textuelle les dates de debut et fin en fonction des cas
 * - Le lundi 20 fevrier a 18h
 * - Le 20 fevrier de 18h a 20h
 * - Du 20 au 23 fevrier
 * - du 20 fevrier au 30 mars
 * - du 20 fevrier 2007 au 30 mars 2008
 * $horaire='oui' permet d'afficher l'horaire, toute autre valeur n'indique que le jour
 * $forme peut contenir abbr (afficher le nom des jours en abbrege) et ou hcal (generer une date au format hcal)
 * 
 * @param string $date_debut
 * @param string $date_fin
 * @param string $horaire
 * @param string $forme
 * @return string
 */
function agenda_affdate_debut_fin($date_debut, $date_fin, $horaire = 'oui', $forme=''){
	static $trans_tbl=NULL;
	if ($trans_tbl==NULL){
		$trans_tbl = get_html_translation_table (HTML_ENTITIES);
		$trans_tbl = array_flip ($trans_tbl);
	}
	
	$abbr = '';
	if (strpos($forme,'abbr')!==false) $abbr = 'abbr';
	$affdate = "affdate_jourcourt";
	if (strpos($forme,'annee')!==false) $affdate = 'affdate';
	
	$dtstart = $dtend = $dtabbr = "";
	if (strpos($forme,'hcal')!==false) {
		$dtstart = "<abbr class='dtstart' title='".date_iso($date_debut)."'>";
		$dtend = "<abbr class='dtend' title='".date_iso($date_fin)."'>";
		$dtabbr = "</abbr>";
	}
	
	$date_debut = strtotime($date_debut);
	$date_fin = strtotime($date_fin);
	$d = date("Y-m-d", $date_debut);
	$f = date("Y-m-d", $date_fin);
	$h = $horaire=='oui';
	$hd = date("H:i",$date_debut);
	$hf = date("H:i",$date_fin);
	$au = " " . strtolower(_T('agenda:evenement_date_au'));
	$du = _T('agenda:evenement_date_du') . " ";
	$s = "";
	if ($d==$f)
	{ // meme jour
		$s = ucfirst(nom_jour($d,$abbr))." ".$affdate($d);
		if ($h)
			$s .= " $hd";
		$s = "$dtstart$s$dtabbr";
		if ($h AND $hd!=$hf) $s .= "-$dtend$hf$dtabbr";
	}
	else if ((date("Y-m",$date_debut))==date("Y-m",$date_fin))
	{ // meme annee et mois, jours differents
		if ($h){
			$s = $du . $dtstart . affdate_jourcourt($d) . " $hd" . $dtabbr;
			$s .= $au . $dtend . $affdate($f);
			if ($hd!=$hf) $s .= " $hf";
			$s .= $dtabbr;
		}
		else {
			$s = $du . $dtstart . jour($d) . $dtabbr;
			$s .= $au . $dtend . $affdate($f) . $dtabbr;
		}
	}
	else if ((date("Y",$date_debut))==date("Y",$date_fin))
	{ // meme annee, mois et jours differents
		$s = $du . $dtstart . affdate_jourcourt($d);
		if ($h) $s .= " $hd";
		$s .= $dtabbr . $au . $dtend . $affdate($f);
		if ($h) $s .= " $hf";
		$s .= $dtabbr;
	}
	else
	{ // tout different
		$s = $du . $dtstart . affdate($d);
		if ($h)
			$s .= " ".date("(H:i)",$date_debut);
		$s .= $dtabbr . $au . $dtend. affdate($f);
		if ($h)
			$s .= " ".date("(H:i)",$date_fin);
		$s .= $dtabbr;
	}
	return unicode2charset(charset2unicode(strtr($s,$trans_tbl),''));	
}
Esempio n. 3
0
function statistiques_href($jour, $moyenne, $script, $value='')
{
	$ce_jour=date("Y-m-d H:i:s", $jour);
	$title = nom_jour($ce_jour) . ' '
	  . ($script ? affdate_heure($ce_jour) :
	     (affdate_jourcourt($ce_jour)  .' '.
	      (" | " ._T('info_visites')." $value | " ._T('info_moyenne')." "
	       . round($moyenne,2))));
	return attribut_html(supprimer_tags($title));
}
Esempio n. 4
0
/**
 * Afficher de facon textuelle les dates de debut et fin en fonction des cas
 * - Le lundi 20 fevrier a 18h
 * - Le 20 fevrier de 18h a 20h
 * - Du 20 au 23 fevrier
 * - du 20 fevrier au 30 mars
 * - du 20 fevrier 2007 au 30 mars 2008
 * $horaire='oui' permet d'afficher l'horaire, toute autre valeur n'indique que le jour
 * $forme peut contenir abbr (afficher le nom des jours en abbrege) et ou hcal (generer une date au format hcal)
 * 
 * @param string $date_debut
 * @param string $date_fin
 * @param string $horaire
 * @param string $forme
 * @return string
 */
function agenda_affdate_debut_fin($date_debut, $date_fin, $horaire = 'oui', $forme = '')
{
    $abbr = '';
    if (strpos($forme, 'abbr') !== false) {
        $abbr = 'abbr';
    }
    $affdate = "affdate_jourcourt";
    if (strpos($forme, 'annee') !== false) {
        $affdate = 'affdate';
    }
    $dtstart = $dtend = $dtabbr = "";
    if (strpos($forme, 'hcal') !== false) {
        $dtstart = "<abbr class='dtstart' title='" . date_iso($date_debut) . "'>";
        $dtend = "<abbr class='dtend' title='" . date_iso($date_fin) . "'>";
        $dtabbr = "</abbr>";
    }
    $date_debut = strtotime($date_debut);
    $date_fin = strtotime($date_fin);
    $d = date("Y-m-d", $date_debut);
    $f = date("Y-m-d", $date_fin);
    $h = $horaire == 'oui';
    $hd = date("H:i", $date_debut);
    $hf = date("H:i", $date_fin);
    $au = " " . strtolower(_T('agenda:evenement_date_au'));
    $du = _T('agenda:evenement_date_du') . " ";
    $s = "";
    if ($d == $f) {
        // meme jour
        $s = ucfirst(nom_jour($d, $abbr)) . " " . $affdate($d);
        if ($h) {
            $s .= " {$hd}";
        }
        $s = "{$dtstart}{$s}{$dtabbr}";
        if ($h and $hd != $hf) {
            $s .= "-{$dtend}{$hf}{$dtabbr}";
        }
    } else {
        if (date("Y-m", $date_debut) == date("Y-m", $date_fin)) {
            // meme annee et mois, jours differents
            if ($h) {
                $s = $du . $dtstart . affdate_jourcourt($d) . " {$hd}" . $dtabbr;
                $s .= $au . $dtend . $affdate($f);
                if ($hd != $hf) {
                    $s .= " {$hf}";
                }
                $s .= $dtabbr;
            } else {
                $s = $du . $dtstart . jour($d) . $dtabbr;
                $s .= $au . $dtend . $affdate($f) . $dtabbr;
            }
        } else {
            if (date("Y", $date_debut) == date("Y", $date_fin)) {
                // meme annee, mois et jours differents
                $s = $du . $dtstart . affdate_jourcourt($d);
                if ($h) {
                    $s .= " {$hd}";
                }
                $s .= $dtabbr . $au . $dtend . $affdate($f);
                if ($h) {
                    $s .= " {$hf}";
                }
                $s .= $dtabbr;
            } else {
                // tout different
                $s = $du . $dtstart . affdate($d);
                if ($h) {
                    $s .= " " . date("(H:i)", $date_debut);
                }
                $s .= $dtabbr . $au . $dtend . affdate($f);
                if ($h) {
                    $s .= " " . date("(H:i)", $date_fin);
                }
                $s .= $dtabbr;
            }
        }
    }
    return unicode2charset(charset2unicode($s, 'AUTO'));
}
Esempio n. 5
0
/**
 * Afficher de facon textuelle les dates de debut et fin en fonction des cas
 * - Lundi 20 fevrier a 18h
 * - Le 20 fevrier de 18h a 20h
 * - Du 20 au 23 fevrier
 * - Du 20 fevrier au 30 mars
 * - Du 20 fevrier 2007 au 30 mars 2008
 * $horaire='oui' ou true permet d'afficher l'horaire, toute autre valeur n'indique que le jour
 * $forme peut contenir une ou plusieurs valeurs parmi
 *  - abbr (afficher le nom des jours en abbrege)
 *  - hcal (generer une date au format hcal)
 *  - jour (forcer l'affichage des jours)
 *  - annee (forcer l'affichage de l'annee)
 *
 * @param string $date_debut
 * @param string $date_fin
 * @param string $horaire
 * @param string $forme
 *   abbr pour afficher le nom du jour en abbrege (Dim. au lieu de Dimanche)
 *   annee pour forcer l'affichage de l'annee courante
 *   jour pour forcer l'affichage du nom du jour
 *   hcal pour pour avoir un markup microformat abbr
 * @return string
 */
function affdate_debut_fin($date_debut, $date_fin, $horaire = 'oui', $forme = '')
{
    $abbr = $jour = '';
    $affdate = "affdate_jourcourt";
    if (strpos($forme, 'abbr') !== false) {
        $abbr = 'abbr';
    }
    if (strpos($forme, 'annee') !== false) {
        $affdate = 'affdate';
    }
    if (strpos($forme, 'jour') !== false) {
        $jour = 'jour';
    }
    $dtstart = $dtend = $dtabbr = "";
    if (strpos($forme, 'hcal') !== false) {
        $dtstart = "<abbr class='dtstart' title='" . date_iso($date_debut) . "'>";
        $dtend = "<abbr class='dtend' title='" . date_iso($date_fin) . "'>";
        $dtabbr = "</abbr>";
    }
    $date_debut = strtotime($date_debut);
    $date_fin = strtotime($date_fin);
    $d = date("Y-m-d", $date_debut);
    $f = date("Y-m-d", $date_fin);
    $h = ($horaire === 'oui' or $horaire === true);
    $hd = _T('date_fmt_heures_minutes_court', array('h' => date("H", $date_debut), 'm' => date("i", $date_debut)));
    $hf = _T('date_fmt_heures_minutes_court', array('h' => date("H", $date_fin), 'm' => date("i", $date_fin)));
    if ($d == $f) {
        // meme jour
        $nomjour = nom_jour($d, $abbr);
        $s = $affdate($d);
        $s = _T('date_fmt_jour', array('nomjour' => $nomjour, 'jour' => $s));
        if ($h) {
            if ($hd == $hf) {
                // Lundi 20 fevrier a 18h25
                $s = spip_ucfirst(_T('date_fmt_jour_heure', array('jour' => $s, 'heure' => $hd)));
                $s = "{$dtstart}{$s}{$dtabbr}";
            } else {
                // Le <abbr...>lundi 20 fevrier de 18h00</abbr> a <abbr...>20h00</abbr>
                if ($dtabbr && $dtstart && $dtend) {
                    $s = _T('date_fmt_jour_heure_debut_fin_abbr', array('jour' => spip_ucfirst($s), 'heure_debut' => $hd, 'heure_fin' => $hf, 'dtstart' => $dtstart, 'dtend' => $dtend, 'dtabbr' => $dtabbr));
                } else {
                    $s = spip_ucfirst(_T('date_fmt_jour_heure_debut_fin', array('jour' => $s, 'heure_debut' => $hd, 'heure_fin' => $hf)));
                }
            }
        } else {
            if ($dtabbr && $dtstart) {
                $s = $dtstart . spip_ucfirst($s) . $dtabbr;
            } else {
                $s = spip_ucfirst($s);
            }
        }
    } else {
        if (date("Y-m", $date_debut) == date("Y-m", $date_fin)) {
            // meme annee et mois, jours differents
            if (!$h) {
                $date_debut = jour($d);
            } else {
                $date_debut = affdate_jourcourt($d, date("Y", $date_fin));
            }
            $date_fin = $affdate($f);
            if ($jour) {
                $nomjour_debut = nom_jour($d, $abbr);
                $date_debut = _T('date_fmt_jour', array('nomjour' => $nomjour_debut, 'jour' => $date_debut));
                $nomjour_fin = nom_jour($f, $abbr);
                $date_fin = _T('date_fmt_jour', array('nomjour' => $nomjour_fin, 'jour' => $date_fin));
            }
            if ($h) {
                $date_debut = _T('date_fmt_jour_heure', array('jour' => $date_debut, 'heure' => $hd));
                $date_fin = _T('date_fmt_jour_heure', array('jour' => $date_fin, 'heure' => $hf));
            }
            $date_debut = $dtstart . $date_debut . $dtabbr;
            $date_fin = $dtend . $date_fin . $dtabbr;
            $s = _T('date_fmt_periode', array('date_debut' => $date_debut, 'date_fin' => $date_fin));
        } else {
            $date_debut = affdate_jourcourt($d, date("Y", $date_fin));
            $date_fin = $affdate($f);
            if ($jour) {
                $nomjour_debut = nom_jour($d, $abbr);
                $date_debut = _T('date_fmt_jour', array('nomjour' => $nomjour_debut, 'jour' => $date_debut));
                $nomjour_fin = nom_jour($f, $abbr);
                $date_fin = _T('date_fmt_jour', array('nomjour' => $nomjour_fin, 'jour' => $date_fin));
            }
            if ($h) {
                $date_debut = _T('date_fmt_jour_heure', array('jour' => $date_debut, 'heure' => $hd));
                $date_fin = _T('date_fmt_jour_heure', array('jour' => $date_fin, 'heure' => $hf));
            }
            $date_debut = $dtstart . $date_debut . $dtabbr;
            $date_fin = $dtend . $date_fin . $dtabbr;
            $s = _T('date_fmt_periode', array('date_debut' => $date_debut, 'date_fin' => $date_fin));
        }
    }
    return $s;
}
Esempio n. 6
0
function http_calendrier_rv($messages, $type) {

	$total = $date_rv = '';
	if (!$messages) return $total;
	$connect_quand = $GLOBALS['visiteur_session']['quand'];

	foreach ($messages as $row) {
		$rv = ($row['location'] == 'oui');
		$date = $row['dtstart'];
		$date_fin = $row['dtend'];
		if ($row['category']=="pb") $bouton = "pense-bete";
		else if ($row['category']=="affich") $bouton = "annonce";
		else $bouton = "message";

		if ($rv) {
			$date_jour = affdate_jourcourt($date);
			$total .= "<tr><td colspan='2'>" .
				(($date_jour == $date_rv) ? '' :
				"\n<div  class='calendrier-arial11'><b>$date_jour</b></div>") .
				"</td></tr>";
			$date_rv = $date_jour;
			$rv =
		((affdate($date) == affdate($date_fin)) ?
		 ("\n<div class='calendrier-arial9 fond-agenda'>"
		  . heures($date).":".minutes($date)."<br />"
		  . heures($date_fin).":".minutes($date_fin)."</div>") :
		( "\n<div class='calendrier-arial9 fond-agenda' style='text-align: center;'>"
		  . heures($date).":".minutes($date)."<br />...</div>" ));
		}

		$c = (strtotime($date) <= $connect_quand) ? '' : " color: red;";
		$total .= "<tr><td style='width: 24px' valign='middle'>" .
		  http_href($row['url'],
				     ($rv ?
				      http_img_pack("rv.gif", 'rv',
						    http_style_background($bouton . '.gif', "no-repeat;")) : 
				      http_img_pack($bouton.".gif", $bouton, ""))) .
		"</td>\n" .
		"<td valign='middle'><div style='font-weight: bold;$c'>" .
		$rv .
		http_href($row['url'], typo($row['summary']), '', '', 'calendrier-verdana') .
		"</div></td></tr>";
	}

	if ($type == 'annonces') {
		$titre = _T('info_annonces_generales');
	}
	else if ($type == 'pb') {
		$titre = _T('infos_vos_pense_bete');
	}
	else if ($type == 'rv') {
		$titre = _T('info_vos_rendez_vous');
	}

	return
	  debut_cadre_enfonce("", true, "", $titre) .
	  "\n<table>" .
	  $total .
	  "</table>" .
	  fin_cadre_enfonce(true);
}
Esempio n. 7
0
function liste_rv($query, $type)
{
    global $spip_lang_rtl, $spip_lang_left, $spip_lang_right;
    if ($type == annonces) {
        $titre = _T('info_annonces_generales');
        $couleur_titre = "ccaa00";
        $couleur_texte = "black";
        $couleur_fond = "#ffffee";
    } else {
        if ($type == pb) {
            $titre = _T('infos_vos_pense_bete');
            $couleur_titre = "#3874B0";
            $couleur_fond = "#EDF3FE";
            $couleur_texte = "white";
        } else {
            if ($type == rv) {
                $titre = _T('info_vos_rendez_vous');
                $couleur_titre = "#666666";
                $couleur_fond = "#eeeeee";
                $couleur_texte = "white";
            }
        }
    }
    $result = spip_query($query);
    if (spip_num_rows($result) > 0) {
        debut_cadre_enfonce("", false, "", $titre);
        echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>";
        while ($row = spip_fetch_array($result)) {
            if (preg_match("/^=([^[:space:]]+)\$/", $row['texte'], $match)) {
                $url = $match[1];
            } else {
                $url = "message.php3?id_message=" . $row['id_message'];
            }
            $type = $row['type'];
            $rv = $row['rv'];
            $date = $row['date_heure'];
            $date_fin = $row['date_fin'];
            if ($type == "normal") {
                $bouton = "message";
            } elseif ($type == "pb") {
                $bouton = "pense-bete";
            } elseif ($type == "affich") {
                $bouton = "annonce";
            } else {
                $bouton = "message";
            }
            $titre = typo($row['titre']);
            if ($rv == "oui") {
                echo "<tr><td colspan='2'>";
                $date_jour = affdate_jourcourt($date);
                if ($date_jour != $date_rv) {
                    echo "<div class='arial11'><b>{$date_jour}</b></div>";
                }
                echo "</td></tr>";
            }
            echo "<tr>";
            echo "<td width='24' valign='middle'>";
            echo "<a href='{$url}'>";
            if ($rv == "oui") {
                echo "<img src='img_pack/rv.gif' style='background: url(img_pack/{$bouton}.gif) no-repeat;' border='0'>";
            } else {
                echo "<img src='img_pack/{$bouton}.gif' border='0'>";
            }
            echo "</a>";
            echo "</td>";
            echo "<td valign='middle'>";
            if ($rv == "oui") {
                if (affdate($date) == affdate($date_fin)) {
                    echo "<div class='arial0' style='float: {$spip_lang_left}; line-height: 12px; color: #666666; margin-{$spip_lang_right}: 3px; padding-{$spip_lang_right}: 4px; background: url(img_pack/fond-agenda.gif) {$spip_lang_right} center no-repeat;'>" . heures($date) . ":" . minutes($date) . "<br />" . heures($date_fin) . ":" . minutes($date_fin) . "</div>";
                } else {
                    echo "<div class='arial0' style='float: {$spip_lang_left}; line-height: 12px; color: #666666; margin-{$spip_lang_right}: 3px; padding-{$spip_lang_right}: 4px; background: url(img_pack/fond-agenda.gif) {$spip_lang_right} center no-repeat; text-align: center;'>" . heures($date) . ":" . minutes($date) . "<br />...</div>";
                }
            }
            echo "<div><b><a href='{$url}' class='arial1' style='color: #333333;'>{$titre}</a></b></div>";
            echo "</td>";
            echo "</tr>\n";
            $date_rv = $date_jour;
        }
        echo "</table>";
        fin_cadre_enfonce();
    }
}
Esempio n. 8
0
function afficher_objet_boucle($row, $own)
{
	global $connect_statut, $spip_lang_right;
	static $chercher_logo = true;

	list($afficher_langue, $affrub, $langue_defaut, $formater,$type,$primary) = $own;
	$vals = array();
	$id_objet = $row[$primary];
	if (autoriser('voir',$type,$id_objet)){

		$date_heure = isset($row['date'])?$row['date']:(isset($row['date_heure'])?$row['date_heure']:"");

		$statut = isset($row['statut'])?$row['statut']:"";
		if (isset($row['lang']))
		  changer_typo($lang = $row['lang']);
		else $lang = $langue_defaut;
		$lang_dir = lang_dir($lang);
		$id_rubrique = isset($row['id_rubrique'])?$row['id_rubrique']:0;

		$puce_statut = charger_fonction('puce_statut', 'inc');
		$vals[] = $puce_statut($id_objet, $statut, $id_rubrique, $type);

		list($titre,$suite) = afficher_titre_objet($type,$row);
		$flogo = '';
		if ($chercher_logo) {
			if ($chercher_logo !== true
			    OR $chercher_logo = charger_fonction_logo_if())
			  if ($logo = $chercher_logo($id_objet, $primary, 'on')) {
				list($fid, $dir, $nom, $format) = $logo;
				include_spip('inc/filtres_images_mini');
				$logo = image_reduire("<img src='$fid' alt='' />", 26, 20);
				if ($logo)
					$flogo = "\n<span style='float: $spip_lang_right; margin-top: -2px; margin-bottom: -2px;'>$logo</span>";
			  }
		}
		if ($titre) {
			$titre = "<a href='"
			.  lien_voir_objet($type,$primary,$id_objet)
			.  "'>"
			. $titre
			. "</a>";
		}
		$vals[] = "\n<div>$flogo$titre$suite</div>";

		$s = "";
		if ($afficher_langue){
			if (isset($row['langue_choisie'])){
				$s .= " <span class='spip_xx-small' style='color: #666666' dir='$lang_dir'>";
				if ($row['langue_choisie'] == "oui") $s .= "<b>".traduire_nom_langue($lang)."</b>";
				else $s .= "(".traduire_nom_langue($lang).")";
				$s .= "</span>";
			}
			elseif ($lang != $langue_defaut)
				$s .= " <span class='spip_xx-small' style='color: #666666' dir='$lang_dir'>".
					($lang
						? "(".traduire_nom_langue($lang).")"
						: ''
					)
				."</span>";
		}
		$vals[] = $s;

		$vals[] = afficher_complement_objet($type,$row);

		$s = "";
		if ($affrub && $id_rubrique) {
			$rub = sql_fetsel("id_rubrique, titre", "spip_rubriques", "id_rubrique=$id_rubrique");
			$id_rubrique = $rub['id_rubrique'];
			$s .= "<a href='" . generer_url_ecrire("naviguer","id_rubrique=$id_rubrique") . "' style=\"display:block;\">".typo($rub['titre'])."</a>";
		} else
		if ($statut){
			if ($statut != "prop")
					$s = affdate_jourcourt($date_heure);
				else
					$s .= _T('info_a_valider');
		}
		$vals[] = $s;

		$vals[] = afficher_numero_edit($id_objet, $primary, $type, $row);
	}
	return $vals;
}
Esempio n. 9
0
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&nbsp;$nom";
	}

	$date = affdate_jourcourt($date);
	if (!$date) $date = '&nbsp;';

	$num = afficher_numero_edit($id_article, 'id_article', 'article');

	// Afficher le numero (JMB)

	return array($puce, $lien, join('<br />', $auteurs), $date, $num);
}
Esempio n. 10
0
function controle_petition_page($id_article, $titre, $type,  $corps, $count)
{
	$args = array();
	$rac = '';

	if (!(autoriser('modererpetition')
	OR (
		$id_article > 0
		AND autoriser('modererpetition', 'article', $id_article)
	    ))) {
		$ong = '';
	} else {
		$ong = controle_petition_onglet($id_article, $debut, $type, '');
		if ($id_article) {
			$h = generer_url_ecrire("statistiques_visites","id_article=$id_article");
			$rac = icone_horizontale(_T('icone_statistiques_visites'), $h, "statistiques-24.gif","rien.gif", false);
			if ($type !== 'public') {

				$h = redirige_action_auteur('editer_signatures', $id_article . 'A', 'controle_petition', "id_article=$id_article&type=interne");
				$rac .= icone_horizontale(_T('icone_relancer_signataire') . " ($count)", $h, "envoi-message-24.gif","rien.gif", false);
			}
			$rac = bloc_des_raccourcis($rac);
			$titre = "<a href='" .
			generer_url_entite($id_article,'article') .
			"'>" .
			typo($titre) .
			"</a>" .
			" <span class='arial1'>(" .
			_T('info_numero_abbreviation') .
			$id_article .
			")</span>";

			if (!sql_countsel('spip_petitions', "id_article=$id_article"))
				$titre .= '<br >' . _T('info_petition_close');

			$args = array('id_article' => $id_article);
		} else {

		  $q = sql_select('A.titre, A.date, A.id_article, count(*) AS n', 
			     'spip_signatures AS S LEFT JOIN spip_articles AS A ON A.id_article=S.id_article',
			     '',
			     'A.id_article',
				  'n desc',
				  "0,10");
		  while ($r = sql_fetch($q)) {
		    $id = $r['id_article'];
		    $h = generer_url_entite($id, 'article');
		    $title = affdate_jourcourt($r['date']) . "\n" .$r['titre'];
		    $rac .= "<li><a href='$h' title=\"" .  attribut_html($title).  '">' . _T('info_numero_abbreviation') . " $id" . '</a>&nbsp;: '. $r['n'] . ' ' . _T('signatures') . "</li>";
		  }
		  if ($rac) $rac = "<ul>$rac</ul>";
		  $rac = debut_cadre_enfonce('',true)
		    . "\n<div style='font-size: x-small' class='verdana1'><b>"
		    ._T('public:articles_populaires')
		    ."</b>"
		    . $rac
		    . "</div>"
		    . fin_cadre_enfonce(true);

		}
		$rac = "<br /><br /><br /><br /><br />" . $rac;
	}
	$head = _T('titre_page_controle_petition');
	$idom = "editer_signature-" . $id_article;
	$commencer_page = charger_fonction('commencer_page', 'inc');

	echo $commencer_page($head, "forum", "suivi-petition");
	echo debut_gauche('', true);
	echo $rac;
	echo debut_droite('', true);
	echo gros_titre(_T('titre_suivi_petition'),'', false);
	echo $ong; 
	echo bouton_spip_rss('signatures', $args);
	echo $titre;
	echo  "<br /><br />";
	echo "<div id='", $idom, "' class='serif2'>", $corps, "</div>";
	echo fin_gauche(), fin_page();
}
Esempio n. 11
0
function spiplistes_affdate ($date) {
	$result = "";
	if($date) {
		$proch = round((strtotime($date) - time()) / _SPIPLISTES_TIME_1_DAY);
		$result = 
			(
			($proch > 1)
			? affdate_jourcourt($date)
			: "<strong>"._T($proch ? 'date_demain' : 'date_aujourdhui')."</strong>"
			)
			. "<br />".heures_minutes($date)
			;
	}
	return($result);
}
Esempio n. 12
0
function http_calendrier_rv($messages, $type)
{
    global $lcm_lang_rtl;
    $total = '';
    if (!$messages) {
        return $total;
    }
    foreach ($messages as $row) {
        if (preg_match("/^=([^[:space:]]+)\$/", $row['texte'], $match)) {
            $url = $match[1];
        } else {
            $url = "message.php3?id_message=" . $row['id_message'];
        }
        $rv = $row['rv'] == 'oui';
        $date = $row['date_heure'];
        $date_fin = $row['date_fin'];
        if ($row['type'] == "pb") {
            $bouton = "pense-bete";
        } else {
            if ($row['type'] == "annonces") {
                $bouton = "annonce";
            } else {
                $bouton = "message";
            }
        }
        if ($rv) {
            $date_jour = affdate_jourcourt($date);
            $total .= "<tr><td colspan='2'>" . ($date_jour == $date_rv ? '' : "<div><b>{$date_jour}</b></div>") . "</td></tr>";
        }
        $total .= "<tr><td width='24' valign='middle'>" . http_href($url, $rv ? http_img_pack("rv.gif", '', http_style_background($bouton . '.gif', "no-repeat;' border='0'")) : http_img_pack("{$bouton}.gif", '', "border='0'"), '', '') . "</td>" . "<td valign='middle'>" . (!$rv ? '' : (affdate($date) == affdate($date_fin) ? "<div style='font-size: 9px;'" . http_style_background('fond-agenda.gif', "right center no-repeat; float: left; line-height: 12px; color: #666666; margin-right: 3px; padding-right: 4px;") . heures($date) . ":" . minutes($date) . "<br />" . heures($date_fin) . ":" . minutes($date_fin) . "</div>" : "<div style='font-size: 9px;'" . http_style_background('fond-agenda.gif', "right center no-repeat; float: left; line-height: 12px; color: #666666; margin-right: 3px; padding-right: 4px; text-align: center;") . heures($date) . ":" . minutes($date) . "<br />...</div>")) . "<div><b>" . http_href($url, typo($row['titre']), '', 'font-size: 10px;') . "</b></div>" . "</td>" . "</tr>\n";
        $date_rv = $date_jour;
    }
    if ($type == 'annonces') {
        $titre = _T('info_annonces_generales');
        $couleur_titre = "ccaa00";
        $couleur_texte = "black";
        $couleur_fond = "#ffffee";
    } else {
        if ($type == 'pb') {
            $titre = _T('infos_vos_pense_bete');
            $couleur_titre = "#3874B0";
            $couleur_fond = "#EDF3FE";
            $couleur_texte = "white";
        } else {
            if ($type == 'rv') {
                $titre = _T('info_vos_rendez_vous');
                $couleur_titre = "#666666";
                $couleur_fond = "#eeeeee";
                $couleur_texte = "white";
            }
        }
    }
    return debut_cadre_enfonce("", true, "", $titre) . "<table width='98%' border='0' cellpadding='0' cellspacing='2'>" . $total . "</table>" . fin_cadre_enfonce(true);
}