Documentation

StatusHelper

Helper class for word status-related display logic.

Provides methods for building status-related SQL conditions, CSS class filters, and HTML display elements.

Tags
since
3.0.0

Table of Contents

Methods

buildColoredMessage()  : string
Build a colored status message HTML.
buildReviewTableControls()  : string
Build status controls (plus/minus buttons) for test table.
buildSetStatusOption()  : string
Build a "set status to" option for multiple word actions.
checkRange()  : bool
Check if a status value is within a status range.
getAbbr()  : string
Get status abbreviation by status code.
getColoredMessage()  : string
Get a colored status message HTML for a given status code.
getIncludedStatuses()  : array<string|int, int>
Get the list of statuses included in a status range.
getName()  : string
Get status name by status code.
makeClassFilter()  : string
Build CSS class filter to exclude certain statuses.
makeCondition()  : string
Build a SQL condition for filtering by status range.

Methods

buildColoredMessage()

Build a colored status message HTML.

public static buildColoredMessage(int $status, string $name, string $abbr) : string
Parameters
$status : int

Status value

$name : string

Status display name

$abbr : string

Status abbreviation

Return values
string

HTML span with status styling

buildReviewTableControls()

Build status controls (plus/minus buttons) for test table.

public static buildReviewTableControls(int $score, int $status, int $wordId, string $statusAbbr) : string
Parameters
$score : int

Score associated with the word

$status : int

Current status value

$wordId : int

Word ID for JavaScript callback

$statusAbbr : string

Status abbreviation text

Return values
string

HTML controls string

buildSetStatusOption()

Build a "set status to" option for multiple word actions.

public static buildSetStatusOption(int $status, string $name, string $abbr[, string $suffix = '' ]) : string
Parameters
$status : int

Status value

$name : string

Status display name

$abbr : string

Status abbreviation

$suffix : string = ''

Optional suffix for the option value

Return values
string

HTML option element

checkRange()

Check if a status value is within a status range.

public static checkRange(int $currentStatus, int $statusRange) : bool
Parameters
$currentStatus : int

Current status value

$statusRange : int

Status range to check against

Return values
bool

True if status is within range

getAbbr()

Get status abbreviation by status code.

public static getAbbr(int $status) : string
Parameters
$status : int

Status value (1-5, 98, or 99)

Return values
string

Status abbreviation

getColoredMessage()

Get a colored status message HTML for a given status code.

public static getColoredMessage(int $status) : string

This is a convenience method that looks up name and abbreviation automatically.

Parameters
$status : int

Status value (1-5, 98, or 99)

Return values
string

HTML span with status styling

getIncludedStatuses()

Get the list of statuses included in a status range.

public static getIncludedStatuses(int|string $statusRange) : array<string|int, int>
Parameters
$statusRange : int|string

Status range code

Return values
array<string|int, int>

Array of included status values

getName()

Get status name by status code.

public static getName(int $status) : string
Parameters
$status : int

Status value (1-5, 98, or 99)

Return values
string

Status display name

makeClassFilter()

Build CSS class filter to exclude certain statuses.

public static makeClassFilter(int|string $status) : string

Returns a CSS selector string that excludes elements NOT matching the given status filter.

Parameters
$status : int|string

Status filter value (0 returns empty string)

Return values
string

CSS :not() selector chain

makeCondition()

Build a SQL condition for filtering by status range.

public static makeCondition(string $fieldName, int $statusRange) : string

Status ranges:

  • 1-5, 98, 99: Single status values
  • 12-15: Status 1 to X (e.g., 14 = status 1-4)
  • 23-25: Status 2 to X
  • 34-35: Status 3 to X
  • 45: Status 4-5
  • 599: Status 5 or 99 (all known)
Parameters
$fieldName : string

Database field name to filter on

$statusRange : int

Status range code

Return values
string

SQL condition string


        
On this page

Search results