Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JText

Liste de tous les membres

Fonctions membres publiques statiques

static _ ($string, $jsSafe=false, $interpretBackSlashes=true, $script=false)
static alt ($string, $alt, $jsSafe=false, $interpretBackSlashes=true, $script=false)
static plural ($string, $n)
static sprintf ($string)
static printf ($string)
static script ($string=null, $jsSafe=false, $interpretBackSlashes=true)

Attributs protégés statiques

static $strings = array()

Description détaillée

Définition à la ligne 19 du fichier text.php.


Documentation des fonctions membres

static JText::_ (   $string,
  $jsSafe = false,
  $interpretBackSlashes = true,
  $script = false 
)
static

Translates a string into the current language.

Examples: <script>alert(Joomla.JText._('<?php echo JText::_("JDEFAULT", array("script"=>true));?>'));</script> will generate an alert message containing 'Default' <?php echo JText::_("JDEFAULT");?> it will generate a 'Default' string

Paramètres:
string$stringThe string to translate.
mixed$jsSafeBoolean: Make the result javascript safe.
boolean$interpretBackSlashesTo interpret backslashes (\=\,
=carriage return, =tabulation)
boolean$scriptTo indicate that the string will be push in the javascript language store
Renvoie:
string The translated string or the key is $script is true
Depuis:
11.1

Définition à la ligne 46 du fichier text.php.

Références JFactory\getLanguage().

Référencé par JLogLoggerCallback\__construct(), JControllerAdmin\__construct(), JControllerForm\__construct(), JAuthentication\__construct(), JModelLegacy\__construct(), JCacheStorageFile\_deleteFolder(), JClientFtp\_passive(), JClientFtp\_putCmd(), JUserHelper\activateUser(), JControllerForm\add(), JModelAdmin\batch(), JControllerForm\batch(), JModelAdmin\batchAccess(), JModelAdmin\batchLanguage(), JModelAdmin\batchMove(), JTableMenu\bind(), JUser\bind(), JControllerForm\cancel(), JClientFtp\chdir(), JTableLanguage\check(), JTableUsergroup\check(), JTableMenuType\check(), JTableExtension\check(), JTableUpdate\check(), JTableViewlevel\check(), JTableMenu\check(), JTableModule\check(), JTableCategory\check(), JTableUser\check(), JTableContent\check(), JModelAdmin\checkCategoryId(), JModelForm\checkin(), JControllerAdmin\checkin(), JModelForm\checkout(), JSession\checkToken(), JClientFtp\chmod(), JStream\chmod(), JStream\close(), JViewCategory\commonCategoryDisplay(), JFile\copy(), JCryptPasswordSimple\create(), JFolder\create(), JClientFtp\create(), JError\customErrorPage(), JDate\dayToString(), JControllerAdmin\delete(), JTableMenuType\delete(), JFolder\delete(), JClientFtp\delete(), JModelAdmin\delete(), JViewCategories\display(), JControllerForm\edit(), JStream\eof(), JDatabaseDriverPostgresql\execute(), JStream\filesize(), JClientFtp\get(), JStream\get_meta_data(), JUserHelper\getCryptedPassword(), JSimplepieFactory\getFeedParser(), JFormFieldGroupedList\getGroups(), JFormFieldRepeatable\getInput(), JFormFieldModulelayout\getInput(), JFormFieldComponentlayout\getInput(), JFormFieldUrl\getInput(), JFormFieldEMail\getInput(), JFormFieldTel\getInput(), JFormFieldCheckboxes\getInput(), JFormFieldTextarea\getInput(), JFormFieldNumber\getInput(), JFormFieldRules\getInput(), JFormFieldCalendar\getInput(), JFormFieldPassword\getInput(), JFormFieldColor\getInput(), JFormFieldText\getInput(), JFormFieldNote\getLabel(), JFormFieldSpacer\getLabel(), JFormField\getLabel(), JModelLegacy\getName(), JViewLegacy\getName(), JControllerLegacy\getName(), JFormFieldSessionHandler\getOptions(), JFormFieldCacheHandler\getOptions(), JFormFieldCategory\getOptions(), JFormFieldDatabaseConnection\getOptions(), JFormFieldPredefinedList\getOptions(), JFormFieldPlugins\getOptions(), JFormFieldSQL\getOptions(), JStream\gets(), JFormField\getTitle(), JFactory\getXML(), JClientLdap\LDAPNetAddr(), JClientFtp\listDetails(), JClientFtp\listNames(), JForm\loadField(), JModelLegacy\loadHistory(), JControllerForm\loadhistory(), JClientFtp\mkdir(), JDate\monthToString(), JFile\move(), JFolder\move(), JStream\open(), JViewCategories\prepareDocument(), JViewCategory\prepareDocument(), JTableExtension\publish(), JControllerAdmin\publish(), JTableContent\publish(), JModelAdmin\publish(), JClientFtp\pwd(), JStream\read(), JClientFtp\read(), JClientFtp\reinit(), JClientFtp\rename(), JDocumentFeed\render(), JDocumentRendererMessage\renderDefaultMessage(), JControllerAdmin\reorder(), JModelAdmin\reorder(), JClientFtp\restart(), JControllerForm\save(), JControllerAdmin\saveorder(), JModelAdmin\saveorder(), JStream\seek(), JMail\Send(), JMail\sendAdminMail(), JClientHelper\setCredentialsFromRequest(), JFormFieldText\setup(), JDatabase\stderr(), JTableLanguage\store(), JTableMenuType\store(), JTableMenu\store(), JTableCategory\store(), JTableContent\store(), JClientFtp\store(), JClientFtp\syst(), JStream\tell(), JFile\upload(), JStream\upload(), JForm\validateField(), JStream\write(), et JClientFtp\write().

