Use $cm->modname rather than specifying mod name literally

Signed-off-by: Tony Butler <tonyjbutler@gmail.com>
Manually reconstruct view link as $cm->url property is private in
MOODLE_25_STABLE

Signed-off-by: Tony Butler <tonyjbutler@gmail.com>