Documentation

do_text_text.php

\file \brief Show text header frame

Call: do_text_text.php?text=[textid]

PHP version 8.1

Tags
author

LWT Project lwt-project@hotmail.com

license

Unlicense http://unlicense.org/

link
https://hugofara.github.io/lwt/docs/php/files/do-text-text.html
since
1.0.3

Table of Contents

Functions

get_text_data()  : array{TxLgID: int, TxTitle: string, TxAnnotatedText: string, TxPosition: int}|false|null
Get the record for this text in the database.
getTextData()  : array{TxLgID: int, TxTitle: string, TxAnnotatedText: string, TxPosition: int}|false|null
Get the record for this text in the database.
get_language_settings()  : Lg}|false|null
Return the settings relative to this language.
getLanguagesSettings()  : array{LgName: string, LgDict1URI: string, LgDict2URI: string, LgGoogleTranslateURI: string, LgTextSize: int, LgRemoveSpaces: int, LgRightToLeft: int}|false|null
Return the settings relative to this language.
echo_term()  : void
Print the output when the word is a term (word or multi-word).
echoTerm()  : int
Print the output when the word is a term.
wordProcessor()  : int
Process each word (can be punction, term, etc...). Caused laggy texts, replaced by wordParser.
sentence_parser()  : int
Check if a new sentence SPAN should be started.
sentenceParser()  : int
Check if a new sentence SPAN should be started.
item_parser()  : void
Process each text item (can be punction, term, etc...)
word_parser()  : int
Process each text item (can be punction, term, etc...)
wordParser()  : int
Process each word (can be punction, term, etc...)
main_word_loop()  : void
Get all words and start the iterate over them.
mainWordLoop()  : void
Get all words and start the iterate over them.
do_text_text_style()  : void
Prepare style for showing word status. Write a now STYLE object
prepareStyle()  : void
Prepare style for showing word status. Write a now STYLE object
do_text_text_javascript()  : void
Print JavaScript-formatted content.
do_text_javascript()  : void
Print JavaScript-formatted content.
do_text_text_content()  : void
Main function for displaying sentences. It will print HTML content.

Functions

get_text_data()

Get the record for this text in the database.

get_text_data(string|int $textid) : array{TxLgID: int, TxTitle: string, TxAnnotatedText: string, TxPosition: int}|false|null
Parameters
$textid : string|int

ID of the text

Tags
global

string $tbpref Table name prefix

psalm-return

array<string, float|int|null|string>|false|null

Return values
array{TxLgID: int, TxTitle: string, TxAnnotatedText: string, TxPosition: int}|false|null

Record corresponding to this text.

getTextData()

Get the record for this text in the database.

getTextData(string $textid) : array{TxLgID: int, TxTitle: string, TxAnnotatedText: string, TxPosition: int}|false|null
Parameters
$textid : string

ID of the text

Tags
global

string $tbpref Table name prefix

deprecated

Use get_text_data instead.

psalm-return

array<string, float|int|null|string>|false|null

Return values
array{TxLgID: int, TxTitle: string, TxAnnotatedText: string, TxPosition: int}|false|null

Record corresponding to this text.

get_language_settings()

Return the settings relative to this language.

get_language_settings(int $langid) : Lg}|false|null
Parameters
$langid : int

Language ID as defined in the database.

Tags
global

string $tbpref Table name prefix

psalm-return

array<string, float|int|null|string>|false|null

Return values
Lg}|false|null

Record corresponding to this language.

getLanguagesSettings()

Return the settings relative to this language.

getLanguagesSettings(int $langid) : array{LgName: string, LgDict1URI: string, LgDict2URI: string, LgGoogleTranslateURI: string, LgTextSize: int, LgRemoveSpaces: int, LgRightToLeft: int}|false|null
Parameters
$langid : int

Language ID as defined in the database.

Tags
global

string $tbpref Table name prefix

deprecated

Use get_language_settings instead.

psalm-return

array<string, float|int|null|string>|false|null

Return values
array{LgName: string, LgDict1URI: string, LgDict2URI: string, LgGoogleTranslateURI: string, LgTextSize: int, LgRemoveSpaces: int, LgRightToLeft: int}|false|null

Record corresponding to this language.

echo_term()

Print the output when the word is a term (word or multi-word).

echo_term(int $actcode, int $showAll, string $spanid, mixed $hidetag, int $currcharcount, array<string, string> $record[, array<string|int, mixed> &$exprs = array() ]) : void
Parameters
$actcode : int

Action code, number of words forming the term (> 1 for multiword)

$showAll : int

Show all words or not

$spanid : string

ID for this span element

$hidetag : mixed
$currcharcount : int

Current number of characters

$record : array<string, string>

Various data

$exprs : array<string|int, mixed> = array()

Current expressions

Tags
since
2.8.0-fork

Takes a new argument $exprs

echoTerm()

Print the output when the word is a term.

