mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 12:31:06 -05:00
formval fixes
This commit is contained in:
parent
a86e7fe066
commit
0aaf5651a9
@ -120,7 +120,7 @@ class Main extends CI_Controller
|
||||
else
|
||||
{
|
||||
$this->load->model('pastes');
|
||||
$this->load->library('validation');
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$rules['code'] = 'required';
|
||||
$rules['lang'] = 'min_length[1]|required|callback__valid_lang';
|
||||
@ -128,12 +128,12 @@ class Main extends CI_Controller
|
||||
$fields['code'] = 'Main Paste';
|
||||
$fields['lang'] = 'Language';
|
||||
|
||||
$this->validation->set_rules($rules);
|
||||
$this->validation->set_fields($fields);
|
||||
$this->validation->set_message('min_length', 'The %s field can not be empty');
|
||||
$this->validation->set_error_delimiters('<div class="message error"><div class="container">', '</div></div>');
|
||||
$this->form_validation->set_rules($rules);
|
||||
//$this->form_validation->set_fields($fields);
|
||||
$this->form_validation->set_message('min_length', 'The %s field can not be empty');
|
||||
$this->form_validation->set_error_delimiters('<div class="message error"><div class="container">', '</div></div>');
|
||||
|
||||
if ($this->validation->run() == FALSE)
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
{
|
||||
$data = $this->_form_prep();
|
||||
$this->load->view('home', $data);
|
||||
@ -331,14 +331,14 @@ class Main extends CI_Controller
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->load->library('validation');
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$rules['full_width'] = 'max_length[1]';
|
||||
$rules['view_raw'] = 'max_length[1]';
|
||||
|
||||
$this->validation->set_rules($rules);
|
||||
$this->form_validation->set_rules($rules);
|
||||
|
||||
if($this->validation->run() == false)
|
||||
if($this->form_validation->run() == false)
|
||||
{
|
||||
exit('Ugh, stupid skiddie.');
|
||||
}
|
||||
@ -407,7 +407,7 @@ class Main extends CI_Controller
|
||||
function _valid_lang($lang)
|
||||
{
|
||||
$this->load->model('languages');
|
||||
$this->validation->set_message('_valid_lang', 'Please select your language');
|
||||
$this->form_validation->set_message('_valid_lang', 'Please select your language');
|
||||
return $this->languages->valid_language($lang);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user