function set_disco_obj($types) { $d = new disco(); $types = array(); foreach ($this->types as $type) { $types = $types + array($type->get_value('id') => $type->get_value('name')); } $d->add_element('types', 'select_multiple', array('options' => $types)); $d->set_display_name('types', 'Types to search:'); $d->set_comments('types', form_comment('<a id="select_all" href="#all">Select all</a>')); $d->add_element('max', 'radio_inline_no_sort', array('options' => array('yes' => 'Yes', 'no' => 'No'))); $d->set_display_name('max', 'Limit number of orphans to find:'); $d->set_comments('max', form_comment('Searching for all orphaned entities can take a while. Limiting the number to find speeds the search.')); $d->set_value('max', 'yes'); $d->add_element('max_num', 'text', array('size' => '5')); $d->set_display_name('max_num', 'Maximum number:'); $d->set_value('max_num', '50'); $d->add_element('cur_module', 'hidden'); $d->set_value('cur_module', 'OrphanManager'); $d->add_required('types', 'max'); $d->add_element('mode', 'hidden'); $d->set_value('mode', 'manager'); $d->set_actions(array('run' => 'Find Orphaned Entities')); function check_phase_callback(&$disco) { if ($disco->successfully_submitted()) { $disco->show_form = false; } } $d->add_callback('check_phase_callback', 'where_to'); $this->d = $d; }