public function col_edit($tool) {
        global $OUTPUT;

        $buttons = array();

        $instance = new \stdClass();
        $instance->id = $tool->enrolid;
        $instance->courseid = $tool->courseid;
        $instance->enrol = 'lti';
        $instance->status = $tool->status;

        $strdelete = get_string('delete');
        $strenable = get_string('enable');
        $strdisable = get_string('disable');

        $url = new \moodle_url('/enrol/lti/index.php', array('sesskey' => sesskey(), 'courseid' => $this->courseid));

        if ($this->ltiplugin->can_delete_instance($instance)) {
            $aurl = new \moodle_url($url, array('action' => 'delete', 'instanceid' => $instance->id));
            $buttons[] = $OUTPUT->action_icon($aurl, new \pix_icon('t/delete', $strdelete, 'core',
                array('class' => 'iconsmall')));
        }

        if ($this->ltienabled && $this->ltiplugin->can_hide_show_instance($instance)) {
            if ($instance->status == ENROL_INSTANCE_ENABLED) {
                $aurl = new \moodle_url($url, array('action' => 'disable', 'instanceid' => $instance->id));
                $buttons[] = $OUTPUT->action_icon($aurl, new \pix_icon('t/hide', $strdisable, 'core',
                    array('class' => 'iconsmall')));
            } else if ($instance->status == ENROL_INSTANCE_DISABLED) {
                $aurl = new \moodle_url($url, array('action' => 'enable', 'instanceid' => $instance->id));
                $buttons[] = $OUTPUT->action_icon($aurl, new \pix_icon('t/show', $strenable, 'core',
                    array('class' => 'iconsmall')));
            }
        }

        if ($this->ltienabled && $this->canconfig) {
            $linkparams = array(
                'courseid' => $instance->courseid,
                'id' => $instance->id, 'type' => $instance->enrol,
                'returnurl' => new \moodle_url('/enrol/lti/index.php', array('courseid' => $this->courseid))
            );
            $editlink = new \moodle_url("/enrol/editinstance.php", $linkparams);
            $buttons[] = $OUTPUT->action_icon($editlink, new \pix_icon('t/edit', get_string('edit'), 'core',
                array('class' => 'iconsmall')));
        }

        return implode(' ', $buttons);
    }
public function col_edit($tool) {
        global $OUTPUT;

        $buttons = array();

        $instance = new \stdClass();
        $instance->id = $tool->enrolid;
        $instance->courseid = $tool->courseid;
        $instance->enrol = 'lti';
        $instance->status = $tool->status;

        $strdelete = get_string('delete');
        $strenable = get_string('enable');
        $strdisable = get_string('disable');

        $url = new \moodle_url('/enrol/lti/index.php', array('sesskey' => sesskey(), 'courseid' => $this->courseid));

        if ($this->ltiplugin->can_delete_instance($instance)) {
            $aurl = new \moodle_url($url, array('action' => 'delete', 'instanceid' => $instance->id));
            $buttons[] = $OUTPUT->action_icon($aurl, new \pix_icon('t/delete', $strdelete, 'core',
                array('class' => 'iconsmall')));
        }

        if ($this->ltienabled && $this->ltiplugin->can_hide_show_instance($instance)) {
            if ($instance->status == ENROL_INSTANCE_ENABLED) {
                $aurl = new \moodle_url($url, array('action' => 'disable', 'instanceid' => $instance->id));
                $buttons[] = $OUTPUT->action_icon($aurl, new \pix_icon('t/hide', $strdisable, 'core',
                    array('class' => 'iconsmall')));
            } else if ($instance->status == ENROL_INSTANCE_DISABLED) {
                $aurl = new \moodle_url($url, array('action' => 'enable', 'instanceid' => $instance->id));
                $buttons[] = $OUTPUT->action_icon($aurl, new \pix_icon('t/show', $strenable, 'core',
                    array('class' => 'iconsmall')));
            }
        }

        if ($this->ltienabled && $this->canconfig) {
            $linkparams = array(
                'courseid' => $instance->courseid,
                'id' => $instance->id, 'type' => $instance->enrol,
                'returnurl' => new \moodle_url('/enrol/lti/index.php', array('courseid' => $this->courseid))
            );
            $editlink = new \moodle_url("/enrol/editinstance.php", $linkparams);
            $buttons[] = $OUTPUT->action_icon($editlink, new \pix_icon('t/edit', get_string('edit'), 'core',
                array('class' => 'iconsmall')));
        }

        return implode(' ', $buttons);
    }
public function col_edit ( $ tool ) { global $ OUTPUT ; $ buttons = array ( ) ; $ instance = new \ stdClass ( ) ; $ instance -> id = $ tool -> enrolid ; $ instance -> courseid = $ tool -> courseid ; $ instance -> enrol = 'lti' ; $ instance -> status = $ tool -> status ; $ strdelete = get_string ( 'delete' ) ; $ strenable = get_string ( 'enable' ) ; $ strdisable = get_string ( 'disable' ) ; $ url = new \ moodle_url ( '/enrol/lti/index.php' , array ( 'sesskey' => sesskey ( ) , 'courseid' => $ this -> courseid ) ) ; if ( $ this -> ltiplugin -> can_delete_instance ( $ instance ) ) { $ aurl = new \ moodle_url ( $ url , array ( 'action' => 'delete' , 'instanceid' => $ instance -> id ) ) ; $ buttons [ ] = $ OUTPUT -> action_icon ( $ aurl , new \ pix_icon ( 't/delete' , $ strdelete , 'core' , array ( 'class' => 'iconsmall' ) ) ) ; } if ( $ this -> ltienabled && $ this -> ltiplugin -> can_hide_show_instance ( $ instance ) ) { if ( $ instance -> status == ENROL_INSTANCE_ENABLED ) { $ aurl = new \ moodle_url ( $ url , array ( 'action' => 'disable' , 'instanceid' => $ instance -> id ) ) ; $ buttons [ ] = $ OUTPUT -> action_icon ( $ aurl , new \ pix_icon ( 't/hide' , $ strdisable , 'core' , array ( 'class' => 'iconsmall' ) ) ) ; } else if ( $ instance -> status == ENROL_INSTANCE_DISABLED ) { $ aurl = new \ moodle_url ( $ url , array ( 'action' => 'enable' , 'instanceid' => $ instance -> id ) ) ; $ buttons [ ] = $ OUTPUT -> action_icon ( $ aurl , new \ pix_icon ( 't/show' , $ strenable , 'core' , array ( 'class' => 'iconsmall' ) ) ) ; } } if ( $ this -> ltienabled && $ this -> canconfig ) { $ linkparams = array ( 'courseid' => $ instance -> courseid , 'id' => $ instance -> id , 'type' => $ instance -> enrol , 'returnurl' => new \ moodle_url ( '/enrol/lti/index.php' , array ( 'courseid' => $ this -> courseid ) ) ) ; $ editlink = new \ moodle_url ( "/enrol/editinstance.php" , $ linkparams ) ; $ buttons [ ] = $ OUTPUT -> action_icon ( $ editlink , new \ pix_icon ( 't/edit' , get_string ( 'edit' ) , 'core' , array ( 'class' => 'iconsmall' ) ) ) ; } return implode ( ' ' , $ buttons ) ; }
Generate the edit column.

@param \stdClass $tool event data.
@return string
Generate the edit column .