本文整理汇总了PHP中_T函数的典型用法代码示例。如果您正苦于以下问题:PHP _T函数的具体用法?PHP _T怎么用?PHP _T使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_T函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_copier_local_post
/**
* http://code.spip.net/@action_copier_local_post
*
* @param $id_document
* @return bool|mixed|string
*/
function action_copier_local_post($id_document)
{
// Il faut la source du document pour le copier
$row = sql_fetsel("mode,fichier, descriptif, credits", "spip_documents", "id_document={$id_document}");
$source = $row['fichier'];
include_spip('inc/distant');
// pour 'copie_locale'
$fichier = copie_locale($source);
if ($fichier) {
$fichier = _DIR_RACINE . $fichier;
$files[] = array('tmp_name' => $fichier, 'name' => basename($fichier));
$ajouter_documents = charger_fonction('ajouter_documents', 'action');
spip_log("convertit doc {$id_document} en local: {$source} => {$fichier}");
$liste = array();
$ajouter_documents($id_document, $files, '', 0, $row['mode'], $liste);
spip_unlink($fichier);
// ajouter l'origine du document aux credits
include_spip('action/editer_document');
document_modifier($id_document, array('credits' => ($row['credits'] ? $row['credits'] . ', ' : '') . $source));
return true;
} else {
spip_log("echec copie locale {$source}");
}
return _T('medias:erreur_copie_fichier', array('nom' => $source));
}
示例2: mots_ieconfig_metas
/**
* Ajoute les metas sauvegardables de Mots pour le plugin IEConfig
*
* @pipeline ieconfig_metas
*
* @param array $table
* Déclaration des sauvegardes
* @return array
* Déclaration des sauvegardes complétées
**/
function mots_ieconfig_metas($table) {
$table['mots']['titre'] = _T('mots:info_mots_cles');
$table['mots']['icone'] = 'mot-16.png';
$table['mots']['metas_brutes'] = 'articles_mots,config_precise_groupes,mots_cles_forums';
return $table;
}
示例3: formulaires_configurer_bank_paiement_verifier_dist
function formulaires_configurer_bank_paiement_verifier_dist()
{
$erreurs = array();
if ($e = _request('email_ticket_admin') and !email_valide($e)) {
$erreurs['email_ticket_admin'] = _T('form_prop_indiquer_email');
}
if (!count($erreurs)) {
if ($dels = _request('action_del') and count($dels)) {
set_request('action_del');
foreach ($dels as $del => $v) {
set_request($del, null);
}
}
if ($ups = _request('action_up') and count($ups)) {
set_request('action_up');
foreach ($ups as $up => $v) {
bank_deplacer_config($up, "up");
}
}
if ($downs = _request('action_down') and count($downs)) {
set_request('action_down');
foreach ($downs as $down => $v) {
bank_deplacer_config($down, "down");
}
}
if (_request('action_append') and $presta = _request('action_append_presta') and in_array($presta, bank_lister_prestas())) {
set_request('action_append');
set_request('action_append_presta');
bank_ajouter_config($presta);
}
}
return $erreurs;
}
示例4: player_affiche_config_form
function player_affiche_config_form ($exec_page){
global $spip_lang_right, $spip_lang_left;
if ($player = _request('player')) {
ecrire_meta('player', $player);
if(version_compare($GLOBALS['spip_version_code'],'1.9300','<')) {
include_spip("inc/meta");
ecrire_metas();
}
}
$player_ = $GLOBALS['meta']['player'];
$out = ""
. debut_cadre_trait_couleur(_DIR_PLUGIN_PLAYER_IMAGES."player-son-24.png", true, "", "Player Audio")
. "<form action='".generer_url_ecrire($exec_page)."' method='post' class='verdana2'><div>"
. bouton_radio("player", "neoplayer", "Neolao player", $player_ == "neoplayer")
. "<br />"
. bouton_radio("player", "dewplayer", "Dew player", $player_ == "dewplayer")
. "<br />"
. bouton_radio("player", "pixplayer", "One pixel out player", $player_ == "pixplayer")
. "<br />"
. bouton_radio("player", "eraplayer", "Erational player", $player_ == "eraplayer")
. "<div style='text-align:$spip_lang_right'><input type='submit' name='Valider' value='"._T('bouton_valider')."' class='fondo' /></div>"
. "</div></form>"
. fin_cadre_trait_couleur(true)
;
return ($out);
}
示例5: configuration_visiteurs_dist
function configuration_visiteurs_dist()
{
global $spip_lang_left ;
if (!avoir_visiteurs(false,false)) {
$res = "<table border='0' cellspacing='1' cellpadding='3' width=\"100%\">"
. "\n<tr><td class='verdana2'>"
. _T('info_question_accepter_visiteurs')
. "</td></tr>"
. "\n<tr><td style='text-align: $spip_lang_left' class='verdana2'>"
. afficher_choix('accepter_visiteurs', $GLOBALS['meta']['accepter_visiteurs'],
array('oui' => _T('info_option_accepter_visiteurs'),
'non' => _T('info_option_ne_pas_accepter_visiteurs')))
. "</td></tr></table>\n";
$res = ajax_action_post('configurer', 'visiteurs', 'config_contenu','',$res);
} else {
$res = _T('info_forums_abo_invites');
}
$res = debut_cadre_trait_couleur("redacteurs-24.gif", true, "", _T('info_visiteurs'))
. $res
. fin_cadre_trait_couleur(true);
return ajax_action_greffe('configurer-visiteurs', '', $res);
}
示例6: valuesToDescription
function valuesToDescription()
{
if (count($this->errors)) {
return $this->errorsDescription();
}
return $this->_descriptionByKeys(array(_T("Mail server") => "mailserver", _T("Priority") => "priority"));
}
示例7: inc_informer_dist
function inc_informer_dist($id, $col, $exclus, $rac, $type, $do = 'aff')
{
include_spip('inc/texte');
if ($type == "rubrique") {
$row = sql_fetsel("titre, descriptif", "spip_rubriques", "id_rubrique = {$id}");
if ($row) {
$titre = typo($row["titre"]);
$descriptif = propre($row["descriptif"]);
} else {
$titre = _T('info_racine_site');
}
} else {
$titre = '';
}
$res = '';
if ($type == "rubrique" and $GLOBALS['spip_display'] != 1 and isset($GLOBALS['meta']['image_process'])) {
if ($GLOBALS['meta']['image_process'] != "non") {
$chercher_logo = charger_fonction('chercher_logo', 'inc');
if ($res = $chercher_logo($id, 'id_rubrique', 'on')) {
list($fid, $dir, $nom, $format) = $res;
include_spip('inc/filtres_images_mini');
$res = image_reduire("<img src='{$fid}' alt='' />", 100, 48);
if ($res) {
$res = "<div style='float: " . $GLOBALS['spip_lang_right'] . "; margin-" . $GLOBALS['spip_lang_right'] . ": -5px; margin-top: -5px;'>{$res}</div>";
}
}
}
}
$rac = spip_htmlentities($rac);
# ce lien provoque la selection (directe) de la rubrique cliquee
# et l'affichage de son titre dans le bandeau
$titre = strtr(str_replace("'", "’", str_replace('"', """, textebrut($titre))), "\n\r", " ");
$js_func = $do . '_selection_titre';
return "<div style='display: none;'>" . "<input type='text' id='" . $rac . "_sel' value='{$id}' />" . "<input type='text' id='" . $rac . "_sel2' value=\"" . entites_html($titre) . "\" />" . "</div>" . "<div class='informer' style='padding: 5px; border-top: 0px;'>" . (!$res ? '' : $res) . "<p><b>" . safehtml($titre) . "</b></p>" . (!$descriptif ? '' : "<div>" . safehtml($descriptif) . "</div>") . "<div style='text-align: " . $GLOBALS['spip_lang_right'] . ";'>" . "<input type='submit' class='fondo' value='" . _T('bouton_choisir') . "'\nonclick=\"{$js_func}('{$titre}',{$id},'selection_rubrique','id_parent'); return false;\" />" . "</div>" . "</div>";
}
示例8: exec_base_delete_all_dist
/**
* Exec de la page de destruction des tables de SPIP
**/
function exec_base_delete_all_dist()
{
include_spip('inc/autoriser');
if (!autoriser('detruire')) {
include_spip('inc/minipres');
echo minipres();
} else {
include_spip('base/dump');
$res = base_lister_toutes_tables('', array(), array(), true);
if (!$res) {
include_spip('inc/minipres');
spip_log("Erreur base de donnees");
echo minipres(_T('info_travaux_titre'), _T('titre_probleme_technique') . "<p><tt>" . sql_errno() . " " . sql_error() . "</tt></p>");
} else {
$res = base_saisie_tables('delete', $res);
include_spip('inc/headers');
$res = "\n<ol style='text-align:left'><li>\n" . join("</li>\n<li>", $res) . '</li></ol>';
$admin = charger_fonction('admin', 'inc');
$res = $admin('delete_all', _T('titre_page_delete_all'), $res);
if (!$res) {
redirige_url_ecrire('install', '');
} else {
echo $res;
}
}
}
}
示例9: actionLogin
/**
* 登录
*/
function actionLogin()
{
do {
/**
* 验证用户名和密码是否正确
*/
$modelSysUsers =& FLEA::getSingleton('Model_SysUsers');
$user = $modelSysUsers->findByUsername($_POST['username']);
if (!$user) {
$msg = _T('ui_l_invalid_username');
break;
}
if (!$modelSysUsers->checkPassword($_POST['password'], $user['password'])) {
$msg = _T('ui_l_invalid_password');
break;
}
/**
* 登录成功,通过 RBAC 保存用户信息和角色
*/
$data = array();
$data['ADMIN'] = $user['username'];
$rbac =& FLEA::getSingleton('FLEA_Rbac');
/* @var $rbac FLEA_Rbac */
$rbac->setUser($data, array('SYSTERM_ADMIN'));
//重定向
redirect(url('ZobAdmin'));
} while (false);
//登录发生错误,再次显示登录界面
$ui =& FLEA::initWebControls();
include APP_DIR . '/ZobLoginIndex.php';
}
示例10: getCMSFields
/**
* Get the fieldset to display in the administration section
*/
function getCMSFields()
{
$templateSource = singleton("NewsletterAdmin")->templateSource();
$fields = new FieldSet(new TabSet("Root", new Tab(_t('NewsletterAdmin.NLSETTINGS', 'Newsletter Settings'), new TextField("Title", _t('NewsletterAdmin.NEWSLTYPE', 'Newsletter Type')), new TreeDropdownField('GroupID', _T('NewsletterAdmin.MAILINGGROUP', 'Mailing list group'), 'Group'), new TextField("FromEmail", _t('NewsletterAdmin.FROMEM', 'From email address')), new DropdownField("Template", _t('NewsletterAdmin.TEMPLATE', 'Template'), $templateSource))));
$this->extend('updateCMSFields', $fields);
return $fields;
}
示例11: html_f3666965c018303599bb64189cbac96c
function html_f3666965c018303599bb64189cbac96c($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0)
{
if (isset($Pile[0]["doublons"]) and is_array($Pile[0]["doublons"])) {
$doublons = nettoyer_env_doublons($Pile[0]["doublons"]);
}
$connect = '';
$page = ' <div' . (($t1 = strval(interdire_scripts(entites_html(sinon(table_valeur(@$Pile[0], (string) 'divclass', null), 'spip-admin-bloc'), true)))) !== '' ? ' class="' . $t1 . '"' : '') . ' id=\'spip-admin\' dir="' . lang_dir(@$Pile[0]['lang'], 'ltr', 'rtl') . '">' . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'analyser', null), true)))) !== '' ? '
<a href="' . $t1 . ('" class="spip-admin-boutons"
id="analyser">' . _T('public|spip|ecrire:analyse_xml') . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'xhtml_error', null), true)))) !== '' ? ' (' . $t2 . ')' : '') . '</a>') : '') . '
' . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'objet', null), true) ? ' ' : ''))) !== '' ? $t1 . ('
' . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id_objet', null), true)))) !== '' ? '<a href="' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) ('voir_' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'objet', null), true))), null), true)) . '" class="spip-admin-boutons"
id="voir_' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'objet', null), true)) . '">' . interdire_scripts(_T(objet_info(entites_html(table_valeur(@$Pile[0], (string) 'objet', null), true), 'texte_objet'))) . '
(' . $t2 . ')</a>' : '') . '
') : '') . '<!--extra-->' . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'ecrire', null), true)))) !== '' ? '
<a href="' . $t1 . ('" class="spip-admin-boutons"
id="ecrire">' . _T('public|spip|ecrire:espace_prive') . '</a>') : '') . '
<a href="' . parametre_url(self(), 'var_mode', interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'calcul', null), true))) . '" class="spip-admin-boutons"
id="var_mode">' . _T('public|spip|ecrire:admin_recalculer') . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'use_cache', null), true)) . '</a>' . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'preview', null), true)))) !== '' ? '
<a href="' . $t1 . ('" class="spip-admin-boutons"
id="preview">' . _T('public|spip|ecrire:previsualisation') . '</a>') : '') . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'debug', null), true)))) !== '' ? '
<a href="' . $t1 . ('" class="spip-admin-boutons"
id="debug">' . _T('public|spip|ecrire:admin_debug') . '</a>') : '') . '
</div>
';
return analyse_resultat_skel('html_f3666965c018303599bb64189cbac96c', $Cache, $page, 'squelettes-dist/formulaires/administration.html');
}
示例12: verifier_email_dist
/**
* Vérifie la validité d'une adresse de courriel.
*
* Les contraintes du mail sont déterminées par le mode de validation
* En option, on contrôle aussi la disponibilité du mail dans la table des auteurs
*
* @param string $valeur
* La valeur à vérifier.
* @param array $options
* Un éventuel tableau d'options.
* @return string
* Retourne une chaine vide si c'est valide, sinon une chaine expliquant l'erreur.
*/
function verifier_email_dist($valeur, $options=array()){
include_spip('inc/filtres');
if (!is_string($valeur)) {
return $erreur;
}
// Disponibilite des courriels en base AUTEURS
// Si l'adresse n'est pas disponible, on stoppe tout sinon on continue
if (!empty($options['disponible']) and !verifier_disponibilite_email($valeur,isset($options['id_auteur'])?$options['id_auteur']:null)){
return _T('verifier:erreur_email_nondispo', array('email' => echapper_tags($valeur)));
}
// Choix du mode de verification de la syntaxe des courriels
if (empty($options['mode']) or !in_array($options['mode'], array('normal','rfc5322','strict'))){
$mode = 'normal';
} else{
$mode = $options['mode'];
}
$fonctions_disponibles = array(
'normal' => 'email_valide',
'rfc5322' => 'verifier_email_rfc5322',
'strict' => 'verifier_email_de_maniere_stricte'
);
$fonction_verif = $fonctions_disponibles[$mode];
if (!$fonction_verif($valeur)) {
return _T('verifier:erreur_email', array('email' => echapper_tags($valeur)));
} else {
return '';
}
}
示例13: afficher_diff_jointure_dist
/**
* Afficher le diff d'un champ texte generique
* @param string $champ
* @param string $old
* @param string $new
* @param string $format
* apercu, diff ou complet
* @return string
*/
function afficher_diff_jointure_dist($champ, $old, $new, $format = 'diff')
{
$join = substr($champ, 9);
$objet = objet_type($join);
$old = explode(',', $old);
$new = explode(',', $new);
$liste = array();
// les communs
$intersection = array_intersect($new, $old);
foreach ($intersection as $id) {
if ($id = intval(trim($id))) {
$liste[$id] = "<a href='" . generer_url_entite($id, $objet) . "' title='" . _T(objet_info($objet, 'texte_objet')) . " {$id}'>" . generer_info_entite($id, $objet, 'titre') . "</a>";
}
}
// les supprimes
$old = array_diff($old, $intersection);
foreach ($old as $id) {
if ($id = intval(trim($id))) {
$liste[$id] = "<span class='diff-supprime'>" . "<a href='" . generer_url_entite($id, $objet) . "' title='" . _T(objet_info($objet, 'texte_objet')) . " {$id}'>" . generer_info_entite($id, $objet, 'titre') . "</a>" . "</span>";
}
}
// les ajoutes
$new = array_diff($new, $intersection);
foreach ($new as $id) {
if ($id = intval(trim($id))) {
$liste[$id] = "<span class='diff-ajoute'>" . "<a href='" . generer_url_entite($id, $objet) . "' title='" . _T(objet_info($objet, 'texte_objet')) . " {$id}'>" . generer_info_entite($id, $objet, 'titre') . "</a>" . "</span>";
}
}
ksort($liste);
$liste = implode(', ', $liste);
return $liste;
}
示例14: info_maj
function info_maj($dir, $file, $version)
{
include_spip('inc/plugin');
list($maj, $min, $rev) = preg_split('/\\D+/', $version);
$nom = _DIR_CACHE_XML . _VERSIONS_LISTE;
$page = !file_exists($nom) ? '' : file_get_contents($nom);
$page = info_maj_cache($nom, $dir, $page);
// reperer toutes les versions de numero majeur superieur ou egal
// (a revoir quand on arrivera a SPIP V10 ...)
$p = substr("0123456789", intval($maj));
$p = ',/' . $file . '\\D+([' . $p . ']+)\\D+(\\d+)(\\D+(\\d+))?.*?[.]zip",i';
preg_match_all($p, $page, $m, PREG_SET_ORDER);
$page = '';
foreach ($m as $v) {
list(, $maj2, $min2, , $rev2) = $v;
$version_maj = $maj2 . '.' . $min2 . '.' . $rev2;
if (spip_version_compare($version, $version_maj, '<') and spip_version_compare($page, $version_maj, '<')) {
$page = $version_maj;
}
}
if (!$page) {
return "";
}
return "<a class='info_maj_spip' href='" . _VERSIONS_SERVEUR . "{$dir}' title='{$page}'>" . _T('nouvelle_version_spip', array('version' => $page)) . '</a>';
}
示例15: Save
public function Save()
{
if (!$this->_GetTable()) {
return false;
}
$this->_FlattenPost();
// session key with instantiated class name, so that mysql and sqlite instances can coexist
$session_key = get_class($this) . '_rowid';
if ($this->lastrowid = Config::GetInstance()->GetSessionVariable($session_key)) {
if (!$this->_UpdateRow()) {
$this->errors[] = array('err' => _T('Failed to update stored data.'));
return false;
}
} else {
if (!$this->_InsertRow()) {
$this->errors[] = array('err' => _T('Failed to store the data.'));
return false;
}
// save the record id, so that using the back button doesn't cause multiple records
// but don't do this for auto-embedded forms, because there is no way to reset this session
// and the same record gets over written time and time again.
if (!Config::GetInstance()->isAutoEmbedded()) {
Config::GetInstance()->SetSessionVariable($session_key, $this->lastrowid);
}
}
return true;
}