added option to disable the github button

This commit is contained in:
HB9HIL
2024-01-25 02:39:50 +01:00
parent b95ed5fa88
commit 06b8ab8d80
3 changed files with 24 additions and 15 deletions

View File

@@ -123,13 +123,11 @@ class Options extends CI_Controller {
$this->session->set_flashdata('success', $this->lang->line('options_logbook_map_changed_to').$this->input->post('logbookMap'));
}
// Update Lang choice within the options system
// $lang_update_status = $this->optionslib->update('language', $this->input->post('language'));
$public_github_button_update_status = $this->optionslib->update('public_github_button', $this->input->post('publicGithubButton'), 'yes');
// 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')));
// }
if($public_github_button_update_status == TRUE) {
$this->session->set_flashdata('success', 'Public Github Button is now ' . $this->input->post('publicGithubButton'));
}
// Redirect back to /appearance
redirect('/options/appearance');

View File

@@ -94,6 +94,15 @@
<small id="logbookMapHelp" class="form-text text-muted"><?php echo lang('options_this_allows_to_disable_the_map_in_the_logbook'); ?></small>
</div>
<div class="mb-3">
<label for="publicGithubButton">Public Github Button</label>
<select class="form-select" id="publicGithubButton" name="publicGithubButton" aria-describedby="publicGithubButtonHelp" required>
<option value='true' <?php if($this->optionslib->get_option('public_github_button') == "true") { echo "selected=\"selected\""; } ?>>Enabled</option>
<option value='false' <?php if($this->optionslib->get_option('public_github_button') == "false") { echo "selected=\"selected\""; } ?>>Disabled</option>
</select>
<small id="publicGithubButtonHelp" class="form-text text-muted">This enables the button to Wavelog's Github page in the public view</small>
</div>
<!-- Save the Form -->
<input class="btn btn-primary" type="submit" value="<?php echo lang('options_save'); ?>" />
</form>

View File

@@ -65,17 +65,19 @@
<a class="nav-link" href="<?php echo site_url('oqrs');?>">OQRS</a>
</li>
<?php }
}
if ($this->uri->segment(1) != "oqrs") { ?>
<li class="nav-item">
<a class="btn btn-outline-primary" href="<?php echo site_url('user/login');?>">Login</a>
</li>
<?php } ?>
} ?>
</ul>
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="btn btn-outline-secondary" href="https://github.com/wavelog/wavelog">Wavelog on Github</a>
</li>
<?php if($this->optionslib->get_option('public_github_button') != "false") { ?> <!-- != false causes to set it on per default -->
<li class="nav-item">
<a class="btn btn-secondary" href="https://github.com/wavelog/wavelog">Visit Wavelog on Github</a>
</li>
<?php } ?>
<?php if ($this->uri->segment(1) != "oqrs") { ?>
<li class="nav-item">
<a class="btn btn-primary ms-2" href="<?php echo site_url('user/login');?>">Login</a>
</li>
<?php } ?>
</ul>
<div class="m-2">
<?php if (!empty($slug)) {