Languages
in package
implements
ActionInterface
uses
ActionTrait, BackwardCompatibility
This class handles the administration of languages tasks.
Table of Contents
Interfaces
- ActionInterface
- Interface for all action classes.
Properties
- $subaction : string
- $subactions : array<string|int, mixed>
- $obj : static
Methods
- add() : void
- Interface for adding a new language
- call() : void
- Convenience method to load() and execute() an instance of this class.
- canBeLogged() : bool
- Determines whether this action can be logged in the online log.
- canShowDebuggingInfo() : bool
- Determines whether debugging info should be shown.
- canShowInMaintenanceMode() : bool
- Determines whether this action allows access in maintenance mode.
- download() : void
- Download a language file from the Simple Machines website.
- editEntries() : mixed
- Edit a particular set of language entries.
- editLanguages() : void
- This lists all the current languages and allows editing of them.
- execute() : void
- Dispatcher to whichever sub-action method is necessary.
- getConfigVars() : array<string|int, mixed>
- Gets the configuration variables for the languages area.
- getOutputType() : OutputTypeInterface
- Gets the output type for this action.
- isAgreementAction() : bool
- Determines whether this action can be accessed without accepting the registration agreement and privacy policy.
- isRestrictedGuestAccessAllowed() : bool
- Determines whether this action allows access if guest access is restricted.
- isSimpleAction() : bool
- Determines whether this is a simple action.
- list_getLanguages() : array<string|int, mixed>
- Fetch the actual language information.
- list_getLanguagesList() : array<string|int, mixed>
- Gets a list of available languages from the mother ship Will return a subset if searching, otherwise all available
- list_getNumLanguages() : int
- How many languages? Callback for the list in editLanguages().
- load() : static
- Static wrapper for constructor.
- settings() : void
- Edit language related settings.
- subActionProvider() : null|array<string|int, mixed>
- Called by Subs-Compat.php BackwardCompatibility wrapper functions to provide subaction execution for existing mods
- __construct() : mixed
- Constructor. Protected to force instantiation via self::load().
- cleanLangString() : string
- This function cleans language entries to/from display.
Properties
$subaction
public
string
$subaction
= 'edit'
The requested sub-action. This should be set by the constructor.
$subactions
public
static array<string|int, mixed>
$subactions
= ['edit' => 'editLanguages', 'add' => 'add', 'settings' => 'settings', 'downloadlang' => 'download', 'editlang' => 'editEntries']
Available sub-actions.
$obj
protected
static static
$obj
An instance of this class. This is used by the load() method to prevent multiple instantiations.
Methods
add()
Interface for adding a new language
public
add() : void
Tags
call()
Convenience method to load() and execute() an instance of this class.
public
static call() : void
canBeLogged()
Determines whether this action can be logged in the online log.
public
canBeLogged() : bool
Return values
boolcanShowDebuggingInfo()
Determines whether debugging info should be shown.
public
canShowDebuggingInfo() : bool
Return values
boolcanShowInMaintenanceMode()
Determines whether this action allows access in maintenance mode.
public
canShowInMaintenanceMode() : bool
Return values
bool —True if access is allowed, false otherwise.
download()
Download a language file from the Simple Machines website.
public
download() : void
Requires a valid download ID ("did") in the URL. Also handles installing language files. Attempts to chmod things as needed. Uses a standard list to display information about all the files and where they'll be put.
Tags
editEntries()
Edit a particular set of language entries.
public
editEntries() : mixed
editLanguages()
This lists all the current languages and allows editing of them.
public
editLanguages() : void
execute()
Dispatcher to whichever sub-action method is necessary.
public
execute() : void
getConfigVars()
Gets the configuration variables for the languages area.
public
static getConfigVars() : array<string|int, mixed>
Return values
array<string|int, mixed> —$config_vars for the languages area.
getOutputType()
Gets the output type for this action.
public
getOutputType() : OutputTypeInterface
Return values
OutputTypeInterfaceisAgreementAction()
Determines whether this action can be accessed without accepting the registration agreement and privacy policy.
public
isAgreementAction() : bool
Return values
boolisRestrictedGuestAccessAllowed()
Determines whether this action allows access if guest access is restricted.
public
isRestrictedGuestAccessAllowed() : bool
Return values
bool —True if access is allowed, false otherwise.
isSimpleAction()
Determines whether this is a simple action.
public
isSimpleAction() : bool
Return values
boollist_getLanguages()
Fetch the actual language information.
public
static list_getLanguages() : array<string|int, mixed>
Callback for $listOptions['get_items']['function'] in editLanguages. Determines which languages are available by looking for the "{language}/General.php" file. Also figures out how many users are using a particular language.
Return values
array<string|int, mixed> —An array of information about currently installed languages
list_getLanguagesList()
Gets a list of available languages from the mother ship Will return a subset if searching, otherwise all available
public
static list_getLanguagesList() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array containing information about each available language
list_getNumLanguages()
How many languages? Callback for the list in editLanguages().
public
static list_getNumLanguages() : int
Return values
int —The number of available languages
load()
Static wrapper for constructor.
public
static load() : static
Return values
static —An instance of this class.
settings()
Edit language related settings.
public
settings([bool $return_config = false ]) : void
Parameters
- $return_config : bool = false
-
Whether to return the $config_vars array (used in admin search)
subActionProvider()
Called by Subs-Compat.php BackwardCompatibility wrapper functions to provide subaction execution for existing mods
public
static subActionProvider([null|string $sa = null ][, bool $return_config = false ][, string|null $activity = null ]) : null|array<string|int, mixed>
Parameters
- $sa : null|string = null
- $return_config : bool = false
- $activity : string|null = null
Return values
null|array<string|int, mixed>__construct()
Constructor. Protected to force instantiation via self::load().
protected
__construct() : mixed
cleanLangString()
This function cleans language entries to/from display.
protected
cleanLangString(string $string[, bool $to_display = true ]) : string
Parameters
- $string : string
-
The language string
- $to_display : bool = true
-
Whether or not this is going to be displayed
Tags
Return values
string —The cleaned string