Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function webform_components_form($form, $form_state, $node) {
- $form = array(
- '#tree' => TRUE,
- '#node' => $node,
- 'components' => array(),
- );
- $form['nid'] = array(
- '#type' => 'value',
- '#value' => $node->nid,
- );
- $options = array();
- foreach ($node->webform['components'] as $cid => $component) { // <-- 56. sor
- $options[$cid] = check_plain($component['name']);
- $form['components'][$cid]['cid'] = array(
- '#type' => 'hidden',
- '#default_value' => $component['cid'],
- );
- $form['components'][$cid]['pid'] = array(
- '#type' => 'hidden',
- '#default_value' => $component['pid'],
- );
- $form['components'][$cid]['weight'] = array(
- '#type' => 'textfield',
- '#size' => 4,
- '#title' => t('Weight'),
- '#default_value' => $component['weight'],
- );
- $form['components'][$cid]['mandatory'] = array(
- '#type' => 'checkbox',
- '#title' => t('Mandatory'),
- '#default_value' => $component['mandatory'],
- '#access' => webform_component_feature($component['type'], 'required'),
- );
- if (!isset($max_weight) || $component['weight'] > $max_weight) {
- $max_weight = $component['weight'];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement