/**
  * Run the event similarity form
  * 
  * @return void
  */
 function run()
 {
     if (!$this->_should_run) {
         echo '<p>' . $this->_no_run_msg . '</p>' . "\n";
         return;
     }
     $d = new disco();
     $d->add_element('referer', 'hidden', array('userland_changeable' => true));
     if ($_SERVER['HTTP_REFERER']) {
         $d->set_value('referer', $_SERVER['HTTP_REFERER']);
     }
     $d->set_actions(array('split' => 'Split Into Separate Event Items'));
     $d->add_callback(array(&$this, 'event_split_callback'), 'process');
     $d->add_callback(array(&$this, 'get_event_info_html'), 'pre_show_form');
     $d->add_callback(array(&$this, 'get_cancel_html'), 'post_show_form');
     $d->add_callback(array(&$this, 'get_event_split_report'), 'no_show_form');
     $d->run();
 }
 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;
 }
Example #3
0
 function _get_editing_form($blurb)
 {
     $form = new disco();
     $form->strip_tags_from_user_input = true;
     $form->allowable_HTML_tags = REASON_DEFAULT_ALLOWED_TAGS;
     $form->add_element('blurb_edit_text', html_editor_name($this->site_id), html_editor_params($this->site_id, $this->get_html_editor_user_id()));
     $form->set_display_name('blurb_edit_text', ' ');
     $form->set_value('blurb_edit_text', $blurb->get_value('content'));
     $form->set_actions(array('save' => 'Save', 'save_and_finish' => 'Save and Finish Editing'));
     $form->add_callback(array(&$this, 'save_blurb_callback'), 'process');
     $form->add_callback(array(&$this, 'where_to_callback'), 'where_to');
     ob_start();
     $form->run();
     $form_output = ob_get_clean();
     return $form_output;
 }