当前位置: 首页>>代码示例>>PHP>>正文


PHP lang_select函数代码示例

本文整理汇总了PHP中lang_select函数的典型用法代码示例。如果您正苦于以下问题:PHP lang_select函数的具体用法?PHP lang_select怎么用?PHP lang_select使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了lang_select函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: menu_lang_pour_tous

function menu_lang_pour_tous($nom, $default) {
	include_spip('inc/lang');

	if ($GLOBALS['spip_lang'] <> $default) {
		$opt = lang_select($default);	# et remplace
		if ($GLOBALS['spip_lang'] <> $default) {
			$default = '';	# annule tout choix par defaut
			if ($opt) lang_select();
		}
	}

	$opt = liste_options_langues($nom, $default);
	if (!$opt)
		return '';

	# lien a partir de /
	$cible = parametre_url(self(), 'lang' , '', '&');
	$post = generer_url_action('converser', 'redirect='. rawurlencode($cible), '&');

	return array('formulaires/menu_lang',
		3600,
		array('nom' => $nom,
			'url' => $post,
			'langues' => $opt
		)
	);
}
开发者ID:rhertzog,项目名称:lcs,代码行数:27,代码来源:menu_lang_ecrire.php

示例2: lister_traductions

function lister_traductions($id_trad, $objet)
{
    $table_objet_sql = table_objet_sql($objet);
    $primary = id_table_objet($objet);
    $rows = sql_allfetsel("{$primary} as id,lang", $table_objet_sql, 'id_trad=' . intval($id_trad));
    lang_select();
    return $rows;
}
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:8,代码来源:objets-trad_fonctions.php

示例3: BOUCLE_articleshtml_ce97d1249b67fffb20134bd49b8a9e29

