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

Create or edit single word. More...

Functions

 insert_new_word ($textlc, $translation)
 
 edit_term ($translation)
 
 lowercase_term_not_equal ($textlc)
 
 change_term_display ($wid, $translation, $hex)
 

Variables

 $translation_raw = repl_tab_nl(getreq("WoTranslation"))
 
if($translation_raw=='') else
 
 $fromAnn = getreq("fromAnn")
 
 $hex = null
 
 $lang = null
 
 $term = null
 
 $res = do_mysqli_query($sql)
 
 $record = mysqli_fetch_assoc($res)
 
 $termlc = mb_strtolower($term, 'UTF-8')
 
 $new = (isset($wid) == false)
 
 $titletext = ($new ? "New Term" : "Edit Term") . ": " . tohtml($term)
 
 $scrdir = getScriptDirectionTag($lang)
 

Detailed Description

Create or edit single word.

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

Since
1.0.3
Author
LWT Project lwt-p.nosp@m.roje.nosp@m.ct@ho.nosp@m.tmai.nosp@m.l.com

Function Documentation

◆ change_term_display()

change_term_display (   $wid,
  $translation,
  $hex 
)

Echoes a JavaScript element, that will edit terms diplay

◆ edit_term()

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

◆ insert_new_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
array{0: string, 1: string} Word id, and then an insertion message

◆ lowercase_term_not_equal()

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.

Variable Documentation

◆ else

if ( $new) else
Initial value:
{
$translation = $translation_raw