function update_from_post() { $ufUF = new UtilityFunctions(); $c_elements = count($_POST['name']); $oa_elements = array(); // // general properties // $s_oncology_title = $ufUF->s_post_var('page_type_name', false); if ($s_oncology_title) { $this->json_oncology_instance->title = $s_oncology_title; } // // full elements // for ($c_element = 0; $c_element < $c_elements; $c_element++) { $s_name = $ufUF->s_post_array_var('name', $c_element, ''); $s_type = $ufUF->s_post_array_var('type', $c_element, ''); $s_editable = $ufUF->s_post_array_var('editable', $c_element, "false"); $s_position = $ufUF->s_post_array_var('position', $c_element, 0); $oa_element = array('name' => $s_name, 'type' => $s_type, 'editable' => $s_editable, 'position' => $s_position); array_push($oa_elements, $oa_element); } $this->json_oncology_instance->full_elements = $oa_elements; $this->datastore->_set_oncology_data($this->json_oncology_instance); $this->datastore->b_save_datastore('oncologies'); }