[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/webform/components/ -> pagebreak.inc (source)

   1  <?php
   2  // $Id: pagebreak.inc,v 1.9.2.1 2010/09/28 22:43:56 quicksketch Exp $
   3  
   4  /**
   5   * @file
   6   * Webform module page break component.
   7   */
   8  
   9  /**
  10   * Implementation of _webform_defaults_component().
  11   */
  12  function _webform_defaults_pagebreak() {
  13    return array(
  14      'name' => '',
  15      'form_key' => NULL,
  16      'pid' => 0,
  17      'weight' => 0,
  18      'extra' => array(),
  19    );
  20  }
  21  
  22  /**
  23   * Implementation of _webform_theme_component().
  24   */
  25  function _webform_theme_pagebreak() {
  26    return array(
  27      'webform_display_pagebreak' => array(
  28        'arguments' => array('element' => NULL),
  29      ),
  30    );
  31  }
  32  
  33  /**
  34   * Implementation of _webform_edit_component().
  35   */
  36  function _webform_edit_pagebreak($component) {
  37    $form = array();
  38    // Force the parent to always be root.
  39    $form['position']['pid'] = array(
  40      '#type' => 'hidden',
  41      '#value' => '0',
  42    );
  43  
  44    $form['extra']['description'] = array();  // No description.
  45    $form['display'] = array('#type' => 'markup'); // Hide the display options.
  46    $form['display']['title_display'] = array();
  47  
  48    return $form;
  49  }
  50  
  51  /**
  52   * Implementation of _webform_render_component().
  53   */
  54  function _webform_render_pagebreak($component, $value = NULL, $filter = TRUE) {
  55    $element = array(
  56      '#type' => 'hidden',
  57      '#value' => $component['name'],
  58      '#weight' => $component['weight'],
  59    );
  60    return $element;
  61  }
  62  
  63  /**
  64   * Implementation of _webform_render_component().
  65   */
  66  function _webform_display_pagebreak($component, $value = NULL, $format = 'html') {
  67    $element = array(
  68      '#theme' => 'webform_display_pagebreak',
  69      '#title' => $component['name'],
  70      '#weight' => $component['weight'],
  71      '#format' => $format,
  72      '#webform_component' => $component,
  73    );
  74    return $element;
  75  }
  76  
  77  /**
  78   * Format the text output data for this component.
  79   */
  80  function theme_webform_display_pagebreak($element) {
  81    return $element['#format'] == 'html' ? '<h2 class="webform-page">' . check_plain($element['#title']) . '</h2>' : "--" . $element['#title'] . "--\n";
  82  }


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7