Пример #1
0
 /** 
  * Edit one element field
  *
  */
 function edit()
 {
     $id_extend_field = $this->input->post('id_extend_field');
     $this->extend_field_model->feed_template($id_extend_field, $this->template);
     $this->extend_field_model->feed_lang_template($id_extend_field, $this->template);
     // Get the parent element
     $element = $this->element_definition_model->get(array('id_element_definition' => $this->template['id_parent']));
     // Pass the parent informations to the template
     $this->template['element'] = $element;
     $this->output('element/field');
 }
Пример #2
0
 /**
  * Get the detail of one Element (Add box)
  *
  */
 function get_element_detail()
 {
     $id_element = $this->input->post('id_element_definition');
     $element_definition = $this->element_definition_model->get(array('id_element_definition' => $id_element), Settings::get_lang('default'));
     // Element's fields definition
     $fields = $this->extend_field_model->get_list(array('parent' => 'element', 'id_parent' => $id_element, 'order_by' => 'ordering ASC'));
     $this->template['element_definition'] = $element_definition;
     $this->template['fields'] = $fields;
     $lang_fields = array_values(array_filter($fields, create_function('$row', 'return $row["translated"] == 1;')));
     $this->template['lang_fields'] = $lang_fields;
     // Check for langs fields different from
     $has_lang_fields = FALSE;
     foreach ($lang_fields as $lf) {
         if ($lf['type'] != 8) {
             $has_lang_fields = TRUE;
         }
     }
     // Check for Media type
     $has_media_fields = FALSE;
     foreach ($fields as $f) {
         if ($f['type'] == 8) {
             $has_media_fields = TRUE;
         }
     }
     $this->template['has_media_fields'] = $has_media_fields;
     $this->template['has_lang_fields'] = $has_lang_fields;
     $this->template['parent'] = $this->input->post('parent');
     $this->template['id_parent'] = $this->input->post('id_parent');
     $this->output('element/detail');
 }