[Options][Appearance] You can now select the default language.
这个提交包含在:
父节点
4770340c45
当前提交
d2aec5d159
共有 2 个文件被更改,包括 28 次插入 和 0 次删除
|
|
@ -33,6 +33,11 @@ class Options extends CI_Controller {
|
||||||
|
|
||||||
// function used to display the /appearance url
|
// function used to display the /appearance url
|
||||||
function appearance() {
|
function appearance() {
|
||||||
|
|
||||||
|
// Get Language Options
|
||||||
|
$directory = 'application/language';
|
||||||
|
$data['language_options'] = array_diff(scandir($directory), array('..', '.'));
|
||||||
|
|
||||||
$data['page_title'] = "Cloudlog Options";
|
$data['page_title'] = "Cloudlog Options";
|
||||||
$data['sub_heading'] = "Appearance";
|
$data['sub_heading'] = "Appearance";
|
||||||
|
|
||||||
|
|
@ -43,6 +48,11 @@ class Options extends CI_Controller {
|
||||||
|
|
||||||
// Handles saving the appreance options to the options system.
|
// Handles saving the appreance options to the options system.
|
||||||
function appearance_save() {
|
function appearance_save() {
|
||||||
|
|
||||||
|
// Get Language Options
|
||||||
|
$directory = 'application/language';
|
||||||
|
$data['language_options'] = array_diff(scandir($directory), array('..', '.'));
|
||||||
|
|
||||||
$data['page_title'] = "Cloudlog Options";
|
$data['page_title'] = "Cloudlog Options";
|
||||||
$data['sub_heading'] = "Appearance";
|
$data['sub_heading'] = "Appearance";
|
||||||
|
|
||||||
|
|
@ -68,6 +78,14 @@ class Options extends CI_Controller {
|
||||||
$this->session->set_flashdata('success', 'Theme changed to '.$this->input->post('theme'));
|
$this->session->set_flashdata('success', 'Theme changed to '.$this->input->post('theme'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update Lang choice within the options system
|
||||||
|
$lang_update_status = $this->optionslib->update('language', $this->input->post('language'));
|
||||||
|
|
||||||
|
// If Lang update is complete set a flashsession with a success note
|
||||||
|
if($lang_update_status == TRUE) {
|
||||||
|
$this->session->set_flashdata('success', 'Language changed to '.ucfirst($this->input->post('language')));
|
||||||
|
}
|
||||||
|
|
||||||
// Redirect back to /appearance
|
// Redirect back to /appearance
|
||||||
redirect('/options/appearance');
|
redirect('/options/appearance');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,16 @@
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php echo form_open('options/appearance_save'); ?>
|
<?php echo form_open('options/appearance_save'); ?>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="themeSelect">Language</label>
|
||||||
|
<select class="custom-select" id="langSelect" name="language" aria-describedby="langHelp" required>
|
||||||
|
<?php foreach ($language_options as &$lang_opt) { ?>
|
||||||
|
<option value='<?php echo $lang_opt; ?>' <?php if($this->optionslib->get_option('language')== $lang_opt) { echo "selected=\"selected\""; } ?>><?php echo ucfirst($lang_opt); ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
<small id="langHelp" class="form-text text-muted">Select the default language for Cloudlog.</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Form options for selecting global theme choice -->
|
<!-- Form options for selecting global theme choice -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="themeSelect">Theme</label>
|
<label for="themeSelect">Theme</label>
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用