function BOUCLE_articleshtml_ce97d1249b67fffb20134bd49b8a9e29(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'articles';
        $command['id'] = '_articles';
        $command['from'] = array('articles' => 'spip_articles', 'L1' => 'spip_auteurs_liens');
        $command['type'] = array();
        $command['groupby'] = array("articles.id_article");
        $command['select'] = array("articles.titre", "articles.id_article", "articles.lang", "articles.texte", "articles.descriptif", "articles.chapo", "articles.date");
        $command['orderby'] = array('articles.titre');
        $command['join'] = array('L1' => array('articles', 'id_objet', 'id_article', 'L1.objet=' . sql_quote('article')));
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), array('=', 'L1.id_auteur', sql_quote($Pile[$SP]['id_auteur'], '', 'bigint(21) NOT NULL DEFAULT \'0\'')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/auteur.html', 'html_ce97d1249b67fffb20134bd49b8a9e29', '_articles', 39, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t1 = '
			<h3><a href="' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '/spip.php?action=converser&amp;redirect=' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '%2F' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '&amp;var_lang=' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" hreflang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" ' . (($t1 = strval(interdire_scripts(entites_html(textebrut(filtre_introduction_dist($Pile[$SP]['descriptif'], strlen($Pile[$SP]['descriptif']) ? '' : $Pile[$SP]['chapo'] . "\n\n" . $Pile[$SP]['texte'], 500, $connect, null)))))) !== '' ? 'title="' . $t1 . '"' : '') . '>' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a></h3>
			<div class="detail">
				' . interdire_scripts(nom_jour(normaliser_date($Pile[$SP]['date']))) . ' ' . interdire_scripts(affdate(normaliser_date($Pile[$SP]['date']))) . '
			</div>
		';
            $t0 .= (strlen($t1) && strlen($t0) ? '<br />' : '') . $t1;
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_articles @ squelettes/auteur.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:47,代码来源:html_ce97d1249b67fffb20134bd49b8a9e29.php

示例4: BOUCLE_art_agendahtml_78503d8cb0bd66f2d97f4b9c0f7d329a

function BOUCLE_art_agendahtml_78503d8cb0bd66f2d97f4b9c0f7d329a(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'articles';
        $command['id'] = '_art_agenda';
        $command['from'] = array('articles' => 'spip_articles', 'L1' => 'spip_mots_liens', 'L2' => 'spip_mots');
        $command['type'] = array();
        $command['groupby'] = array("articles.id_article");
        $command['select'] = array("articles.date_redac", "articles.id_article", "articles.texte", "articles.descriptif", "articles.chapo", "articles.titre", "articles.lang");
        $command['orderby'] = array('articles.date_redac');
        $command['join'] = array('L1' => array('articles', 'id_objet', 'id_article', 'L1.objet=' . sql_quote('article')), 'L2' => array('L1', 'id_mot'));
        $command['limit'] = '0,5';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), array('=', 'L2.titre', "'Agenda'"), array('<', 'TIMESTAMPDIFF(HOUR,articles.date_redac,NOW())/24', "1"), array('=', 'articles.lang', sql_quote($GLOBALS['spip_lang'], '', 'varchar(10) NOT NULL DEFAULT \'\'')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-menu-agenda.html', 'html_78503d8cb0bd66f2d97f4b9c0f7d329a', '_art_agenda', 4, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t0 .= '
				<li>' . (($t1 = strval(affdate(normaliser_date($Pile[$SP]['date_redac'])))) !== '' ? '<span>' . $t1 . (' ' . (($t2 = strval(heures(normaliser_date($Pile[$SP]['date_redac'])) != '0' ? (($t3 = strval(heures(normaliser_date($Pile[$SP]['date_redac'])))) !== '' ? $t3 . ':' : '') . minutes(normaliser_date($Pile[$SP]['date_redac'])) : '')) !== '' ? '- ' . $t2 : '') . '</span>') : '') . '
					<a class="lien' . interdire_scripts(@$Pile[0]['exposer']) . ' article" href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" ' . (($t1 = strval(interdire_scripts(entites_html(textebrut(filtre_introduction_dist($Pile[$SP]['descriptif'], strlen($Pile[$SP]['descriptif']) ? '' : $Pile[$SP]['chapo'] . "\n\n" . $Pile[$SP]['texte'], 500, $connect, null)))))) !== '' ? 'title="' . $t1 . '"' : '') . '>' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a>

				</li>
		';
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_art_agenda @ squelettes/inc/inc-menu-agenda.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:46,代码来源:html_78503d8cb0bd66f2d97f4b9c0f7d329a.php

示例5: tradrub_pre_insertion

/**
 * Ajout lors de l'insertion d'une traduction de rubrique
 * de la langue, qui peut ne pas être connue mais héritée
 * de la rubrique parente à la destination
 *
 * @param array $flux    Données du pipeline
 * @return array         Données du pipeline
**/
function tradrub_pre_insertion($flux) {
	// pour les rubriques
	if ($flux['args']['table'] == 'spip_rubriques') {
		// si on crée une traduction
		if ($id_rubrique_source = _request('lier_trad')) {
			$id_parent_trad = $flux['data']['id_parent'];

			$row = sql_fetsel("lang, id_secteur", "spip_rubriques", "id_rubrique=$id_parent_trad");
			$lang_rub = $row['lang'];


			$lang = "";
			$choisie = 'non';

			// La langue a la creation : si les liens de traduction sont autorises
			// dans les rubriques, on essaie avec la langue de l'auteur,
			// ou a defaut celle de la rubrique
			// Sinon c'est la langue de la rubrique qui est choisie + heritee
			if (in_array('spip_rubriques',explode(',',$GLOBALS['meta']['multi_objets']))) {
				lang_select($GLOBALS['visiteur_session']['lang']);
				if (in_array($GLOBALS['spip_lang'],
				explode(',', $GLOBALS['meta']['langues_multilingue']))) {
					$lang = $GLOBALS['spip_lang'];
					$choisie = 'oui';
				}
			}

			if (!$lang) {
				$choisie = 'non';
				$lang = $lang_rub ? $lang_rub : $GLOBALS['meta']['langue_site'];
			}

			$flux['data']['lang'] = $lang;
			$flux['data']['langue_choisie'] = $choisie;

			// ici on ignore changer_lang qui est poste en cas de trad,
			// car l'heuristique du choix de la langue est pris en charge ici
			// en fonction de la config du site et de la rubrique choisie
			set_request("changer_lang");
		}

	}

	return $flux;
}
开发者ID:samszo,项目名称:open-edition,代码行数:53,代码来源:tradrub.php

示例6: BOUCLE_langueshtml_9491858aea5af6033788aa1936ebca8d

function BOUCLE_langueshtml_9491858aea5af6033788aa1936ebca8d(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'rubriques';
        $command['id'] = '_langues';
        $command['from'] = array('rubriques' => 'spip_rubriques');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("rubriques.lang", "rubriques.titre");
        $command['orderby'] = array('rubriques.lang');
        $command['join'] = array();
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('rubriques.statut', '!', 'publie', ''), array('=', 'rubriques.id_parent', 0), array('NOT', array('=', 'rubriques.lang', sql_quote(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'lang', null), true)), '', 'varchar(10) NOT NULL DEFAULT \'\''))));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-bas_menu-lang.html', 'html_9491858aea5af6033788aa1936ebca8d', '_langues', 18, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t0 .= ($t1 = strval(traduire_nom_langue(unique(spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']))))) !== '' ? '
		<span lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" xml:lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '">| 
		<a href="spip.php?action=converser&amp;var_lang=' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '&amp;redirect=/" rel="alternate"  title="' . _T('public|spip|ecrire:accueil_site') . ' : ' . traduire_nom_langue(spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang'])) . '" dir="' . lang_dir($Pile[$SP]['lang'], 'ltr', 'rtl') . '">' . $t1 . '</a>
		</span>