{
if (is_array($jsSafe))
{
if (array_key_exists('interpretBackSlashes', $jsSafe))
{
$interpretBackSlashes = (boolean) $jsSafe['interpretBackSlashes'];
}
if (array_key_exists('script', $jsSafe))
{
$script = (boolean) $jsSafe['script'];
}
if (array_key_exists('jsSafe', $jsSafe))
{
$jsSafe = (boolean) $jsSafe['jsSafe'];
}
else
{
$jsSafe = false;
}
}
if (!(strpos($string, ',') === false))
{
$test = substr($string, strpos($string, ','));
if (strtoupper($test) === $test)
{
$strs = explode(',', $string);
foreach ($strs as $i => $str)
{
$strs[$i] = $lang->_($str, $jsSafe, $interpretBackSlashes);
if ($script)
{
self::$strings[$str] = $strs[$i];
}
}
$str = array_shift($strs);
$str = preg_replace('/\[\[%([0-9]+):[^\]]*\]\]/', '%\1$s', $str);
$str = vsprintf($str, $strs);
return $str;
}
}
if ($script)
{
self::$strings[$string] = $lang->_($string, $jsSafe, $interpretBackSlashes);
return $string;
}
else
{
return $lang->_($string, $jsSafe, $interpretBackSlashes);
}
}

+ Voici le graphe d'appel pour cette fonction :

static JText::alt (   $string,
  $alt,
  $jsSafe = false,
  $interpretBackSlashes = true,
  $script = false 
)
static

Translates a string into the current language.

Examples: <?php echo JText::alt("JALL","language");?> it will generate a 'All' string in English but a "Toutes" string in French <?php echo JText::alt("JALL","module");?> it will generate a 'All' string in English but a "Tous" string in French

Paramètres:
string$stringThe string to translate.
string$altThe alternate option for global string
mixed$jsSafeBoolean: Make the result javascript safe.
boolean$interpretBackSlashesTo interpret backslashes (\=\,
=carriage return, =tabulation)
boolean$scriptTo indicate that the string will be pushed in the javascript language store
Renvoie:
string The translated string or the key if $script is true
Depuis:
11.1

Définition à la ligne 127 du fichier text.php.

Références JFactory\getLanguage().

Référencé par JFormFieldGroupedList\getGroups(), JFormFieldRadio\getInput(), JFormFieldList\getOptions(), JFormFieldFolderList\getOptions(), JFormFieldFileList\getOptions(), et JFormFieldText\getSuggestions().

{
if ($lang->hasKey($string . '_' . $alt))
{
return self::_($string . '_' . $alt, $jsSafe, $interpretBackSlashes, $script);
}
else
{
return self::_($string, $jsSafe, $interpretBackSlashes, $script);
}
}

+ Voici le graphe d'appel pour cette fonction :

+ Voici le graphe des appelants de cette fonction :

static JText::plural (   $string,
  $n 
)
static

Like JText::sprintf but tries to pluralise the string.

Note that this method can take a mixed number of arguments as for the sprintf function.

The last argument can take an array of options:

array('jsSafe'=>boolean, 'interpretBackSlashes'=>boolean, 'script'=>boolean)

where:

jsSafe is a boolean to generate a javascript safe strings. interpretBackSlashes is a boolean to interpret backslashes \->\,
->new line, ->tabulation. script is a boolean to indicate that the string will be push in the javascript language store.

