[Options] Frontend Code added to enable or disable public search

这个提交包含在:
Peter Goodhall 2021-02-09 17:46:47 +00:00
父节点 91f53dddd2
当前提交 18f8933d7a
共有 2 个文件被更改,包括 17 次插入0 次删除

查看文件

@ -78,6 +78,14 @@ class Options extends CI_Controller {
$this->session->set_flashdata('success', 'Theme changed to '.$this->input->post('theme'));
}
// Update theme choice within the options system
$search_update_status = $this->optionslib->update('global_search', $this->input->post('globalSearch'));
// If theme update is complete set a flashsession with a success note
if($search_update_status == TRUE) {
$this->session->set_flashdata('success', 'Global Search changed to '.$this->input->post('globalSearch'));
}
// Update Lang choice within the options system
$lang_update_status = $this->optionslib->update('language', $this->input->post('language'));

查看文件

@ -57,6 +57,15 @@
<small id="themeHelp" class="form-text text-muted">Global Theme Choice, this is used when users arent logged in.</small>
</div>
<div class="form-group">
<label for="globalSearch">Public Search Bar</label>
<select class="custom-select" id="globalSearch" name="globalSearch" aria-describedby="globalSearchHelp" required>
<option value='true' <?php if($this->optionslib->get_option('global_search') == "true") { echo "selected=\"selected\""; } ?>>Enabled</option>
<option value='false' <?php if($this->optionslib->get_option('global_search') == "false") { echo "selected=\"selected\""; } ?>>Disabled</option>
</select>
<small id="globalSearchHelp" class="form-text text-muted">This allows non logged in users to access the search functions.</small>
</div>
<!-- Save the Form -->
<input class="btn btn-primary" type="submit" value="Save" />
</form>