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

Manage active texts. More...

Namespaces

 Lwt
 

Functions

 edit_texts_get_wh_query ($currentquery, $currentquerymode, $currentregexmode)
 
 edit_texts_get_wh_tag ($currentlang)
 
 edit_texts_mark_action ($markaction, $marked, $actiondata)
 
 edit_texts_delete ($txid)
 
 edit_texts_archive ($txid)
 
 edit_texts_do_operation ($op, $message1, $no_pagestart)
 
 edit_texts_form ($text, $annotated)
 
 edit_texts_new ($lid)
 
 edit_texts_change ($txid)
 
 edit_texts_filters_form ($currentlang, $recno, $currentpage, $pages)
 
 edit_texts_other_pages ($recno)
 
 edit_texts_show_text_row ($txrecord, $currentlang, $statuses)
 
 edit_texts_texts_form ($currentlang, $showCounts, $sql, $recno)
 
 edit_texts_display ($message)
 
 edit_texts_do_page ()
 

Detailed Description

Manage active texts.

Call: edit_texts.php?.... ... markaction=[opcode] ... do actions on marked texts ... del=[textid] ... do delete ... arch=[textid] ... do archive ... op=Check ... do check ... op=Save ... do insert new ... op=Change ... do update ... op=Save+and+Open ... do insert new and open ... op=Change+and+Open ... do update and open ... new=1 ... display new text screen ... chg=[textid] ... display edit screen ... filterlang=[langid] ... language filter ... sort=[sortcode] ... sort ... page=[pageno] ... page ... query=[titlefilter] ... title filter

PHP version 8.1

Function Documentation

◆ edit_texts_archive()

edit_texts_archive (   $txid)

Archive a text.

Parameters
int$txidtext ID
Returns
string Number of archives saved, texts deleted, sentences deleted, text items deleted.

@global string $tbpref Database table prefix

◆ edit_texts_change()

edit_texts_change (   $txid)

Create the main window to edit an existing text.

Parameters
int$txidText ID
Returns
void

@global string $tbpref Database table prefix

◆ edit_texts_delete()

edit_texts_delete (   $txid)

Delete an existing text.

Parameters
string | int$txidText ID
Returns
string Texts, sentences, and text items deleted.

@global string $tbpref Database table prefix

◆ edit_texts_display()

edit_texts_display (   $message)

Main display for the edit text functionality.

Parameters
string$messageMessage to display.
Returns
void

@global string $tbpref Database table prefix @global int $debug Debug mode active or not

◆ edit_texts_do_operation()

edit_texts_do_operation (   $op,
  $message1,
  $no_pagestart 
)

Do an operation on texts.

Parameters
string$opOperation name
mixed$message1Unnused
int | bool$no_pagestartIf you don't want a page
Returns
string Edition message (number of rows edited)

@global string $tbpref Database table prefix

Since
2.4.1-fork $message1 is unnused

◆ edit_texts_do_page()

edit_texts_do_page ( )

Main function for displaying the edit_texts page.

Returns
void

◆ edit_texts_filters_form()

edit_texts_filters_form (   $currentlang,
  $recno,
  $currentpage,
  $pages 
)

Do the filters form for texts display.

Parameters
string$currentlangCurrent language ID
int$recno
int$currentpageCurrent page number
int$pagesTotal number of pages
Returns
void

◆ edit_texts_form()

edit_texts_form (   $text,
  $annotated 
)

Display the main form for text creation and edition.

Parameters
Text$textText object to edit
bool$annotatedTrue if this text has annotations
Returns
void

Change the language of inputs for text and title based on selected language.

◆ edit_texts_get_wh_query()

edit_texts_get_wh_query (   $currentquery,
  $currentquerymode,
  $currentregexmode 
)

Get the value of $wh_query.

Parameters
string$currentqueryCurrent database query
string$currentquerymode
string$currentregexmode
Returns
string Content for $wh_query.

◆ edit_texts_get_wh_tag()

edit_texts_get_wh_tag (   $currentlang)

Return the value for $wh_tag.

Parameters
string | int$currentlangCurrent language ID
Returns
string Content for $wh_tag.

◆ edit_texts_mark_action()

edit_texts_mark_action (   $markaction,
  $marked,
  $actiondata 
)

When a mark action is in use, do the action.

Parameters
string$markactionType of action
array$markedTexts marked.
string$actiondataValues to insert to the database
Returns
(null|string)[] Number of rows edited, the second element is always null.

@global string $tbpref Database table prefix

Since
2.4.1-fork The second return field is always null

@psalm-return list{string, null}

◆ edit_texts_new()

edit_texts_new (   $lid)

Create a window to make a new text in the target language.

Parameters
int$lidLanguage ID
Returns
void

@global string $tbpref

◆ edit_texts_other_pages()

edit_texts_other_pages (   $recno)

Make links to navigate to other pages if necessary.

Parameters
int$recnoRecord number
Returns
void

◆ edit_texts_show_text_row()

edit_texts_show_text_row (   $txrecord,
  $currentlang,
  $statuses 
)

Display the content of a table row for text edition.

Parameters
array$txrecord
Various information about the text should contain 'TxID' at least.
string$currentlangCurrent language ID
array{int<0,5>|98|99,array{string,string}}$statuses List of statuses WITH unknown words (status 0)
Returns
void
Since
2.6.0-fork Audio was never shown

◆ edit_texts_texts_form()

edit_texts_texts_form (   $currentlang,
  $showCounts,
  $sql,
  $recno 
)

Main form for displaying multiple texts.

Parameters
string$currentlangCurrent language ID
string$showCountsNumber of items to show, put into a string
string$sqlSQL string to execute
int$recnoRecord number
Returns
void

@global int $debug Display debug information.