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

Change status of term while reading. More...

Namespaces

 Lwt
 

Functions

 get_word_data ($wid)
 
 set_word_status_ajax ($wid, $status)
 
 set_word_status_database ($wid, $status)
 
 set_word_status_javascript ($tid, $wid, $status, $word, $trans, $roman)
 
 set_word_status_display_page ($tid, $wid, $status, $word, $trans, $roman)
 
 do_set_word_status ($textid, $wordid, $status)
 

Detailed Description

Change status of term while reading.

Call: set_word_status.php?... ... tid=[textid]&wid=[wordid]&status=1..5/98/99

PHP version 8.1

Function Documentation

◆ do_set_word_status()

do_set_word_status (   $textid,
  $wordid,
  $status 
)

Complete workflow for updating a word. It edits the database, show the success message and do JavaScript action to change its display.

Parameters
string$textidID of the affected text
string$wordidID of the word to update
string$statusNew status for this word
Returns
void
Since
2.0.4-fork

◆ get_word_data()

get_word_data (   $wid)

Get various data for the word corresponding to the ID.

Parameters
string$widID of the word
Returns
array{0: string, 1: string, 2: string} The word in plain text, his translation and his romanization

@global string $tbpref

◆ set_word_status_ajax()

set_word_status_ajax (   $wid,
  $status 
)

Sent an AJAX request to change a word satus.

Parameters
string$widID of the word status to change
string$statusNew status to set

◆ set_word_status_database()

set_word_status_database (   $wid,
  $status 
)

Edit the term status in the database.

Parameters
string$widID of the word to update
string$statusNew status to set
Returns
string Some edit message, number of affected rows or error message

@global string $tbpref

◆ set_word_status_display_page()

set_word_status_display_page (   $tid,
  $wid,
  $status,
  $word,
  $trans,
  $roman 
)

Echo the HTML content of the page.

Parameters
string$tidText ID
string$widID of the word that changed status
string$statusNew status
string$wordWord in plain text
string$transTranslation of the word
string$romanRomanization of the word
Returns
void

◆ set_word_status_javascript()

set_word_status_javascript (   $tid,
  $wid,
  $status,
  $word,
  $trans,
  $roman 
)

Do the JavaScript action for changing display of the word.

Parameters
string$tidText ID
string$widID of the word that changed status, unnused
string$statusNew status, unnused
string$wordWord in plain text
string$transTranslation of the word
string$romanRomanization of the word
Returns
void