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

Edit/New Multi-word term (expression) More...

Namespaces

 Lwt
 

Functions

 export_term_js_dict ($term)
 
 edit_mword_prepare_term ()
 
 edit_mword_do_operation ($term)
 
 edit_mword_do_insert ($term)
 
 edit_mword_do_update ($term, $newstatus)
 
 edit_mword_new ($text, $tid, $ord, $len)
 
 edit_mword_update ($wid, $tid, $ord)
 
 edit_mword_display_new ($term, $tid, $ord, $len)
 
 edit_mword_display_change ($term, $tid, $ord)
 
 edit_mword_page ()
 

Detailed Description

Edit/New Multi-word term (expression)

Call: edit_mword.php?.... ... op=Save ... do insert new ... op=Change ... do update ... tid=[textid]&ord=[textpos]&wid=[wordid] ... edit
... tid=[textid]&ord=[textpos]&txt=[word] ... new or edit

PHP version 8.1

Function Documentation

◆ edit_mword_display_change()

edit_mword_display_change (   $term,
  $tid,
  $ord 
)

Display an updating form for a multi-word.

Parameters
Term$termMulti-word to being modified.
int$tidText ID
int$ordText order
Returns
void

@global string $tbpref Database table prefix.

◆ edit_mword_display_new()

edit_mword_display_new (   $term,
  $tid,
  $ord,
  $len 
)

Display a form for the insertion of a new multi-word.

Parameters
Term$termMulti-word to insert.
int$tidText ID
int$ordText order
int$lenNumber of words in the multi-word.
Returns
void

@global string $tbpref Database table prefix.

◆ edit_mword_do_insert()

edit_mword_do_insert (   $term)

Insert a multi-word to the database.

Parameters
Term$termMulti-word to be inserted.
Returns
string "Terms saved: n"

@global string $tbpref Database table prefix.

Since
2.5.2-fork Use the "wordcount" attribute of $term instead of the wrong word_count.

◆ edit_mword_do_operation()

edit_mword_do_operation (   $term)

Do a server operation for multiwords.

Returns
void

◆ edit_mword_do_update()

edit_mword_do_update (   $term,
  $newstatus 
)

Update a multi-word.

Parameters
Term$termMulti-word to be inserted.
int$newstatusNew multi-word status
Returns
string "Terms updated: n"

@global string $tbpref Database table prefix.

◆ edit_mword_new()

edit_mword_new (   $text,
  $tid,
  $ord,
  $len 
)

Make the main display for editing new multi-word.

Parameters
string$textOriginal group of words.
int$tidText ID
int$ordText order
int$lenNumber of words in the multi-word.
Returns
void

@global string $tbpref Database table prefix.

◆ edit_mword_page()

edit_mword_page ( )

Create the multi-word frame.

Returns
void

@global string $tbpref Database table prefix.

◆ edit_mword_prepare_term()

edit_mword_prepare_term ( )

Use the superglobals to load a new Term object.

Check if the lowercase version is a good one.

Returns
Term The loaded data.
Since
2.5.2-fork The created term has the attribute "wordcount" assigned (instead of the wrong "word_count").

◆ edit_mword_update()

edit_mword_update (   $wid,
  $tid,
  $ord 
)

Make the main display for editing existing multi-word.

Parameters
int$widTerm ID
int$tidText ID
int$ordText order
Returns
void

@global string $tbpref Database table prefix.

◆ export_term_js_dict()

export_term_js_dict (   $term)

Export term data as a JSON dictionnary.

Returns
string JSON dictionnary.