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

Create or edit single word. More...

Namespaces

 Lwt
 

Functions

 insert_new_word ($textlc, $translation)
 
 edit_term ($translation)
 
 lowercase_term_not_equal ($textlc)
 
 change_term_display ($wid, $translation, $hex)
 
 edit_word_do_operation ($translation, $fromAnn)
 
 edit_word_do_form ($wid, $text_id, $ord, $fromAnn)
 
 do_content ()
 

Detailed Description

Create or edit single word.

Call: edit_word.php?.... ... op=Save ... do insert new ... op=Change ... do update ... fromAnn=recno&tid=[textid]&ord=[textpos] ... calling from impr. annotation editing ... tid=[textid]&ord=[textpos]&wid= ... new word
... tid=[textid]&ord=[textpos]&wid=[wordid] ... edit word

PHP version 8.1

Function Documentation

◆ change_term_display()

Lwt\Interface\Edit_Word\change_term_display (   $wid,
  $translation,
  $hex 
)

Echoes a JavaScript element, that will edit terms diplay

◆ edit_term()

Lwt\Interface\Edit_Word\edit_term (   $translation)

Edit an existing term.

Parameters
string$translationNew translation for this term
Returns
array{0: string, 1: string} Word id, and then an insertion message

◆ edit_word_do_form()

Lwt\Interface\Edit_Word\edit_word_do_form (   $wid,
  $text_id,
  $ord,
  $fromAnn 
)
Returns
void

Sets the translation of a term.

Sets the romanization of a term.

◆ insert_new_word()

Lwt\Interface\Edit_Word\insert_new_word (   $textlc,
  $translation 
)

Insert a new word to the database

Parameters
string$textlcThe word to insert, in lowercase
string$translationTranslation of this term
Returns
(int|string)[] Word id, and then an insertion message

@psalm-return list{int, string}

◆ lowercase_term_not_equal()

Lwt\Interface\Edit_Word\lowercase_term_not_equal (   $textlc)

Use this function if the lowercase version of the word does not correspond. It will echo an error message.

Parameters
string$textlcThe lowercase version of the word we want.