original_string: 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 '';
      }
code: 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 '';
      }
code_tokens: 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 '' ; }
docstring: Returns the link for the related activity
  @return string
docstring_tokens: Returns the link for the related activity