Esempio n. 1
0
 public function recipients_selection_form(user_selector_base $existinguc, user_selector_base $potentialuc)
 {
     $output = '';
     $formattributes = array();
     $formattributes['id'] = 'recipientform';
     $formattributes['action'] = $this->page->url;
     $formattributes['method'] = 'post';
     $output .= html_writer::start_tag('form', $formattributes);
     $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));
     $existingcell = new html_table_cell();
     $existingcell->text = $existinguc->display(true);
     $existingcell->attributes['class'] = 'existing';
     $actioncell = new html_table_cell();
     $actioncell->text = html_writer::start_tag('div', array());
     $actioncell->text .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'award', 'value' => $this->output->larrow() . ' ' . get_string('award', 'badges'), 'class' => 'actionbutton'));
     $actioncell->text .= html_writer::end_tag('div', array());
     $actioncell->attributes['class'] = 'actions';
     $potentialcell = new html_table_cell();
     $potentialcell->text = $potentialuc->display(true);
     $potentialcell->attributes['class'] = 'potential';
     $table = new html_table();
     $table->attributes['class'] = 'recipienttable boxaligncenter';
     $table->data = array(new html_table_row(array($existingcell, $actioncell, $potentialcell)));
     $output .= html_writer::table($table);
     $output .= html_writer::end_tag('form');
     return $output;
 }
Esempio n. 2
0
 /**
  * This is used to display a control containing all of the subscribed users so that
  * it can be searched
  *
  * @param user_selector_base $existingusers
  * @return string
  */
 public function subscribed_users(user_selector_base $existingusers)
 {
     $output = $this->output->box_start('subscriberdiv boxaligncenter');
     $output .= html_writer::tag('p', get_string('forcesubscribed', 'forum'));
     $output .= $existingusers->display(true);
     $output .= $this->output->box_end();
     return $output;
 }