mirror of
https://github.com/Relintai/mourne_rcpp_fw.git
synced 2024-12-23 21:16:50 +01:00
79 lines
1.5 KiB
PHP
Executable File
79 lines
1.5 KiB
PHP
Executable File
<?php
|
|
|
|
class Changelog extends MO_Controller
|
|
{
|
|
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
function show()
|
|
{
|
|
$this->load->model('changelog_model');
|
|
|
|
$data['versions'] = $this->changelog_model->get_versions();
|
|
$data['commits'] = $this->changelog_model->get_commits();
|
|
$data['userlevel'] = $this->userlevel;
|
|
$data['required_userlevel'] = 4;
|
|
|
|
$this->headers();
|
|
$this->load->view('changelog/changelog', $data);
|
|
$this->footer();
|
|
}
|
|
|
|
function add_new_version()
|
|
{
|
|
if (!$this->userlevel > 4)
|
|
show404();
|
|
|
|
$this->load->library('form_validation');
|
|
|
|
$this->form_validation->set_rules('text', 'Text', 'required');
|
|
|
|
if (!$this->form_validation->run())
|
|
{
|
|
$this->load->view('changelog/new_version');
|
|
}
|
|
else
|
|
{
|
|
$this->load->model('changelog_model');
|
|
|
|
$text = $this->input->post('text');
|
|
$this->changelog_model->new_version($text);
|
|
|
|
$this->load->helper('url');
|
|
redirect('changelog/show');
|
|
}
|
|
|
|
}
|
|
|
|
function add_new_commit()
|
|
{
|
|
if (!$this->userlevel > 4)
|
|
show404();
|
|
|
|
$this->load->library('form_validation');
|
|
|
|
$this->form_validation->set_rules('text', 'Text', 'required');
|
|
|
|
if (!$this->form_validation->run())
|
|
{
|
|
$this->load->view('changelog/new_commit');
|
|
}
|
|
else
|
|
{
|
|
$this->load->model('changelog_model');
|
|
|
|
$text = $this->input->post('text');
|
|
$this->changelog_model->new_commit($text);
|
|
|
|
$this->load->helper('url');
|
|
redirect('changelog/show');
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
//nowhitesp
|