Bearsampp 2026.3.26
API documentation
Loading...
Searching...
No Matches
TplAppServices Class Reference

Static Public Member Functions

static getActionRestartServices ()
static getActionStartServices ()
static getActionStopServices ()
static process ()

Data Fields

const ACTION_RESTART = 'restartServices'
const ACTION_START = 'startServices'
const ACTION_STOP = 'stopServices'

Detailed Description

Class TplAppServices

This class provides methods to generate menu items and actions for managing multiple services within the Bearsampp application. It includes functionalities for starting, stopping, and restarting all services at once.

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

Member Function Documentation

◆ getActionRestartServices()

getActionRestartServices ( )
static

Generates the actions to restart all services using a single splash screen.

Returns
string The generated action to restart all services.

Definition at line 91 of file class.tpl.app.services.php.

92 {
94 }
const RESTART_ALL_SERVICES
static getActionRun($action, $args=array(), $item=array(), $waitUntilTerminated=true)

References TplApp\getActionRun(), and Action\RESTART_ALL_SERVICES.

◆ getActionStartServices()

getActionStartServices ( )
static

Generates the actions to start all services using a single splash screen.

Returns
string The generated action to start all services.

Definition at line 71 of file class.tpl.app.services.php.

72 {
74 }
const START_ALL_SERVICES

References TplApp\getActionRun(), and Action\START_ALL_SERVICES.

◆ getActionStopServices()

getActionStopServices ( )
static

Generates the actions to stop all services using a single splash screen.

Returns
string The generated action to stop all services.

Definition at line 81 of file class.tpl.app.services.php.

82 {
84 }
const STOP_ALL_SERVICES

References TplApp\getActionRun(), and Action\STOP_ALL_SERVICES.

◆ process()

process ( )
static

Generates the main services menu with options to start, stop, and restart all services.

@global object $bearsamppLang Provides language support for retrieving language-specific values.

Returns
array An array containing the generated menu items and actions for services.

Definition at line 31 of file class.tpl.app.services.php.

32 {
33 global $bearsamppLang;
34
35 $tplStart = TplApp::getActionMulti(
36 self::ACTION_START, null,
38 false, get_called_class()
39 );
40
41 $tplStop = TplApp::getActionMulti(
42 self::ACTION_STOP, null,
44 false, get_called_class()
45 );
46
47 $tplRestart = TplApp::getActionMulti(
48 self::ACTION_RESTART, null,
50 false, get_called_class()
51 );
52
53 // Items
54 $items = $tplStart[TplApp::SECTION_CALL] . PHP_EOL .
55 $tplStop[TplApp::SECTION_CALL] . PHP_EOL .
56 $tplRestart[TplApp::SECTION_CALL] . PHP_EOL;
57
58 // Actions
59 $actions = PHP_EOL . $tplStart[TplApp::SECTION_CONTENT] .
60 PHP_EOL . $tplStop[TplApp::SECTION_CONTENT] .
61 PHP_EOL . $tplRestart[TplApp::SECTION_CONTENT];
62
63 return array($items, $actions);
64 }
global $bearsamppLang
const MENU_RESTART_SERVICES
const MENU_START_SERVICES
const MENU_STOP_SERVICES
const GLYPH_SERVICES_STOP
const GLYPH_SERVICES_RESTART
const GLYPH_SERVICES_START
static getActionMulti($action, $args=array(), $item=array(), $disabled=false, $class=false)
const SECTION_CALL
const SECTION_CONTENT

References $bearsamppLang, TplApp\getActionMulti(), TplAestan\GLYPH_SERVICES_RESTART, TplAestan\GLYPH_SERVICES_START, TplAestan\GLYPH_SERVICES_STOP, Lang\MENU_RESTART_SERVICES, Lang\MENU_START_SERVICES, Lang\MENU_STOP_SERVICES, TplApp\SECTION_CALL, and TplApp\SECTION_CONTENT.

Referenced by TplApp\getSectionMenuLeft().

Field Documentation

◆ ACTION_RESTART

const ACTION_RESTART = 'restartServices'

Definition at line 22 of file class.tpl.app.services.php.

◆ ACTION_START

const ACTION_START = 'startServices'

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

◆ ACTION_STOP

const ACTION_STOP = 'stopServices'

Definition at line 21 of file class.tpl.app.services.php.


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