You are here

function ctools_ajax_sample_animals in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 ctools_ajax_sample/ctools_ajax_sample.module \ctools_ajax_sample_animals()

Get a list of our animals and associated forms.

What we're doing is making it easy to add more animals in just one place, which is often how it will work in the real world. If using CTools, what you would probably really have, here, is a set of plugins for each animal.

2 calls to ctools_ajax_sample_animals()
ctools_ajax_sample_animal in ctools_ajax_sample/ctools_ajax_sample.module
A modal login callback.
ctools_ajax_sample_start in ctools_ajax_sample/ctools_ajax_sample.module
Wizard start form. Choose an animal.

File

ctools_ajax_sample/ctools_ajax_sample.module, line 392
Sample AJAX functionality so people can see some of the CTools AJAX features in use.

Code

function ctools_ajax_sample_animals() {
  return array(
    'sheep' => array(
      'title' => t('Sheep'),
      'config title' => t('Configure sheep'),
      'form' => 'ctools_ajax_sample_configure_sheep',
      'output' => 'ctools_ajax_sample_show_sheep',
    ),
    'lizard' => array(
      'title' => t('Lizard'),
      'config title' => t('Configure lizard'),
      'form' => 'ctools_ajax_sample_configure_lizard',
      'output' => 'ctools_ajax_sample_show_lizard',
    ),
    'raptor' => array(
      'title' => t('Raptor'),
      'config title' => t('Configure raptor'),
      'form' => 'ctools_ajax_sample_configure_raptor',
      'output' => 'ctools_ajax_sample_show_raptor',
    ),
  );
}