public function display($templates) {
        global $OUTPUT;
        if (empty($templates)) {
            echo $OUTPUT->box(get_string('no_templates_available_yet', 'feedback'),
                             'generalbox boxaligncenter');
            return;
        }

        $this->setup();
        $strdeletefeedback = get_string('delete_template', 'feedback');

        foreach ($templates as $template) {
            $data = array();
            $data[] = format_string($template->name);
            $url = new moodle_url($this->baseurl, array('deletetempl' => $template->id, 'sesskey' => sesskey()));

            $deleteaction = new confirm_action(get_string('confirmdeletetemplate', 'feedback'));
            $data[] = $OUTPUT->action_icon($url, new pix_icon('t/delete', $strdeletefeedback), $deleteaction);
            $this->add_data($data);
        }
        $this->finish_output();
    }
public function display($templates) {
        global $OUTPUT;
        if (empty($templates)) {
            echo $OUTPUT->box(get_string('no_templates_available_yet', 'feedback'),
                             'generalbox boxaligncenter');
            return;
        }

        $this->setup();
        $strdeletefeedback = get_string('delete_template', 'feedback');

        foreach ($templates as $template) {
            $data = array();
            $data[] = format_string($template->name);
            $url = new moodle_url($this->baseurl, array('deletetempl' => $template->id, 'sesskey' => sesskey()));

            $deleteaction = new confirm_action(get_string('confirmdeletetemplate', 'feedback'));
            $data[] = $OUTPUT->action_icon($url, new pix_icon('t/delete', $strdeletefeedback), $deleteaction);
            $this->add_data($data);
        }
        $this->finish_output();
    }
public function display ( $ templates ) { global $ OUTPUT ; if ( empty ( $ templates ) ) { echo $ OUTPUT -> box ( get_string ( 'no_templates_available_yet' , 'feedback' ) , 'generalbox boxaligncenter' ) ; return ; } $ this -> setup ( ) ; $ strdeletefeedback = get_string ( 'delete_template' , 'feedback' ) ; foreach ( $ templates as $ template ) { $ data = array ( ) ; $ data [ ] = format_string ( $ template -> name ) ; $ url = new moodle_url ( $ this -> baseurl , array ( 'deletetempl' => $ template -> id , 'sesskey' => sesskey ( ) ) ) ; $ deleteaction = new confirm_action ( get_string ( 'confirmdeletetemplate' , 'feedback' ) ) ; $ data [ ] = $ OUTPUT -> action_icon ( $ url , new pix_icon ( 't/delete' , $ strdeletefeedback ) , $ deleteaction ) ; $ this -> add_data ( $ data ) ; } $ this -> finish_output ( ) ; }
Displays the table with the given set of templates
@param array $templates
Displays the table with the given set of templates