Example #1
0
function plugins_afficher_plugin_dist($url_page, $plug_file, $checked, $actif, $expose = false, $class_li = "item", $dir_plugins = _DIR_PLUGINS)
{
    static $id_input = 0;
    static $versions = array();
    $force_reload = _request('var_mode') == 'recalcul';
    $get_infos = charger_fonction('get_infos', 'plugins');
    $info = $get_infos($plug_file, $force_reload, $dir_plugins);
    $prefix = $info['prefix'];
    $cfg = "";
    $checkable = $dir_plugins !== _DIR_PLUGINS_DIST;
    $nom = plugin_nom($info, $dir_plugins, $plug_file);
    if (!plugin_version_compatible($info['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
        $info['slogan'] = _T('plugin_info_non_compatible_spip');
        $erreur = http_img_pack("plugin-dis-32.png", _T('plugin_info_non_compatible_spip'), " class='picto_err'", _T('plugin_info_non_compatible_spip'));
        $class_li .= " disabled";
        $checkable = false;
    } elseif (isset($info['erreur'])) {
        $class_li .= " error";
        $erreur = http_img_pack("plugin-err-32.png", _T('plugin_info_erreur_xml'), " class='picto_err'", _T('plugin_info_erreur_xml')) . "<div class='erreur'>" . join('<br >', $info['erreur']) . "</div>";
        $checkable = false;
    } elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file])) {
        $class_li .= " error";
        $erreur = http_img_pack("plugin-err-32.png", _T('plugin_impossible_activer', array('plugin' => $nom)), " class='picto_err'", _T('plugin_impossible_activer', array('plugin' => $nom))) . "<div class='erreur'>" . implode("<br />", $GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file]) . "</div>";
    } else {
        $cfg = $actif ? plugin_bouton_config($plug_file, $info, $dir_plugins) : "";
    }
    // numerotons les occurrences d'un meme prefix
    $versions[$prefix] = $id = isset($versions[$prefix]) ? $versions[$prefix] + 1 : '';
    $class_li .= ($actif ? " actif" : "") . ($expose ? " on" : "");
    return "<li id='{$prefix}{$id}' class='{$class_li}'>" . ((!$checkable and !$checked) ? '' : plugin_checkbox(++$id_input, $plug_file, $checked)) . plugin_resume($info, $dir_plugins, $plug_file, $url_page) . $cfg . $erreur . (($dir_plugins !== _DIR_PLUGINS_DIST and plugin_est_installe($plug_file)) ? plugin_desintalle($plug_file, $nom) : '') . "<div class='details'>" . (!$expose ? '' : affiche_bloc_plugin($plug_file, $info)) . "</div>" . "</li>";
}
Example #2
0
function puce_statut_site_dist($id, $statut, $id_rubrique, $type, $ajax = '', $menu_rapide = _ACTIVER_PUCE_RAPIDE)
{
    $t = sql_getfetsel("syndication", "spip_syndic", "id_syndic=" . intval($id));
    // cas particulier des sites en panne de syndic :
    // on envoi une puce speciale, et pas de menu de changement rapide
    if ($t == 'off' or $t == 'sus') {
        switch ($statut) {
            case 'publie':
                $puce = 'puce-verte-anim.gif';
                $title = _T('sites:info_site_reference');
                break;
            case 'prop':
                $puce = 'puce-orange-anim.gif';
                $title = _T('sites:info_site_attente');
                break;
            case 'refuse':
            default:
                $puce = 'puce-poubelle-anim.gif';
                $title = _T('sites:info_site_refuse');
                break;
        }
        return http_img_pack($puce, $title);
    } else {
        return puce_statut_changement_rapide($id, $statut, $id_rubrique, $type, $ajax, $menu_rapide);
    }
}
Example #3
0
function en_travaux_affichage_final($flux){
	if(defined('_en_travaux_SANSMSG') || !$GLOBALS['html']) return $flux;
	include_spip('inc/minipres'); // pour http_img_pack
	$res = '<div id="en_travaux" style="padding:6px; position:absolute; left:12px; top:22px; border-color:#CECECE #CECECE #4A4A4A; background-color:#FFEEEE; opacity:0.8; font-size:12px; border-style:solid; border-width:3px; font-weight:bold;">'
	. http_img_pack('warning-24.gif', _T('info_travaux_titre'), 'align="absmiddle"')
	. ' &nbsp;'. _T('info_travaux_titre') . '</div>';
	if (!$pos = stripos($flux, '</body>')) $pos = strlen($flux);
	return substr_replace($flux, $res, $pos, 0);
}
Example #4
0
function aider_icone($url, $clic = '')
{
    global $spip_lang, $spip_lang_rtl;
    if (!$clic) {
        $t = _T('titre_image_aide');
        $clic = http_img_pack("aide" . aide_lang_dir($spip_lang, $spip_lang_rtl) . "-16.png", _T('info_image_aide'), " title=\"{$t}\" class='aide'");
    }
    return "\n&nbsp;&nbsp;<a class='aide popin'\nhref='" . $url . "' target='_blank'>" . $clic . "</a>";
}
Example #5
0
/**
 * Inserer les infos d'agenda sur les articles et rubriques
 *
 * @param array $flux
 * @return array
 */
