在PHP中添加现有的Drupal7表单字段

时间:2014-03-04 14:24:53

标签: php drupal-7 textfield content-type drupal-theming

<?php
/** featurename.module */
function featurename_confirm_page($form, &$form_state, $node) {
  $question = t('Are you sure you want to proceed with <em>@something</em> task?', array('@something' => $node->title));
  $form = array();
  $form['#node'] = $node;
  $form['nid'] = array(
    '#type' => 'value',
    '#value' => $node->nid,
  );
  $form = confirm_form($form, $question, 'node/' .
    $node->nid, t(  (preg_match("/featurename_content_type/i", $node->type) ? 'DROP-DOWN MENU HERE: ' .
    /* (insert list text field from another content type here) */ .
    : '') .
    '<p>By proceeding you are confirming that you want to do something; click only after you have selected an option from the drop-down menu and are ready to do something.'));
  return $form;
} // end featurename_confirm_page
?>

鉴于上述情况,文档中的哪些部分显示了如何以编程方式(通过PHP)添加来自不同内容类型的现有表单字段的语法?

0 个答案:

没有答案