2024.8.23
Loading...
Searching...
No Matches
TplAppOnline Class Reference

Static Public Member Functions

static getActionStatus ($status)
 
static process ()
 

Data Fields

const ACTION = 'status'
 

Detailed Description

Class TplAppOnline

This class provides methods to handle the online/offline status of the Bearsampp application. It includes functionalities for generating actions and menu items to switch the application between online and offline states.

Definition at line 17 of file class.tpl.app.online.php.

Member Function Documentation

◆ getActionStatus()

static TplAppOnline::getActionStatus ( $status)
static

Generates the action string to switch the online/offline status.

This method creates the action string for switching the application's online/offline status. It includes commands to restart relevant services and reload the application. The action string is used to define what happens when the status switch action is triggered.

Parameters
int$statusThe status to switch to (enabled or disabled).
Returns
string The generated action string for switching the online/offline status.

Definition at line 56 of file class.tpl.app.online.php.

57 {
58 return TplApp::getActionRun(Action::SWITCH_ONLINE, array($status)) . PHP_EOL .
62 }
const SWITCH_ONLINE
static getActionRun($action, $args=array(), $item=array(), $waitUntilTerminated=true)
static getActionRestart($sName)

References TplAppReload\getActionReload(), TplService\getActionRestart(), TplApp\getActionRun(), BinApache\SERVICE_NAME, BinFilezilla\SERVICE_NAME, and Action\SWITCH_ONLINE.

◆ process()

static TplAppOnline::process ( )
static

Generates the menu item and associated actions for switching the online/offline status.

This method creates a menu item for switching the application's online/offline status and defines the actions to be taken when the menu item is selected. It uses the global configuration and language objects to retrieve the current status and localized strings.

@global object $bearsamppConfig Provides access to the application's configuration settings. @global object $bearsamppLang Provides language support for retrieving language-specific values.

Returns
array The generated menu item and actions for switching the online/offline status.

Definition at line 34 of file class.tpl.app.online.php.

35 {
37
39 self::ACTION, array($bearsamppConfig->isOnline() ? Config::DISABLED : Config::ENABLED),
40 array($bearsamppConfig->isOnline() ? $bearsamppLang->getValue(Lang::MENU_PUT_OFFLINE) : $bearsamppLang->getValue(Lang::MENU_PUT_ONLINE)),
41 false, get_called_class()
42 );
43 }
global $bearsamppLang
const DISABLED
static getActionMulti($action, $args=array(), $item=array(), $disabled=false, $class=false)
global $bearsamppConfig
Definition homepage.php:26

References $bearsamppConfig, $bearsamppLang, Config\DISABLED, Config\ENABLED, TplApp\getActionMulti(), Lang\MENU_PUT_OFFLINE, and Lang\MENU_PUT_ONLINE.

Referenced by TplApp\getSectionMenuLeft().

+ Here is the caller graph for this function:

Field Documentation

◆ ACTION

const TplAppOnline::ACTION = 'status'

Definition at line 20 of file class.tpl.app.online.php.


The documentation for this class was generated from the following file: