Bearsampp 2026.9.23
Loading...
Searching...
No Matches
TplAppTools Class Reference

Static Public Member Functions

static getActionDelSslCertificate ()
static getActionGenSslCertificate ()
static getActionMakeRootCa ()
static getMenuTools ()
static process ()

Data Fields

const ACTION_DEL_SSL_CERTIFICATE = 'delSslCertificate'
const ACTION_GEN_SSL_CERTIFICATE = 'genSslCertificate'
const ACTION_MAKE_ROOT_CA = 'makeRootCA'
const MENU = 'tools'

Detailed Description

Class TplAppTools

This class provides methods to generate menu items and actions for managing various tools within the Bearsampp application. It includes functionalities for accessing tools like Git, Python, Composer, Ghostscript, Ngrok, Pear, Perl, Ruby and more.

Definition at line 18 of file class.tpl.app.tools.php.

Member Function Documentation

◆ getActionDelSslCertificate()

getActionDelSslCertificate ( )
static

Generates the action to delete an SSL certificate.

Returns
string The generated action to delete an SSL certificate.

Definition at line 221 of file class.tpl.app.tools.php.

222 {
224 }
const DEL_SSL_CERTIFICATE
static getActionRun($action, $args=array(), $item=array(), $waitUntilTerminated=true)

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

Here is the call graph for this function:

◆ getActionGenSslCertificate()

getActionGenSslCertificate ( )
static

Generates the action to generate an SSL certificate.

Returns
string The generated action to generate an SSL certificate.

Definition at line 211 of file class.tpl.app.tools.php.

212 {
214 }
const GEN_SSL_CERTIFICATE

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

Here is the call graph for this function:

◆ getActionMakeRootCa()

getActionMakeRootCa ( )
static

Generates the action to create a new Root CA.

Returns
string The generated action to create a new Root CA.

Definition at line 201 of file class.tpl.app.tools.php.

202 {
204 }
const MAKE_ROOT_CA

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

Here is the call graph for this function:

◆ getMenuTools()

getMenuTools ( )
static

Generates the Tools menu with options for accessing various tools like Git, Python, Composer, etc.

Returns
string The generated menu items and actions for Tools. @global object $bearsamppCore Provides access to core functionalities and configurations. @global object $bearsamppTools Provides access to various tools and their configurations.

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

Definition at line 49 of file class.tpl.app.tools.php.

50 {
52 $resultItems = $resultActions = '';
53
54 // Git
55 $tplGit = TplAppGit::process();
56 $resultItems .= $tplGit[TplApp::SECTION_CALL] . PHP_EOL;
57 $resultActions .= $tplGit[TplApp::SECTION_CONTENT] . PHP_EOL;
58
59 // Python
60 $tplPython = TplAppPython::process();
61 $resultItems .= $tplPython[TplApp::SECTION_CALL] . PHP_EOL;
62 $resultActions .= $tplPython[TplApp::SECTION_CONTENT] . PHP_EOL;
63
64 // Bruno postman IDE
65 $resultItems .= TplAestan::getItemExe(
66 $bearsamppLang->getValue(Lang::BRUNO),
67 $bearsamppTools->getBruno()->getExe(),
69 ) . PHP_EOL;
70
71 // Composer
72 $resultItems .= TplAestan::getItemPowerShell(
75 null,
76 $bearsamppTools->getPowerShell()->getTabTitleComposer(),
78 null
79 ) . PHP_EOL;
80
81 // Ghostscript
82 $resultItems .= TplAestan::getItemPowerShell(
85 null,
86 $bearsamppTools->getPowerShell()->getTabTitleGhostscript(),
88 null
89 ) . PHP_EOL;
90
91 // Ngrok
92 $resultItems .= TplAestan::getItemPowerShell(
93 $bearsamppLang->getValue(Lang::NGROK),
95 null,
96 $bearsamppTools->getPowerShell()->getTabTitleNgrok(),
98 null
99 ) . PHP_EOL;
100
101 // Pear
102 $resultItems .= TplAestan::getItemPowerShell(
103 $bearsamppLang->getValue(Lang::PEAR),
105 null,
106 $bearsamppTools->getPowerShell()->getTabTitlePear(),
107 Path::getModuleSymlinkPath($bearsamppBins->getPhp()) . '/pear',
108 null
109 ) . PHP_EOL;
110
111 // Perl
112 $resultItems .= TplAestan::getItemPowerShell(
113 $bearsamppLang->getValue(Lang::PERL),
115 null,
116 $bearsamppTools->getPowerShell()->getTabTitlePerl(),
118 null
119 ) . PHP_EOL;
120
121 // Ruby
122 $resultItems .= TplAestan::getItemPowerShell(
123 $bearsamppLang->getValue(Lang::RUBY),
125 null,
126 $bearsamppTools->getPowerShell()->getTabTitleRuby(),
128 null
129 ) . PHP_EOL;
130
131 // Line Separator
132 $resultItems .= TplAestan::getItemSeparator() . PHP_EOL;
133
134 // Console
135 $resultItems .= TplAestan::getItemPowerShell(
136 $bearsamppLang->getValue(Lang::CONSOLE),
138 null,
139 $bearsamppTools->getPowerShell()->getTabTitleDefault(),
141 ) . PHP_EOL;
142
143 // HostsEditor
144 $resultItems .= TplAestan::getItemExe(
148 ) . PHP_EOL;
149
150 // Pwgen password manager
151 $resultItems .= TplAestan::getItemExe(
152 $bearsamppLang->getValue(Lang::PWGEN),
155 ) . PHP_EOL;
156
157 // Line Separator
158 $resultItems .= TplAestan::getItemSeparator() . PHP_EOL;
159
160 // Generate rootCA certificate
161 $tplMakeRootCa = TplApp::getActionMulti(
162 self::ACTION_MAKE_ROOT_CA,
163 null,
165 false,
166 get_called_class()
167 );
168 $resultItems .= $tplMakeRootCa[TplApp::SECTION_CALL] . PHP_EOL;
169 $resultActions .= $tplMakeRootCa[TplApp::SECTION_CONTENT] . PHP_EOL;
170
171 // Generate SSL Certificate
172 $tplGenSslCertificate = TplApp::getActionMulti(
173 self::ACTION_GEN_SSL_CERTIFICATE,
174 null,
176 false,
177 get_called_class()
178 );
179 $resultItems .= $tplGenSslCertificate[TplApp::SECTION_CALL] . PHP_EOL;
180 $resultActions .= $tplGenSslCertificate[TplApp::SECTION_CONTENT] . PHP_EOL;
181
182 // Delete SSL Certificate
183 $tplDelSslCertificate = TplApp::getActionMulti(
184 self::ACTION_DEL_SSL_CERTIFICATE,
185 null,
187 false,
188 get_called_class()
189 );
190 $resultItems .= $tplDelSslCertificate[TplApp::SECTION_CALL] . PHP_EOL;
191 $resultActions .= $tplDelSslCertificate[TplApp::SECTION_CONTENT];
192
193 return $resultItems . PHP_EOL . $resultActions;
194 }
global $bearsamppBins
global $bearsamppLang
global $bearsamppRoot
global $bearsamppCore
const COMPOSER
const GHOSTSCRIPT
const RUBY
const BRUNO
const CONSOLE
const NGROK
const MENU_GEN_SSL_CERTIFICATE
const HOSTSEDITOR
const PWGEN
const PEAR
const PERL
const MENU_GEN_ROOT_CA
const DELSSL_TITLE
static getHostsEditorExe($aetrayPath=false)
static getRootPath($aetrayPath=false)
static getWwwPath($aetrayPath=false)
static getModuleSymlinkPath($module)
static getPwgenExe($aetrayPath=false)
static getItemPowerShell($caption, $glyph, $id=null, $title=null, $initDir=null, $command=null)
static getItemExe($caption, $exe, $glyph, $params=null)
const GLYPH_POWERSHELL
const GLYPH_GHOSTSCRIPT
const GLYPH_HOSTSEDITOR
const GLYPH_SSL_CERTIFICATE
static getItemSeparator()
static getActionMulti($action, $args=array(), $item=array(), $disabled=false, $class=false)
const SECTION_CALL
const SECTION_CONTENT

