function tripal_analysis_theme_node_form_properties
1.x tripal_analysis.form.inc | tripal_analysis_theme_node_form_properties($form) |
3 calls to tripal_analysis_theme_node_form_properties()
- theme_chado_analysis_node_form in tripal_analysis/
includes/ tripal_analysis.form.inc - tripal_analysis_property_add in tripal_analysis/
includes/ tripal_analysis.form.inc - tripal_analysis_property_delete in tripal_analysis/
includes/ tripal_analysis.form.inc
File
- tripal_analysis/
includes/ tripal_analysis.form.inc, line 545
Code
function tripal_analysis_theme_node_form_properties($form) {
$rows = array();
if ($form['properties']) {
// first add in the properties derived from the analysisprop table
// the array tree for these properties looks like this:
// $form['properties']['table'][$type_id][$rank]["prop_id-$type_id-$rank"]
foreach ($form['properties']['table'] as $type_id => $elements) {
// there are other fields in the properties array so we only
// want the numeric ones those are our type_id
if (is_numeric($type_id)) {
foreach ($elements as $rank => $element) {
if (is_numeric($rank)) {
$rows[] = array(
drupal_render($element["prop_id-$type_id-$rank"]),
drupal_render($element["prop_value-$type_id-$rank"]),
drupal_render($element["remove-$type_id-$rank"]),
);
}
}
}
}
// second, add in any new properties added by the user through AHAH callbacks
// the array tree for these properties looks like this:
// $form['properties']['table']['new'][$type_id][$rank]["new_id-$new_id-$rank"]
foreach ($form['properties']['table']['new'] as $type_id => $elements) {
if (is_numeric($type_id)) {
foreach ($elements as $rank => $element) {
if (is_numeric($rank)) {
$rows[] = array(
drupal_render($element["new_id-$type_id-$rank"]),
drupal_render($element["new_value-$type_id-$rank"]),
drupal_render($element["remove-$type_id-$rank"]),
);
}
}
}
}
// finally add in a set of blank field for adding a new property
$rows[] = array(
drupal_render($form['properties']['table']['new']['new_id']),
drupal_render($form['properties']['table']['new']['new_value']),
drupal_render($form['properties']['table']['new']['add']),
);
}
$headers = array('Property Type', 'Value', '');
return theme('table', $headers, $rows);
}