Remove the "Return to" appended to Link to acitivity

Remove the "Return to" appended to Link to acitivity

ni Walid Hammad -
Number of replies: 2

Hello there,

Linking to activity at the end of a lesson module is awesome feature. However it appends "Return to" as well as "Go to" as you can see in the screen shot below.

How do I get rid of that? This is moodle 2.0 installation and I have access to the php files but no experience where to do what.

Thanks in advance,

Walid

Average of ratings:Useful (1)
In reply to Walid Hammad

Re: Remove the "Return to" appended to Link to acitivity

ni Chris Collman -
Larawan ng Documentation writers

Hi Walid,

This is a minor bug, but a bug that I added to Tracker (MDL 24401).   Another similar one is after you create a "Content page" the save button says "Save question page" (addaquestionpage string).

I would say there are 2 ways for you to fix this.  One via the PHP code and the other by editing the string via the site language pack.

The quickest fix: I would suggest playing with the site administration>language>language customizations  and checking out the mod>lesson strings.  First time I have dug into this interface in 2.0, different but easier to find the modules strings.   Anyway, "activitylinkname" in demo.moodle.net says Go to: {$a} , I changed that to just {$a}.   "returnto" is probably the string that is repeated 2 times in the php code.  So I changed that to check it to "Wowie I want to go to:"  It is, so I suggest changing that string to "Go to: ", unless of course you like my "Wowie" or longer "Wowie Zowie" ngiti

Here is the before (1) and after (2) in demo.moodle.net in a one page lesson.  The pink string is the activitylinkname and the yellow is the returnto string.

Thanks for the  post.

Attachment Lesson end of page links.png
In reply to Chris Collman

Re: Remove the "Return to" appended to Link to acitivity

ni Walid Hammad -

Thank you Chris!

I am interested in the php solution as I would want to completely remove return to phrase just from the activity link but not from returning to course.

So i found the code that causes this to be in mod/lesson/locallib.php

----------------------

return html_writer::link(new moodle_url('/mod/'.$modname.'/view.php', array('id'=>$this->properties->activitylink)),
get_string('returnto', 'lesson', get_string('activitylinkname', 'lesson', $instancename)),
array('class'=>'centerpadded lessonbutton standardbutton'));

----------------------

I don't seem to understand truely how the arguments for the function get_string work, because putting any other string in place of 'returnto' would result in the link appearing as [/[ lesson ]/] rather than Go to: Activity name

Anyhow, Thanks again ngiti

Cheers,

Walid