Documentation

ajax_chg_term_status.php

\file \brief Change term status (Table Test).

value-difference should be either 1 or -1.

Call: inc/ajax_chg_term_status.php?id=[wordID]&data=[value-difference]

Tags
author

LWT Project lwt-project@hotmail.com

license

Unlicense http://unlicense.org/

link
https://hugofara.github.io/lwt/docs/php/files/inc-ajax-chg-term-status.html
since
1.5.4

Table of Contents

Functions

set_word_status()  : string
Force a term to get a new status.
get_new_status()  : int<1, 5>|98|99
Check the consistency of the new status.
update_word_status()  : string|null
Save the new word status to the database, return the controls.
ajax_increment_term_status()  : string
Do a word status change.
do_ajax_chg_term_status()  : void
Do a word status change and print the result.

Functions

set_word_status()

Force a term to get a new status.

set_word_status(string|int $wid, string|int $status) : string
Parameters
$wid : string|int

ID of the word to edit

$status : string|int

New status to set

Tags
global

string $tbpref

Return values
string

Number of affected rows or error message

get_new_status()

Check the consistency of the new status.

get_new_status(int $oldstatus, bool $up) : int<1, 5>|98|99
Parameters
$oldstatus : int

Old status

$up : bool

True if status should incremented, false if decrementation needed

Return values
int<1, 5>|98|99

New status in the good number range.

update_word_status()

Save the new word status to the database, return the controls.

update_word_status(int $wid, int $currstatus) : string|null
Parameters
$wid : int

Word ID

$currstatus : int

Current status in the good value range.

Tags
global

string $tbpref Database table prefix

Return values
string|null

HTML-formatted string with plus/minus controls if a success.

ajax_increment_term_status()

Do a word status change.

ajax_increment_term_status(int $wid, bool $up) : string
Parameters
$wid : int

Word ID

$up : bool

Should the status be incremeted or decremented

Tags
global

string $tbpref Database table prefix.

todo

2.9.0 Dirty PHP implementation, needs further refactoring

Return values
string

HTML-formatted string for increments

do_ajax_chg_term_status()

Do a word status change and print the result.

do_ajax_chg_term_status(int $wid, bool $up) : void
Parameters
$wid : int

Word ID

$up : bool

Should the status be incremeted or decremented

Tags
global

string $tbpref Database table prefix.

see
ajax_increment_term_status

Return values instead of printing.


        
On this page

Search results