public function link_for_activitylink() {
        global $DB;
        $module = $DB->get_record('course_modules', array('id' => $this->properties->activitylink));
        if ($module) {
            $modname = $DB->get_field('modules', 'name', array('id' => $module->module));
            if ($modname) {
                $instancename = $DB->get_field($modname, 'name', array('id' => $module->instance));
                if ($instancename) {
                    return html_writer::link(new moodle_url('/mod/'.$modname.'/view.php',
                        array('id' => $this->properties->activitylink)), get_string('activitylinkname',
                        'lesson', $instancename), array('class' => 'centerpadded lessonbutton standardbutton p-r-1'));
                }
            }
        }
        return '';
    }
public function link_for_activitylink() {
        global $DB;
        $module = $DB->get_record('course_modules', array('id' => $this->properties->activitylink));
        if ($module) {
            $modname = $DB->get_field('modules', 'name', array('id' => $module->module));
            if ($modname) {
                $instancename = $DB->get_field($modname, 'name', array('id' => $module->instance));
                if ($instancename) {
                    return html_writer::link(new moodle_url('/mod/'.$modname.'/view.php',
                        array('id' => $this->properties->activitylink)), get_string('activitylinkname',
                        'lesson', $instancename), array('class' => 'centerpadded lessonbutton standardbutton p-r-1'));
                }
            }
        }
        return '';
    }
public function link_for_activitylink ( ) { global $ DB ; $ module = $ DB -> get_record ( 'course_modules' , array ( 'id' => $ this -> properties -> activitylink ) ) ; if ( $ module ) { $ modname = $ DB -> get_field ( 'modules' , 'name' , array ( 'id' => $ module -> module ) ) ; if ( $ modname ) { $ instancename = $ DB -> get_field ( $ modname , 'name' , array ( 'id' => $ module -> instance ) ) ; if ( $ instancename ) { return html_writer :: link ( new moodle_url ( '/mod/' . $ modname . '/view.php' , array ( 'id' => $ this -> properties -> activitylink ) ) , get_string ( 'activitylinkname' , 'lesson' , $ instancename ) , array ( 'class' => 'centerpadded lessonbutton standardbutton p-r-1' ) ) ; } } } return '' ; }
Returns the link for the related activity
@return string
Returns the link for the related activity