Learning with Texts - Fork 2.4.0-fork
Learn foreign languages with texts
Namespaces | Functions
do_text_text.php File Reference

Show text header frame. More...

Namespaces

namespace  Lwt
 

Functions

 get_text_data ($textid)
 
 getTextData ($textid)
 
 get_language_settings ($langid)
 
 getLanguagesSettings ($langid)
 
 echo_term ($actcode, $showAll, $spanid, $hidetag, $currcharcount, $record)
 
 echoTerm ( $actcode, $showAll, $hideuntil, $spanid, $hidetag, $currcharcount, $record)
 
 wordProcessor ($record, $showAll, $currcharcount)
 
 sentence_parser ($sid, $old_sid)
 
 sentenceParser ($sid, $old_sid)
 
 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)
 

Detailed Description

Show text header frame.

Call: do_text_text.php?text=[textid]

Function Documentation

◆ 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_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

◆ 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$showLearning1 to show learning translations
int<1,4>$mode_trans Annotation position
int$textsizeText font size
bool$ann_existDoes annotations exist for this text
Returns
void

◆ echo_term()

echo_term (   $actcode,
  $showAll,
  $spanid,
  $hidetag,
  $currcharcount,
  $record 
)

Print the output when the word is a term.

Parameters
int$actcodeAction code, > 1 for multiword
int$showAllShow all words or not
int$hideuntilUnused
string$spanidID for this span element
int$currcharcountCurrent number of characters
array<string,string>$record Various data
Returns
void

◆ echoTerm()

echoTerm (   $actcode,
  $showAll,
  $hideuntil,
  $spanid,
  $hidetag,
  $currcharcount,
  $record 
)

Print the output when the word is a term.

Parameters
int$actcodeAction code, > 1 for multiword
int$showAllShow all words or not
int$hideuntilUnused
string$spanidID for this span element
int$currcharcountCurrent number of characters
array<string,string>$record Various data
Returns
int 0
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$langidLanguage 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

◆ get_text_data()

get_text_data (   $textid)

Get the record for this text in the database.

Parameters
string$textidID 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

◆ getLanguagesSettings()

getLanguagesSettings (   $langid)

Return the settings relative to this language.

Parameters
int$langidLanguage 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.

◆ getTextData()

getTextData (   $textid)

Get the record for this text in the database.

Parameters
string$textidID 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.

◆ main_word_loop()

main_word_loop (   $textid,
  $showAll 
)

Get all words and start the iterate over them.

Parameters
string$textidID of the text
0 | 1$showAllShow 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$textidID of the text
0 | 1$showAllShow 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$showLearning1 to show learning translations
int<1,4>$mode_trans Annotation position
int$textsizeText font size
bool$ann_existDoes 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$sidSentence ID
int$old_sidOld sentence ID
Returns
int Sentence ID

◆ sentenceParser()

sentenceParser (   $sid,
  $old_sid 
)

Check if a new sentence SPAN should be started.

Parameters
int$sidSentence ID
int$old_sidOld sentence ID
Returns
int Sentence ID
Deprecated:
Use sentence_parser instead.

◆ word_parser()

word_parser (   $record,
  $showAll,
  $currcharcount,
  $hideuntil 
)

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

Parameters
string[]$recordRecord information
0 | 1$showAllShow all words or not
int$currcharcountCurrent number of caracters
int$cnt
int$sidSentence ID
int$hideuntilShould the value be hidden or not
Returns
int New value for $hideuntil

◆ wordParser()

wordParser (   $record,
  $showAll,
  $currcharcount,
  $hideuntil 
)

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

Parameters
string[]$recordRecord information
0 | 1$showAllShow all words or not
int$currcharcountCurrent number of caracters
int$cnt
int$sidSentence ID
int$hideuntilShould 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[]$recordRecord information
0 | 1$showAllShow all words or not
int$currcharcountCurrent number of caracters
Returns
int New number of caracters
Deprecated:
Use sentenceParser and wordParser instead.