Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. $handlers = array();
  2. foreach (get_fast_modinfo($COURSE->id)->get_cms() as $cm) {
  3.     $name = $cm->name;
  4.     $link = $cm->url;
  5.     $mform = new simplehtml_form($name, $link);
  6.     array_push($handlers, $mform);
  7.     $mform->set_data($toform);
  8.     $html = $mform->render();
  9. }
  10.  
  11. foreach ($handlers as $h) {
  12.     if ($h->get_data()) {
  13.         echo('prints only the submit data of the first. WHY???');
  14.         var_dump($h->get_data());
  15.     }            
  16. }
  17.  
  18. $this->content = new stdClass;
  19. $this->content->text = $html;
  20. return $this->content;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement