Change status of term while reading.
More...
|
| 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) |
|
Change status of term while reading.
Call: set_word_status.php?... ... tid=[textid]&wid=[wordid]&status=1..5/98/99
PHP version 8.1
◆ 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 | $textid | ID of the affected text |
string | $wordid | ID of the word to update |
string | $status | New status for this word |
- Returns
- void
- Since
- 2.0.4-fork
◆ get_word_data()
Get various data for the word corresponding to the ID.
- Parameters
-
- 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 | $wid | ID of the word status to change |
string | $status | New status to set |
◆ set_word_status_database()
set_word_status_database |
( |
|
$wid, |
|
|
|
$status |
|
) |
| |
Edit the term status in the database.
- Parameters
-
string | $wid | ID of the word to update |
string | $status | New 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 | $tid | Text ID |
string | $wid | ID of the word that changed status |
string | $status | New status |
string | $word | Word in plain text |
string | $trans | Translation of the word |
string | $roman | Romanization 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 | $tid | Text ID |
string | $wid | ID of the word that changed status, unnused |
string | $status | New status, unnused |
string | $word | Word in plain text |
string | $trans | Translation of the word |
string | $roman | Romanization of the word |
- Returns
- void