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

Delete a word. More...

Functions

 get_term ($wid)
 
 delete_word_from_database ($wid)
 
 delete_word_javascript ($wid, $tid)
 
 delete_word_page_content ($tid, $wid, $term, $m1)
 
 do_delete_word ($textid, $wordid)
 

Detailed Description

Delete a word.

Call: delete_word.php?wid=[wordid]&tid=[textid]

PHP version 8.1

Function Documentation

◆ delete_word_from_database()

delete_word_from_database (   $wid)

Edit the word from the database.

Parameters
string$widID of the word to delete
Returns
string Some edit message, number of affected rows or error message

@global string $tbpref

◆ delete_word_javascript()

delete_word_javascript (   $wid,
  $tid 
)

Do the JavaScript action for changing display of the word.

Parameters
string$widID of the word to delete
int$tidText ID
Returns
void

Make the visual effects to delete a word from the page.

Parameters
{int}wid Word ID
Returns
{undefined}

◆ delete_word_page_content()

delete_word_page_content (   $tid,
  $wid,
  $term,
  $m1 
)

Make the HTML content of the page when deleting a word.

Parameters
int$tidText ID
string$widID of the word to delete
string$termThe deleted word
string$m1Some edit message, number of affected rows or error message
Returns
void

◆ do_delete_word()

do_delete_word (   $textid,
  $wordid 
)

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

Parameters
int$textidID of the affected text
string$wordidID of the word to delete
Returns
void
Since
2.0.4-fork

◆ get_term()

get_term (   $wid)

Return the term corresponding to the ID.

Parameters
string$widID of the word
Returns
string A word

@global string $tbpref