You are here

function pardot_admin_scoring in Pardot Integration 7

Same name and namespace in other branches
  1. 6 pardot.admin-scoring.inc \pardot_admin_scoring()
  2. 7.2 pardot.admin-scoring.inc \pardot_admin_scoring()

Form constructor for managing and viewing scoring entries.

See also

pardot_admin_scoring_validate()

pardot_admin_scoring_submit()

1 string reference to 'pardot_admin_scoring'
pardot_menu in ./pardot.module
Implements hook_menu().

File

./pardot.admin-scoring.inc, line 15
Admin scoring form.

Code

function pardot_admin_scoring($form, &$form_state) {
  $form = array();
  $scores = db_query('SELECT * FROM {pardot_scoring}');
  foreach ($scores as $score) {

    //dsm($score);
    $form['scores'][$score->scoring_id] = array(
      '#score' => $score,
      'path' => array(
        '#value' => $score->path,
        '#markup' => $score->path,
      ),
      'score' => array(
        '#value' => $score->score,
        '#markup' => $score->score,
      ),
    );
  }
  $form['new'] = array(
    'path' => array(
      '#prefix' => '<div class="add-new-placeholder">' . t('Add new path') . '</div>',
      '#type' => 'textfield',
      '#size' => 30,
    ),
    'score' => array(
      '#prefix' => '<div class="add-new-placeholder">' . t('Score') . '</div>',
      '#type' => 'textfield',
      '#size' => 30,
    ),
  );
  $form['add'] = array(
    '#prefix' => '<div class="add-new-placeholder"></div>',
    '#type' => 'submit',
    '#value' => t('Add'),
  );
  return $form;
}