Merge branch 'MDL-50391-master' of git://github.com/aspark21/moodle

This commit is contained in:
David Monllao 2015-08-18 12:09:49 +08:00 committed by Eloy Lafuente (stronk7)
commit d2999f8085
2 changed files with 7 additions and 11 deletions

View File

@ -338,16 +338,10 @@ class format_singleactivity extends format_base {
* @return bool|null (null if the check is not possible)
*/
public function activity_has_subtypes() {
global $CFG;
if (!($modname = $this->get_activitytype())) {
return null;
}
$libfile = "$CFG->dirroot/mod/$modname/lib.php";
if (!file_exists($libfile)) {
return null;
}
include_once($libfile);
return function_exists($modname. '_get_types');
return component_callback('mod_' . $modname, 'get_types', array(), MOD_SUBTYPE_NO_CHILDREN) !== MOD_SUBTYPE_NO_CHILDREN;
}
/**

View File

@ -75,10 +75,12 @@ class mod_lti_mod_form extends moodleform_mod {
$mform->setAdvanced('introeditor');
// Display the label to the right of the checkbox so it looks better & matches rest of the form.
$coursedesc = $mform->getElement('showdescription');
if (!empty($coursedesc)) {
$coursedesc->setText(' ' . $coursedesc->getLabel());
$coursedesc->setLabel('&nbsp');
if ($mform->elementExists('showdescription')) {
$coursedesc = $mform->getElement('showdescription');
if (!empty($coursedesc)) {
$coursedesc->setText(' ' . $coursedesc->getLabel());
$coursedesc->setLabel('&nbsp');
}
}
$mform->setAdvanced('showdescription');