[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/data/data_ui/tests/ -> data_ui_test.module (source)

   1  <?php
   2  /**
   3   * @file
   4   * Test module for data_ui.test .
   5   */
   6  
   7  /**
   8   * Implementation of hook_ctools_plugin_api().
   9   */
  10  function data_ui_test_ctools_plugin_api($module, $api) {
  11    if ($module == 'data' && $api == 'data_default') {
  12      return array(
  13        'version' => 1,
  14      );
  15    }
  16  }
  17  
  18  /**
  19   * Implementation of hook_data_default().
  20   */
  21  function data_ui_test_data_default() {
  22    $data_table = new stdClass;
  23    $data_table->disabled = FALSE; /* Edit this to true to make a default data_table disabled initially */
  24    $data_table->api_version = 1;
  25    $data_table->title = 'Kittens';
  26    $data_table->name = 'data_table_kittens';
  27    $data_table->table_schema = array(
  28      'fields' => array(
  29        'id' => array(
  30          'type' => 'int',
  31          'size' => 'normal',
  32          'disp-width' => '10',
  33          'unsigned' => TRUE,
  34          'not null' => TRUE,
  35          'default' => 0,
  36        ),
  37        'name' => array(
  38          'type' => 'varchar',
  39          'size' => 'normal',
  40          'length' => '255',
  41          'not null' => FALSE,
  42        ),
  43        'age' => array(
  44          'type' => 'varchar',
  45          'size' => 'normal',
  46          'length' => '255',
  47          'not null' => FALSE,
  48        ),
  49        'color' => array(
  50          'type' => 'varchar',
  51          'size' => 'normal',
  52          'length' => '255',
  53          'not null' => FALSE,
  54        ),
  55      ),
  56      'name' => 'data_table_kittens',
  57      'indexes' => array(
  58        'id' => array(
  59          '0' => 'id',
  60        ),
  61        'name' => array(
  62          '0' => 'name',
  63        ),
  64      ),
  65      'primary key' => array(
  66        '0' => 'id',
  67      ),
  68    );
  69    $data_table->meta = array(
  70      'fields' => array(
  71        'id' => array(
  72          'label' => 'Id',
  73        ),
  74        'name' => array(
  75          'label' => 'Name',
  76        ),
  77        'age' => array(
  78          'label' => 'Age',
  79        ),
  80        'color' => array(
  81          'label' => 'Color',
  82        ),
  83      ),
  84      'join' => array(
  85        'node' => array(
  86          'left_field' => 'nid',
  87          'field' => 'id',
  88          'inner_join' => '1',
  89        ),
  90      ),
  91    );
  92    $data_tables['data_table_kittens'] = $data_table;
  93  
  94    return $data_tables;
  95  }


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7