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

Change the text display mode. More...

Namespaces

 Lwt
 

Functions

 text_mode_save_settings ($showAll, $showLearning)
 
 text_mode_page_content ($showAll, $showLearning, $oldShowLearning)
 
 change_text_mode ($textid, $showAll, $showLearning)
 

Detailed Description

Change the text display mode.

Call: set_text_mode.php?text=[textid]&mode=0/1&showLeaning=0/1

PHP version 8.1

Function Documentation

◆ change_text_mode()

change_text_mode (   $textid,
  $showAll,
  $showLearning 
)

Complete workflow for changing text mode. It edits the settings in the database, show the success message and do JavaScript action to change its display.

Parameters
int$textidID of the current text
int$showAllWhether all word should be shown
int$showLearningWhether to show translation of learning words
Returns
void

◆ text_mode_page_content()

text_mode_page_content (   $showAll,
  $showLearning,
  $oldShowLearning 
)

Do the main page content when chaning display of translations.

Parameters
int$showAllWhether all word should be shown
int$showLearningWhether to show translation of learning words
int$oldShowLearningIf show learning was previously true (1) or false (0)
Returns
void

◆ text_mode_save_settings()

text_mode_save_settings (   $showAll,
  $showLearning 
)

Save text mode settings.

Parameters
int$showAllWhether all word should be shown
int$showLearningWhether to show translation of learning words
Returns
int If show learning were previously true (1) or false (0)

@psalm-return 0|1