Skip to content

Commit

Permalink
updated has_many and belongs_to generated form fields to use the shor…
Browse files Browse the repository at this point in the history
…t_name for the module value that it is linked to
  • Loading branch information
David McReynolds committed Feb 21, 2013
1 parent 23b09e1 commit 78083ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fuel/modules/fuel/core/MY_Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function short_name($lower = FALSE, $record_class = FALSE)
*
<code>
echo $this->examples_model->friendly_name(TRUE);
// example
// examples
</code>
*
* @access public
Expand Down Expand Up @@ -2736,7 +2736,7 @@ public function form_fields($values = array(), $related = array())
}
$related_options = $CI->$related_model->options_list(NULL, NULL, $where);
$related_vals = ( ! empty($values['id'])) ? $this->get_related_keys($values, $related_model, 'has_many', $rel_config) : array();
$fields[$related_field] = array('label' => humanize($related_field), 'type' => 'multi', 'options' => $related_options, 'value' => $related_vals, 'mode' => 'multi', 'module' => $CI->$related_model->friendly_name(TRUE));
$fields[$related_field] = array('label' => humanize($related_field), 'type' => 'multi', 'options' => $related_options, 'value' => $related_vals, 'mode' => 'multi', 'module' => $CI->$related_model->short_name(TRUE));
}
}

Expand All @@ -2753,7 +2753,7 @@ public function form_fields($values = array(), $related = array())
$related_model = $this->load_related_model($rel_config);
$related_options = $CI->$related_model->options_list(NULL, NULL, $where);
$related_vals = ( ! empty($values['id'])) ? $this->get_related_keys($values, $related_model, 'belongs_to', $rel_config) : array();
$fields[$related_field] = array('label' => lang('label_belongs_to').'<br />' . humanize($related_field), 'type' => 'multi', 'options' => $related_options, 'value' => $related_vals, 'mode' => 'multi', 'module' => $CI->$related_model->friendly_name(TRUE));
$fields[$related_field] = array('label' => lang('label_belongs_to').'<br />' . humanize($related_field), 'type' => 'multi', 'options' => $related_options, 'value' => $related_vals, 'mode' => 'multi', 'module' => $CI->$related_model->short_name(TRUE));
}
}

Expand Down

0 comments on commit 78083ce

Please sign in to comment.