function agenda_affiche_milieu($flux)
{
    $e = trouver_objet_exec($flux['args']['exec']);
    $out = "";
    if ($e['type'] == 'rubrique' and autoriser('configurer') and $e['edition'] == false and $id_rubrique = intval($flux['args']['id_rubrique']) and autoriser('modifier', 'rubrique', $id_rubrique)) {
        $activer = true;
        $res = "";
        $actif = sql_getfetsel('agenda', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique));
        $statut = "-32";
        $alt = "";
        $voir = "";
        if (!sql_countsel('spip_rubriques', 'agenda=1')) {
            $res .= "<span class='small'>" . _T('agenda:aucune_rubrique_mode_agenda') . "</span><br />";
        } else {
            include_spip('inc/rubriques');
            if (sql_countsel('spip_rubriques', sql_in('id_rubrique', calcul_hierarchie_in($id_rubrique)) . " AND agenda=1 AND id_rubrique<>" . intval($id_rubrique))) {
                $alt = _T('agenda:rubrique_dans_une_rubrique_mode_agenda');
                $activer = false;
                $statut = "-ok-32";
                $voir = _T('agenda:voir_evenements_rubrique');
            } elseif (!$actif) {
                $alt = _T('agenda:rubrique_sans_gestion_evenement') . '<br />';
                $statut = "-non-32";
            }
            if ($actif) {
                $alt = _T('agenda:rubrique_mode_agenda') . '<br />';
                $statut = "-ok-32";
                $voir = _T('agenda:voir_evenements_rubrique');
            }
        }
        if (!$actif) {
            if ($activer) {
                $res .= bouton_action(_T('agenda:rubrique_activer_agenda'), generer_action_auteur('activer_agenda_rubrique', $id_rubrique, self()), 'ajax');
            }
        } else {
            $res .= bouton_action(_T('agenda:rubrique_desactiver_agenda'), generer_action_auteur('activer_agenda_rubrique', "-{$id_rubrique}", self()), 'ajax');
        }
        if ($voir) {
            $res .= " | <a href='" . generer_url_ecrire('evenements', "id_rubrique={$id_rubrique}") . "'>{$voir}</a>";
        }
        if ($res) {
            $out .= boite_ouvrir(_T('agenda:agenda') . http_img_pack("agenda{$statut}.png", $alt, "class='statut'", $alt), 'simple agenda-statut') . $res . boite_fermer();
        }
    } elseif ($e['type'] == 'article' and $e['edition'] == false) {
        $id_article = $flux['args']['id_article'];
        $out .= recuperer_fond('prive/objets/contenu/article-evenements', $flux['args']);
    }
    if ($out) {
        if ($p = strpos($flux['data'], '<!--affiche_milieu-->')) {
            $flux['data'] = substr_replace($flux['data'], $out, $p, 0);
        } else {
            $flux['data'] .= $out;
        }
    }
    return $flux;
}
/**
 * Construit le sélectionneur de hierarchie
 *
 * @param string $idom
 *     Identifiant dans le dom de l'élément
 * @param string $liste
 * @param int $racine
 * @param string $url
 * @param string $name
 * @param string $url_init
 * @return string
 *     Code HTML
 **/
function construire_selectionner_hierarchie($idom, $liste, $racine, $url, $name, $url_init = '')
{
    $idom1 = $idom . "_champ_recherche";
    $idom2 = $idom . "_principal";
    $idom3 = $idom . "_selection";
    $idom4 = $idom . "_col_1";
    $idom5 = 'img_' . $idom4;
    $idom6 = $idom . "_fonc";
    return "<div id='{$idom}'>" . "<a id='{$idom6}' style='visibility: hidden;'" . ($url_init ? "\nhref='{$url_init}'" : '') . "></a>" . "<div class='recherche_rapide_parent'>" . http_img_pack("searching.gif", "*", "style='visibility: hidden;float:" . $GLOBALS['spip_lang_right'] . "' id='{$idom5}'") . "" . "<input style='width: 100px;float:" . $GLOBALS['spip_lang_right'] . ";' type='search' id='{$idom1}'" . "\nonkeypress=\"k=event.keyCode;if (k==13 || k==3 || k==9){return false;}\"" . "\nonkeyup=\"if(event.keyCode==9){return false;};return onkey_rechercher(this.value," . "'{$idom4}'" . ",'" . $url . "'," . "this.parentNode.previousSibling.firstChild" . ",'" . $name . "','" . $idom6 . "')\"" . " />" . "\n</div>" . ($racine ? "<div>{$racine}</div>" : "") . "<div id='" . $idom2 . "'><div id='{$idom4}'" . " class=''>" . $liste . "</div></div>\n<div id='{$idom3}'></div></div>\n";
}
Example #7
0
function construire_selectionner_hierarchie($idom, $liste, $racine, $url, $name, $url_init='')
{
	global $spip_lang_right;

	$idom1 = $idom . "_champ_recherche";
	$idom2 = $idom . "_principal";
	$idom3 = $idom . "_selection";
	$idom4 = $idom . "_col_1";
	$idom5 = 'img_' . $idom4;
	$idom6 = $idom."_fonc";

	return "<div id='$idom'>"
	. "<a id='$idom6' style='visibility: hidden;'"
	. ($url_init ?  "\nhref='$url_init'" : '')
	. "></a>"
	. "<div class='recherche_rapide_parent'>"
	. http_img_pack("searching.gif", "*", "style='visibility: hidden;float:$spip_lang_right' id='$idom5'")
	. ""
	. "<input style='width: 100px;float:$spip_lang_right;' type='search' id='$idom1'"
	  // eliminer Return car il provoque la soumission (balise unique)
	  // ce serait encore mieux de ne le faire que s'il y a encore plusieurs
	  // resultats retournes par la recherche
	. "\nonkeypress=\"k=event.keyCode;if (k==13 || k==3){return false;}\""
	  // lancer la recherche apres le filtrage ci-dessus
	. "\nonkeyup=\"return onkey_rechercher(this.value,"
	  // la destination de la recherche
	. "'$idom4'"
#	. "this.parentNode.parentNode.parentNode.parentNode.nextSibling.firstChild.id"
	. ",'"
	  // l'url effectuant la recherche
	. $url
	. "',"	
	  // le noeud contenant un gif anime 
	  // . "'idom5'"
	. "this.parentNode.previousSibling.firstChild"
	. ",'"
	  // la valeur de l'attribut Name a remplir
	.  $name
	. "','"
	  // noeud invisible memorisant l'URL initiale (pour re-initialisation)
	. $idom6
	. "')\"" 
	. " />"
	. "\n</div>"
	. ($racine?"<div>$racine</div>":"")
	. "<div id='"
	.  $idom2
	.  "'><div id='$idom4'"
	. " class='arial1'>" 
	. $liste
	. "</div></div>\n<div id='$idom3'></div></div>\n";
}
Example #8
0
function inc_plonger_dist($id_rubrique, $idom = "", $list = array(), $col = 1, $exclu = 0, $do = 'aff')
{
    global $spip_lang_left;
    if ($list) {
        $id_rubrique = $list[$col - 1];
    }
    $ret = '';
    # recherche les filles et petites-filles de la rubrique donnee
    # en excluant une eventuelle rubrique interdite (par exemple, lorsqu'on
    # deplace une rubrique, on peut la deplacer partout a partir de la
    # racine... sauf vers elle-meme ou sa propre branche)
    $ordre = array();
    $rub = array();
    $res = sql_select("rub1.id_rubrique, rub1.titre, rub1.id_parent, rub1.lang, rub1.langue_choisie, rub2.id_rubrique AS id_enfant", "spip_rubriques AS rub1 LEFT JOIN spip_rubriques AS rub2 ON (rub1.id_rubrique = rub2.id_parent)", "rub1.id_parent = " . sql_quote($id_rubrique) . "\n\t\t\tAND rub1.id_rubrique!=" . sql_quote($exclu) . "\n\t\t\tAND (rub2.id_rubrique IS NULL OR rub2.id_rubrique!=" . sql_quote($exclu) . ")", "", "0+rub1.titre,rub1.titre");
    while ($row = sql_fetch($res)) {
        if (autoriser('voir', 'rubrique', $row['id_rubrique'])) {
            $rub[$row['id_rubrique']]['enfants'] = $row['id_enfant'];
            if ($row['id_parent'] == $id_rubrique) {
                $t = trim(typo(supprimer_numero($row['titre'])));
                if ($row['langue_choisie'] != 'oui') {
                    $t .= ' <small title="' . traduire_nom_langue($row['lang']) . '">[' . $row['lang'] . ']</small>';
                }
                $ordre[$row['id_rubrique']] = $t;
            }
        }
    }
    $next = isset($list[$col]) ? $list[$col] : 0;
    if ($ordre) {
        $rec = generer_url_ecrire('plonger', "rac={$idom}&exclus={$exclu}&do={$do}&col=" . ($col + 1));
        $info = generer_url_ecrire('informer', "type=rubrique&rac={$idom}&do={$do}&id=");
        $args = "'{$idom}',this,{$col},'{$spip_lang_left}','{$info}',event";
        while (list($id, $titrebrut) = each($ordre)) {
            $titre = supprimer_numero($titrebrut);
            $classe1 = $id_rubrique ? 'petite-rubrique' : "petit-secteur";
            if (isset($rub[$id]["enfants"])) {
                $classe2 = " class='rub-ouverte'";
                $url = "\nhref='{$rec}&amp;id={$id}'";
            } else {
                $classe2 = $url = '';
                $url = "\nhref='javascript:void(0)'";
            }
            $js_func = $do . '_selection_titre';
            $click = "\nonclick=\"changerhighlight(this.parentNode.parentNode.parentNode);\nreturn " . (!is_array($list) ? ' false' : "aff_selection_provisoire({$id},{$args})") . "\"\nondblclick=\"" . "{$js_func}(this." . "firstChild.nodeValue," . $id . ",'selection_rubrique','id_parent');" . "\nreturn aff_selection_provisoire({$id},{$args});" . "\"";
            $ret .= "<div class='" . ($id == $next ? "item on" : "item") . "'><div class='" . $classe1 . "'><div{$classe2}><a" . $url . $click . ">" . $titre . "</a></div></div></div>";
        }
    }
    $idom2 = $idom . "_col_" . ($col + 1);
    $left = $col * 150;
    return http_img_pack("searching.gif", "*", "style='visibility: hidden; position: absolute; {$spip_lang_left}: " . ($left - 30) . "px; top: 2px; z-index: 2;' id='img_{$idom2}'") . "<div style='width: 150px; height: 100%; overflow: auto; position: absolute; top: 0px; {$spip_lang_left}: " . ($left - 150) . "px;'>" . $ret . "\n</div>\n<div id='{$idom2}'>" . ($next ? inc_plonger_dist($id_rubrique, $idom, $list, $col + 1, $exclu) : "") . "\n</div>";
}
Example #9
0
/**
 * Afficher la puce de statut pour les documents
 *
 * @param unknown_type $id_document
 * @param unknown_type $statut
 * @param unknown_type $id_rubrique
 * @param unknown_type $type
 * @param unknown_type $ajax
 * @return unknown
 */
