public static function getMenuGit() { global $neardLang, $neardTools; $tplRepos = TplApp::getMenu($neardLang->getValue(Lang::REPOS), self::MENU_REPOS, get_called_class()); $emptyRepos = count(explode(PHP_EOL, $tplRepos[TplApp::SECTION_CONTENT])) == 2; $isScanStartup = $neardTools->getGit()->isScanStartup(); $tplRefreshRepos = TplApp::getActionMulti(self::ACTION_REFRESH_REPOS, null, array($neardLang->getValue(Lang::MENU_REFRESH_REPOS), TplAestan::GLYPH_RELOAD), false, get_called_class()); $tplRefreshReposStartup = TplApp::getActionMulti(self::ACTION_REFRESH_REPOS_STARTUP, array($isScanStartup ? Config::DISABLED : Config::ENABLED), array($neardLang->getValue(Lang::MENU_SCAN_REPOS_STARTUP), $isScanStartup ? TplAestan::GLYPH_CHECK : ''), false, get_called_class()); return (!$emptyRepos ? $tplRepos[TplApp::SECTION_CALL] . PHP_EOL : '') . $tplRefreshRepos[TplApp::SECTION_CALL] . PHP_EOL . TplAestan::getItemLink($neardLang->getValue(Lang::GITLIST), 'gitlist/', true) . PHP_EOL . $tplRefreshReposStartup[TplApp::SECTION_CALL] . PHP_EOL . (!$emptyRepos ? $tplRepos[TplApp::SECTION_CONTENT] . PHP_EOL : PHP_EOL) . $tplRefreshRepos[TplApp::SECTION_CONTENT] . PHP_EOL . $tplRefreshReposStartup[TplApp::SECTION_CONTENT]; }
public static function process() { global $neardLang; $tplStart = TplApp::getActionMulti(self::ACTION_START, null, array($neardLang->getValue(Lang::MENU_START_SERVICES), TplAestan::GLYPH_SERVICES_START), false, get_called_class()); $tplStop = TplApp::getActionMulti(self::ACTION_STOP, null, array($neardLang->getValue(Lang::MENU_STOP_SERVICES), TplAestan::GLYPH_SERVICES_STOP), false, get_called_class()); $tplRestart = TplApp::getActionMulti(self::ACTION_RESTART, null, array($neardLang->getValue(Lang::MENU_RESTART_SERVICES), TplAestan::GLYPH_SERVICES_RESTART), false, get_called_class()); // Items $items = $tplStart[TplApp::SECTION_CALL] . PHP_EOL . $tplStop[TplApp::SECTION_CALL] . PHP_EOL . $tplRestart[TplApp::SECTION_CALL] . PHP_EOL; // Actions $actions = PHP_EOL . $tplStart[TplApp::SECTION_CONTENT] . PHP_EOL . $tplStop[TplApp::SECTION_CONTENT] . PHP_EOL . $tplRestart[TplApp::SECTION_CONTENT]; return array($items, $actions); }
public static function getMenuLang() { global $neardLang; $items = ''; $actions = ''; foreach ($neardLang->getList() as $lang) { $tplSwitchLang = TplApp::getActionMulti(Action::SWITCH_LANG, array($lang), array(ucfirst($lang), $lang == $neardLang->getCurrent() ? TplAestan::GLYPH_CHECK : ''), false, get_called_class()); // Item $items .= $tplSwitchLang[TplApp::SECTION_CALL] . PHP_EOL; // Action $actions .= PHP_EOL . $tplSwitchLang[TplApp::SECTION_CONTENT] . PHP_EOL; } return $items . $actions; }
public static function getMenuNodejsVersions() { global $neardBins; $items = ''; $actions = ''; foreach ($neardBins->getNodejs()->getVersionList() as $version) { $tplSwitchNodejsVersion = TplApp::getActionMulti(self::ACTION_SWITCH_VERSION, array($version), array($version, $version == $neardBins->getNodejs()->getVersion() ? TplAestan::GLYPH_CHECK : ''), false, get_called_class()); // Item $items .= $tplSwitchNodejsVersion[TplApp::SECTION_CALL] . PHP_EOL; // Action $actions .= PHP_EOL . $tplSwitchNodejsVersion[TplApp::SECTION_CONTENT]; } return $items . $actions; }
public static function getMenuLogsVerbose() { global $neardLang, $neardConfig; $items = ''; $actions = ''; $verboses = array(Config::VERBOSE_SIMPLE => $neardLang->getValue(Lang::VERBOSE_SIMPLE), Config::VERBOSE_REPORT => $neardLang->getValue(Lang::VERBOSE_REPORT), Config::VERBOSE_DEBUG => $neardLang->getValue(Lang::VERBOSE_DEBUG)); foreach ($verboses as $verbose => $caption) { $tplSwitchLogsVerbose = TplApp::getActionMulti(Action::SWITCH_LOGS_VERBOSE, array($verbose), array($caption, $verbose == $neardConfig->getLogsVerbose() ? TplAestan::GLYPH_CHECK : ''), false, get_called_class()); // Item $items .= $tplSwitchLogsVerbose[TplApp::SECTION_CALL] . PHP_EOL; // Action $actions .= PHP_EOL . $tplSwitchLogsVerbose[TplApp::SECTION_CONTENT] . PHP_EOL; } return $items . $actions; }
public static function getMenuHosts() { global $neardLang; $items = ''; $actions = ''; foreach (Util::getWindowsHosts() as $host) { $tplSwitchHost = TplApp::getActionMulti(self::ACTION_SWITCH_HOST, array($host['ip'], $host['domain'], $host['enabled']), array($host['domain'] . ' (' . $host['ip'] . ')', $host['enabled'] ? TplAestan::GLYPH_CHECK : ''), false, get_called_class()); // Item $items .= $tplSwitchHost[TplApp::SECTION_CALL] . PHP_EOL; // Action $actions .= PHP_EOL . $tplSwitchHost[TplApp::SECTION_CONTENT]; } $items .= TplAestan::getItemSeparator() . PHP_EOL . TplAestan::getItemNotepad(basename(HOSTS_FILE), HOSTS_FILE) . PHP_EOL; return $items . $actions; }
public static function getMenuMariadbService() { global $neardLang, $neardBins; $tplChangePort = TplApp::getActionMulti(self::ACTION_CHANGE_PORT, null, array($neardLang->getValue(Lang::MENU_CHANGE_PORT), TplAestan::GLYPH_NETWORK), false, get_called_class()); $isLaunchStartup = $neardBins->getMariadb()->isLaunchStartup(); $tplLaunchStartup = TplApp::getActionMulti(self::ACTION_LAUNCH_STARTUP, array($isLaunchStartup ? Config::DISABLED : Config::ENABLED), array($neardLang->getValue(Lang::MENU_LAUNCH_STARTUP_SERVICE), $isLaunchStartup ? TplAestan::GLYPH_CHECK : ''), false, get_called_class()); $result = TplAestan::getItemActionServiceStart($neardBins->getMariadb()->getService()->getName()) . PHP_EOL . TplAestan::getItemActionServiceStop($neardBins->getMariadb()->getService()->getName()) . PHP_EOL . TplAestan::getItemActionServiceRestart($neardBins->getMariadb()->getService()->getName()) . PHP_EOL . TplAestan::getItemSeparator() . PHP_EOL . TplApp::getActionRun(Action::CHECK_PORT, array($neardBins->getMariadb()->getName(), $neardBins->getMariadb()->getPort()), array(sprintf($neardLang->getValue(Lang::MENU_CHECK_PORT), $neardBins->getMariadb()->getPort()), TplAestan::GLYPH_LIGHT)) . PHP_EOL . $tplChangePort[TplApp::SECTION_CALL] . PHP_EOL . $tplLaunchStartup[TplApp::SECTION_CALL] . PHP_EOL; $isInstalled = $neardBins->getMariadb()->getService()->isInstalled(); if (!$isInstalled) { $tplInstallService = TplApp::getActionMulti(self::ACTION_INSTALL_SERVICE, null, array($neardLang->getValue(Lang::MENU_INSTALL_SERVICE), TplAestan::GLYPH_SERVICE_INSTALL), $isInstalled, get_called_class()); $result .= $tplInstallService[TplApp::SECTION_CALL] . PHP_EOL . PHP_EOL . $tplInstallService[TplApp::SECTION_CONTENT] . PHP_EOL; } else { $tplRemoveService = TplApp::getActionMulti(self::ACTION_REMOVE_SERVICE, null, array($neardLang->getValue(Lang::MENU_REMOVE_SERVICE), TplAestan::GLYPH_SERVICE_REMOVE), !$isInstalled, get_called_class()); $result .= $tplRemoveService[TplApp::SECTION_CALL] . PHP_EOL . PHP_EOL . $tplRemoveService[TplApp::SECTION_CONTENT] . PHP_EOL; } $result .= $tplChangePort[TplApp::SECTION_CONTENT] . PHP_EOL . $tplLaunchStartup[TplApp::SECTION_CONTENT] . PHP_EOL; return $result; }
public static function getMenuPhpExtensions() { global $neardBins; $items = ''; $actions = ''; foreach ($neardBins->getPhp()->getExtensions() as $extension => $switch) { $tplSwitchPhpExtension = TplApp::getActionMulti(self::ACTION_SWITCH_EXTENSION, array($extension, $switch), array($extension, $switch == ActionSwitchPhpExtension::SWITCH_ON ? TplAestan::GLYPH_CHECK : ''), false, get_called_class()); // Item $items .= $tplSwitchPhpExtension[TplApp::SECTION_CALL] . PHP_EOL; // Action $actions .= PHP_EOL . $tplSwitchPhpExtension[TplApp::SECTION_CONTENT]; } return $items . $actions; }
public static function process() { global $neardLang; return TplApp::getActionMulti(self::ACTION, null, array($neardLang->getValue(Lang::QUIT), TplAestan::GLYPH_EXIT), false, get_called_class()); }
public static function process() { global $neardLang; $isLaunchStartup = Util::isLaunchStartup(); return TplApp::getActionMulti(self::ACTION, array($isLaunchStartup ? Config::DISABLED : Config::ENABLED), array($neardLang->getValue(Lang::MENU_LAUNCH_STARTUP), $isLaunchStartup ? TplAestan::GLYPH_CHECK : ''), false, get_called_class()); }
public static function getMenuApacheVhosts() { global $neardLang, $neardBins; $tplAddVhost = TplApp::getActionMulti(self::ACTION_ADD_VHOST, null, array($neardLang->getValue(Lang::MENU_ADD_VHOST), TplAestan::GLYPH_ADD), false, get_called_class()); // Items $items = $tplAddVhost[TplApp::SECTION_CALL] . PHP_EOL . TplAestan::getItemSeparator() . PHP_EOL; // Actions $actions = PHP_EOL . $tplAddVhost[TplApp::SECTION_CONTENT]; foreach ($neardBins->getApache()->getVhosts() as $vhost) { $tplEditVhost = TplApp::getActionMulti(self::ACTION_EDIT_VHOST, array($vhost), array(sprintf($neardLang->getValue(Lang::MENU_EDIT_VHOST), $vhost), TplAestan::GLYPH_FILE), false, get_called_class()); // Items $items .= $tplEditVhost[TplApp::SECTION_CALL] . PHP_EOL; // Actions $actions .= PHP_EOL . PHP_EOL . $tplEditVhost[TplApp::SECTION_CONTENT]; } return $items . $actions; }
public static function getMenuTools() { global $neardLang, $neardTools; $tplGenSslCertificate = TplApp::getActionMulti(self::ACTION_GEN_SSL_CERTIFICATE, null, array($neardLang->getValue(Lang::MENU_GEN_SSL_CERTIFICATE), TplAestan::GLYPH_SSL_CERTIFICATE), false, get_called_class()); return TplAestan::getItemConsole($neardLang->getValue(Lang::GIT), TplAestan::GLYPH_GIT, $neardTools->getConsole()->getTabTitleGit()) . PHP_EOL . TplAestan::getItemConsole($neardLang->getValue(Lang::SVN), TplAestan::GLYPH_SVN, $neardTools->getConsole()->getTabTitleSvn()) . PHP_EOL . TplAestan::getItemConsole($neardLang->getValue(Lang::PEAR), TplAestan::GLYPH_CONSOLE, $neardTools->getConsole()->getTabTitlePear()) . PHP_EOL . TplAestan::getItemExe($neardLang->getValue(Lang::XDC), $neardTools->getXdc()->getExe(), TplAestan::GLYPH_CONSOLE) . PHP_EOL . TplAestan::getItemLink($neardLang->getValue(Lang::WEBGRIND), 'webgrind/', true) . PHP_EOL . $tplGenSslCertificate[TplApp::SECTION_CALL] . PHP_EOL . $tplGenSslCertificate[TplApp::SECTION_CONTENT]; }
public static function process() { global $neardConfig, $neardLang; return TplApp::getActionMulti(self::ACTION, array($neardConfig->isOnline() ? Config::DISABLED : Config::ENABLED), array($neardConfig->isOnline() ? $neardLang->getValue(Lang::MENU_PUT_OFFLINE) : $neardLang->getValue(Lang::MENU_PUT_ONLINE)), false, get_called_class()); }