' : '';
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_langues @ squelettes/inc/inc-bas_menu-lang.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:45,代码来源:html_9491858aea5af6033788aa1936ebca8d.php

示例7: squelettes_par_rubrique_styliser_par_langue

/**
 * Cherche l'existence un squelette par langue squelette.en.html
 *
 * Options de recherche de squelette par le styliseur, appelé par le pipeline 'styliser'
 *
 * @pipeline styliser
 *
 * @param array $flux Données du pipeline
 * @return array       Données du pipeline
 */
function squelettes_par_rubrique_styliser_par_langue($flux)
{
    // uniquement si un squelette a ete trouve
    if ($squelette = $flux['data']) {
        $ext = $flux['args']['ext'];
        // Affiner par lang
        if ($lang = $flux['args']['lang']) {
            $l = lang_select($lang);
            $f = "{$squelette}." . $GLOBALS['spip_lang'];
            if ($l) {
                lang_select();
            }
            if (@file_exists("{$f}.{$ext}")) {
                // sauver le squelette
                $flux['data'] = $f;
            }
        }
    }
    return $flux;
}
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:30,代码来源:squelettes_par_rubrique_options.php

示例8: lang

         echo '<input type="submit" name="junk" value="' . lang('Continue') . '">';
         echo '</form>';
         echo '</body></html>';
         break;
     } else {
         $GLOBALS['phpgw_setup']->html->show_header('Error generating header.inc.php', False, 'header');
         echo lang('Could not open header.inc.php for writing!') . '<br>' . "\n";
         echo lang('Please check read/write permissions on directories, or back up and use another option.') . '<br>';
         echo '</td></tr></table></body></html>';
     }
     break;
 default:
     $GLOBALS['phpgw_setup']->html->show_header($GLOBALS['phpgw_info']['setup']['HeaderFormMSG'], False, 'header');
     $detected = '';
     if (!get_var('ConfigLang', array('POST', 'COOKIE'))) {
         $detected .= '<br><form action="manageheader.php" method="Post">Please Select your language ' . lang_select(True, 'en') . "</form>\n";
     }
     $detected .= '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
     $detected .= '<tr><td colspan="2"><p>' . $GLOBALS['phpgw_info']['setup']['PageMSG'] . '<br />&nbsp;</p></td></tr>';
     $detected .= '<tr class="th"><td colspan="2">' . lang('Analysis') . '</td></tr><tr><td colspan="2">' . "\n";
     $supported_db = array();
     if (extension_loaded('mysql') || function_exists('mysql_connect')) {
         $detected .= lang('You appear to have MySQL support enabled') . '<br>' . "\n";
         $supported_db[] = 'mysql';
     } else {
         $detected .= lang('No MySQL support found. Disabling') . '<br>' . "\n";
     }
     if (extension_loaded('pgsql') || function_exists('pg_connect')) {
         $detected .= lang('You appear to have PostgreSQL support enabled') . '<br>' . "\n";
         $supported_db[] = 'pgsql';
     } else {
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:31,代码来源:manageheader.php

示例9: public_debusquer_dist

/**
 * Point d'entrée pour les erreurs de compilation
 *
 * Point d'entrée pour les appels involontaires ($message non vide => erreur)
 *  et volontaires (var_mode et var_profile)
 * 
 * Si pas d'autorisation, les erreurs ne sont pas affichées
 * (mais seront dans les logs)
 *
 * Si l'erreur vient de SPIP,  en parler sur `spip@rezo.net`
 * 
 * @param bool|string|array $message
 *     - Message d'erreur (string|array)
 *     - false pour retourner le texte des messages d'erreurs
 *     - vide pour afficher les messages d'erreurs
 * @param string|Contexte $lieu
 *     Contexte : lieu d'origine de l'erreur
 * @param array $opt
 *     Options pour debug ou tests unitaires
 *     - 'erreurs' = 'get' : Retourne le tableau des erreurs
 *     - 'erreurs' = 'reset' : Efface le tableau des erreurs
 * @return null|string
 *     - string si $message à false.
**/
function public_debusquer_dist($message = '', $lieu = '', $opt = array())
{
    global $visiteur_session;
    global $debug_objets;
    static $tableau_des_erreurs = array();
    // Pour des tests unitaires, pouvoir récupérer les erreurs générées
    if (isset($opt['erreurs'])) {
        if ($opt['erreurs'] == 'get') {
            return $tableau_des_erreurs;
        }
        if ($opt['erreurs'] == 'reset') {
            $tableau_des_erreurs = array();
            return true;
        }
    }
    // Erreur ou appel final ?
    if ($message) {
        $message = debusquer_compose_message($message);
        $tableau_des_erreurs[] = array($message, $lieu);
        set_request('var_mode', 'debug');
        $GLOBALS['bouton_admin_debug'] = true;
        // Permettre a la compil de continuer
        if (is_object($lieu) and (!isset($lieu->code) or !$lieu->code)) {
            $lieu->code = "''";
        }
        // forcer l'appel au debusqueur en cas de boucles infernales
        $urgence = (_DEBUG_MAX_SQUELETTE_ERREURS and count($tableau_des_erreurs) > _DEBUG_MAX_SQUELETTE_ERREURS);
        if (!$urgence) {
            return;
        }
    }
    if (empty($debug_objets['principal'])) {
        // espace public ?
        if (isset($GLOBALS['fond'])) {
            $debug_objets['principal'] = $GLOBALS['fond'];
        }
    }
    include_spip('inc/autoriser');
    if (!autoriser('debug')) {
        return;
    }
    include_spip('inc/headers');
    include_spip('inc/filtres');
    // en cas de squelette inclus,  virer le code de l'incluant:
    // - il contient souvent une Div restreignant la largeur a 3 fois rien
    // - ca fait 2 headers !
    // sauf si l'on se trouve deja dans un flux compresse (plugin compresseur
    // actif par exemple)
    if (ob_get_length() and !in_array('ob_gzhandler', ob_get_status())) {
        ob_end_clean();
    }
    lang_select($visiteur_session['lang']);
    $fonc = _request('var_mode_objet');
    $mode = _request('var_mode_affiche');
    $self = str_replace("\\'", '&#39;', self());
    $self = parametre_url($self, 'var_mode', 'debug');
    $res = debusquer_bandeau($tableau_des_erreurs) . '<br />' . debusquer_squelette($fonc, $mode, $self);
    if (!_DIR_RESTREINT or headers_sent()) {
        return $res;
    }
    if ($tableau_des_erreurs) {
        http_status(503);
    }
    http_no_cache();
    if (isset($_GET['var_profile'])) {
        $titre = parametre_url($GLOBALS['REQUEST_URI'], 'var_profile', '');
        $titre = parametre_url($titre, 'var_mode', '');
    } else {
        if (!$fonc) {
            $fonc = $debug_objets['principal'];
        }
        $titre = !$mode ? $fonc : $mode . (isset($debug_objets['sourcefile'][$fonc]) ? " " . $debug_objets['sourcefile'][$fonc] : "");
    }
    if ($message === false) {
        lang_select();
        return debusquer_entete($titre, $res);
//.........这里部分代码省略.........
开发者ID:JLuc,项目名称:SPIP,代码行数:101,代码来源:debusquer.php

示例10: action_crayons_store_args

function action_crayons_store_args($store = 'crayons_store')
{
    header("Content-Type: text/plain; charset=" . $GLOBALS['meta']['charset']);
    lang_select($GLOBALS['auteur_session']['lang']);
    $r = $store();
    // Si on a ete appeles par jQuery, on renvoie tout, c'est le client
    // crayons.js qui va traiter l'affichage du resultat et status
    # Attention le test $_SERVER["HTTP_X_REQUESTED_WITH"] === "XMLHttpRequest"
    # n'est pas bon car le cas d'un fichier uploade via iframe n'est pas detecte
    // S'il y a une adresse de redirection, on renvoie vers elle
    // En cas d'erreur il faudrait ajouter &err=... dans l'url ?
    if (_request('redirect')) {
        if (!$r['$erreur'] or $r['$annuler']) {
            include_spip('inc/headers');
            redirige_par_entete(_request('redirect'));
        } else {
            echo "<h4 class='status'>" . $r['$erreur'] . "</h4>\n";
            foreach ($r as $wid => $v) {
                if ($wid !== '$erreur') {
                    echo "<div id='{$wid}'>{$v}</div><hr />\n";
                }
            }
            echo "<a href='" . quote_amp(_request('redirect')) . "'>" . quote_amp(_request('redirect')) . "</a>\n";
        }
    } else {
        echo crayons_json_export($r);
    }
    exit;
}
开发者ID:RadioCanut,项目名称:site-radiocanut,代码行数:29,代码来源:crayons_store.php

示例11: public_parametrer_dist

function public_parametrer_dist($fond, $contexte = '', $cache = '', $connect = '')
{
    static $composer, $styliser, $notes = null;
    $page = tester_redirection($fond, $contexte, $connect);
    if ($page) {
        return $page;
    }
    if (isset($contexte['lang'])) {
        $lang = $contexte['lang'];
    } elseif (!isset($lang)) {
        $lang = $GLOBALS['meta']['langue_site'];
    }
    $select = ((!isset($GLOBALS['forcer_lang']) or !$GLOBALS['forcer_lang']) and $lang != $GLOBALS['spip_lang']);
    if ($select) {
        $select = lang_select($lang);
    }
    $debug = defined('_VAR_MODE') && _VAR_MODE == 'debug';
    if (!$styliser) {
        $styliser = charger_fonction('styliser', 'public');
    }
    list($skel, $mime_type, $gram, $sourcefile) = $styliser($fond, $contexte, $GLOBALS['spip_lang'], $connect);
    if ($skel) {
        // sauver le nom de l'eventuel squelette en cours d'execution
        // (recursion possible a cause des modeles)
        if ($debug) {
            $courant = @$GLOBALS['debug_objets']['courant'];
            $GLOBALS['debug_objets']['contexte'][$sourcefile] = $contexte;
        }
        // charger le squelette en specifiant les langages cibles et source
        // au cas il faudrait le compiler (source posterieure au resultat)
        if (!$composer) {
            $composer = charger_fonction('composer', 'public');
        }
        $fonc = $composer($skel, $mime_type, $gram, $sourcefile, $connect);
    } else {
        $fonc = '';
    }
    if (!$fonc) {
        // squelette inconnu (==='') ou faux (===false)
        $page = $fonc;
    } else {
        // Preparer l'appel de la fonction principale du squelette
        spip_timer($a = 'calcul page ' . rand(0, 1000));
        // On cree un marqueur de notes unique lie a cette composition
        // et on enregistre l'etat courant des globales de notes...
        if (is_null($notes)) {
            $notes = charger_fonction('notes', 'inc', true);
        }
        if ($notes) {
            $notes('', 'empiler');
        }
        // Rajouter d'office ces deux parametres
        // (mais vaudrait mieux que le compilateur sache le simuler
        // car ca interdit l'usage de criteres conditionnels dessus).
        if (!isset($contexte['date'])) {
            $contexte['date'] = date("Y-m-d H:i:s");
            $contexte['date_default'] = true;
        } else {
            $contexte['date'] = normaliser_date($contexte['date'], true);
        }
        if (!isset($contexte['date_redac'])) {
            $contexte['date_redac'] = date("Y-m-d H:i:s");
            $contexte['date_redac_default'] = true;
        } else {
            $contexte['date_redac'] = normaliser_date($contexte['date_redac'], true);
        }
        // Passer le nom du cache pour produire sa destruction automatique
        $page = $fonc(array('cache' => $cache), array($contexte));
        // Restituer les globales de notes telles qu'elles etaient avant l'appel
        // Si l'inclus n'a pas affiche ses notes, tant pis (elles *doivent*
        // etre dans son resultat, autrement elles ne seraient pas prises en
        // compte a chaque calcul d'un texte contenant un modele, mais seulement
        // quand le modele serait calcule, et on aurait des resultats incoherents)
        if ($notes) {
            $notes('', 'depiler');
        }
        // reinjecter en dynamique la pile des notes
        // si il y a des inclure dynamiques
        // si la pile n'est pas vide
        // la generalisation de cette injection permettrait de corriger le point juste au dessus
        // en faisant remonter les notes a l'incluant (A tester et valider avant application)
        if ($notes) {
            $page['notes'] = $notes('', 'sauver_etat');
        }
        // spip_log: un joli contexte
        $infos = array();
        foreach (array_filter($contexte) as $var => $val) {
            if (is_array($val)) {
                $val = serialize($val);
            }
            if (strlen("{$val}") > 30) {
                $val = substr("{$val}", 0, 27) . '..';
            }
            if (strstr($val, ' ')) {
                $val = "'{$val}'";
            }
            $infos[] = $var . '=' . $val;
        }
        $profile = spip_timer($a);
        spip_log("calcul ({$profile}) [{$skel}] " . join(', ', $infos) . ' (' . strlen($page['texte']) . ' octets)');
//.........这里部分代码省略.........
开发者ID:RadioCanut,项目名称:site-radiocanut,代码行数:101,代码来源:parametrer.php

示例12: BOUCLE_breves_rubriqueshtml_11157eacea3e766769d2031f1e2eed04

function BOUCLE_breves_rubriqueshtml_11157eacea3e766769d2031f1e2eed04(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'breves';
        $command['id'] = '_breves_rubriques';
        $command['from'] = array('breves' => 'spip_breves');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("breves.date_heure", "breves.date_heure AS date", "breves.id_breve", "breves.texte", "breves.titre", "breves.lang");
        $command['orderby'] = array('breves.date_heure DESC');
        $command['join'] = array();
        $command['limit'] = '0,10';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('breves.statut', 'publie,prop', 'publie', ''), array('=', 'breves.id_rubrique', sql_quote(@$Pile[0]['id_rubrique'], '', 'bigint(21) NOT NULL DEFAULT \'0\'')), array('=', 'breves.lang', sql_quote($GLOBALS['spip_lang'], '', 'varchar(10) NOT NULL DEFAULT \'\'')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-breves.html', 'html_11157eacea3e766769d2031f1e2eed04', '_breves_rubriques', 2, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t0 .= '
          	<li>' . (($t1 = strval(interdire_scripts(affdate(normaliser_date($Pile[$SP]['date']))))) !== '' ? '<span>' . $t1 . '</span>' : '') . '
              <a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_breve'], 'breve', '', '', true))) . '" ' . (($t1 = strval(interdire_scripts(entites_html(textebrut(filtre_introduction_dist('', $Pile[$SP]['texte'], 300, $connect, null)))))) !== '' ? 'title="' . $t1 . '"' : '') . '>' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a>
          	</li>
            ';
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_breves_rubriques @ squelettes/inc/inc-breves.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:45,代码来源:html_11157eacea3e766769d2031f1e2eed04.php

示例13: BOUCLE_article_headhtml_f7a72f7c15527e9fefe562fecb18cf87

function BOUCLE_article_headhtml_f7a72f7c15527e9fefe562fecb18cf87(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'articles';
        $command['id'] = '_article_head';
        $command['from'] = array('articles' => 'spip_articles', 'L1' => 'spip_mots_liens', 'L2' => 'spip_mots');
        $command['type'] = array();
        $command['groupby'] = array("articles.id_article");
        $command['select'] = array("articles.id_article", "articles.texte", "articles.descriptif", "articles.chapo", "articles.titre", "articles.lang", "articles.date");
        $command['orderby'] = array();
        $command['join'] = array('L1' => array('articles', 'id_objet', 'id_article', 'L1.objet=' . sql_quote('article')), 'L2' => array('L1', 'id_mot'));
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), array('=', 'articles.id_article', sql_quote(@$Pile[0]['id_article'], '', 'bigint(21) NOT NULL AUTO_INCREMENT')), array('NOT', array('IN', 'articles.id_article', array('SELF', 'articles.id_article', array('REGEXP', 'L2.type', "'^_config'")))));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-meta.html', 'html_f7a72f7c15527e9fefe562fecb18cf87', '_article_head', 13, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t0 .= '
  <!-- META article -->
  ' . (($t1 = strval(interdire_scripts(entites_html(textebrut(filtre_introduction_dist($Pile[$SP]['descriptif'], strlen($Pile[$SP]['descriptif']) ? '' : $Pile[$SP]['chapo'] . "\n\n" . $Pile[$SP]['texte'], 500, $connect, null)))))) !== '' ? '<meta name="Description" content="' . $t1 . '" />' : '') . '
' . (($t1 = BOUCLE_authorhtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? '  <meta name="Author" content="' . $t1 . '" />' : '') . '
' . (($t1 = BOUCLE_keywords_articlehtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? '  <meta name="Keywords" content="' . $t1 . '" />' : '') . '
  <!-- META Dublin Core - voir: http://uk.dublincore.org/documents/dcq-html/  -->
  ' . (($t1 = strval(interdire_scripts(entites_html(textebrut(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))))) !== '' ? '<meta name="DC.title" content="' . $t1 . '" />
  ' : '') . (($t1 = strval(spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']))) !== '' ? '<meta name="DC.language" scheme="ISO639-1" content="' . $t1 . '" />
  ' : '') . (($t1 = strval(spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')))) !== '' ? '<meta name="DC.identifier" scheme="DCTERMS.URI" content="' . $t1 . '/' : '') . (($t1 = strval(vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))))) !== '' ? $t1 . '" />
  ' : '') . (($t1 = strval(spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')))) !== '' ? '<meta name="DC.source" scheme="DCTERMS.URI" content="' . $t1 . '" />' : '') . BOUCLE_auteursDChtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP) . (($t1 = strval(interdire_scripts(attribut_html(entites_html(textebrut(filtre_introduction_dist($Pile[$SP]['descriptif'], strlen($Pile[$SP]['descriptif']) ? '' : $Pile[$SP]['chapo'] . "\n\n" . $Pile[$SP]['texte'], 500, $connect, null))))))) !== '' ? '
  <meta name="DC.description" content="' . $t1 . '" />' : '') . (($t1 = BOUCLE_subjectDChtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? '
  <meta name="DC.subject" content="' . $t1 . '" />' : '') . (($t1 = strval(interdire_scripts(date_iso(normaliser_date($Pile[$SP]['date']))))) !== '' ? '
  <meta name="DC.date" scheme="ISO8601" content="' . $t1 . '" />' : '') . '
';
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_article_head @ squelettes/inc/inc-meta.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:54,代码来源:html_f7a72f7c15527e9fefe562fecb18cf87.php

示例14: BOUCLE_rubrique_principalhtml_0caead67327defaf94febb642f511490

function BOUCLE_rubrique_principalhtml_0caead67327defaf94febb642f511490(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'rubriques';
        $command['id'] = '_rubrique_principal';
        $command['from'] = array('rubriques' => 'spip_rubriques');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("rubriques.id_rubrique", "rubriques.lang", "rubriques.titre", "rubriques.id_secteur", "rubriques.texte", "rubriques.descriptif");
        $command['orderby'] = array();
        $command['join'] = array();
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('rubriques.statut', '!', 'publie', ''), array('=', 'rubriques.id_rubrique', sql_quote(@$Pile[0]['id_rubrique'], '', 'bigint(21) NOT NULL AUTO_INCREMENT')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/rubrique.html', 'html_0caead67327defaf94febb642f511490', '_rubrique_principal', 1, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            lang_select_public($Pile[$SP]['lang'], 'oui', $Pile[$SP]['titre']);
            $t0 .= '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" dir="' . lang_dir($Pile[$SP]['lang'], 'ltr', 'rtl') . '">
<head>
	<title>[' . interdire_scripts(textebrut(typo($GLOBALS['meta']['nom_site'], "TYPO", $connect, $Pile[0]))) . '] : ' . interdire_scripts(entites_html(textebrut(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))) . '</title>
	' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-meta') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',7,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>
	<link rel="alternate" type="application/rss+xml" title="' . _T('public|spip|ecrire:syndiquer_rubrique') . ' : ' . interdire_scripts(entites_html(textebrut(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))) . '" href="' . interdire_scripts(parametre_url(generer_url_public('backend', ''), 'id_rubrique', $Pile[$SP]['id_rubrique'])) . '" />

	' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('styles') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',10,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>
</head>
<body dir="' . lang_dir($Pile[$SP]['lang'], 'ltr', 'rtl') . '" class="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . ' rubrique sect' . $Pile[$SP]['id_secteur'] . ' ' . BOUCLE_rubriques_bodyhtml_0caead67327defaf94febb642f511490($Cache, $Pile, $doublons, $Numrows, $SP) . ' rub' . $Pile[$SP]['id_rubrique'] . '">
<div id="page" class="rubrique rub' . $Pile[$SP]['id_rubrique'] . '">

<!-- *****************************************************************
	Bandeau, titre du site et menu langue
	Header and main menu (top and right) 
    ************************************************************* -->
	
' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-bandeau') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',20,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>

<!-- *****************************************************************
	Contenu principal (centre)
	Main content (center) 
    ************************************************************* -->
	<div id="bloc-contenu">
		<h5>
		<a href="' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '" title="' . _T('public|spip|ecrire:accueil_site') . ' : ' . interdire_scripts(typo($GLOBALS['meta']['nom_site'], "TYPO", $connect, $Pile[0])) . '">' . _T('public|spip|ecrire:accueil_site') . '</a>
    ' . (($t1 = BOUCLE_rubriques_cheminhtml_0caead67327defaf94febb642f511490($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? '
    ' . $t1 . '
	' : '') . '
		' . (($t1 = strval(interdire_scripts(couper(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])), '60')))) !== '' ? '<b class=\'separateur\'>&gt;</b> ' . $t1 : '') . '
		</h5>
		<div class="ligne-debut"></div><!-- ligne-debut -->
    	' . (($t1 = strval(filtrer('image_graver', filtrer('image_reduire', !is_array($l = quete_logo('id_rubrique', 'ON', $Pile[$SP]['id_rubrique'], quete_parent($Pile[$SP]['id_rubrique']), 0)) ? '' : "<img class=\"spip_logo spip_logos\" alt=\"\" src=\"{$l['0']}\"" . $l[2] . ($l[1] ? " onmouseover=\"this.src='{$l['1']}'\" onmouseout=\"this.src='{$l['0']}'\"" : "") . ' />', '120', '0')))) !== '' ? '<div class="logo-liste-art">
    		' . $t1 . '
    	</div>' : '') . '
    <h1 class="titre-article">' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</h1>
	' . (($t1 = strval(interdire_scripts(($a = filtrer('image_graver', filtrer('image_reduire', propre($Pile[$SP]['texte'], $connect, $Pile[0]), '560', '0')) or is_string($a) and strlen($a)) ? $a : interdire_scripts(propre($Pile[$SP]['descriptif'], $connect, $Pile[0]))))) !== '' ? '<div class="chapo ' . interdire_scripts($Pile[$SP]['texte'] ? '' : '') . '" id="description">
        ' . $t1 . ('
        ' . (($t2 = strval(interdire_scripts(calculer_notes()))) !== '' ? '<div class="notes" style="padding: 0 1.5em;">' . $t2 . '</div>' : '') . '
	</div><!-- chapo -->') : '') . '
	

		' . recuperer_fond('inc/inc-rub-documents', array_merge($Pile[0], array('id_rubrique' => $Pile[$SP]['id_rubrique'])), array('compil' => array('squelettes/rubrique.html', 'html_0caead67327defaf94febb642f511490', '_rubrique_principal', 43, $GLOBALS['spip_lang'])), _request('connect')) . '
	


		' . (($t1 = BOUCLE_type_miniplanhtml_0caead67327defaf94febb642f511490($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? $t1 . '
		' : '


		' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-rub-articles') . ', array_merge(' . var_export($Pile[0], 1) . ',array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'id_secteur\' => ' . argumenter_squelette($Pile[$SP]['id_secteur']) . ',
	\'self\' => ' . argumenter_squelette(self()) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . ')), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',63,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>
		
		') . '
		
		<br class="nettoyeur" />
	</div><!-- bloc-contenu -->
	
<!-- *****************************************************************
//.........这里部分代码省略.........
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:101,代码来源:html_0caead67327defaf94febb642f511490.php

示例15: article_inserer

/**
 * Insérer un nouvel article en base de données
 * 
 * En plus des données enregistrées par défaut, la fonction :
 * - retrouve un identifiant de rubrique pour stocker l'article (la
 *   première rubrique racine) si l'identifiant de rubrique transmis est
 *   nul.
 * - calcule la langue de l'article, soit
 *   - d'après la langue de la rubrique si les articles ne sont pas
 *     configurés comme pouvant être traduits,
 *   - d'après la langue de l'auteur en cours si les articles peuvent être traduits et
 *     si la langue de l'auteur est acceptée en tant que langue de traduction
 * - crée une liaison automatiquement entre l'auteur connecté et l'article
 *   créé, de sorte que la personne devient par défaut auteur de l'article
 *   qu'elle crée.
 *   
 * @pipeline_appel pre_insertion
 * @pipeline_appel post_insertion
 *
 * @global array $GLOBALS['meta']
 * @global array $GLOBALS['visiteur_session']
 * @global string $GLOBALS['spip_lang']
 * 
 * @param int $id_rubrique
 *     Identifiant de la rubrique parente
 * @return int
 *     Identifiant du nouvel article
 * 
 */