function medias_puce_statut_document($id_document, $statut)
{
    if ($statut == 'publie') {
        $puce = 'puce-verte.gif';
    } else {
        if ($statut == "prepa") {
            $puce = 'puce-blanche.gif';
        } else {
            if ($statut == "poubelle") {
                $puce = 'puce-poubelle.gif';
            } else {
                $puce = 'puce-blanche.gif';
            }
        }
    }
    return http_img_pack($puce, $statut, "class='puce'");
}
Example #10
0
function exec_convert_sql_utf8_dist() {
	include_spip('inc/minipres');
	include_spip('inc/charsets');
	$charset_spip = $GLOBALS['meta']['charset'];

	// Definir le titre de la page (et le nom du fichier admin)
	//$action = _T('utf8_convertir_votre_site');
	$action = _L("Conversion de la base en $charset_spip"); #volontairement non traduit (obsolete)

	// si meta deja la, c'est une reprise apres timeout.
	if ($GLOBALS['meta']['convert_sql_utf8']) {
		$base = charger_fonction('convert_sql_utf8', 'base');
		$base($action, true);
	} else {
		$charset_supporte = false;
		$utf8_supporte = false;	
		// verifier que mysql gere le charset courant pour effectuer les conversions 
		include_spip('base/abstract_sql');
		if ($c = sql_get_charset($charset_spip)){
			$sql_charset = $c['charset'];
			$sql_collation = $c['collation'];
			$charset_supporte = true;
		}
		if (!$charset_supporte) {
		  	$utf8_supporte = sql_get_charset('utf8');
			$res = _L("Le charset SPIP actuel $charset_spip n'est pas supporte par votre serveur MySQL<br/>");
			if ($utf8_supporte)
				$res .= _L("Votre serveur supporte utf-8, vous devriez convertir votre site en utf-8 avant de recommencer cette operation");
			echo minipres($action, $res);
		} else {

		$commentaire = "";
		//$commentaire = _T('utf8_convert_avertissement',
		//	array('orig' => $charset_orig,'charset' => 'utf-8'));
		$commentaire .=  "<small>"
		. http_img_pack('warning.gif', _T('info_avertissement'), "style='width: 48px; height: 48px; float: right;margin: 10px;'");
		$commentaire .= _T('utf8_convert_backup', array('charset' => 'utf-8'))
		."</small>";
		$commentaire .= '<br />'._T('utf8_convert_timeout');
		$commentaire .= "<hr />\n";

		$admin = charger_fonction('admin', 'inc');
		echo $admin('convert_sql_utf8', $action, $commentaire);
		}
	}
}
Example #11
0
function aider_icone($url, $clic= '')
{
	global $spip_lang, $spip_lang_rtl;

	if (!$clic) {
		$t = _T('titre_image_aide');
		$clic = http_img_pack("aide-12".aide_lang_dir($spip_lang,$spip_lang_rtl).".png",
			_T('info_image_aide'),
		      " title=\"$t\" class='aide'");
	}
	return "\n&nbsp;<a class='aide'\nhref='"
	.  $url
	. "'\nonclick=\"javascript:window.open(this.href,"
	. "'spip_aide', "
	. "'scrollbars=yes, resizable=yes, width=740, height=580'); "
	. "return false;\">"
	. $clic
	. "</a>";
}
Example #12
0
function exec_convert_utf8_dist() {
	include_spip('inc/minipres');
	include_spip('inc/charsets');

	// Definir le titre de la page (et le nom du fichier admin)
	$action = _T('utf8_convertir_votre_site');

	// si meta deja la, c'est une reprise apres timeout.
        if ($GLOBALS['meta']['convert_utf8'] AND $GLOBALS['meta']['admin']) {
                $admin = charger_fonction('admin', 'inc');
                echo $admin('convert_utf8', $action, '', true);
        } else {
		$charset_orig =	$GLOBALS['meta']['charset'];
		// tester si le charset d'origine est connu de spip
		if (!load_charset($charset_orig))
			convert_utf8_non($action,
					  _T('utf8_convert_erreur_orig', array('charset' => "<b>".$charset_orig."</b>")));

		// ne pas convertir si deja utf8 
		// ou si l'interface du serveur ne comprend rien
		else if (($charset_orig == 'utf-8'))
			convert_utf8_non($action,
					  _T('utf8_convert_erreur_deja',
					     array('charset' => $charset_orig)));
		else if(!sql_get_charset('utf-8'))
			convert_utf8_non($action,
					  _L('Votre version du serveur SQL ne gere pas les charset'));
		else {
		$commentaire = _T('utf8_convert_avertissement',
			array('orig' => $charset_orig,'charset' => 'utf-8'));
		$commentaire .=  "<small>"
		. http_img_pack('warning.gif', _T('info_avertissement'), "style='width: 48px; height: 48px; float: right;margin: 10px;'");
		$commentaire .= _T('utf8_convert_backup', array('charset' => 'utf-8'))
		."</small>";
		$commentaire .= '<br />'._T('utf8_convert_timeout');
		$commentaire .= "<hr />\n";

		$admin = charger_fonction('admin', 'inc');
		echo $admin('convert_utf8', $action, $commentaire);
		}
	}
}
/**
 * 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;
}
Example #14
0
/**
 * Fonction de base pour une icone dans un squelette
 * structure html : <span><a><img><b>texte</b></span>
 *
 * @param string $type
 *  'lien' ou 'bouton'
 * @param string $lien
 *  url
 * @param string $texte
 *  texte du lien / alt de l'image
 * @param string $fond
 *  objet avec ou sans son extension et sa taille (article, article-24, article-24.png)
 * @param string $fonction
 *  new/del/edit
 * @param string $class
 *  classe supplementaire (horizontale, verticale, ajax ...)
 * @param string $javascript
 *  "onclick='...'" par exemple
 * @return string 
 */
