ajax_edit_impr_text.php
\file \brief Display table for Improved Annotation (Edit Mode),
Ajax call in print_impr_text.php Call: inc/ajax_edit_impr_text.php?id=[textid]
Tags
Table of Contents
Functions
- make_trans() : string
- Make the translations choices for a term.
- get_translations() : array<string|int, string>
- Find the possible translations for a term.
- get_term_translations() : array<string|int, array<string|int, mixed>|int|null|string>
- Gather useful data to edit a term annotation on a specific text.
- edit_term_interaction() : string
- Prepare the HTML content for the interaction with a term
- edit_term_form() : string
- Full form for terms edition in a given text.
- make_form() : array<string|int, string>
- Prepare the form for printed text.
- do_ajax_edit_impr_text() : void
- Do the AJAX modification for editing a printed text.
Functions
make_trans()
Make the translations choices for a term.
make_trans(int $i, int|null $wid, string $trans, string $word, int $lang) : string
Parameters
- $i : int
-
Word unique index in the form
- $wid : int|null
-
Word ID or null
- $trans : string
-
Current translation set for the term, may be empty
- $word : string
-
Term text
- $lang : int
-
Language ID
Return values
string —HTML-formatted string
get_translations()
Find the possible translations for a term.
get_translations(int $word_id) : array<string|int, string>
Parameters
- $word_id : int
-
Term ID
Tags
Return values
array<string|int, string> —Return the possible translations.
get_term_translations()
Gather useful data to edit a term annotation on a specific text.
get_term_translations(string $wordlc, int $textid) : array<string|int, array<string|int, mixed>|int|null|string>
Parameters
- $wordlc : string
-
Term in lower case
- $textid : int
-
Text ID
Tags
Return values
array<string|int, array<string|int, mixed>|int|null|string> —Return the useful data to edit a term annotation on a specific text.
edit_term_interaction()
Prepare the HTML content for the interaction with a term
edit_term_interaction(string $wordlc, int $textid) : string
Parameters
- $wordlc : string
-
Term in lower case
- $textid : int
-
Text ID
Tags
Return values
string —JS string of the different fields of the term
edit_term_form()
Full form for terms edition in a given text.
edit_term_form(int $textid) : string
Parameters
- $textid : int
-
Text ID.
Return values
string —HTML table for all terms
make_form()
Prepare the form for printed text.
make_form(int $textid, string $wordlc) : array<string|int, string>
Parameters
- $textid : int
-
Text ID
- $wordlc : string
-
Lowercase word
Tags
Return values
array<string|int, string> —HTML output and JS output
do_ajax_edit_impr_text()
Do the AJAX modification for editing a printed text.
do_ajax_edit_impr_text(int $textid, string $wordlc) : void
Parameters
- $textid : int
-
Text ID
- $wordlc : string
-
Word lowercase. Can be left empty.