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

Setting all unknown words to Well Known (99) More...

Namespaces

 Lwt
 

Functions

 all_words_wellknown_get_words ($txid)
 
 all_words_wellknown_process_word ($status, $term, $termlc, $langid)
 
 all_words_wellknown_main_loop ($txid, $status)
 
 all_words_wellknown_count_terms ($status, $count)
 
 all_words_wellknown_javascript ($txid, $javascript)
 
 all_words_wellknown_content ($txid, $status)
 
 all_words_wellknown_full ($txid, $status)
 

Detailed Description

Setting all unknown words to Well Known (99)

Call: all_words_wellknown.php?text=[textid] (mark all words as well-known) all_words_wellknown.php?text=[textid]&status=[statusint] (mark with a specific status, normally 98 or 99)

PHP version 8.1

Function Documentation

◆ all_words_wellknown_content()

all_words_wellknown_content (   $txid,
  $status 
)

Make the main content of the page for all well-known words.

Parameters
int$txidText ID
int$statusNew status to apply to words.
Returns
void

◆ all_words_wellknown_count_terms()

all_words_wellknown_count_terms (   $status,
  $count 
)

Display the number of edited words.

Parameters
int$statusNew status
int$countNumber of edited words.
Returns
void
Since
2.5.3-fork Improved messages (more clear, and can handle singular/plural)

◆ all_words_wellknown_full()

all_words_wellknown_full (   $txid,
  $status 
)

Make a full HTML page for all well-known words.

Parameters
int$txidText ID
int$statusNew status to apply to words.
Returns
void

◆ all_words_wellknown_get_words()

all_words_wellknown_get_words (   $txid)

Make the SQL query for all words in the text.

Parameters
int$txidText id
Returns
mysqli_result|true SQL query.

◆ all_words_wellknown_javascript()

all_words_wellknown_javascript (   $txid,
  $javascript 
)

Execute JavaScript to change the display of all words.

Parameters
int$txidText ID
string$javascriptJavaScript-formatted string.
Returns
void

◆ all_words_wellknown_main_loop()

all_words_wellknown_main_loop (   $txid,
  $status 
)

Main processing loop to mark all words of a text with a new status.

Parameters
int$txidText ID
int$statusNew status to apply to all words.
Returns
array [int, string] Number of edited words, and JavaScript query to change their display
Since
2.5.3-fork Use 'let' instead of 'var' in returned JS

@psalm-return list{int, string}

◆ all_words_wellknown_process_word()

all_words_wellknown_process_word (   $status,
  $term,
  $termlc,
  $langid 
)

For each word, add the word to the database.

Parameters
int$statusNew word status
string$termWord to mark
string$termlcSame as $term, but in lowercase.
int$langidLanguage ID
Returns
array [int, string] Number of rows edited and a javascript query.
Since
2.5.3-fork Do not crash when echoing an error
2.5.3-fork Do not crash when a word is already registred to the database

@psalm-return list{int, string}