Function __global->insert_lang_comcode

Definitions

sources/lang.php

  • Insert a Comcode content language string into the translation table, and return details of the content language string.
  • 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)
$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)
$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 Comcode content language string into the translation table, and return details of the content language string.
 *
 * @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 $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  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_comcode(string $field_name, string $text, int $level, ?object $db = null, bool $insert_as_admin = false, ?string $pass_id = null, bool $preparse_mode = true, bool $save_as_volatile = false) : array