Show text header frame.
More...
|
| get_text_data ($textid) |
|
| getTextData ($textid) |
|
| get_language_settings ($langid) |
|
| getLanguagesSettings ($langid) |
|
| echo_term ( $actcode, $showAll, $spanid, $hidetag, $currcharcount, $record, &$exprs=array()) |
|
| echoTerm ( $actcode, $showAll, $hideuntil, $spanid, $hidetag, $currcharcount, $record) |
|
| wordProcessor ($record, $showAll, $currcharcount) |
|
| sentence_parser ($sid, $old_sid) |
|
| sentenceParser ($sid, $old_sid) |
|
| item_parser ( $record, $showAll, $currcharcount, $hide, &$exprs=array()) |
|
| word_parser ($record, $showAll, $currcharcount, $hideuntil) |
|
| wordParser ($record, $showAll, $currcharcount, $hideuntil) |
|
| main_word_loop ($textid, $showAll) |
|
| mainWordLoop ($textid, $showAll) |
|
| do_text_text_style ($showLearning, $mode_trans, $textsize, $ann_exists) |
|
| prepareStyle ($showLearning, $mode_trans, $textsize, $ann_exists) |
|
| do_text_text_javascript ($var_array) |
|
| do_text_javascript ($var_array) |
|
| do_text_text_content ($textid, $only_body=true) |
|
Show text header frame.
Call: do_text_text.php?text=[textid]
PHP version 8.1
◆ do_text_javascript()
do_text_javascript |
( |
|
$var_array | ) |
|
Print JavaScript-formatted content.
- Parameters
-
array<string,mixed> | Associative array of all global variables for JS |
- Returns
- void
- Deprecated:
- Use do_text_text_javascript instead.
◆ do_text_text_content()
do_text_text_content |
( |
|
$textid, |
|
|
|
$only_body = true |
|
) |
| |
Main function for displaying sentences. It will print HTML content.
- Parameters
-
string | int | $textid | ID of the requiered text |
bool | $only_body | If true, only show the inner body. If false, create a complete HTML document. |
Annotation position between 0 and 4
Ruby annotations
◆ do_text_text_javascript()
do_text_text_javascript |
( |
|
$var_array | ) |
|
Print JavaScript-formatted content.
- Parameters
-
array<string,mixed> | Associative array of all global variables for JS |
- Returns
- void
Map global variables as a JSON object
Save the current reading position. @global {string} LWT_DATA.text.id Text ID
- Since
- 2.0.3-fork
◆ do_text_text_style()
do_text_text_style |
( |
|
$showLearning, |
|
|
|
$mode_trans, |
|
|
|
$textsize, |
|
|
|
$ann_exists |
|
) |
| |
Prepare style for showing word status. Write a now STYLE object
- Parameters
-
int | $showLearning | 1 to show learning translations |
| int<1,4> | $mode_trans Annotation position |
int | $textsize | Text font size |
bool | $ann_exist | Does annotations exist for this text |
- Returns
- void
◆ echo_term()
echo_term |
( |
|
$actcode, |
|
|
|
$showAll, |
|
|
|
$spanid, |
|
|
|
$hidetag, |
|
|
|
$currcharcount, |
|
|
|
$record, |
|
|
& |
$exprs = array() |
|
) |
| |
Print the output when the word is a term (word or multi-word).
- Parameters
-
int | $actcode | Action code, number of words forming the term (> 1 for multiword) |
int | $showAll | Show all words or not |
int | $hideuntil | Unused |
string | $spanid | ID for this span element |
int | $currcharcount | Current number of characters |
| array<string,string> | $record Various data |
array | $exprs | Current expressions |
- Returns
- void
- Since
- 2.8.0-fork Takes a new argument $exprs
◆ echoTerm()
echoTerm |
( |
|
$actcode, |
|
|
|
$showAll, |
|
|
|
$hideuntil, |
|
|
|
$spanid, |
|
|
|
$hidetag, |
|
|
|
$currcharcount, |
|
|
|
$record |
|
) |
| |
Print the output when the word is a term.
- Parameters
-
int | $actcode | Action code, > 1 for multiword |
int | $showAll | Show all words or not |
int | $hideuntil | Unused |
string | $spanid | ID for this span element |
int | $currcharcount | Current number of characters |
| array<string,string> | $record Various data |
- Since
- 2.2.1 Return 0 instead of a new value for $hideuntil
- Deprecated:
- Use echo_term instead.
◆ get_language_settings()
get_language_settings |
( |
|
$langid | ) |
|
Return the settings relative to this language.
- Parameters
-
int | $langid | Language ID as defined in the database. |
- Returns
- array{LgName: string, LgDict1URI: string, LgDict2URI: string, LgGoogleTranslateURI: string, LgTextSize: int, LgRegexpWordCharacters: string, LgRemoveSpaces: int, LgRightToLeft: int, Lg}|false|null Record corresponding to this language.
@global string $tbpref Table name prefix
@psalm-return array<string, float|int|null|string>|false|null
◆ get_text_data()
Get the record for this text in the database.
- Parameters
-
string | int | $textid | ID of the text |
- Returns
- array{TxLgID: int, TxTitle: string, TxAnnotatedText: string, TxPosition: int}|false|null Record corresponding to this text.
@global string $tbpref Table name prefix
@psalm-return array<string, float|int|null|string>|false|null
◆ getLanguagesSettings()
getLanguagesSettings |
( |
|
$langid | ) |
|
Return the settings relative to this language.
- Parameters
-
int | $langid | Language ID as defined in the database. |
- Returns
- array{LgName: string, LgDict1URI: string, LgDict2URI: string, LgGoogleTranslateURI: string, LgTextSize: int, LgRemoveSpaces: int, LgRightToLeft: int}|false|null Record corresponding to this language.
@global string $tbpref Table name prefix
- Deprecated:
- Use get_language_settings instead.
@psalm-return array<string, float|int|null|string>|false|null
◆ getTextData()
Get the record for this text in the database.
- Parameters
-
string | $textid | ID of the text |
- Returns
- array{TxLgID: int, TxTitle: string, TxAnnotatedText: string, TxPosition: int}|false|null Record corresponding to this text.
@global string $tbpref Table name prefix
- Deprecated:
- Use get_text_data instead.
@psalm-return array<string, float|int|null|string>|false|null
◆ item_parser()
item_parser |
( |
|
$record, |
|
|
|
$showAll, |
|
|
|
$currcharcount, |
|
|
|
$hide, |
|
|
& |
$exprs = array() |
|
) |
| |
Process each text item (can be punction, term, etc...)
- Parameters
-
array | $record | Text item information |
0 | 1 | $showAll | Show all words or not |
int | $currcharcount | Current number of caracters |
bool | $hide | Should some item be hidden, depends on $showAll |
array | $exprs | Current expressions |
- Returns
- void
- Since
- 2.5.0-fork
-
2.8.0-fork Take a new optional arguent $exprs
◆ main_word_loop()
main_word_loop |
( |
|
$textid, |
|
|
|
$showAll |
|
) |
| |
Get all words and start the iterate over them.
- Parameters
-
string | $textid | ID of the text |
0 | 1 | $showAll | Show all words or not |
- Returns
- void
@global string $tbpref Table name prefix
◆ mainWordLoop()
mainWordLoop |
( |
|
$textid, |
|
|
|
$showAll |
|
) |
| |
Get all words and start the iterate over them.
- Parameters
-
string | $textid | ID of the text |
0 | 1 | $showAll | Show all words or not |
- Returns
- void
@global string $tbpref Table name prefix
- Deprecated:
- Use main_word_loop instead.
◆ prepareStyle()
prepareStyle |
( |
|
$showLearning, |
|
|
|
$mode_trans, |
|
|
|
$textsize, |
|
|
|
$ann_exists |
|
) |
| |
Prepare style for showing word status. Write a now STYLE object
- Parameters
-
int | $showLearning | 1 to show learning translations |
| int<1,4> | $mode_trans Annotation position |
int | $textsize | Text font size |
bool | $ann_exist | Does annotations exist for this text |
- Returns
- void
- Deprecated:
- Use do_text_text_style instead.
◆ sentence_parser()
sentence_parser |
( |
|
$sid, |
|
|
|
$old_sid |
|
) |
| |
Check if a new sentence SPAN should be started.
- Parameters
-
int | $sid | Sentence ID |
int | $old_sid | Old sentence ID |
- Returns
- int Sentence ID
◆ sentenceParser()
sentenceParser |
( |
|
$sid, |
|
|
|
$old_sid |
|
) |
| |
Check if a new sentence SPAN should be started.
- Parameters
-
int | $sid | Sentence ID |
int | $old_sid | Old sentence ID |
- Returns
- int Sentence ID
- Deprecated:
- Use sentence_parser instead.
◆ word_parser()
word_parser |
( |
|
$record, |
|
|
|
$showAll, |
|
|
|
$currcharcount, |
|
|
|
$hideuntil |
|
) |
| |
Process each text item (can be punction, term, etc...)
- Parameters
-
string[] | $record | Record information |
0 | 1 | $showAll | Show all words or not |
int | $currcharcount | Current number of caracters |
int | $hideuntil | Should the value be hidden or not |
- Returns
- int New value for $hideuntil
- Deprecated:
- Use item_parser instead (since 2.5.0-fork).
◆ wordParser()
wordParser |
( |
|
$record, |
|
|
|
$showAll, |
|
|
|
$currcharcount, |
|
|
|
$hideuntil |
|
) |
| |
Process each word (can be punction, term, etc...)
- Parameters
-
string[] | $record | Record information |
0 | 1 | $showAll | Show all words or not |
int | $currcharcount | Current number of caracters |
int | $cnt | |
int | $sid | Sentence ID |
int | $hideuntil | Should the value be hidden or not |
- Returns
- int New value for $hideuntil
- Deprecated:
- Use word_parser instead.
◆ wordProcessor()
wordProcessor |
( |
|
$record, |
|
|
|
$showAll, |
|
|
|
$currcharcount |
|
) |
| |
Process each word (can be punction, term, etc...). Caused laggy texts, replaced by wordParser.
- Parameters
-
string[] | $record | Record information |
0 | 1 | $showAll | Show all words or not |
int | $currcharcount | Current number of caracters |
- Returns
- int New number of caracters
- Deprecated:
- Use sentenceParser and wordParser instead.