References $bearsamppBins, $bearsamppCore, $bearsamppLang, $bearsamppRoot, Lang\BRUNO, Lang\COMPOSER, Lang\CONSOLE, Lang\DELSSL_TITLE, TplApp\getActionMulti(), Path\getHostsEditorExe(), TplAestan\getItemExe(), TplAestan\getItemPowerShell(), TplAestan\getItemSeparator(), Path\getModuleSymlinkPath(), Path\getPwgenExe(), Path\getRootPath(), Path\getWwwPath(), Lang\GHOSTSCRIPT, TplAestan\GLYPH_BRUNO, TplAestan\GLYPH_COMPOSER, TplAestan\GLYPH_GHOSTSCRIPT, TplAestan\GLYPH_HOSTSEDITOR, TplAestan\GLYPH_NGROK, TplAestan\GLYPH_PEAR, TplAestan\GLYPH_PERL, TplAestan\GLYPH_POWERSHELL, TplAestan\GLYPH_PWGEN, TplAestan\GLYPH_RUBY, TplAestan\GLYPH_SSL_CERTIFICATE, TplAestan\GLYPH_TRASHCAN, Lang\HOSTSEDITOR, Lang\MENU_GEN_ROOT_CA, Lang\MENU_GEN_SSL_CERTIFICATE, Lang\NGROK, Lang\PEAR, Lang\PERL, TplAppGit\process(), TplAppPython\process(), Lang\PWGEN, Lang\RUBY, TplApp\SECTION_CALL, and TplApp\SECTION_CONTENT.

Here is the call graph for this function:

◆ process()

process ( )
static

Generates the main Tools menu with options to access various tools.

Returns
array The generated menu items and actions for Tools. @global object $bearsamppLang Provides language support for retrieving language-specific values.

Definition at line 33 of file class.tpl.app.tools.php.

34 {
35 global $bearsamppLang;
36
37 return TplApp::getMenu($bearsamppLang->getValue(Lang::TOOLS), self::MENU, get_called_class());
38 }
const TOOLS
static getMenu($caption, $menu, $class)

References $bearsamppLang, TplApp\getMenu(), and Lang\TOOLS.

Referenced by TplApp\getSectionMenuLeft().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ ACTION_DEL_SSL_CERTIFICATE

const ACTION_DEL_SSL_CERTIFICATE = 'delSslCertificate'

Definition at line 24 of file class.tpl.app.tools.php.

◆ ACTION_GEN_SSL_CERTIFICATE

const ACTION_GEN_SSL_CERTIFICATE = 'genSslCertificate'

Definition at line 23 of file class.tpl.app.tools.php.

◆ ACTION_MAKE_ROOT_CA

const ACTION_MAKE_ROOT_CA = 'makeRootCA'

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

◆ MENU

const MENU = 'tools'

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


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