protected function _configVFS($ctx, $node)
{
$nosql = $this->configNoSQL($ctx . '|params');
$sql = $this->configSQL($ctx . '|params');
$default = $node->getAttribute('default');
$default = empty($default) ? 'horde' : $default;
list($default, $isDefault) = $this->__default($ctx . '|' . $node->getAttribute('switchname'), $default);
$xpath = new DOMXPath($node->ownerDocument);
$config = array('desc' => 'What VFS driver should we use?', 'default' => $default, 'is_default' => $isDefault, 'switch' => array('None' => array('desc' => 'None', 'fields' => array()), 'File' => array('desc' => 'Files on the local system', 'fields' => array('params' => array('vfsroot' => array('_type' => 'text', 'desc' => 'Where on the real filesystem should Horde use as root of the virtual filesystem?', 'default' => $this->_default($ctx . '|params|vfsroot', $xpath->evaluate('string(configsection/configstring[@name="vfsroot"])', $node) ?: '/tmp'))))), 'Nosql' => array('desc' => 'NoSQL database', 'fields' => array('params' => array('driverconfig' => $nosql))), 'Sql' => array('desc' => 'SQL database', 'fields' => array('params' => array('driverconfig' => $sql))), 'Ssh2' => array('desc' => 'SSH2 (SFTP)', 'fields' => array('params' => array('hostspec' => array('_type' => 'text', 'required' => true, 'desc' => 'SSH server/host', 'default' => $this->_default($ctx . '|hostspec', $xpath->evaluate('string(configsection/configstring[@name="hostspec"])', $node) ?: '')), 'port' => array('_type' => 'text', 'required' => false, 'desc' => 'Port number on which SSH listens', 'default' => $this->_default($ctx . '|port', $xpath->evaluate('string(configsection/configstring[@name="port"])', $node) ?: '22')), 'username' => array('_type' => 'text', 'required' => true, 'desc' => 'Username to connect to the SSH server', 'default' => $this->_default($ctx . '|username', $xpath->evaluate('string(configsection/configstring[@name="username"])', $node) ?: '')), 'password' => array('_type' => 'text', 'required' => true, 'desc' => 'Password with which to connect', 'default' => $this->_default($ctx . '|password', $xpath->evaluate('string(configsection/configstring[@name="password"])', $node) ?: '')), 'vfsroot' => array('_type' => 'text', 'desc' => 'Where on the real filesystem should Horde use as root of the virtual filesystem?', 'default' => $this->_default($ctx . '|vfsroot', $xpath->evaluate('string(configsection/configstring[@name="vfsroot"])', $node) ?: '/tmp')))))));
if (isset($node) && $node->getAttribute('baseconfig') != 'true') {
$config['switch']['horde'] = array('desc' => 'Horde defaults', 'fields' => array());
}
$cases = $this->_getSwitchValues($node, $ctx . '|params');
foreach ($cases as $case => $fields) {
if (isset($config['switch'][$case])) {
$config['switch'][$case]['fields']['params'] = array_merge($config['switch'][$case]['fields']['params'], $fields['fields']);
}
}
return $config;
}