function article_inserer($id_rubrique)
{
    // Si id_rubrique vaut 0 ou n'est pas definie, creer l'article
    // dans la premiere rubrique racine
    if (!($id_rubrique = intval($id_rubrique))) {
        $row = sql_fetsel("id_rubrique, id_secteur, lang", "spip_rubriques", "id_parent=0", '', '0+titre,titre', "1");
        $id_rubrique = $row['id_rubrique'];
    } else {
        $row = sql_fetsel("lang, id_secteur", "spip_rubriques", "id_rubrique={$id_rubrique}");
    }
    // eviter $id_secteur = NULL (erreur sqlite) si la requete precedente echoue
    // cas de id_rubrique = -1 par exemple avec plugin "pages"
    $id_secteur = isset($row['id_secteur']) ? $row['id_secteur'] : 0;
    $lang_rub = $row['lang'];
    $lang = "";
    $choisie = 'non';
    // La langue a la creation : si les liens de traduction sont autorises
    // dans les rubriques, on essaie avec la langue de l'auteur,
    // ou a defaut celle de la rubrique
    // Sinon c'est la langue de la rubrique qui est choisie + heritee
    if (in_array('spip_articles', explode(',', $GLOBALS['meta']['multi_objets']))) {
        lang_select($GLOBALS['visiteur_session']['lang']);
        if (in_array($GLOBALS['spip_lang'], explode(',', $GLOBALS['meta']['langues_multilingue']))) {
            $lang = $GLOBALS['spip_lang'];
            $choisie = 'oui';
        }
    }
    if (!$lang) {
        $choisie = 'non';
        $lang = $lang_rub ? $lang_rub : $GLOBALS['meta']['langue_site'];
    }
    $champs = array('id_rubrique' => $id_rubrique, 'id_secteur' => $id_secteur, 'statut' => 'prepa', 'date' => date('Y-m-d H:i:s'), 'lang' => $lang, 'langue_choisie' => $choisie);
    // Envoyer aux plugins
    $champs = pipeline('pre_insertion', array('args' => array('table' => 'spip_articles'), 'data' => $champs));
    $id_article = sql_insertq("spip_articles", $champs);
    pipeline('post_insertion', array('args' => array('table' => 'spip_articles', 'id_objet' => $id_article), 'data' => $champs));
    // controler si le serveur n'a pas renvoye une erreur
    if ($id_article > 0 and $GLOBALS['visiteur_session']['id_auteur']) {
        include_spip('action/editer_auteur');
        auteur_associer($GLOBALS['visiteur_session']['id_auteur'], array('article' => $id_article));
    }
    return $id_article;
}
开发者ID:nursit,项目名称:SPIP,代码行数:72,代码来源:editer_article.php


注:本文中的lang_select函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。