/** * Sets dynamic information about a course module * * This function is called from cm_info when displaying the module * mod_folder can be displayed inline on course page and therefore have no course link * * @param cm_info $cm */ function folder_cm_info_dynamic(cm_info $cm) { if ($cm->get_custom_data()) { // the field 'customdata' is not empty IF AND ONLY IF we display contens inline $cm->set_no_view_link(); } }
/** * Sets dynamic information about a course module * * This function is called from cm_info when displaying the module * mod_dataform can be displayed inline on course page in which case it should not have course link * * @param cm_info $cm */ function dataform_cm_info_dynamic(cm_info $cm) { if ($customdata = $cm->customdata and !empty($customdata->inlineview)) { // The field 'customdata' is not empty IF AND ONLY IF we display content inline. $cm->set_no_view_link(); } }