diff --git a/config/lang/de.json b/config/lang/de.json index 2701d0da5376e11c67043aba759f5832904655e2..fc46c953abc08f5465eab6f01d7fb83261a65002 100644 --- a/config/lang/de.json +++ b/config/lang/de.json @@ -242,6 +242,9 @@ "deploy": "Deploy", "deploy-configfile": "Konfiguration", "deploy-configfile-hint": "Hier können Variablen in Bash-Syntax hinterlegt werden. Bei einem Build werden diese in [root]/ci-custom-vars geschrieben und lassen sich vom onbuild oder ondeploy Hook lesen.", + "deploy-rollout-plugin": "Rollout-Plugin", + "deploy-rollout-plugin-hint": "Geben Sie vor, wie die Zielsystem angesteuert werden, um das Paket zu installieren.", + "deploy-rollout-plugin-config": "Konfiguration des gewählten Plugins", "deploy-hint": "Deploy der Queue von Phase [%s]", "deploy-impossible": "Deploy der Queue von Phase [%s] ist nicht möglich.", "deploy-settings": "Deployment-Einstellungen", diff --git a/public_html/deployment/classes/formgen.class.php b/public_html/deployment/classes/formgen.class.php index a8f38502842d74c055d39dd4c18e885876886bb8..b6f9676733da30f211aed661346936db4f636289 100644 --- a/public_html/deployment/classes/formgen.class.php +++ b/public_html/deployment/classes/formgen.class.php @@ -192,7 +192,7 @@ class formgen { $s = preg_replace('/\W/iu', '', $sId . $idOption); $sOptionId = preg_replace('/[äöüß]/i', '', $s); $sFormElement.=' <input type="radio" id="' . $sOptionId . '" value="' . $idOption . '" '; - $sFormElement.=$this->_addHtmlAtrributes(explode(",", "$sDefaultAttributes,checked"), $aOptionData); + $sFormElement.=$this->_addHtmlAtrributes(explode(",", "$sDefaultAttributes,checked,disabled"), $aOptionData); $sFormElement.=" " . $this->_addHtmlAtrributes(explode(",", "name"), $elementData); $sFormElement.='/><label for="' . $sOptionId . '">' . $aOptionData["label"] . '</label></div>'; } diff --git a/public_html/deployment/classes/htmlguielements.class.php b/public_html/deployment/classes/htmlguielements.class.php index 7eb28ba75d56bac71977571f858d0ae39cb8b99e..7efad72e9dacde729c80dc8250176d80785aa913 100644 --- a/public_html/deployment/classes/htmlguielements.class.php +++ b/public_html/deployment/classes/htmlguielements.class.php @@ -152,6 +152,7 @@ class htmlguielements{ 'delete'=>'fas fa-trash', 'deploy'=>'fas fa-forward', 'deploy-configfile'=>'far fa-file-code', + 'deploy-rollout-plugin'=>'fas fa-plug', 'filter'=>'fas fa-filter', 'foreman'=>'fas fa-hard-hat', 'gotop'=>'fas fa-arrow-up', diff --git a/public_html/deployment/classes/project.class.php b/public_html/deployment/classes/project.class.php index 98b08fd169f3e5d3dabbe9d066ac37c801742482..16f17943838b3d8d6733d8ffd1ab0242a3849633 100644 --- a/public_html/deployment/classes/project.class.php +++ b/public_html/deployment/classes/project.class.php @@ -1346,6 +1346,16 @@ class project extends base { return $aReturn; } + /** + * get a location of a plugin file with full path + * @param string $sType type of plugin, i.e. "rollout" + * @param string $sPluginName Name of plugin + * @return string + */ + protected function _getPluginFilename($sType, $sPluginName){ + return __DIR__.'/../plugins/'.$sType.'/'.$sPluginName.'/'.$sType.'_'.$sPluginName.'.php'; + } + /** * get a flat array of all existing ssh keys * @return array @@ -1474,14 +1484,15 @@ class project extends base { // ----- init rollout plugin // set name of the activated plugin for this project - $sPluginName=(isset($this->_aPrjConfig['deploy']['active_rollout_plugin']) && $this->_aPrjConfig['deploy']['active_rollout_plugin']) - ? $this->_aPrjConfig['deploy']['active_rollout_plugin'] + $sPluginName=(isset($this->_aPrjConfig['deploy']['enabled_rollout_plugin']) && $this->_aPrjConfig['deploy']['enabled_rollout_plugin']) + ? $this->_aPrjConfig['deploy']['enabled_rollout_plugin'] : 'default' ; $this->oRolloutPlugin = false; try{ - require_once __DIR__.'/../plugins/rollout/'.$sPluginName.'/rollout_'.$sPluginName.'.php'; - $this->oRolloutPlugin = new rollout(array( + require_once $this->_getPluginFilename('rollout', $sPluginName); + $sPluginClassname='rollout_'.$sPluginName; + $this->oRolloutPlugin = new $sPluginClassname(array( 'lang'=>$this->_aConfig['lang'], 'phase'=>false, 'globalcfg'=>$this->_aConfig['plugins']['rollout'][$sPluginName], @@ -3276,7 +3287,7 @@ class project extends base { $sMessages = ''; require_once ("formgen.class.php"); - + $aSelectSlack = array( 'type' => 'hidden', 'name' => 'messenger[slack]', @@ -3311,6 +3322,69 @@ class project extends base { } + $aRollout = array( + 'project-select' => array( + 'type' => 'radio', + 'name' => 'deploy[enabled_rollout_plugin]', + 'label' => t("deploy-rollout-plugin"), + ), + 'project-config' => '', + ); + foreach (array_keys($this->getConfiguredPlugins('rollout')) as $sPluginName){ + + $sPluginFile=$this->_getPluginFilename('rollout', $sPluginName); + $TmpRolloutPlugin = false; + $sMyClassname='rollout_'. $sPluginName; + $sMyDivId='rollout-'. $sPluginName.'-config'; + $sMyDivClass='rolloutconfigdiv'; + $sMyDivClassActive='rolloutconfigdiv-'. $sPluginName; + $bActive=$sPluginName === $this->oRolloutPlugin->getId(); + + if(file_exists($sPluginFile)){ + try{ + include_once $this->_getPluginFilename('rollout', $sPluginName); + $TmpRolloutPlugin = new $sMyClassname(array( + 'lang'=>$this->_aConfig['lang'], + 'phase'=>false, + 'globalcfg'=>$this->_aConfig['plugins']['rollout'][$sPluginName], + 'projectcfg'=>$this->_aPrjConfig, + )); + $aRollout['project-select']['options'][$sPluginName]=array( + 'label' => $TmpRolloutPlugin->getName(), + 'checked' => $bActive, + 'onclick' => '$(\'.'.$sMyDivClass.'\').hide(); $(\'.' . $sMyDivClassActive . '\').show();', + ); + + $aRollout['project-config'].='' + . '<div id="'.$sMyDivId.'" class="'.$sMyDivClass.' '.$sMyDivClassActive.'"' + . ($bActive ? '' : 'style="display: none;"' ) + . '>' + . $TmpRolloutPlugin->renderFormdata4Project() + . '</div>' + ; + } catch (Exception $ex) { + + } + } else { + $aRollout['project-select']['options'][$sPluginName]=array( + 'label' => "not found: " . $sMyClassname, + 'checked' => false, + 'disabled' => "disabled", + 'onclick' => '$(\'.'.$sMyDivClass.'\').hide(); $(\'.' . $sMyDivClassActive . '\').show();', + ); + $aRollout['project-config'].='' + . '<div id="'.$sMyDivId.'" class="'.$sMyDivClass.' '.$sMyDivClassActive.'"' + . ($bActive ? '' : 'style="display: none;"' ) + . '>' + . 'id="'.$sMyDivId.'" class="'.$sMyDivClass.'"<br>' + // . 'Plugin content' + . ':-/' + . '</div>' + ; + + } + } + $aForemanHostgroups = false; $iForemanHostgroupDefault = false; $sForemanHostgroupDefault = false; @@ -3421,14 +3495,19 @@ class project extends base { <li><a href="#tab2" data-toggle="tab">' . $this->_oHtml->getIcon('repository').t('repositoryinfos') . '</a></li> <li><a href="#tab3" data-toggle="tab">' . $this->_oHtml->getIcon('deploy-configfile').t('deploy-configfile') . '</a></li> - <li><a href="#tab4" data-toggle="tab">' . $this->_oHtml->getIcon('phase').t('phases') . '</a></li> - <li><a href="#tab5" data-toggle="tab">' . $this->_oHtml->getIcon('raw-data').t('raw-data') . '</a></li> + <li><a href="#tab4" data-toggle="tab">' . $this->_oHtml->getIcon('deploy-rollout-plugin').t('deploy-rollout-plugin') . '</a></li> + <li><a href="#tab5" data-toggle="tab">' . $this->_oHtml->getIcon('phase').t('phases') . '</a></li> + <li><a href="#tab6" data-toggle="tab">' . $this->_oHtml->getIcon('raw-data').t('raw-data') . '</a></li> </ul> <div class="tab-content"> <div class="tab-pane active" id="tab1"> ', ), + + // -------------------------------------------------- + // Tab for metadata + // -------------------------------------------------- 'input' . $i++ => array( 'type' => 'text', 'name' => 'label', @@ -3475,6 +3554,9 @@ class project extends base { ), 'input' . $i++ => $aSelectSlack, + + // -------------------------------------------------- + // Tab soources repository & build // -------------------------------------------------- 'input' . $i++ => array( 'type' => 'markup', @@ -3551,6 +3633,9 @@ class project extends base { ), ), ), + + // -------------------------------------------------- + // Tab for config and API key // -------------------------------------------------- 'input' . $i++ => array( 'type' => 'markup', @@ -3586,15 +3671,37 @@ class project extends base { . '</p></div>', ), + // -------------------------------------------------- + // Tab rollout plugin // -------------------------------------------------- 'input' . $i++ => array( 'type' => 'markup', 'value' => ' </div><div class="tab-pane" id="tab4"> + <p>' . t('deploy-rollout-plugin-hint') . '</p>', + ), + // select box for active rollout plugin + $aRollout['project-select'], + + // project based config + 'input' . $i++ => array( + 'type' => 'markup', + 'value' => '' + . '<hr>' + .'<label class="col-sm-2">'.t('deploy-rollout-plugin-config') .'</label>' + .'<div class="col-sm-10">'. $aRollout['project-config'].'</div>' + ), + // -------------------------------------------------- + 'input' . $i++ => array( + 'type' => 'markup', + 'value' => ' </div><div class="tab-pane" id="tab5"> <p>' . sprintf(t("class-project-info-setup-phaseinfos"), $this->getNextPhase()) . '</p>', ), ), ), ); + // -------------------------------------------------- + // Tab for phases + // -------------------------------------------------- if ($aSelectForemanGroups) { $aForms["setup"]["form"]['input' . $i++] = array( 'type' => 'markup', @@ -3815,11 +3922,15 @@ class project extends base { 'value' => '</td></tr></tbody></table>', ); } // END: loop over phases + + // -------------------------------------------------- + // Tab for raw data + // -------------------------------------------------- $aForms["setup"]["form"]['input' . $i++] = array( 'type' => 'markup', 'value' => '</div>' - . '<div class="tab-pane" id="tab5">' + . '<div class="tab-pane" id="tab6">' . '<br><pre>'.print_r($this->_aPrjConfig, 1).'</pre>' . '</div>' diff --git a/public_html/deployment/classes/rollout.interface.php b/public_html/deployment/classes/rollout.interface.php index 1c7ac6345db96b881b25c73516ca6f81088113e0..ffdb3e482b74b64bd5be16d6c6862a3ed489db50 100644 --- a/public_html/deployment/classes/rollout.interface.php +++ b/public_html/deployment/classes/rollout.interface.php @@ -49,9 +49,14 @@ interface iRolloutplugin { */ public function getPluginInfos(); + // ---------------------------------------------------------------------- + // RENDERER + // ---------------------------------------------------------------------- + // ---------------------------------------------------------------------- // ACTIONS // ---------------------------------------------------------------------- + } diff --git a/public_html/deployment/classes/rollout_base.class.php b/public_html/deployment/classes/rollout_base.class.php index aec0070baeaca837832dcaffd71e6c0fd8b2a163..0165097d45395941de3c5847e04947ea67bc73b7 100644 --- a/public_html/deployment/classes/rollout_base.class.php +++ b/public_html/deployment/classes/rollout_base.class.php @@ -4,10 +4,14 @@ require_once 'rollout.interface.php'; /** * rollout_base class that will beextended in a rollout plugin * + * * @author axel */ class rollout_base implements iRolloutplugin{ + // --------------------------------------------------------------- + // VARIABLES + // --------------------------------------------------------------- /** * identifier for current plugin; it us used to find the current plugin * settings in the config structore for global and project based config @@ -33,7 +37,10 @@ class rollout_base implements iRolloutplugin{ */ protected $_sLang = 'en'; - + /** + * string with phase of project; one of preview|stage|live + * @var type + */ protected $_sPhase = false; /** @@ -47,6 +54,11 @@ class rollout_base implements iRolloutplugin{ */ protected $_aCfgProject = false; + + // --------------------------------------------------------------- + // METHODS + // --------------------------------------------------------------- + /** * initialize rollout plugin * @param array $aParams hash with those possible keys @@ -87,15 +99,28 @@ class rollout_base implements iRolloutplugin{ } - + protected function _renderForm($aFormdata, $sKey){ + $sReturn=''; + $sKeyPrefix=$this->getId().'_'.$sKey; + $i=0; + + $oForm = new formgen($aForms); + foreach ($aFormdata as $elementData) { + $elementKey=$sKeyPrefix.'_'.$i++; + $sReturn.=$oForm->renderHtmlElement($elementKey, $elementData); + } + return $sReturn; + } /** - * get a translated text from lang_XX.json + * get a translated text from lang_XX.json in plugin dir; + * If the key is missed it returns "[KEY :: LANG]" + * * @see setLang() * @param string $sKey key to find in lang file * @return string */ - private function _t($sKey){ + protected function _t($sKey){ return (isset($this->_aLang[$sKey]) && $this->_aLang[$sKey]) ? $this->_aLang[$sKey] : "[ $sKey :: $this->_sLang ]" @@ -170,17 +195,20 @@ class rollout_base implements iRolloutplugin{ */ public function setProjectConfig($aProjectConfigArray){ $this->_aCfgProject=$aProjectConfigArray; - + // echo '<pre>'.print_r($aProjectConfigArray, 1).'</pre>'; // ----- ensure that the config structure exists // (it is easier fo handling in getConfig()) - if (!isset($this->_aCfgProject['deploy']['plugins'][$this->_sPluginId])){ - if (!isset($this->_aCfgProject['deploy']['plugins'])){ - if (!isset($this->_aCfgProject['deploy'])){ - $this->_aCfgProject['deploy']=array(); + if (!isset($this->_aCfgProject['plugins']['rollout'][$this->_sPluginId])){ + /* + if (!isset($this->_aCfgProject['plugins']['rollout'])){ + if (!isset($this->_aCfgProject['plugins'])){ + $this->_aCfgProject['plugins']=array(); } - $this->_aCfgProject['deploy']['plugins']=array(); + $this->_aCfgProject['plugins']['rollout']=array(); } - $this->_aCfgProject['deploy']['plugins'][$this->_sPluginId]=array(); + * + */ + $this->_aCfgProject['plugins']['rollout'][$this->_sPluginId]=array('INFO'=>'created'); } return $this->_aCfgProject; } @@ -197,16 +225,32 @@ class rollout_base implements iRolloutplugin{ */ public function getConfig($sPhase=false){ - return ($sPhase && isset($this->_aCfgProject['phases']['plugins'][$this->_sPluginId])) - ? array_merge($this->_aCfgGlobal, $this->_aCfgProject['deploy']['plugins'][$this->_sPluginId], $this->_aCfgProject['phases']['plugins'][$this->_sPluginId]) - : array_merge($this->_aCfgGlobal, $this->_aCfgProject['deploy']['plugins'][$this->_sPluginId]) + return ($sPhase && isset($this->_aCfgProject['phases']['plugins']['rollout'][$this->_sPluginId])) + ? array_merge($this->_aCfgGlobal, $this->_aCfgProject['plugins']['rollout'][$this->_sPluginId], $this->_aCfgProject['phases']['plugins']['rollout'][$this->_sPluginId]) + : array_merge($this->_aCfgGlobal, $this->_aCfgProject['plugins']['rollout'][$this->_sPluginId]) ; } + /** + * get string with current ID + * @return string + */ + public function getId(){ + return $this->_sPluginId; + } + + /** + * get string with plugin name (taken from plugin language file) + * @return string + */ public function getName(){ return $this->_t('plugin_name'); } + /** + * get string with plugin description (taken from plugin language file) + * @return string + */ public function getDescription(){ return $this->_t('description'); } @@ -229,4 +273,11 @@ class rollout_base implements iRolloutplugin{ return $this->_aPlugininfos; } + // ---------------------------------------------------------------------- + // INTERFACE :: RENDERER + // ---------------------------------------------------------------------- + public function renderFormdata4Project() { + return ''; + } + } diff --git a/public_html/deployment/pages/act_setup.php b/public_html/deployment/pages/act_setup.php index 6487e00f2dd31b483e17e149bd5e71b0b8a89ac7..8a762aa199d9d5b1334bf7992c96fcddb786543c 100644 --- a/public_html/deployment/pages/act_setup.php +++ b/public_html/deployment/pages/act_setup.php @@ -55,6 +55,35 @@ function maskEntries($aMask, $aConfig){ return $aConfig; } +/** + * recursive replace of values in a hash + * source: https://www.w3schools.in/php-script/recursive-array-replace-by-Key-or-Value/ + * FIX: 3x "=" in if($Key === $Find) + * + * @param array $Array Array + * @param string $Find key to scan for + * @param strin $Replace new value + * @return array + */ +function ArrayReplace($Array, $Find, $Replace) { + if (is_array($Array)) { + foreach ($Array as $Key => $Val) { + if (is_array($Array[$Key])) { + $Array[$Key] = ArrayReplace($Array[$Key], $Find, $Replace); + } else { + if ($Key === $Find) { + $Array[$Key] = $Replace; + } + } + } + } + return $Array; +} + +// --------------------------------------------------------------------- +// MAIN +// --------------------------------------------------------------------- + if ($aParams["prj"] == "all") { // ------------------------------------------------------------ @@ -62,7 +91,10 @@ if ($aParams["prj"] == "all") { // ------------------------------------------------------------ if (!array_key_exists("par3", $aParams)) { $oPrj = new project(); - $aTmp=maskEntries($aMask, $aConfig); + // $aTmp=maskEntries($aMask, $aConfig); + $aTmp=$aConfig; + $aTmp=ArrayReplace($aTmp, "password", $sFakePassword); + $aTmp=ArrayReplace($aTmp, "PwLdapUser", $sFakePassword); $sOut.= '<pre>'.print_r($aTmp, 1).'</pre>'; // print_r($aConfig); @@ -304,13 +336,14 @@ if ($aParams["prj"] == "all") { // setup page of a an existing project // ------------------------------------------------------------ $oPrj = new project($aParams["prj"]); + /* $sOut.='<div style="float: right">' // . 'aParams:<pre>'.print_r($aParams, true).'</pre>' . 'configured rollout plugins:<pre>'.print_r($oPrj->getConfiguredPlugins('rollout'), true).'</pre>' // . 'rollout plugin infos:<pre>'.print_r($oPrj->oRolloutPlugin->getPluginInfos(), true).'</pre>' . 'prj config of rollout plugin:<pre>'.print_r($oPrj->oRolloutPlugin->getConfig(), true).'</pre>' . '</div>'; - + */ if (array_key_exists("setupaction", $aParams) && $aParams["setupaction"] == "save") { if ($oPrj->saveConfig()) { $sOut.=$oHtml->getBox("success", t("page-setup-info-settings-were-saved")); diff --git a/public_html/deployment/plugins/rollout/default/lang_de.json b/public_html/deployment/plugins/rollout/default/lang_de.json index 0e2b0efb3d6d9a810c2a01c25fb73c9280bb08c1..540c8bbb40fb520cff89ec6f67dffbb4ee1fc8bf 100644 --- a/public_html/deployment/plugins/rollout/default/lang_de.json +++ b/public_html/deployment/plugins/rollout/default/lang_de.json @@ -1,4 +1,6 @@ { "plugin_name": "Default: keine Aktion", - "description": "Es wird keine Aktion zum Rollout gestartet." + "description": "Es wird keine Aktion zum Rollout gestartet.", + + "no-project-cfg": "Es wird keine Einstellungen benötigt." } \ No newline at end of file diff --git a/public_html/deployment/plugins/rollout/default/rollout_default.php b/public_html/deployment/plugins/rollout/default/rollout_default.php index 312ebf12e2e6e489affdef86a7d1144bc379012b..a1f864abcf561ec929952ad7f85e212894377111 100644 --- a/public_html/deployment/plugins/rollout/default/rollout_default.php +++ b/public_html/deployment/plugins/rollout/default/rollout_default.php @@ -7,7 +7,7 @@ * * @author axel */ -class rollout extends rollout_base { +class rollout_default extends rollout_base { /** * check requirements if the plugin could work @@ -25,4 +25,8 @@ class rollout extends rollout_base { return true; } + public function renderFormdata4Project() { + return $this->_t('no-project-cfg'); + + } } diff --git a/public_html/deployment/plugins/rollout/ssh/info.json b/public_html/deployment/plugins/rollout/ssh/info.json new file mode 100644 index 0000000000000000000000000000000000000000..7aaf679104cb84dbc13d1227bd195418302b350b --- /dev/null +++ b/public_html/deployment/plugins/rollout/ssh/info.json @@ -0,0 +1,16 @@ +{ + "name": "SSH", + "description": "Run a SSH command on remote targets.", + "author": "Axel Hahn; University odf Bern; Institute for Medical education", + + "version": "1.0", + "url": "[included]", + "license": "GNU GPL 3.0", + + "vars": { + "global": {}, + "project": {}, + "phase": {} + } +} + diff --git a/public_html/deployment/plugins/rollout/ssh/lang_de.json b/public_html/deployment/plugins/rollout/ssh/lang_de.json new file mode 100644 index 0000000000000000000000000000000000000000..477f41da3ffd9a7a185c58c4903a1f119ba6cdf1 --- /dev/null +++ b/public_html/deployment/plugins/rollout/ssh/lang_de.json @@ -0,0 +1,14 @@ +{ + "plugin_name": "SSH", + "description": "Ein SSH Kommando auf einem Zielsystem starten.", + + "user": "SSH User", + "section-required": "Erforderliche Angaben", + "section-optional": "optionale Angaben", + "section-commands": "Kommandos", + "privatekey": "Dateiname des Privatekeys", + "addkeycommand": "Hinzufügen in die known_hosts", + "command": "Kommando", + "testcommand": "Test-Remote-Kommando", + "project___": "" +} \ No newline at end of file diff --git a/public_html/deployment/plugins/rollout/ssh/lang_en.json b/public_html/deployment/plugins/rollout/ssh/lang_en.json new file mode 100644 index 0000000000000000000000000000000000000000..1a21a39a114fb69e6574f5638f9131d4281b0564 --- /dev/null +++ b/public_html/deployment/plugins/rollout/ssh/lang_en.json @@ -0,0 +1,4 @@ +{ + "plugin_name": "SSH", + "description": "Run a command on a remote system via SSH ." +} \ No newline at end of file diff --git a/public_html/deployment/plugins/rollout/ssh/rollout_ssh.php b/public_html/deployment/plugins/rollout/ssh/rollout_ssh.php new file mode 100644 index 0000000000000000000000000000000000000000..a054a59db1e79d743a50e6c89fbe8e52d2be893f --- /dev/null +++ b/public_html/deployment/plugins/rollout/ssh/rollout_ssh.php @@ -0,0 +1,103 @@ +<?php +/** + * + * Rollout plugin - default + * + * no action + * + * @author axel + */ +class rollout_ssh extends rollout_base { + + /** + * check requirements if the plugin could work + */ + public function checkRequirements(){ + // no specific checks needed ... always true + return true; + } + + /** + * check access to a deploy target + */ + public function checkConnectionToTarget(){ + // do nothing ... always true + return true; + } + + /** + * form fields for project settings + * @return type + */ + public function renderFormdata4Project() { + $sReturn=''; + $i=0; + + $sNamePrefix='plugins[rollout]['.$this->getId().']'; + $aValues=$this->getConfig(); + + $aFormdata=array( + array('type' => 'markup','value' => '<br>'.$this->_t('section-required').':'), + array( + 'type' => 'text', + 'name' => $sNamePrefix.'[user]', + 'label' => $this->_t('user'), + 'value' => $aValues['user'], + // 'required' => 'required', + 'validate' => 'isastring', + 'size' => 25, + 'placeholder' => $this->_aCfgGlobal['user'], + ), + array( + 'type' => 'text', + 'name' => $sNamePrefix.'[command]', + 'label' => $this->_t('command'), + 'value' => $aValues['command'], + // 'required' => 'required', + 'validate' => 'isastring', + // 'size' => 100, + 'placeholder' => $this->_aCfgGlobal['command'], + ), + array('type' => 'markup','value' => '<br><br>'.$this->_t('section-optional').':'), + array( + 'type' => 'text', + 'name' => $sNamePrefix.'[privatekey]', + 'label' => $this->_t('privatekey'), + 'value' => $aValues['privatekey'], + // 'required' => 'required', + 'validate' => 'isastring', + // 'size' => 100, + 'placeholder' => $this->_aCfgGlobal['privatekey'], + ), + array('type' => 'markup','value' => '<br><br>'.$this->_t('section-commands').':'), + array( + 'type' => 'text', + 'name' => $sNamePrefix.'[addkeycommand]', + 'label' => $this->_t('addkeycommand'), + 'value' => $aValues['addkeycommand'], + // 'required' => 'required', + 'validate' => 'isastring', + // 'size' => 100, + 'placeholder' => $this->_aCfgGlobal['addkeycommand'], + ), + array( + 'type' => 'text', + 'name' => $sNamePrefix.'[testcommand]', + 'label' => $this->_t('testcommand'), + 'value' => $aValues['testcommand'], + // 'required' => 'required', + 'validate' => 'isastring', + // 'size' => 100, + 'placeholder' => $this->_aCfgGlobal['testcommand'], + ), + ); + + return 'WIP: config for plugin ['.$this->getId().']<br><br>' + . $this->_renderForm($aFormdata, 'project') + // .$sReturn + // .'<pre>DEBUG: GLOBAL settings - $this->_aCfgGlobal = '.print_r($this->_aCfgGlobal, 1).'</pre>' + // .'<pre>DEBUG: PROJECT settings - $this->getConfig() = '.print_r($aValues, 1).'</pre>' + // .'<pre>DEBUG: $this->_aCfgProject ... plugin = '.print_r($this->_aCfgProject, 1).'</pre>' + ; + } +}