function prepare_icone_base($type, $lien, $texte, $fond, $fonction = "", $class = "", $javascript = "")
{
    if (in_array($fonction, array("del", "supprimer.gif"))) {
        $class .= ' danger';
    } elseif ($fonction == "rien.gif") {
        $fonction = "";
    } elseif ($fonction == "delsafe") {
        $fonction = "del";
    }
    // remappage des icone : article-24.png+new => article-new-24.png
    if ($icone_renommer = charger_fonction('icone_renommer', 'inc', true)) {
        list($fond, $fonction) = $icone_renommer($fond, $fonction);
    }
    // ajouter le type d'objet dans la class de l'icone
    $class .= " " . substr(basename($fond), 0, -4);
    $alt = attribut_html($texte);
    $title = " title=\"{$alt}\"";
    // est-ce pertinent de doubler le alt par un title ?
    $ajax = "";
    if (strpos($class, "ajax") !== false) {
        $ajax = "ajax";
        if (strpos($class, "preload") !== false) {
            $ajax .= " preload";
        }
        if (strpos($class, "nocache") !== false) {
            $ajax .= " nocache";
        }
        $ajax = " class='{$ajax}'";
    }
    $size = 24;
    if (preg_match("/-([0-9]{1,3})[.](gif|png)\$/i", $fond, $match)) {
        $size = $match[1];
    }
    if ($fonction) {
        // 2 images pour composer l'icone : le fond (article) en background,
        // la fonction (new) en image
        $icone = http_img_pack($fonction, $alt, "width='{$size}' height='{$size}'\n" . http_style_background($fond));
    } else {
        $icone = http_img_pack($fond, $alt, "width='{$size}' height='{$size}'");
    }
    if ($type == 'lien') {
        return "<span class='icone s{$size} {$class}'>" . "<a href='{$lien}'{$title}{$ajax}{$javascript}>" . $icone . "<b>{$texte}</b>" . "</a></span>\n";
    } else {
        return bouton_action("{$icone}<b>{$texte}</b>", $lien, "icone s{$size} {$class}", $javascript, $alt);
    }
}
Example #15
0
function statistiques_zoom($id_article, $largeur_abs, $date_premier, $date_debut, $date_fin)
{
	if ($largeur_abs > 1) {
		$inc = ceil($largeur_abs / 5);
		$duree_plus = 420 / ($largeur_abs - $inc);
		$duree_moins = 420 / ($largeur_abs + $inc);
	}

	if ($largeur_abs == 1) {
		$duree_plus = 840;
		$duree_moins = 210;
	}

	if ($largeur_abs < 1) {
		$duree_plus = 420 * ((1/$largeur_abs) + 1);
		$duree_moins = 420 * ((1/$largeur_abs) - 1);
	}

	$pour_article = $id_article ? "&id_article=$id_article" : '';

	$zoom = '';
	
	if ($date_premier < $date_debut)
		$zoom= lien_ou_expose(generer_url_ecrire("statistiques_visites","duree=$duree_plus$pour_article"),
			 http_img_pack('loupe-moins.gif',
				       _T('info_zoom'). '-',
				       "style='border: 0px; vertical-align: middle;'"), false, '',
			 "&nbsp;");
	if ( (($date_fin - $date_debut) / (24*3600)) > 30)
		$zoom .= lien_ou_expose(generer_url_ecrire("statistiques_visites","duree=$duree_moins$pour_article"),
			 http_img_pack('loupe-plus.gif',
				       _T('info_zoom'). '+',
				       "style='border: 0px; vertical-align: middle;'"), false, '',
			 "&nbsp;");

	return $zoom;
}
Example #16
0
/**
 * Nettoie un texte, traite les raccourcis autre qu'URL, la typo, etc.
 *
 * http://code.spip.net/@traiter_raccourcis
 *
 * @param string $t
 * @param bool $show_autobr
 * @return string
 */
