Beispiel #1
0
function barre_onglets($rubrique, $ongletCourant, $class = "barre_onglet")
{
    include_spip('inc/presentation');
    $res = '';
    foreach (definir_barre_onglets($rubrique) as $exec => $onglet) {
        $url = $onglet->url ? $onglet->url : generer_url_ecrire($exec);
        $res .= onglet(_T($onglet->libelle), $url, $exec, $ongletCourant, $onglet->icone);
    }
    return !$res ? '' : debut_onglet($class) . $res . fin_onglet();
}
function ckeditor_barre_onglets($rubrique, $ongletCourant, $class="barre_onglet"){
	include_spip('inc/presentation');
	include_spip('inc/ckeditor_constantes') ;

	$res = '';

	$cpt = 0 ;

	foreach(definir_barre_onglets($rubrique) as $exec => $onglet) {
		if ($cpt==_CKE_MAX_ONGLETS) {
			$cpt = 0 ;
			$res .= '</tr><tr>' ;
		} else {
			$cpt++ ;
		}

		$url= $onglet->url ? $onglet->url : generer_url_ecrire($exec);
		$res .= onglet(_T($onglet->libelle), $url, $exec, $ongletCourant, $onglet->icone);

	}

	return  !$res ? '' : (debut_onglet($class) . $res . fin_onglet());
}
Beispiel #3
0
/**
 * Affichage spécifique de la page de gestion des plugins 
 *
 * Affiche la liste des plugins demandés et les erreurs éventuelles.
 *
 * @uses plugin_donne_erreurs()
 * @uses liste_chemin_plugin()
 * @uses plugin_installes_meta()
 * @uses affiche_les_plugins_verrouilles()
 * 
 * @pipeline_appel affiche_gauche
 * @pipeline_appel affiche_droit
 * @pipeline_appel affiche_milieu
 * 
 * @param string $quoi
 *     Quels plugins afficher ? actifs, ou autre
 * @param string $erreur
 *     Erreur éventuelle à afficher
 * @param string $format
 *     Format d'affichage (liste ou arborescence)
**/
function admin_plug_args($quoi, $erreur, $format)
{
    if (!$quoi) {
        $quoi = 'actifs';
    }
    // empecher l'affichage des erreurs dans le bandeau, on le donne ensuite
    // format brut par plugin
    $GLOBALS['erreurs_activation_raw'] = plugin_donne_erreurs(true, false);
    // format resume mis en forme
    $erreur_activation = plugin_donne_erreurs();
    $commencer_page = charger_fonction('commencer_page', 'inc');
    echo $commencer_page(_T('icone_admin_plugin'), "configuration", "plugin");
    echo debut_gauche('plugin', true);
    echo recuperer_fond('prive/squelettes/navigation/configurer', array('exec' => 'admin_plugin'));
    echo pipeline('affiche_gauche', array('args' => array('exec' => 'admin_plugin'), 'data' => afficher_librairies()));
    echo debut_droite('plugin', true);
    echo gros_titre(_T('icone_admin_plugin'), '', false);
    // Barre d'onglets de premier niveau
    echo barre_onglets("plugins", "plugins_actifs");
    // Barre d'onglets de second niveau
    $onglet2 = $quoi == 'actifs' ? 'plugins_actifs' : 'admin_plugin';
    echo debut_onglet('onglets_simple second');
    echo onglet(_T('plugins_tous_liste'), generer_url_ecrire("admin_plugin", "voir=tous"), 'admin_plugin', $onglet2);
    echo onglet(_T('plugins_actifs_liste'), generer_url_ecrire("admin_plugin"), 'plugins_actifs', $onglet2);
    echo fin_onglet();
    // message d'erreur au retour d'une operation
    if ($erreur) {
        echo "<div class='error'>{$erreur}</div>";
    }
    if ($erreur_activation) {
        echo "<div class='error'>{$erreur_activation}</div>";
    }
    // la mise a jour de cette meta a ete faite par ecrire_plugin_actifs
    $actifs = unserialize($GLOBALS['meta']['plugin']);
    $lcpa = $actifs + unserialize($GLOBALS['meta']['plugin_attente']);
    // Les affichages se basent sur le repertoire, pas sur le nom
    $actifs = liste_chemin_plugin($actifs, '');
    if (defined('_DIR_PLUGINS_SUPPL')) {
        $lcpas = liste_chemin_plugin($lcpa, _DIR_PLUGINS_SUPPL);
    }
    $lcpa = liste_chemin_plugin($lcpa);
    // on installe les plugins maintenant,
    // cela permet aux scripts d'install de faire des affichages (moches...)
    plugin_installes_meta();
    echo "<div class='liste-plugins formulaire_spip'>";
    echo debut_cadre_trait_couleur('plugin-24.png', true, '', _T('plugins_liste'), 'plugins');
    if ($quoi !== 'actifs') {
        $lpf = liste_plugin_files();
        if ($lpf) {
            echo "<p>" . _T('texte_presente_plugin') . "</p>";
        } else {
            if (!@is_dir(_DIR_PLUGINS)) {
                echo "<p>" . _T('plugin_info_automatique_ftp', array('rep' => joli_repertoire(_DIR_PLUGINS))) . " &mdash; " . _T('plugin_info_automatique_creer') . "</p>";
            }
        }
        $lcpaffiche = $lpf;
        if (defined('_DIR_PLUGINS_SUPPL')) {
            $lcpaffichesup = liste_plugin_files(_DIR_PLUGINS_SUPPL);
        }
    } else {
        // la liste
        // $quoi=='actifs'
        $lcpaffiche = $lcpa;
        if (defined('_DIR_PLUGINS_SUPPL')) {
            $lcpaffichesup = $lcpas;
        }
    }
    if ($quoi == 'actifs' or $lpf) {
        $nb = count($lcpa);
        if (defined('_DIR_PLUGINS_SUPPL')) {
            $nb += count($lcpas);
        }
        echo "<h3>" . sinon(singulier_ou_pluriel($nb, 'plugins_actif_un', 'plugins_actifs', 'count'), _T('plugins_actif_aucun')) . "</h3>";
    }
    if (empty($format)) {
        $format = 'liste';
    } elseif (!in_array($format, array('liste', 'repertoires'))) {
        $format = 'repertoires';
    }
    $afficher = charger_fonction("afficher_{$format}", 'plugins');
    $corps = $afficher(self(), $lcpaffiche, $lcpa, $actifs);
    if (defined('_DIR_PLUGINS_SUPPL')) {
        $corps .= $afficher(self(), $lcpaffichesup, $lcpas, $actifs, _DIR_PLUGINS_SUPPL);
    }
    if ($corps) {
        $corps .= "\n<div class='boutons' style='display:none;'>" . "<input type='submit' class='submit save' value='" . _T('bouton_enregistrer') . "' />" . "</div>";
    }
    echo redirige_action_post('activer_plugins', 'activer', 'admin_plugin', '', $corps);
    echo fin_cadre_trait_couleur(true);
    if ($quoi == 'actifs') {
        echo affiche_les_plugins_verrouilles($actifs);
    }
    echo "</div>";
    echo http_script("\n\tjQuery(function(){\n\t\tjQuery('.plugins li.item a[rel=info]').click(function(){\n\t\t\tvar li = jQuery(this).parents('li').eq(0);\n\t\t\tvar prefix = li.find('input.checkbox').attr('name');\n\t\t\tif (!jQuery('div.details',li).html()) {\n\t\t\t\tjQuery('div.details',li).prepend(ajax_image_searching).load(\n\t\t\t\t\tjQuery(this).attr('href').replace(/admin_plugin|plugins/, 'info_plugin'), function(){\n\t\t\t\t\t\tli.addClass('on');\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (jQuery('div.details',li).toggle().is(':visible'))\n\t\t\t\t\tli.addClass('on');\n\t\t\t\telse\n\t\t\t\t\tli.removeClass('on');\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tjQuery('.plugins li.item input.checkbox').change(function(){\n\t\t\tjQuery(this).parents('form').eq(0).find('.boutons').slideDown();\n\t\t});\n\t});\n\t");
    echo pipeline('affiche_milieu', array('args' => array('exec' => 'admin_plugin'), 'data' => ''));
    echo fin_gauche(), fin_page();
}
Beispiel #4
0
function barre_onglets($rubrique, $ongletCourant){

	$res = '';

	foreach(definir_barre_onglets($rubrique) as $exec => $onglet) {
		$url= $onglet->url ? $onglet->url : generer_url_ecrire($exec);
		$res .= onglet(_T($onglet->libelle), $url, $exec, $ongletCourant, $onglet->icone);
	}

	return  !$res ? '' : (debut_onglet() . $res . fin_onglet());
}
Beispiel #5
0
 function barre_onglets()
 {
     // determiner les onglets a cacher et a mettre en surbrillance
     if ($onglets = lister_onglets_cfg()) {
         foreach ($onglets as $fonds => $ong) {
             $o = $ong['onglet'];
             // onglet actif
             if ($o == 'oui') {
                 $ong['actif'] = $fonds == _request('cfg');
             }
             // rendre actif un parent si l'enfant est actif (onglet=nom_du_parent
             // (/!\ ne pas le desactiver s'il a deja ete mis actif)
             if ($o && $o != 'oui' && $o != 'non') {
                 if (!isset($onglets[$o])) {
                     $onglets[$o] = array();
                 }
                 if (!isset($onglets[$o]['enfant_actif'])) {
                     $onglets[$o]['enfant_actif'] = false;
                 }
                 $onglets[$o]['enfant_actif'] = ($onglets[$o]['enfant_actif'] or $fonds == _request('cfg'));
             }
         }
     }
     // retourner le code des onglets selectionnes
     $res = "";
     if ($onglets) {
         $res = debut_onglet();
         $n = -1;
         foreach ($onglets as $titre => $args) {
             if ($args['afficher']) {
                 // Faire des lignes s'il y en a effectivement plus de 6
                 if (!(++$n % 6) && $n > 0) {
                     $res .= fin_onglet() . debut_onglet();
                 }
                 $res .= onglet($args['titre'], $args['url'], 'cfg', $args['actif'] || $args['enfant_actif'], $args['icone']);
             }
         }
         $res .= fin_onglet();
     }
     return $res;
 }
