Learning with Texts - Fork 2.9.0-fork
Learn foreign languages with texts
Loading...
Searching...
No Matches
Namespaces | Functions
ajax_edit_impr_text.php File Reference

Display table for Improved Annotation (Edit Mode),. More...

Namespaces

namespace  Lwt
 

Functions

 make_trans ($i, $wid, $trans, $word, $lang)
 
 get_translations ($word_id)
 
 get_term_translations ($wordlc, $textid)
 
 edit_term_interaction ($wordlc, $textid)
 
 edit_term_form ($textid)
 
 make_form ($textid, $wordlc)
 
 do_ajax_edit_impr_text ($textid, $wordlc)
 

Detailed Description

Display table for Improved Annotation (Edit Mode),.

Ajax call in print_impr_text.php Call: inc/ajax_edit_impr_text.php?id=[textid]

Function Documentation

◆ do_ajax_edit_impr_text()

do_ajax_edit_impr_text (   $textid,
  $wordlc 
)

Do the AJAX modification for editing a printed text.

Parameters
int$textidText ID
string$wordlcWord lowercase. Can be left empty.
Returns
void

◆ edit_term_form()

edit_term_form (   $textid)

Full form for terms edition in a given text.

Parameters
int$textidText ID.
Returns
string HTML table for all terms

◆ edit_term_interaction()

edit_term_interaction (   $wordlc,
  $textid 
)

Prepare the HTML content for the interaction with a term

Parameters
string$wordlcTerm in lower case
int$textidText ID
Returns
string JS string of the different fields of the term
Deprecated:
2.9.0 Use AJAX instead

◆ get_term_translations()

get_term_translations (   $wordlc,
  $textid 
)

Gather useful data to edit a term annotation on a specific text.

Parameters
string$wordlcTerm in lower case
int$textidText ID
Returns
(array|int|null|string)[] Return the useful data to edit a term annotation on a specific text.

@psalm-return array{term_lc?: string, wid?: int|null, trans?: string, ann_index?: int<0, max>, term_ord?: int, translations?: array, lang_id?: int, error?: 'Annotation line is ill-formatted'|'Annotation not found'}

◆ get_translations()

get_translations (   $word_id)

Find the possible translations for a term.

Parameters
int$word_idTerm ID
Returns
string[] Return the possible translations.

@psalm-return list<non-empty-string>

◆ make_form()

make_form (   $textid,
  $wordlc 
)

Prepare the form for printed text.

Parameters
int$textidText ID
string$wordlcLowercase word
Returns
string[] HTML output and JS output

@global string $tbpref Database table prefix.

@psalm-return list{string, string}

Deprecated:
2.9.0 Use AJAX instead

◆ make_trans()

make_trans (   $i,
  $wid,
  $trans,
  $word,
  $lang 
)

Make the translations choices for a term.

Parameters
int$iWord unique index in the form
int | null$widWord ID or null
string$transCurrent translation set for the term, may be empty
string$wordTerm text
int$langLanguage ID
Returns
string HTML-formatted string