Cześć,
Piszę sobie projekt i jedna z metod bardzo mi się nie podoba, może wy wymyślicie jak ją przerobić na czytelną. Metoda jest w klasie Files która obsługuje pliki:
public function changeFilename(){
if($this->input->post('filename') != NULL AND $this->input->post('customer_filename') != NULL){
if($this->input->post('customer_filename') != ''){
if($this->files_model->changeFilename($this->input->post('customer_filename'), $this->input->post('filename'))){
responseAjax(AJAX_SUCCESS, $this->lang->line('files_filename_changed'));
} else {
responseAjax(AJAX_ERROR, $this->lang->line('error_messages_unknown_error'));
}
} else {
responseAjax(AJAX_ERROR, $this->lang->line('files_filename_cant_be_empty'))
}
} else {
responseAjax(AJAX_ERROR, $this->lang->line('error_messages_unknown_error'));
}
}