function link_element() { $result = FALSE; $id_element = $this->input->post('id_element'); $parent = $this->input->post('parent'); $id_parent = $this->input->post('id_parent'); $old_parent = $this->input->post('old_parent'); $old_id_parent = $this->input->post('old_id_parent'); $copy = $this->input->post('copy'); // TRUE / FALSE : is the element copied from one block to another ? $where = array('id_element' => $id_element, 'parent' => $parent, 'id_parent' => $id_parent); $message = lang('ionize_message_element_moved'); // Copy if ($copy !== FALSE) { $result = $this->element_model->copy($where); $message = lang('ionize_message_element_copied'); } else { $result = $this->element_model->move($where); } if ($result !== FALSE) { $this->callback = array(array('fn' => 'ION.getContentElements', 'args' => array($old_parent, $old_id_parent)), array('fn' => 'ION.notification', 'args' => array('success', $message))); } $this->response(); }