Beispiel #6
0
function exec_controle_forum_args2($id_rubrique, $type, $debut, $pas, $enplus, $recherche, $from, $where, $debut_id_forum)
{
	// Si un id_controle_forum est demande, on adapte le debut
	if ($debut_id_forum
	AND (NULL !== ($d = sql_getfetsel('date_heure', 'spip_forum', "id_forum=$debut_id_forum")))) {
	  $debut = sql_countsel($from, $where . (" AND F.date_heure > '$d'"));
	}

	if ($recherche)
	  $args = 'recherche='.rawurlencode($recherche).'&';
	else $args = '';

	$args .= (!$id_rubrique ? "" : "id_rubrique=$id_rubrique&") . 'type=';

	$query = array('SELECT' => "F.id_forum, F.id_parent, F.id_rubrique, F.id_article, F.id_breve, F.date_heure, F.titre, F.texte, F.auteur, F.email_auteur, F.nom_site, F.url_site, F.statut, F.ip, F.id_auteur",
		       'FROM' => $from,
		       'WHERE' => $where,
		       'GROUP BY' => "",
		       'ORDER BY' => "F.date_heure DESC");
  
	$nav = affiche_navigation_forum($query, 'controle_forum', $args . $type, $debut, $pas, $enplus);

	$select = sql_select($query['SELECT'], $query['FROM'], $query['WHERE'], $query['GROUP BY'], $query['ORDER BY'], $query['LIMIT']);
	
	$res = '';
	while ($row = sql_fetch($select)) 
		$res .= controle_forum_boucle($row, "$args$type&debut=$debut");
	$res =  "<br />$nav<br />$res<br />$nav";	

	if (_AJAX) {
		ajax_retour($res);
	} else {
		pipeline('exec_init',array('args'=>array('exec'=>'controle_forum', 'type'=>$type),'data'=>''));

		$commencer_page = charger_fonction('commencer_page', 'inc');
		echo $commencer_page(_T('titre_page_forum_suivi'), "forum", "forum-controle");

		echo "<br /><br /><br />";
		echo gros_titre(_T('titre_forum_suivi'),'',false);

		echo debut_onglet();
		echo onglet(_T('onglet_messages_publics'), generer_url_ecrire('controle_forum', $args . "public"), "public", $type=='public', "forum-public-24.gif");
		echo onglet(_T('onglet_messages_internes'), generer_url_ecrire('controle_forum', $args . "interne"), "interne", $type=='interne', "forum-interne-24.gif");

		list($from,$where) = critere_statut_controle_forum('vide', $id_rubrique);
		$n = sql_fetsel('1', $from, $where);
		if ($n) echo onglet(_T('onglet_messages_vide'), generer_url_ecrire('controle_forum', $args . "vide"), "vide", $type=='vide');

		list($from,$where) = critere_statut_controle_forum('prop', $id_rubrique);
		$f = sql_fetsel('1', $from, $where);
		if ($f)
			echo onglet(_T('texte_statut_attente_validation'), generer_url_ecrire('controle_forum', $args . "prop"), "prop", $type=='prop');

		echo fin_onglet();

		echo debut_gauche('', true);
		echo debut_boite_info(true);
		echo "<span class='verdana1 spip_small'>", _T('info_gauche_suivi_forum_2'), aide("suiviforum"), "</span>";

		// Afficher le lien RSS

		echo bouton_spip_rss("forums_$type");

		echo fin_boite_info(true);
			
		echo pipeline('affiche_gauche',array('args'=>array('exec'=>'controle_forum', 'type'=>$type),'data'=>''));
		echo creer_colonne_droite('', true);
		echo pipeline('affiche_droite',array('args'=>array('exec'=>'controle_forum', 'type'=>$type),'data'=>''));
			
		echo debut_droite('', true);
		echo pipeline('affiche_milieu',array('args'=>array('exec'=>'controle_forum', 'type'=>$type),'data'=>''));

		echo formulaire_recherche("controle_forum","<input type='hidden' name='type' value='$type' />");
		echo "<div class='nettoyeur'></div>";
		echo "<div id='controle_forum' class='serif2'>", $res, "</div>";
		echo fin_gauche(), fin_page();
	}
}
Beispiel #7
0
function controle_petition_onglet($id_article, $debut, $type, $arg='')
{
	$arg .= ($id_article ? "id_article=$id_article&" :'');
	$arg2 = ($debut ? "debut=$debut&" : '');
	if ($type=='public') {
	  $argp = $arg2;
	  $argi = '';
	} else {
	  $argi = $arg2;
	  $argp = '';
	}

	return debut_onglet()
	  . onglet(_T('titre_signatures_confirmees'), generer_url_ecrire('controle_petition', $argp . $arg . "type=public"), "public", $type=='public', "forum-public-24.gif")
	.  onglet(_T('titre_signatures_attente'), generer_url_ecrire('controle_petition', $argi . $arg .  "type=interne"), "interne", $type=='interne', "forum-interne-24.gif")
	. fin_onglet()
	. '<br />';
}