public function setmodelv1() { $cr = 0; $array_data = NULL; $this->load->helper('slicer'); $array_data = array(SLICER_PRM_ID => 0, SLICER_PRM_XROT => $this->input->get('xrot'), SLICER_PRM_YROT => $this->input->get('yrot'), SLICER_PRM_ZROT => $this->input->get('zrot'), SLICER_PRM_SCALE => $this->input->get('s')); // we pass to allow part of parameter (at least one useful parameter) $cr = ERROR_MISS_PRM; foreach ($array_data as $key => $value) { if ($value === FALSE) { if ($key == SLICER_PRM_ID) { $cr = ERROR_MISS_PRM; break; } } else { if ($key != SLICER_PRM_ID) { $cr = ERROR_OK; break; } } } if ($cr == ERROR_OK) { $cr = Slicer_setModel($array_data); } $this->_return_cr($cr); return; }
function preview_change_ajax() { $cr = 0; $display = NULL; $this->load->helper('slicer'); $array_data = array(SLICER_PRM_ID => $this->input->get('id'), SLICER_PRM_XPOS => $this->input->get('xpos'), SLICER_PRM_YPOS => $this->input->get('ypos'), SLICER_PRM_ZPOS => $this->input->get('zpos'), SLICER_PRM_XROT => $this->input->get('xrot'), SLICER_PRM_YROT => $this->input->get('yrot'), SLICER_PRM_ZROT => $this->input->get('zrot'), SLICER_PRM_SCALE => $this->input->get('s'), SLICER_PRM_COLOR => $this->input->get('c')); $cr = Slicer_setModel($array_data, $display); if ($cr != ERROR_OK) { $display = $cr . " " . t(MyERRMSG($cr)); $this->output->set_status_header($cr, $display); } else { $this->output->set_status_header($cr); } // http_response_code($cr); $this->output->set_content_type('txt_u'); $this->load->library('parser'); $this->parser->parse('plaintxt', array('display' => $display)); //optional return; }