Stv Settings Phrases

This commit is contained in:
chfhtw
2025-11-13 09:11:06 +01:00
parent 5d957e38ae
commit 95f1c66684
2 changed files with 134 additions and 11 deletions
@@ -74,7 +74,7 @@ class Config extends FHCAPI_Controller
$config['number_displayed_past_studiensemester'] = [
"type" => "number",
"label" => "Anzahl angezeigter vergangender Studiensemester",// TODO(chris): phrase
"label" => $this->p->t('stv', 'settings_no_displayed_past_sem'),
"value" => $data['number_displayed_past_studiensemester']
?? $number_displayed_past_studiensemester_default
];
@@ -84,17 +84,20 @@ class Config extends FHCAPI_Controller
$data = $this->getDataOrTerminateWithError($result);
$config['font_size'] = [
"type" => "select",
"label" => "Font size",
"label" => $this->p->t('stv', 'settings_fontsize'),
"value" => $data['stv_font_size'] ?? "fs_normal",
"options" => [
"fs_small" => "klein",// TODO(chris): phrase
"fs_normal" => "normal",// TODO(chris): phrase
"fs_big" => "groß",// TODO(chris): phrase
"fs_huge" => "sehr groß"// TODO(chris): phrase
"fs_small" => $this->p->t('stv', 'settings_fontsize_small'),
"fs_normal" => $this->p->t('stv', 'settings_fontsize_normal'),
"fs_big" => $this->p->t('stv', 'settings_fontsize_big'),
"fs_huge" => $this->p->t('stv', 'settings_fontsize_huge')
]
];
// TODO(chris): Event
#others
Events::trigger('stv_config_get', function & () use (&$config) {
return $config;
});
$this->terminateWithSuccess($config);
}
@@ -109,16 +112,16 @@ class Config extends FHCAPI_Controller
$this->form_validation->set_rules(
'number_displayed_past_studiensemester',
"Anzahl angezeigter vergangender Studiensemester",// TODO(chris): phrase
$this->p->t('stv', 'settings_no_displayed_past_sem'),
'required|integer'
);
$this->form_validation->set_rules(
'font_size',
"Font size",// TODO(chris): phrase
$this->p->t('stv', 'settings_fontsize'),
'required|in_list[fs_small,fs_normal,fs_big,fs_huge]'
);
// TODO(chris): Event
Events::trigger('stv_config_validation', $this->form_validation);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
@@ -135,7 +138,7 @@ class Config extends FHCAPI_Controller
$this->input->post('font_size')
);
// TODO(chris): Event
Events::trigger('stv_config_set', $this->input);
$this->terminateWithSuccess();
}
+120
View File
@@ -38760,6 +38760,126 @@ array(
)
),
//**************************** CORE/stv
array(
'app' => 'core',
'category' => 'stv',
'phrase' => 'settings_no_displayed_past_sem',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Anzahl angezeigter vergangender Studiensemester',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Number of past semesters of study displayed',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'stv',
'phrase' => 'settings_fontsize',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Zoom',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Zoom',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'stv',
'phrase' => 'settings_fontsize_small',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Klein',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Small',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'stv',
'phrase' => 'settings_fontsize_normal',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Normal',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Normal',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'stv',
'phrase' => 'settings_fontsize_big',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Groß',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Big',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'stv',
'phrase' => 'settings_fontsize_huge',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Sehr groß',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Very big',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'stv',