echoTerm(int $actcode, int $showAll, int $hideuntil, string $spanid, mixed $hidetag, int $currcharcount, array<string, string> $record) : int
Parameters
$actcode : int

Action code, > 1 for multiword

$showAll : int

Show all words or not

$hideuntil : int

Unused

$spanid : string

ID for this span element

$hidetag : mixed
$currcharcount : int

Current number of characters

$record : array<string, string>

Various data

Tags
since
2.2.1

Return 0 instead of a new value for $hideuntil

deprecated

Use echo_term instead.

Return values
int

wordProcessor()

Process each word (can be punction, term, etc...). Caused laggy texts, replaced by wordParser.

wordProcessor(array<string|int, string> $record, 0|1 $showAll, int $currcharcount) : int
Parameters
$record : array<string|int, string>

Record information

$showAll : 0|1

Show all words or not

$currcharcount : int

Current number of caracters

Tags
deprecated

Use sentenceParser and wordParser instead.

Return values
int

New number of caracters

sentence_parser()

Check if a new sentence SPAN should be started.

sentence_parser(int $sid, int $old_sid) : int
Parameters
$sid : int

Sentence ID

$old_sid : int

Old sentence ID

Return values
int

Sentence ID

sentenceParser()

Check if a new sentence SPAN should be started.

sentenceParser(int $sid, int $old_sid) : int
Parameters
$sid : int

Sentence ID

$old_sid : int

Old sentence ID

Tags
deprecated

Use sentence_parser instead.

Return values
int

Sentence ID

item_parser()

Process each text item (can be punction, term, etc...)

item_parser(array<string|int, mixed> $record, 0|1 $showAll, int $currcharcount, bool $hide[, array<string|int, mixed> &$exprs = array() ]) : void
Parameters
$record : array<string|int, mixed>

Text item information

$showAll : 0|1

Show all words or not

$currcharcount : int

Current number of caracters

$hide : bool

Should some item be hidden, depends on $showAll

$exprs : array<string|int, mixed> = array()

Current expressions

Tags
since
2.5.0-fork
since
2.8.0-fork

Take a new optional arguent $exprs

word_parser()

Process each text item (can be punction, term, etc...)

word_parser(array<string|int, string> $record, 0|1 $showAll, int $currcharcount, int $hideuntil) : int
Parameters
$record : array<string|int, string>

Record information

$showAll : 0|1

Show all words or not

$currcharcount : int

Current number of caracters

$hideuntil : int

Should the value be hidden or not

Tags
deprecated

Use item_parser instead (since 2.5.0-fork).

Return values
int

New value for $hideuntil

wordParser()

Process each word (can be punction, term, etc...)

wordParser(array<string|int, string> $record, 0|1 $showAll, int $currcharcount, int $hideuntil) : int
Parameters
$record : array<string|int, string>

Record information

$showAll : 0|1

Show all words or not

$currcharcount : int

Current number of caracters

$hideuntil : int

Should the value be hidden or not

Tags
deprecated

Use word_parser instead.

Return values
int

New value for $hideuntil

main_word_loop()

Get all words and start the iterate over them.

main_word_loop(string $textid, 0|1 $showAll) : void
Parameters
$textid : string

ID of the text

$showAll : 0|1

Show all words or not

Tags
global

string $tbpref Table name prefix

mainWordLoop()

Get all words and start the iterate over them.

mainWordLoop(string $textid, 0|1 $showAll) : void
Parameters
$textid : string

ID of the text

$showAll : 0|1

Show all words or not

Tags
global

string $tbpref Table name prefix

deprecated

Use main_word_loop instead.

do_text_text_style()

Prepare style for showing word status. Write a now STYLE object

do_text_text_style(int $showLearning, int<1, 4> $mode_trans, int $textsize, mixed $ann_exists) : void
Parameters
$showLearning : int

1 to show learning translations

$mode_trans : int<1, 4>

Annotation position

$textsize : int

Text font size

$ann_exists : mixed

prepareStyle()

Prepare style for showing word status. Write a now STYLE object

prepareStyle(int $showLearning, int<1, 4> $mode_trans, int $textsize, mixed $ann_exists) : void
Parameters
$showLearning : int

1 to show learning translations

$mode_trans : int<1, 4>

Annotation position

$textsize : int

Text font size

$ann_exists : mixed
Tags
deprecated

Use do_text_text_style instead.

do_text_text_javascript()

Print JavaScript-formatted content.

do_text_text_javascript(mixed $var_array) : void
Parameters
$var_array : mixed

do_text_javascript()

Print JavaScript-formatted content.

do_text_javascript(mixed $var_array) : void
Parameters
$var_array : mixed
Tags
deprecated

Use do_text_text_javascript instead.

do_text_text_content()

Main function for displaying sentences. It will print HTML content.

do_text_text_content(string|int $textid[, bool $only_body = true ]) : void
Parameters
$textid : string|int

ID of the requiered text

$only_body : bool = true

If true, only show the inner body. If false, create a complete HTML document.


        
On this page

Search results