Documentation

set_word_status.php

\file \brief Change status of term while reading

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

PHP version 8.1

Tags
category

Helper_Frame

author

LWT Project lwt-project@hotmail.com

license

Unlicense http://unlicense.org/

since
1.0.3

Table of Contents

Functions

get_word_data()  : array{0: string, 1: string, 2: string}
Get various data for the word corresponding to the ID.
set_word_status_ajax()  : void
Sent an AJAX request to change a word satus.
set_word_status_database()  : string
Edit the term status in the database.
set_word_status_javascript()  : void
Do the JavaScript action for changing display of the word.
set_word_status_display_page()  : void
Echo the HTML content of the page.
do_set_word_status()  : void
Complete workflow for updating a word.

Functions

get_word_data()

Get various data for the word corresponding to the ID.

get_word_data(string $wid) : array{0: string, 1: string, 2: string}
Parameters
$wid : string

ID of the word

Tags
global

string $tbpref

Return values
array{0: string, 1: string, 2: string}

The word in plain text, his translation and his romanization

set_word_status_ajax()

Sent an AJAX request to change a word satus.

set_word_status_ajax(string $wid, string $status) : void
Parameters
$wid : string

ID of the word status to change

$status : string

New status to set

set_word_status_database()

Edit the term status in the database.

set_word_status_database(string $wid, string $status) : string
Parameters
$wid : string

ID of the word to update

$status : string

New status to set

Tags
global

string $tbpref

Return values
string

Some edit message, number of affected rows or error message

set_word_status_javascript()

Do the JavaScript action for changing display of the word.

set_word_status_javascript(string $tid, string $wid, string $status, string $word, string $trans, string $roman) : void
Parameters
$tid : string

Text ID

$wid : string

ID of the word that changed status

$status : string

New status

$word : string

Word in plain text

$trans : string

Translation of the word

$roman : string

Romanization of the word

set_word_status_display_page()

Echo the HTML content of the page.

set_word_status_display_page(string $tid, string $wid, string $status, string $word, string $trans, string $roman) : void
Parameters
$tid : string

Text ID

$wid : string

ID of the word that changed status

$status : string

New status

$word : string

Word in plain text

$trans : string

Translation of the word

$roman : string

Romanization of the word

do_set_word_status()

Complete workflow for updating a word.

do_set_word_status(string $textid, string $wordid, string $status) : void

It edits the database, show the success message and do JavaScript action to change its display.

Parameters
$textid : string

ID of the affected text

$wordid : string

ID of the word to update

$status : string

New status for this word

Tags
since
2.0.4-fork

        
On this page

Search results