summaryrefslogtreecommitdiffstats
path: root/modules-available/baseconfig
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/baseconfig')
-rw-r--r--modules-available/baseconfig/api.inc.php30
-rw-r--r--modules-available/baseconfig/config.json2
-rw-r--r--modules-available/baseconfig/lang/de/template-tags.json3
-rw-r--r--modules-available/baseconfig/lang/en/template-tags.json1
-rw-r--r--modules-available/baseconfig/lang/pt/template-tags.json2
-rw-r--r--modules-available/baseconfig/page.inc.php1
-rw-r--r--modules-available/baseconfig/templates/_page.html2
7 files changed, 31 insertions, 10 deletions
diff --git a/modules-available/baseconfig/api.inc.php b/modules-available/baseconfig/api.inc.php
index c692a0b2..db890299 100644
--- a/modules-available/baseconfig/api.inc.php
+++ b/modules-available/baseconfig/api.inc.php
@@ -59,9 +59,33 @@ foreach ($defaults as $setting => $value) {
$configVars[$setting] = $value;
}
-// Finally, output what we gathered
-foreach ($configVars as $setting => $value) {
- echo $setting, "='", escape($value), "'\n";
+// All done, now output
+
+if (Request::any('save') === 'true') {
+ // output AND save to disk: Generate contents
+ $lines = '';
+ foreach ($configVars as $setting => $value) {
+ $lines .= $setting . "='" . escape($value) . "'\n";
+ }
+ // Save to all the locations
+ $data = Property::getVersionCheckInformation();
+ if (is_array($data) && isset($data['systems'])) {
+ foreach ($data['systems'] as $system) {
+ $path = CONFIG_HTTP_DIR . '/' . $system['id'] . '/config';
+ if (file_put_contents($path, $lines) > 0) {
+ echo "# Saved config to $path\n";
+ } else {
+ echo "# Error saving config to $path\n";
+ }
+ }
+ }
+ // Output to browser
+ echo $lines;
+} else {
+ // Only output to client
+ foreach ($configVars as $setting => $value) {
+ echo $setting, "='", escape($value), "'\n";
+ }
}
// For quick testing or custom extensions: Include external file that should do nothing
diff --git a/modules-available/baseconfig/config.json b/modules-available/baseconfig/config.json
index 9ce17b0d..dd2122be 100644
--- a/modules-available/baseconfig/config.json
+++ b/modules-available/baseconfig/config.json
@@ -1,3 +1,3 @@
{
- "category": "main.settings"
+ "category": "main.settings-client"
}
diff --git a/modules-available/baseconfig/lang/de/template-tags.json b/modules-available/baseconfig/lang/de/template-tags.json
index 1c71e174..34163ca9 100644
--- a/modules-available/baseconfig/lang/de/template-tags.json
+++ b/modules-available/baseconfig/lang/de/template-tags.json
@@ -1,6 +1,5 @@
{
"lang_basicConfiguration": "Basiskonfiguration",
"lang_clientRelatedConfig": "Die Optionen auf dieser Seite beziehen sich auf das Verhalten der bwLehrpool-Clients.",
- "lang_enableOverride": "\u00dcberschreiben",
- "lang_reset": "Zur\u00fccksetzen"
+ "lang_enableOverride": "\u00dcberschreiben"
} \ No newline at end of file
diff --git a/modules-available/baseconfig/lang/en/template-tags.json b/modules-available/baseconfig/lang/en/template-tags.json
index 84eb01d7..6adfd682 100644
--- a/modules-available/baseconfig/lang/en/template-tags.json
+++ b/modules-available/baseconfig/lang/en/template-tags.json
@@ -15,7 +15,6 @@
"lang_partitionMountPoint": "Mount Point",
"lang_partitionOptions": "Options",
"lang_partitionSize": "Size",
- "lang_reset": "Reset",
"lang_resetConfirm": "Do you really wish to reset the variable to their default values?",
"lang_resetDefault": "Reset Default",
"lang_userName": "Username",
diff --git a/modules-available/baseconfig/lang/pt/template-tags.json b/modules-available/baseconfig/lang/pt/template-tags.json
index 79e3e911..28b9cb76 100644
--- a/modules-available/baseconfig/lang/pt/template-tags.json
+++ b/modules-available/baseconfig/lang/pt/template-tags.json
@@ -4,7 +4,6 @@
"lang_catUser": "Gerenciamente de Usu\u00e1rios",
"lang_confirm": "Voc\u00ea deseja salvar configura\u00e7\u00f5es em [ \/srv\/openslx\/www\/boot\/default\/config ] ?",
"lang_create": "Criar",
- "lang_delete": "Deletar",
"lang_helpId": "Id da parti\u00e7\u00e3o",
"lang_helpMountPoint": "Precisa ser um diret\u00f3rio: \/exemplo\/diret\u00f3rio\/",
"lang_helpOptions": "Atualmente, apenas a op\u00e7\u00e3o 'bootable' est\u00e1 dispon\u00edvel",
@@ -15,7 +14,6 @@
"lang_partitionMountPoint": "Mount Point",
"lang_partitionOptions": "Op\u00e7\u00f5es",
"lang_partitionSize": "Tamanho",
- "lang_reset": "Limpar",
"lang_resetConfirm": "Voc\u00ea realmente deseja restaurar as vari\u00e1veis para seus valores padr\u00f5es?",
"lang_resetDefault": "Restaurar Padr\u00e3o",
"lang_userName": "Nome",
diff --git a/modules-available/baseconfig/page.inc.php b/modules-available/baseconfig/page.inc.php
index 21b5459b..d14c64ac 100644
--- a/modules-available/baseconfig/page.inc.php
+++ b/modules-available/baseconfig/page.inc.php
@@ -157,6 +157,7 @@ class Page_BaseConfig extends Page
unset($setting);
array_multisort($sortvals, SORT_ASC, SORT_NUMERIC, $settings);
Render::addTemplate('_page', array(
+ 'userid' => User::getId(),
'override' => $this->targetModule !== false,
'categories' => array_values($settings),
'target_module' => $this->targetModule,
diff --git a/modules-available/baseconfig/templates/_page.html b/modules-available/baseconfig/templates/_page.html
index 093cb10f..305b3cd9 100644
--- a/modules-available/baseconfig/templates/_page.html
+++ b/modules-available/baseconfig/templates/_page.html
@@ -63,5 +63,5 @@
</div>
<button class="btn btn-primary" type="submit">{{lang_save}}</button>
<button class="btn btn-default" type="reset">{{lang_reset}}</button>
- <a class="btn btn-default" href="api.php?do=baseconfig">Download</a>
+ <a class="btn btn-default" href="api.php?do=baseconfig&amp;user={{userid}}">Download</a>
</form>