Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 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.     $stuff = $mform->render();
  9.     $html .= '<li><a href="' . $link . '">' . $name . '</a> ' . $stuff . '</li>';        
  10. }
  11.  
  12. foreach ($handlers as $h) {
  13.     if ($h->get_data()) {
  14.         echo('prints only the submit data of the first. WHY???');
  15.         var_dump($h->get_data());
  16.     }            
  17. }
  18.  
  19. $this->content = new stdClass;
  20. $this->content->text = $html;
  21. return $this->content;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement