2024.8.23
Loading...
Searching...
No Matches
class.tpl.app.launchStartup.php
Go to the documentation of this file.
1
<?php
2
/*
3
* Copyright (c) 2021-2024 Bearsampp
4
* License: GNU General Public License version 3 or later; see LICENSE.txt
5
* Author: bear
6
* Website: https://bearsampp.com
7
* Github: https://github.com/Bearsampp
8
*/
9
10
/**
11
* Class TplAppLaunchStartup
12
*
13
* This class provides methods to generate actions and menu items for launching the Bearsampp application at startup.
14
* It includes functionalities for creating launch startup actions and processing launch startup commands.
15
*/
16
class
TplAppLaunchStartup
17
{
18
// Constant for the launch startup action identifier
19
const
ACTION
=
'launchStartup'
;
20
21
/**
22
* Generates the launch startup menu item and associated actions.
23
*
24
* This method creates a menu item for launching the application at startup and defines the actions to be taken
25
* when the launch startup menu item is selected. It checks the current launch startup status and toggles it.
26
* It uses the global language object to retrieve the localized string for the launch startup action.
27
*
28
* @global object $bearsamppLang Provides language support for retrieving language-specific values.
29
*
30
* @return array The generated menu item and actions for launching the application at startup.
31
*/
32
public
static
function
process
()
33
{
34
global
$bearsamppLang
;
35
36
$isLaunchStartup =
Util::isLaunchStartup
();
37
return
TplApp::getActionMulti
(
38
self::ACTION, array($isLaunchStartup ?
Config::DISABLED
:
Config::ENABLED
),
39
array(
$bearsamppLang
->getValue(
Lang::MENU_LAUNCH_STARTUP
), $isLaunchStartup ?
TplAestan::GLYPH_CHECK
:
''
),
40
false
, get_called_class()
41
);
42
}
43
44
/**
45
* Generates the action to launch the application at startup.
46
*
47
* This method creates the action string for launching the application at startup. It includes commands to reload
48
* the application configuration. The action string is used to define what happens when the launch startup action
49
* is triggered.
50
*
51
* @param int $launchStartup The status to set for launch startup (enabled or disabled).
52
*
53
* @return string The generated action string for launching the application at startup.
54
*/
55
public
static
function
getActionLaunchStartup
($launchStartup)
56
{
57
return
TplApp::getActionRun
(
Action::LAUNCH_STARTUP
, array($launchStartup)) . PHP_EOL .
58
TplAppReload::getActionReload
() . PHP_EOL;
59
}
60
}
$bearsamppLang
global $bearsamppLang
Definition
ajax.apache.php:16
Action\LAUNCH_STARTUP
const LAUNCH_STARTUP
Definition
class.action.php:34
Config\DISABLED
const DISABLED
Definition
class.config.php:33
Config\ENABLED
const ENABLED
Definition
class.config.php:32
Lang\MENU_LAUNCH_STARTUP
const MENU_LAUNCH_STARTUP
Definition
class.lang.php:103
TplAestan\GLYPH_CHECK
const GLYPH_CHECK
Definition
class.tpl.aestan.php:60
TplAppLaunchStartup
Definition
class.tpl.app.launchStartup.php:17
TplAppLaunchStartup\getActionLaunchStartup
static getActionLaunchStartup($launchStartup)
Definition
class.tpl.app.launchStartup.php:55
TplAppLaunchStartup\process
static process()
Definition
class.tpl.app.launchStartup.php:32
TplAppLaunchStartup\ACTION
const ACTION
Definition
class.tpl.app.launchStartup.php:19
TplAppReload\getActionReload
static getActionReload()
Definition
class.tpl.app.reload.php:52
TplApp\getActionMulti
static getActionMulti($action, $args=array(), $item=array(), $disabled=false, $class=false)
Definition
class.tpl.app.php:152
TplApp\getActionRun
static getActionRun($action, $args=array(), $item=array(), $waitUntilTerminated=true)
Definition
class.tpl.app.php:115
Util\isLaunchStartup
static isLaunchStartup()
Definition
class.util.php:645
Bearsampp-development
sandbox
core
classes
tpls
app
class.tpl.app.launchStartup.php
Generated by
1.11.0