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

Static Public Member Functions

static getActionGenSslCertificate ()
static getMenuTools ()
static process ()

Data Fields

const ACTION_GEN_SSL_CERTIFICATE = 'genSslCertificate'
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

◆ getActionGenSslCertificate()

getActionGenSslCertificate ( )
static

Generates the action to generate an SSL certificate.

Returns
string The generated action to generate an SSL certificate.

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

170 {
172 }
const GEN_SSL_CERTIFICATE
static getActionRun($action, $args=array(), $item=array(), $waitUntilTerminated=true)

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

◆ getMenuTools()

getMenuTools ( )
static

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

@global object $bearsamppLang Provides language support for retrieving language-specific values. @global object $bearsamppCore Provides access to core functionalities and configurations. @global object $bearsamppTools Provides access to various tools and their configurations.

Returns
string The generated menu items and actions for Tools.

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

48 {
50 $resultItems = $resultActions = '';
51
52 // Git
53 $tplGit = TplAppGit::process();
54 $resultItems .= $tplGit[TplApp::SECTION_CALL] . PHP_EOL;
55 $resultActions .= $tplGit[TplApp::SECTION_CONTENT] . PHP_EOL;
56
57 // Python
58 $tplPython = TplAppPython::process();
59 $resultItems .= $tplPython[TplApp::SECTION_CALL] . PHP_EOL;
60 $resultActions .= $tplPython[TplApp::SECTION_CONTENT] . PHP_EOL;
61
62 // Bruno postman IDE
63 $resultItems .= TplAestan::getItemExe(
64 $bearsamppLang->getValue(Lang::BRUNO),
65 $bearsamppTools->getBruno()->getExe(),
67 ) . PHP_EOL;
68
69 // Composer
70 $resultItems .= TplAestan::getItemPowerShell(
73 null,
74 $bearsamppTools->getPowerShell()->getTabTitleComposer(),
75 $bearsamppRoot->getWwwPath(),
76 null
77 ) . PHP_EOL;
78
79 // Ghostscript
80 $resultItems .= TplAestan::getItemPowerShell(
83 null,
84 $bearsamppTools->getPowerShell()->getTabTitleGhostscript(),
85 $bearsamppRoot->getWwwPath(),
86 null
87 ) . PHP_EOL;
88
89 // Ngrok
90 $resultItems .= TplAestan::getItemPowerShell(
91 $bearsamppLang->getValue(Lang::NGROK),
93 null,
94 $bearsamppTools->getPowerShell()->getTabTitleNgrok(),
95 $bearsamppRoot->getWwwPath(),
96 null
97 ) . PHP_EOL;
98
99 // Pear
100 $resultItems .= TplAestan::getItemPowerShell(
101 $bearsamppLang->getValue(Lang::PEAR),
103 null,
104 $bearsamppTools->getPowerShell()->getTabTitlePear(),
105 $bearsamppBins->getPhp()->getSymlinkPath() . '/pear',
106 null
107 ) . PHP_EOL;
108
109 // Perl
110 $resultItems .= TplAestan::getItemPowerShell(
111 $bearsamppLang->getValue(Lang::PERL),
113 null,
114 $bearsamppTools->getPowerShell()->getTabTitlePerl(),
115 $bearsamppRoot->getWwwPath(),
116 null
117 ) . PHP_EOL;
118
119 // Ruby
120 $resultItems .= TplAestan::getItemPowerShell(
121 $bearsamppLang->getValue(Lang::RUBY),
123 null,
124 $bearsamppTools->getPowerShell()->getTabTitleRuby(),
125 $bearsamppRoot->getWwwPath(),
126 null
127 ) . PHP_EOL;
128
129 // Line Separator
130 $resultItems .= TplAestan::getItemSeparator() . PHP_EOL;
131
132 // Console
133 $resultItems .= TplAestan::getItemPowerShell(
134 $bearsamppLang->getValue(Lang::CONSOLE),
136 ) . PHP_EOL;
137
138 // HostsEditor
139 $resultItems .= TplAestan::getItemExe(
141 $bearsamppCore->getHostsEditorExe(),
143 ) . PHP_EOL;
144
145 // Pwgen password manager
146 $resultItems .= TplAestan::getItemExe(
147 $bearsamppLang->getValue(Lang::PWGEN),
148 $bearsamppCore->getPwgenExe(),
150 ) . PHP_EOL;
151
152 // Generate SSL Certificate
153 $tplGenSslCertificate = TplApp::getActionMulti(
154 self::ACTION_GEN_SSL_CERTIFICATE, null,
156 false, get_called_class()
157 );
158 $resultItems .= $tplGenSslCertificate[TplApp::SECTION_CALL] . PHP_EOL;
159 $resultActions .= $tplGenSslCertificate[TplApp::SECTION_CONTENT];
160
161 return $resultItems . PHP_EOL . $resultActions;
162 }
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
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, TplApp\getActionMulti(), TplAestan\getItemExe(), TplAestan\getItemPowerShell(), TplAestan\getItemSeparator(), 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, Lang\HOSTSEDITOR, 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.

◆ process()

process ( )
static

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

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

Returns
array The generated menu items and actions for Tools.

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

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

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

Referenced by TplApp\getSectionMenuLeft().

Field Documentation

◆ ACTION_GEN_SSL_CERTIFICATE

const ACTION_GEN_SSL_CERTIFICATE = 'genSslCertificate'

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: