Function __global->_insert_lang

Definitions

sources/lang3.php

  • Insert a content language string into the translation table, and returns the ID.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$field_name ID_TEXT No No required parameter N/A N/A The field name
$text string No No required parameter N/A N/A The text
$level integer No No required parameter 1 2 3 4 N/A The level of importance this content language string holds
$db ?object No No Null N/A N/A The database connector to use (null: standard site connector)
$comcode boolean No No False N/A N/A Whether it is to be parsed as Comcode
$lang_id ?integer No No Null N/A N/A The ID to use for the content language string (null: work out next available)
$lang ?LANGUAGE_NAME No No Null N/A N/A The language (null: uses the current language)
$insert_as_admin boolean No No False N/A N/A Whether to insert it as an admin (any Comcode parsing will be carried out with admin privileges)
$pass_id ?string No No Null N/A N/A The special identifier for this content language string on the page it will be displayed on; this is used to provide an explicit binding between languaged elements and greater templated areas (null: none)
$text_parsed ?string No No Null N/A N/A Assembled Tempcode portion (null: work it out)
$preparse_mode boolean No No True N/A N/A Whether to generate a fatal error if there is invalid Comcode
$save_as_volatile boolean No No False N/A N/A Whether we are saving as a 'volatile' file extension (used in the XML DB driver, to mark things as being non-syndicated to Git)

Returns

  • The content language string save fields
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Insert a content language string into the translation table, and returns the ID.
 *
 * @param  ID_TEXT $field_name The field name
 * @param  string $text The text
 * @param  integer $level The level of importance this content language string holds
 * @set 1 2 3 4
 * @param  ?object $db The database connector to use (null: standard site connector)
 * @param  boolean $comcode Whether it is to be parsed as Comcode
 * @param  ?integer $lang_id The ID to use for the content language string (null: work out next available)
 * @param  ?LANGUAGE_NAME $lang The language (null: uses the current language)
 * @param  boolean $insert_as_admin Whether to insert it as an admin (any Comcode parsing will be carried out with admin privileges)
 * @param  ?string $pass_id The special identifier for this content language string on the page it will be displayed on; this is used to provide an explicit binding between languaged elements and greater templated areas (null: none)
 * @param  ?string $text_parsed Assembled Tempcode portion (null: work it out)
 * @param  boolean $preparse_mode Whether to generate a fatal error if there is invalid Comcode
 * @param  boolean $save_as_volatile Whether we are saving as a 'volatile' file extension (used in the XML DB driver, to mark things as being non-syndicated to Git)
 * @return array The content language string save fields
 */

function _insert_lang(string $field_name, string $text, int $level, ?object $db = null, bool $comcode = false, ?int $lang_id = null, ?string $lang = null, bool $insert_as_admin = false, ?string $pass_id = null, ?string $text_parsed = null, bool $preparse_mode = true, bool $save_as_volatile = false) : array