Examples: <script>alert(Joomla.JText._('<?php echo JText::plural("COM_PLUGINS_N_ITEMS_UNPUBLISHED", 1, array("script"=>true));?>'));</script> will generate an alert message containing '1 plugin successfully disabled' <?php echo JText::plural("COM_PLUGINS_N_ITEMS_UNPUBLISHED", 1);?> it will generate a '1 plugin successfully disabled' string

Paramètres:
string$stringThe format string.
integer$nThe number of items
Renvoie:
string The translated strings or the key if 'script' is true in the array of options
Depuis:
11.1

Définition à la ligne 168 du fichier text.php.

Références JFactory\getLanguage().

Référencé par JControllerAdmin\checkin(), JControllerAdmin\delete(), et JControllerAdmin\publish().

{
$args = func_get_args();
$count = count($args);
if ($count > 1)
{
// Try the key from the language plural potential suffixes
$found = false;
$suffixes = $lang->getPluralSuffixes((int) $n);
array_unshift($suffixes, (int) $n);
foreach ($suffixes as $suffix)
{
$key = $string . '_' . $suffix;
if ($lang->hasKey($key))
{
$found = true;
break;
}
}
if (!$found)
{
// Not found so revert to the original.
$key = $string;
}
if (is_array($args[$count - 1]))
{
$args[0] = $lang->_(
$key, array_key_exists('jsSafe', $args[$count - 1]) ? $args[$count - 1]['jsSafe'] : false,
array_key_exists('interpretBackSlashes', $args[$count - 1]) ? $args[$count - 1]['interpretBackSlashes'] : true
);
if (array_key_exists('script', $args[$count - 1]) && $args[$count - 1]['script'])
{
self::$strings[$key] = call_user_func_array('sprintf', $args);
return $key;
}
}
else
{
$args[0] = $lang->_($key);
}
return call_user_func_array('sprintf', $args);
}
elseif ($count > 0)
{
// Default to the normal sprintf handling.
$args[0] = $lang->_($string);
return call_user_func_array('sprintf', $args);
}
return '';
}

+ Voici le graphe d'appel pour cette fonction :

+ Voici le graphe des appelants de cette fonction :

static JText::printf (   $string)
static

Passes a string thru an printf.

Note that this method can take a mixed number of arguments as for the sprintf function.

Paramètres:
format$stringThe format string.
Renvoie:
mixed
Depuis:
11.1

Définition à la ligne 297 du fichier text.php.

Références JFactory\getLanguage().

{
$args = func_get_args();
$count = count($args);
if ($count > 0)
{
if (is_array($args[$count - 1]))
{
$args[0] = $lang->_(
$string, array_key_exists('jsSafe', $args[$count - 1]) ? $args[$count - 1]['jsSafe'] : false,
array_key_exists('interpretBackSlashes', $args[$count - 1]) ? $args[$count - 1]['interpretBackSlashes'] : true
);
}
else
{
$args[0] = $lang->_($string);
}
return call_user_func_array('printf', $args);
}
return '';
}

+ Voici le graphe d'appel pour cette fonction :

static JText::script (   $string = null,
  $jsSafe = false,
  $interpretBackSlashes = true 
)
static

Translate a string into the current language and stores it in the JavaScript language store.

Paramètres:
string$stringThe JText key.
boolean$jsSafeEnsure the output is JavaScript safe.
boolean$interpretBackSlashesInterpret and
.
Renvoie:
string
Depuis:
11.1

Définition à la ligne 334 du fichier text.php.

Références JFactory\getLanguage().

Référencé par JDocumentRendererHead\fetchHead(), JDocumentHTML\getHeadData(), JFormFieldRepeatable\getInput(), et JDocumentHTML\setHeadData().

{
if (is_array($jsSafe))
{
if (array_key_exists('interpretBackSlashes', $jsSafe))
{
$interpretBackSlashes = (boolean) $jsSafe['interpretBackSlashes'];
}
if (array_key_exists('jsSafe', $jsSafe))
{
$jsSafe = (boolean) $jsSafe['jsSafe'];
}
else
{
$jsSafe = false;
}
}
// Add the string to the array if not null.
if ($string !== null)
{
// Normalize the key and translate the string.
self::$strings[strtoupper($string)] = JFactory::getLanguage()->_($string, $jsSafe, $interpretBackSlashes);
}
}

+ Voici le graphe d'appel pour cette fonction :