function traiter_raccourcis($t, $show_autobr = false)
{
    static $wheel, $notes;
    static $img_br_auto, $img_br_manuel, $img_br_no;
    // hack1: respecter le tag ignore br
    if (_AUTOBR_IGNORER and strncmp($t, _AUTOBR_IGNORER, strlen(_AUTOBR_IGNORER)) == 0) {
        $ignorer_autobr = true;
        $t = substr($t, strlen(_AUTOBR_IGNORER));
    } else {
        $ignorer_autobr = false;
    }
    // Appeler les fonctions de pre_traitement
    $t = pipeline('pre_propre', $t);
    if (!isset($wheel)) {
        $ruleset = SPIPTextWheelRuleset::loader($GLOBALS['spip_wheels']['raccourcis'], 'personnaliser_raccourcis');
        $wheel = new TextWheel($ruleset);
        if (_request('var_mode') == 'wheel' and autoriser('debug')) {
            $f = $wheel->compile();
            echo "<pre>\n" . spip_htmlspecialchars($f) . "</pre>\n";
            exit;
        }
        $notes = charger_fonction('notes', 'inc');
    }
    // Gerer les notes (ne passe pas dans le pipeline)
    list($t, $mes_notes) = $notes($t);
    $t = $wheel->text($t);
    // Appeler les fonctions de post-traitement
    $t = pipeline('post_propre', $t);
    if ($mes_notes) {
        $notes($mes_notes, 'traiter', $ignorer_autobr);
    }
    // hack2: wrap des autobr dans l'espace prive, pour affichage css
    // car en css on ne sait pas styler l'element BR
    if ($ignorer_autobr and _AUTOBR) {
        if (is_null($img_br_no)) {
            $img_br_no = $show_autobr ? http_img_pack("br-no-10.png", _T("tw:retour_ligne_ignore"), "class='br-no'", _T("tw:retour_ligne_ignore")) : "";
        }
        $t = str_replace(_AUTOBR, $img_br_no, $t);
    }
    if ($show_autobr and _AUTOBR) {
        if (is_null($img_br_manuel)) {
            $img_br_manuel = http_img_pack("br-manuel-10.png", _T("tw:retour_ligne_manuel"), "class='br-manuel'", _T("tw:retour_ligne_manuel"));
        }
        if (is_null($img_br_auto)) {
            $img_br_auto = http_img_pack("br-auto-10.png", _T("tw:retour_ligne_auto"), "class='br-auto'", _T("tw:retour_ligne_auto"));
        }
        if (false !== strpos(strtolower($t), '<br')) {
            $t = preg_replace("/<br\\b.*>/UiS", "{$img_br_manuel}\\0", $t);
            $t = str_replace($img_br_manuel . _AUTOBR, $img_br_auto . _AUTOBR, $t);
        }
    }
    return $t;
}
Example #17
0
function afficher_site($id_syndic, $id_rubrique, $nom_site, $row){

	global $spip_lang_right;

	$cherche_mot = _request('cherche_mot');
	$select_groupe = _request('select_groupe');
	$id_secteur = $row["id_secteur"];
	$url_site = $row["url_site"];
	$url_syndic = $row["url_syndic"];
	$syndication = $row["syndication"];
	$statut = $row["statut"];
	$date_heure = $row["date"];
	$date_syndic = $row['date_syndic'];

	$flag_administrable = autoriser('modifier','site',$id_syndic);
	$flag_editable = ($flag_administrable OR ($GLOBALS['meta']["proposer_sites"] > 0 AND ($statut == 'prop')));

	$meme_rubrique = charger_fonction('meme_rubrique', 'inc');
	$iconifier = charger_fonction('iconifier', 'inc');
	if ($flag_editable AND ($statut == 'publie'))
		$dater = charger_fonction('dater', 'inc');
	$editer_mots = charger_fonction('editer_mots', 'inc');
	if ($flag_administrable)
		$instituer_site = charger_fonction('instituer_site','inc');

	echo debut_grand_cadre(true);
	echo afficher_hierarchie($id_rubrique);
	echo fin_grand_cadre(true);

	echo debut_gauche('', true);
	echo debut_boite_info(true);
	echo pipeline ('boite_infos', array('data' => '',
		'args' => array(
			'type'=>'site',
			'id' => $id_syndic,
			'row' => $row
			)
	));
	echo fin_boite_info(true);
	echo $iconifier('id_syndic', $id_syndic, 'sites', false, $flag_administrable);

	echo pipeline('affiche_gauche',array('args'=>array('exec'=>'sites','id_syndic'=>$id_syndic),'data'=>''));

	echo creer_colonne_droite('', true);
	echo $meme_rubrique($id_rubrique, $id_syndic, 'syndic');
	echo pipeline('affiche_droite',array('args'=>array('exec'=>'sites','id_syndic'=>$id_syndic),'data'=>''));

	echo bloc_des_raccourcis(
		icone_horizontale(_T('icone_voir_sites_references'), generer_url_ecrire("sites_tous",""), "site-24.gif","rien.gif", false)
	);


	echo debut_droite('', true);

	if ($syndication == 'off' OR $syndication == 'sus')
	  $droit = $id_rubrique;
	else $droit = 0;

	$url_affichee = $url_site;
	if (strlen($url_affichee) > 40) $url_affichee = substr($url_affichee, 0, 30)."...";

	$actions =
	 ($flag_editable ? icone_inline(_T('icone_modifier_site'), generer_url_ecrire('sites_edit',"id_syndic=$id_syndic"), "site-24.gif", "edit.gif",$spip_lang_right) : "");

	$haut =
		"<div class='bandeau_actions'>$actions</div>".
		gros_titre($nom_site?$nom_site:"("._T('info_sans_titre_2').")", '' , false)
	  . "<a href='$url_site' class='url_site'>$url_affichee</a>";

	$type = 'site';
	$contexte = array('id'=>$id_syndic,'id_rubrique'=>$id_rubrique);
	$fond = recuperer_fond("prive/contenu/$type",$contexte);
	// permettre aux plugin de faire des modifs ou des ajouts
	$fond = pipeline('afficher_contenu_objet',
			array(
			'args'=>array(
				'type'=>$type,
				'id_objet'=>$id_syndic,
				'contexte'=>$contexte),
			'data'=> $fond));
	
	$fond = "<div id='wysiwyg'>$fond</div>";

	$onglet_contenu =
		(_INTERFACE_ONGLETS?
		($statut == 'prop' ? "<p class='site_prop'>"._T('info_site_propose')." <b>".affdate($date_heure)."&nbsp;</b></p>" : "")
		 . $fond:"")

		. (($syndication == "oui" OR $syndication == "off" OR $syndication == "sus") ?
		  "<p class='site_syndique'><a href='".htmlspecialchars($url_syndic)."'>"
		  .	http_img_pack('feed.png', 'RSS').	'</a>'._T('info_site_syndique').'</p>'

			. (($syndication == "off" OR $syndication=="sus") ?
			  "<div class='site_syndique_probleme'>" . _T('avis_site_syndique_probleme', array('url_syndic' => quote_amp($url_syndic)))
			  . redirige_action_auteur('editer_site', $id_syndic, 'sites', '',
			    "<input type='hidden' name='reload' value='oui' />
			    <input type='submit' value=\""
				  . attribut_html(_T('lien_nouvelle_recuperation'))
				  . "\" class='spip_xx-small' />")
				. "</div>"
			  : "")

			. afficher_objets('syndic_article',_T('titre_articles_syndiques'), array('FROM' => 'spip_syndic_articles', 'WHERE' => "id_syndic=$id_syndic", 'ORDER BY' => "date DESC"), $id_syndic)

			. ($date_syndic ? "<div class='date_syndic'>" . _T('info_derniere_syndication').' '.affdate_heure($date_syndic) .".</div>" : "")
			. "<div class='mise_a_jour_syndic'>"
			. redirige_action_post('editer_site', $id_syndic, 'sites', "id_syndic=$id_syndic",
				"<input type='hidden' name='reload' value='oui' />
				<input type='submit' value=\""
				. attribut_html(_T('lien_mise_a_jour_syndication'))
				. "\" class='spip_xx-small' />")
			. "</div>"

			: choix_feed($id_syndic, $id_rubrique, $nom_site, $row))
		. (_INTERFACE_ONGLETS?"":($flag_administrable ? options_moderation($row) : ""))

	  ;

	$onglet_proprietes =
		(_INTERFACE_ONGLETS?"":
		$fond
		. ($statut == 'prop' ? "<p class='site_prop'>"._T('info_site_propose')." <b>".affdate($date_heure)."&nbsp;</b></p>" : "")
		)
		. afficher_site_rubrique($id_syndic, $id_rubrique, $id_secteur)
		. ($dater ? $dater($id_syndic, $flag_editable, $statut, 'syndic', 'sites', $date_heure) : "")
	  . $editer_mots('syndic', $id_syndic,  $cherche_mot,  $select_groupe, $flag_editable, true, 'sites')
	  . (_INTERFACE_ONGLETS?($flag_administrable ? options_moderation($row) : ""):"")
	  . pipeline('affiche_milieu',array('args'=>array('exec'=>'sites','id_syndic'=>$id_syndic),'data'=>''))
	  ;

	$discuter = charger_fonction('discuter', 'inc');
	$onglet_discuter = $discuter($id_syndic, 'sites', 'id_syndic');
	$onglet_documents = "" ;
	$onglet_interactivite = "";

	echo
	  "<div class='fiche_objet'>"
	  . $haut
	  . afficher_onglets_pages(array(
	  	'voir' => _T('onglet_contenu'),
	  	'props' => _T('onglet_proprietes'),
	  	'docs' => _T('onglet_documents'),
	  	'interactivite' => _T('onglet_interactivite'),
	  	'discuter' => _T('onglet_discuter')),
	  _INTERFACE_ONGLETS?
	  array(
	    'voir'=>$onglet_contenu,
	    'props'=>$onglet_proprietes,
	    'docs'=>$onglet_documents,
	    'interactivite'=>$onglet_interactivite,
	    'discuter'=>$onglet_discuter)
	  :array(
	    'props'=>$onglet_proprietes,
	    'voir'=>$onglet_contenu	    )
	   )
	  . "</div>"
	  . (_INTERFACE_ONGLETS?"":$onglet_discuter);
}
Example #18
0
function puce_statut($statut, $atts='') {
	switch ($statut) {
		case 'publie':
			$img = 'puce-verte.gif';
			$alt = _T('info_article_publie');
			return http_img_pack($img, $alt, $atts);
		case 'prepa':
			$img = 'puce-blanche.gif';
			$alt = _T('info_article_redaction');
			return http_img_pack($img, $alt, $atts);
		case 'prop':
			$img = 'puce-orange.gif';
			$alt = _T('info_article_propose');
			return http_img_pack($img, $alt, $atts);
		case 'refuse':
			$img = 'puce-rouge.gif';
			$alt = _T('info_article_refuse');
			return http_img_pack($img, $alt, $atts);
		case 'poubelle':
			$img = 'puce-poubelle.gif';
			$alt = _T('info_article_supprime');
			return http_img_pack($img, $alt, $atts);
	}
	return http_img_pack($img, $alt, $atts);
}
Example #19
0
function afficher_tranches_requete($num_rows, $idom, $url='', $nb_aff = 10, $old_arg=NULL) {
	static $ancre = 0;
	global $browser_name, $spip_lang_right, $spip_display;
	if ($old_arg!==NULL){ // eviter de casser la compat des vieux appels $cols_span ayant disparu ...
		$idom = $url;		$url = $nb_aff; $nb_aff=$old_arg;
	}

	$ancre++;
	$self = self();
	$ie_style = ($browser_name == "MSIE") ? "height:1%" : '';
	$style = "style='visibility: hidden; float: $spip_lang_right'";
	$nav= navigation_pagination($num_rows, $nb_aff, $url, _request($idom), $idom, true);
	$script = parametre_url($self, $idom, -1);
	$l = htmlentities(_T('lien_tout_afficher'));

	return http_img_pack("searching.gif", "*", "$style id='img_$idom'")
	  . "\n<div style='$ie_style;' class='arial1 tranches' id='a$ancre'>"
	  . $nav
	  . "<a href='$script#a$ancre' class='plus'"
	  . (!$url ? '' : generer_onclic_ajax($url, $idom,-1))
	  . "><img title=\"$l\" alt=\"$l\"\nsrc=\""
	  . chemin_image("plus.gif")
	  . "\" /></a></div>\n";
}
Example #20
0
function http_label_img($statut, $etat, $var, $img, $texte) {
	return  
		"<label for='$statut'>" .
		boutonne('checkbox',
			$var . '[]',
			$statut,
			(($etat !== false) ? ' checked="checked" ' : '') .
			"id='$statut'") .
		"&nbsp;" . 
		http_img_pack($img, $texte, "style='width: 8px; height: 9px; border: 0px;'", $texte) .
		" " .
		$texte .
		"</label>" .
		"<br />\n";
}
Example #21
0
function redirige_formulaire($url, $equiv = '', $format = 'message')
{
    if (!_AJAX and !headers_sent() and !_request('var_ajax')) {
        redirige_par_entete(str_replace('&amp;', '&', $url), $equiv);
    } elseif ($format == 'ajaxform' and preg_match(',^#[0-9a-z\\-_]+$,i', $url)) {
        return array("<a href='{$url}' name='ajax_ancre' style='display:none;'>anchor</a>", '');
    } else {
        // ne pas laisser passer n'importe quoi dans l'url
        $url = str_replace(array('<', '"'), array('&lt;', '&quot;'), $url);
        $url = strtr($url, "\n\r", "  ");
        # en theorie on devrait faire ca tout le temps, mais quand la chaine
        # commence par ? c'est imperatif, sinon l'url finale n'est pas la bonne
        if ($url[0] == '?') {
            $url = url_de_base() . $url;
        }
        $url = str_replace('&amp;', '&', $url);
        spip_log("redirige formulaire ajax: {$url}");
        include_spip('inc/filtres');
        if ($format == 'ajaxform') {
            return array('<a href="' . quote_amp($url) . '" name="ajax_redirect"  style="display:none;">' . _T('navigateur_pas_redirige') . '</a>', '<br /><a href="' . quote_amp($url) . '">' . _T('navigateur_pas_redirige') . '</a>');
        } else {
            return "<script type='text/javascript'>if (parent.window){parent.window.document.location.replace(\"{$url}\");} else {document.location.replace(\"{$url}\");}</script>" . http_img_pack('searching.gif', '') . '<br />' . '<a href="' . quote_amp($url) . '">' . _T('navigateur_pas_redirige') . '</a>';
        }
    }
}
Example #22
0
function inc_couleurs_dist($choix=NULL,$ajouter = false)
{
	static $couleurs_spip = array(
// Vert de gris
1 => array (
		"couleur_foncee" => "#999966",
		"couleur_claire" => "#CCCC99",
		"couleur_lien" => "#666633",
		"couleur_lien_off" => "#999966"
		),
// Rose vieux
2 => array (
		"couleur_foncee" => "#EB68B3",
		"couleur_claire" => "#E4A7C5",
		"couleur_lien" => "#8F004D",
		"couleur_lien_off" => "#BE6B97"
		),
// Orange
3 => array (
		"couleur_foncee" => "#fa9a00",
		"couleur_claire" => "#ffc000",
		"couleur_lien" => "#FF5B00",
		"couleur_lien_off" => "#B49280"
		),
//  Bleu truquoise
4 => array (
		"couleur_foncee" => "#5da7c5",
		"couleur_claire" => "#97d2e1",
		"couleur_lien" => "#116587",
		"couleur_lien_off" => "#81B7CD"
		),
// Violet
5 => array (
		"couleur_foncee" => "#8F8FBD",
		"couleur_claire" => "#C4C4DD",
		"couleur_lien" => "#6071A5",
		"couleur_lien_off" => "#5C5C8C"
		),
//  Gris
6 => array (
		"couleur_foncee" => "#909090",
		"couleur_claire" => "#D3D3D3",
		"couleur_lien" => "#808080",
		"couleur_lien_off" => "#909090"
		),
);

	if (is_numeric($choix)) {
		// Compatibilite ascendante (plug-ins notamment)
		$GLOBALS["couleur_claire"] = $couleurs_spip[$choix]['couleur_claire'];
		$GLOBALS["couleur_foncee"] = $couleurs_spip[$choix]['couleur_foncee'];
		$GLOBALS["couleur_lien"] = $couleurs_spip[$choix]['couleur_lien'];
		$GLOBALS["couleur_lien_off"] = $couleurs_spip[$choix]['couleur_lien_off'];
		
	  return
	    "couleur_claire=" .
	    substr($couleurs_spip[$choix]['couleur_claire'],1).
	    '&couleur_foncee=' .
	    substr($couleurs_spip[$choix]['couleur_foncee'],1);
	} else {
		if (is_array($choix)) {
			if ($ajouter) {
				return $couleurs_spip = $couleurs_spip + $choix;
			} else {
				return $couleurs_spip = $choix;
			}
		}

		$evt = '
onmouseover="changestyle(\'bandeauinterface\');"
onfocus="changestyle(\'bandeauinterface\');"
onblur="changestyle(\'bandeauinterface\');"';

		$bloc = '';
		$ret = self('&');
		foreach ($couleurs_spip as $key => $val) {
			$bloc .=
			'<a href="'
			  . generer_action_auteur('preferer',"couleur:$key",$ret)
				. '"'
			. ' rel="'.generer_url_public('style_prive','ltr='
				. $GLOBALS['spip_lang_left'] . '&'
				. inc_couleurs_dist($key)).'"'
			  . $evt
			.'>'
			. http_img_pack("rien.gif",
					_T('choix_couleur_interface') . $key,
					"width='8' height='8' style='margin: 1px; background-color: "	. $val['couleur_claire'] . ";'")
			. "</a>";
		}

		// Ce js permet de changer de couleur sans recharger la page

		return  '<span id="selecteur_couleur">'
		.  $bloc
		. "</span>\n"
		. '<script type="text/javascript"><!--' . "
			$('#selecteur_couleur a')
			.click(function(){
				$('head>link#cssprivee')
				.clone()
				.removeAttr('id')
				.attr('href', $(this).attr('rel'))
				.appendTo($('head'));

				$.get($(this).attr('href'));
				return false;
			});
		// --></script>\n";


	}
}
Example #23
0
function onglet($texte, $lien, $onglet_ref, $onglet, $icone = "")
{
    return "<li>" . ($icone ? http_img_pack($icone, '', " class='cadre-icone'") : '') . lien_ou_expose($lien, $texte, $onglet == $onglet_ref) . "</li>";
}
Example #24
0
function afficher_forum_4($compteur_forum, $nb_forum, $thread)
{
	global $spip_lang_rtl;
	$fleche2="forum-droite$spip_lang_rtl.gif";
	$fleche='rien.gif';
	$vertical = chemin_image('forum-vert.gif');
	$rien = chemin_image('rien.gif');
	$res = '';
	for ($j=2;$j<=$compteur_forum AND $j<20;$j++){
		$res .= "<td style='width: 10px; vertical-align: top; background-image: url("
		. (($thread[$j]!=$nb_forum[$j]) ? $vertical : $rien)
		.  ");'>"
		. http_img_pack(($j==$compteur_forum) ? $fleche2 : $fleche, "", "width='10' height='13'")
		. "</td>\n";
	}
	return $res;
}
Example #25
0
function rejouer_session()
{
	include_spip('inc/filtres');
	return	  http_img_pack('rien.gif', " ", "id='img_session' width='0' height='0'") .
		  http_script("\ndocument.img_session.src='" . generer_url_action('cookie','change_session=oui', true) .  "'");
}
Example #26
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);
}
Example #27
0
/**
 * Afficher un petit "i" pour lien vers autre page
 *
 * @param string $lien
 * 		URL du lien desire
 * @param string $titre
 * 		Titre au survol de l'icone pointant le lien
 * @param string $titre_lien
 * 		Si present, ajoutera en plus apres l'icone
 * 		un lien simple, vers la meme URL,
 * 		avec le titre indique
 * 
 * @return string
 */
