function forena_report_field_form in Forena Reports 7.5
Same name and namespace in other branches
- 8 forena.report.inc \forena_report_field_form()
- 7.4 forena.report.inc \forena_report_field_form()
Form field translation editor.
_state
Parameters
unknown $form:
unknown $report_name:
unknown $id:
Return value
multitype:string multitype:string Ambigous <The, string, A, Optional>
1 string reference to 'forena_report_field_form'
- forena_menu in ./
forena.module - Implementation of hook_menu.
File
- ./
forena.report.inc, line 960
Code
function forena_report_field_form($form, &$form_state, $report_name, $id) {
$r = Frx::Editor($report_name);
$id = urldecode($id);
$form['report_name'] = array(
'#type' => 'value',
'#value' => $report_name,
);
$field = $r->frxReport
->getField($id);
$form['field'] = array(
'#tree' => TRUE,
);
$form['field']['id'] = array(
'#type' => 'value',
'#value' => $id,
);
$form['field']['id_label'] = array(
'#type' => 'item',
'#markup' => $id,
'#title' => t('token'),
);
$form['field']['format'] = array(
'#type' => 'textfield',
'#title' => t('format'),
'#default_value' => $field['format'],
'#size' => 30,
'#autocomplete_path' => 'forena/fields/format/autocomplete',
'#description' => t('Format a date and time field by entering the name of a supported format function. Enter a "*" to see all available formats.'),
);
$form['field']['format-string'] = array(
'#type' => 'textfield',
'#title' => t('format-string'),
'#default_value' => $field['format-string'],
'#size' => 30,
'#description' => t('The display type of your format.'),
);
$form['field']['link'] = array(
'#type' => 'textfield',
'#title' => t('link'),
'#default_value' => $field['link'],
'#size' => 100,
'#maxlength' => 256,
'#description' => t('Create a link that incorporates this field, e.g "profile/{field_name}" will create a link to this field_name\'s profile. *Note the field must be wrapped in {}.'),
);
$form['field']['add-query'] = array(
'#type' => 'checkbox',
'#title' => t('Pass through url parameters'),
'#default_value' => $field['add-query'],
'#description' => t('Automatically pass through url parameters on this link'),
);
$form['field']['rel'] = array(
'#type' => 'textfield',
'#title' => t('rel'),
'#description' => t('Relationship attribute to apply to the link.'),
'#size' => 100,
'#maxlength' => 256,
'#default_value' => $field['rel'],
);
$form['field']['class'] = array(
'#type' => 'textfield',
'#title' => t('class'),
'#description' => t('Class applied to be applied to the link.'),
'#size' => 100,
'#maxlength' => 256,
'#default_value' => $field['class'],
);
$form['field']['target'] = array(
'#type' => 'textfield',
'#title' => t('target'),
'#default_value' => $field['target'],
'#size' => 30,
'#description' => t('Link target eg. _BLANK, Targets that begin with "popup" will be opened in a new window using javascript.'),
);
$form['field']['default'] = array(
'#type' => 'textfield',
'#title' => t('default value'),
'#default_value' => $field['default'],
'#size' => 30,
'#description' => t('The value to be displayed in the report when no value exists.'),
);
$form['field']['calc'] = array(
'#type' => 'textfield',
'#title' => t('calculation'),
'#default_value' => $field['calc'],
'#size' => 100,
'#description' => t('Enter a valid XPath expression used to calculate this field. Tokens (e.g. {title} may be used in the calculation.'),
);
$form['field']['context'] = array(
'#type' => 'textfield',
'#title' => t('context'),
'#default_value' => $field['context'],
'#size' => 100,
'#description' => t('Enter the data context used in the calculation. '),
);
$form['update'] = array(
'#type' => 'submit',
'#value' => t('Update'),
);
$form['cancel'] = array(
'#type' => 'submit',
'#value' => t('Cancel'),
'#submit' => array(
'forena_update_cancel',
),
);
return $form;
}