コード例 #1
0
 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;
 }