function afficher_plus_info($lien, $titre = "+", $titre_lien = "")
{
    $titre = attribut_html($titre);
    $icone = "\n<a href='{$lien}' title='{$titre}' class='plus_info'>" . http_img_pack("information-16.png", $titre) . "</a>";
    if (!$titre_lien) {
        return $icone;
    } else {
        return $icone . "\n<a href='{$lien}'>{$titre_lien}</a>";
    }
}
Example #28
0
function installer_gadgets($id_rubrique)
{
	return "<a id='boutonbandeautoutsite' href='"
	. generer_url_ecrire("articles_tous")
	. "' class='icone26' onmouseover=\"changestyle('bandeautoutsite');\" onfocus=\"changestyle('bandeautoutsite');\" onblur=\"changestyle('bandeautoutsite');\">"
	. http_img_pack("tout-site.png", _T('icone_site_entier'), "width='26' height='20'")
	. "</a>"
	. "<a id='boutonbandeaunavrapide' href='"
	. generer_url_ecrire("brouteur",($id_rubrique ? "id_rubrique=$id_rubrique" : ''))
	. "' class='icone26' onmouseover=\"changestyle('bandeaunavrapide');\" onfocus=\"changestyle('bandeaunavrapide');\" onblur=\"changestyle('bandeaunavrapide');\">"
	. http_img_pack("naviguer-site.png",  _T('icone_brouteur'), "width='26' height='20'")
	."</a>"
	. "<a href='"
	. generer_url_ecrire("recherche")
	. "' class='icone26' onmouseover=\"changestyle('bandeaurecherche'); jQuery('#form_recherche')[0].focus();\" onfocus=\"changestyle('bandeaurecherche');\" onblur=\"changestyle('bandeaurecherche');\">"
	. http_img_pack("loupe.png", _T('info_rechercher'), "width='26' height='20'")
	."</a>"

	. (($GLOBALS['meta']['messagerie_agenda'] != 'non')
		? http_img_pack("rien.gif", "", "width='10'")
		. "<a id='boutonbandeauagenda' href='"
		. generer_url_ecrire("calendrier","type=semaine")
		. "' class='icone26' onmouseover=\"changestyle('bandeauagenda');\">"
		. http_img_pack("cal-rv.png", _T('icone_agenda'), "width='26' height='20'")
		."</a>"
		. "<a href='"
		. generer_url_ecrire("messagerie")
		. "' class='icone26' onmouseover=\"changestyle('bandeaumessagerie');\" onfocus=\"changestyle('bandeaumessagerie');\" onblur=\"changestyle('bandeaumessagerie');\">"
		. http_img_pack("cal-messagerie.png", _T('icone_messagerie_personnelle'), "width='26' height='20'")
		."</a>"
		. "<a href='"
		. generer_url_ecrire("synchro")
		. "' class='icone26' onmouseover=\"changestyle('bandeausynchro');\" onfocus=\"changestyle('bandeausynchro');\" onblur=\"changestyle('bandeausynchro');\">"
		. http_img_pack("cal-suivi.png", _T('icone_suivi_activite'), "width='26' height='20'")
		. "</a>"
	: '');
}
Example #29
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();

}
Example #30
0
function forum_envoi_entete($parent, $titre_parent, $texte, $titre, $nom_site, $url_site)
{
	global $spip_lang_rtl;

	return "\n<br /><br /><table width='100%' cellpadding='0' cellspacing='0' border='0'>"
		. (!$parent ? '' : "<tr><td colspan='2'>$parent</td></tr>")
		. "<tr>"
		. (!$parent ? "<td colsan='2'"
			: (" <td style='width: 10px; background-image: url("
			   . chemin_image('forum-vert.gif')
			   . ");'>"
			   . http_img_pack('rien.gif', ' ', " style='width: 0px; height: 0px; border: 0px;'")
			   . "</td>\n<td "))
		.  " style='width: 100%' valign='top' rowspan='2'>"
		.  debut_cadre_thread_forum("", true, "", typo($titre))
		. propre($texte)
		. (!$nom_site ? '' : "<p><a href='$url_site'>$nom_site</a></p>")
		. "\n<div style='text-align: right'><input type='submit' name='valider_forum' value='"
		. _T('bouton_envoyer_message')
		. "'\nonclick='AjaxNamedSubmit(this)' /></div>"
		. fin_cadre_thread_forum(true)
		. "</td>"
		. "</tr>\n"
		. (!$parent ? ''
			: ("<tr><td valign='top' style='width: 10px; background-image: url("
			  . chemin_image('rien.gif')
			  . ");'>"
			  .  http_img_pack("forum-droite$spip_lang_rtl.gif",
					    '&nbsp;', 
					   " style='width: 10px; height: 13px'")
		      . "</td>\n</tr>"))
		. "</table>";
}