- more work on froxlor-client settings (multiserver mode)
This commit is contained in:
@@ -181,7 +181,20 @@ if((int)$settings['multiserver']['enabled'] == 1)
|
||||
) {
|
||||
$client = froxlorclient::getInstance($userinfo, $db, $id);
|
||||
|
||||
$settings_data = $client->getSettingsData();
|
||||
/**
|
||||
* @TODO
|
||||
* - decide by client type (implementation will follow)
|
||||
* what settings are going to be shown here
|
||||
* (parameter $client_settings, has to be an array,
|
||||
* see loadConfigArrayDir-function)
|
||||
*/
|
||||
$client_settings = array('froxlorclient');
|
||||
|
||||
$settings_data = loadConfigArrayDir(
|
||||
'./actions/admin/settings/',
|
||||
'./actions/multiserver/clientsettings/',
|
||||
$client_settings
|
||||
);
|
||||
$settings = $client->getSettingsArray();
|
||||
|
||||
if(isset($_POST['send'])
|
||||
@@ -190,14 +203,32 @@ if((int)$settings['multiserver']['enabled'] == 1)
|
||||
}
|
||||
else
|
||||
{
|
||||
$_part = isset($_GET['part']) ? $_GET['part'] : '';
|
||||
|
||||
if($_part == '')
|
||||
{
|
||||
$_part = isset($_POST['part']) ? $_POST['part'] : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @TODO
|
||||
* - show all client settings
|
||||
* - validate settings
|
||||
*/
|
||||
echo $header;
|
||||
echo "Here you will see the clients configuration, you will know most of the settings from the 'master'-panel already";
|
||||
echo $footer;
|
||||
* @TODO this has to get the client-id so the
|
||||
* links "configuration" have the ID
|
||||
*/
|
||||
$fields = buildFormEx($settings_data, $_part);
|
||||
|
||||
$settings_page = '';
|
||||
if($_part == '')
|
||||
{
|
||||
eval("\$settings_page .= \"" . getTemplate("froxlorclients/froxlorclient_settingsoverview") . "\";");
|
||||
}
|
||||
else
|
||||
{
|
||||
eval("\$settings_page .= \"" . getTemplate("froxlorclients/froxlorclient_settings") . "\";");
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("settings/settings_form_begin") . "\";");
|
||||
eval("echo \$settings_page;");
|
||||
eval("echo \"" . getTemplate("froxlorclients/froxlorclient_settingsend") . "\";");
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -235,15 +235,6 @@ class froxlorclient
|
||||
return $this->Get('settings');
|
||||
}
|
||||
|
||||
/**
|
||||
* return the complete client-settings-data array
|
||||
* for the settings page
|
||||
*/
|
||||
public function getSettingsData()
|
||||
{
|
||||
return $this->s_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* get a value from the internal data array
|
||||
*
|
||||
|
||||
@@ -28,9 +28,20 @@ function loadConfigArrayDir()
|
||||
$numargs = func_num_args();
|
||||
if($numargs <= 0) { return null; }
|
||||
|
||||
// variable that holds all dirs that will
|
||||
// be parsed for inclusion
|
||||
$configdirs = array();
|
||||
// if one of the parameters is an array
|
||||
// we assume that this is a list of
|
||||
// setting-groups to be selected
|
||||
$selection = null;
|
||||
for($x=0;$x<$numargs;$x++) {
|
||||
$configdirs[] = func_get_arg($x);
|
||||
$arg = func_get_arg($x);
|
||||
if(is_array($arg) && isset($arg[0])) {
|
||||
$selection = $arg;
|
||||
} else {
|
||||
$configdirs[] = $arg;
|
||||
}
|
||||
}
|
||||
|
||||
$data = array();
|
||||
@@ -62,6 +73,23 @@ function loadConfigArrayDir()
|
||||
$data = array_merge_recursive($data, include($data_filename));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if we have specific setting-groups
|
||||
// to select, we'll handle this here
|
||||
// (this is for multiserver-client settings)
|
||||
$_data = array();
|
||||
if($selection != null
|
||||
&& is_array($selection)
|
||||
&& isset($selection[0])
|
||||
) {
|
||||
foreach($data['groups'] as $group => $data)
|
||||
{
|
||||
if(in_array($group, $selection)) {
|
||||
$_data[$group] = $data;
|
||||
}
|
||||
}
|
||||
$data = $_data;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -1537,5 +1537,6 @@ $lng['froxlorclient']['ssh_user'] = 'SSH user';
|
||||
$lng['froxlorclient']['ssh_passphrase'] = 'SSH passphrase';
|
||||
$lng['froxlorclient']['ssh_pubkey'] = 'SSH public key';
|
||||
$lng['froxlorclient']['ssh_privkey'] = 'SSH private key';
|
||||
$lng['admin']['froxlorclient_settings'] = 'Froxlor client settings:';
|
||||
|
||||
?>
|
||||
|
||||
12
templates/admin/froxlorclients/froxlorclient_settings.tpl
Normal file
12
templates/admin/froxlorclients/froxlorclient_settings.tpl
Normal file
@@ -0,0 +1,12 @@
|
||||
<table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable">
|
||||
<tr>
|
||||
<td class="maintitle" colspan="2"><b><img src="images/title.gif" alt="" /> {$lng['admin']['froxlorclient_settings']} "{$client->Get('name')}</b>
|
||||
[<a href="$filename?page=settings&part=&s=$s&id={$id}">{$lng['admin']['configfiles']['compactoverview']}</a>]</td>
|
||||
</tr>
|
||||
$fields
|
||||
<tr>
|
||||
<td class="maintitle_apply_right" nowrap="nowrap" colspan="2">
|
||||
<input class="bottom" type="reset" value="{$lng['panel']['reset']}" /><input class="bottom" type="submit" value="{$lng['panel']['save']}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -0,0 +1,8 @@
|
||||
<if $_part != ''>
|
||||
<input type="hidden" name="part" value="{$_part}" />
|
||||
</if>
|
||||
<input type="hidden" name="id" value="{$id}" />
|
||||
</form>
|
||||
<br />
|
||||
<br />
|
||||
$footer
|
||||
@@ -0,0 +1,14 @@
|
||||
<table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable_60">
|
||||
<tr>
|
||||
<td class="maintitle" align="center" colspan="3">
|
||||
<b><img src="images/title.gif" alt="" /> {$lng['admin']['configfiles']['serverconfiguration']}</b>
|
||||
[<a href="$filename?page=settings&part=all&s=$s&id={$id}">{$lng['admin']['configfiles']['overview']}</a>]
|
||||
</td>
|
||||
</tr>
|
||||
$fields
|
||||
<tr>
|
||||
<td class="maintitle_apply_right" nowrap="nowrap" colspan="3">
|
||||
<input class="bottom" type="reset" value="{$lng['panel']['reset']}" /> <input class="bottom" type="submit" value="{$lng['panel']['save']}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
Reference in New Issue
Block a user