+ Voici le graphe des appelants de cette fonction :

static JText::sprintf (   $string)
static

Passes a string thru a sprintf.

Note that this method can take a mixed number of arguments as for the sprintf function.

The last argument can take an array of options:

array('jsSafe'=>boolean, 'interpretBackSlashes'=>boolean, 'script'=>boolean)

where:

jsSafe is a boolean to generate a javascript safe strings. interpretBackSlashes is a boolean to interpret backslashes \->\,
->new line, ->tabulation. script is a boolean to indicate that the string will be push in the javascript language store.

Paramètres:
string$stringThe format string.
Renvoie:
string The translated strings or the key if 'script' is true in the array of options.
Depuis:
11.1

Définition à la ligne 251 du fichier text.php.

Références JFactory\getLanguage().

Référencé par JCacheStorageFile\_deleteFolder(), JCacheStorageFile\_filesInFolder(), JCacheStorageFile\_folders(), JClientFtp\_mode(), JClientFtp\_passive(), JClientFtp\_putCmd(), JClientFtp\_verifyResponse(), JFilesystemPatcher\applyHunk(), JAuthentication\authenticate(), JControllerForm\batch(), JModelAdmin\batchCopy(), JModelAdmin\batchMove(), JControllerForm\cancel(), JClientFtp\chdir(), JTableMenuType\check(), JTableMenu\check(), JTableUser\check(), JControllerAdmin\checkin(), JClientFtp\chmod(), JClientFtp\connect(), JFile\copy(), JClientFtp\create(), JControllerLegacy\createView(), JFile\delete(), JTableMenuType\delete(), JFolder\delete(), JClientFtp\delete(), JControllerForm\edit(), JDatabaseDriverMysql\execute(), JDatabaseDriverPdo\execute(), JDatabaseDriverMysqli\execute(), JDatabaseDriverSqlsrv\execute(), JDatabaseDriverPostgresql\execute(), JControllerLegacy\execute(), JFolder\files(), JUpdaterExtension\findUpdate(), JUpdaterCollection\findUpdate(), JFolder\folders(), JClientFtp\get(), JFormFieldModulelayout\getInput(), JFormFieldComponentlayout\getInput(), JFormFieldRules\getInput(), JLanguageStemmer\getInstance(), JModelLegacy\getInstance(), JControllerLegacy\getInstance(), JUser\getInstance(), JTable\getInstance(), JModelLegacy\getTable(), JControllerLegacy\getView(), JTableSession\insert(), JClientFtp\listDetails(), JClientFtp\listNames(), JUser\load(), JUpdate\loadFromXML(), JControllerForm\loadhistory(), JViewLegacy\loadTemplate(), JClientFtp\login(), JClientFtp\mkdir(), JFile\move(), JFolder\move(), JLanguage\parse(), JViewCategories\prepareDocument(), JViewCategory\prepareDocument(), JClientFtp\pwd(), JFile\read(), JClientFtp\read(), JClientFtp\reinit(), JClientFtp\rename(), JDocumentRendererRSS\render(), JDocumentRendererAtom\render(), JControllerAdmin\reorder(), JClientFtp\restart(), JControllerForm\save(), JControllerAdmin\saveorder(), JMail\sendAdminMail(), JMail\setSender(), JDatabase\stderr(), JTableMenuType\store(), JClientFtp\store(), JClientFtp\syst(), JTableSession\update(), JFile\upload(), JForm\validateField(), JFile\write(), et JClientFtp\write().

{
$args = func_get_args();
$count = count($args);
if ($count > 0)
{
if (is_array($args[$count - 1]))
{
$args[0] = $lang->_(
$string, array_key_exists('jsSafe', $args[$count - 1]) ? $args[$count - 1]['jsSafe'] : false,
array_key_exists('interpretBackSlashes', $args[$count - 1]) ? $args[$count - 1]['interpretBackSlashes'] : true
);
if (array_key_exists('script', $args[$count - 1]) && $args[$count - 1]['script'])
{
self::$strings[$string] = call_user_func_array('sprintf', $args);
return $string;
}
}
else
{
$args[0] = $lang->_($string);
}
$args[0] = preg_replace('/\[\[%([0-9]+):[^\]]*\]\]/', '%\1$s', $args[0]);
return call_user_func_array('sprintf', $args);
}
return '';
}

+ Voici le graphe d'appel pour cette fonction :


Documentation des données membres

JText::$strings = array()
staticprotected

Définition à la ligne 27 du fichier text.php.


La documentation de cette classe a été générée à partir du fichier suivant :