Modificaciones pendientes
This commit is contained in:
parent
03c371c9e4
commit
cfbec8b7cf
|
@ -112,10 +112,10 @@ class condition extends \core_availability\condition {
|
|||
//print_r("Estas matriculado en todos estos cursos ".$matriculados."<br>");
|
||||
$allow = false;
|
||||
if ($matriculados < $this->ncoursesid) {
|
||||
print_r("puedes matricularte");
|
||||
// print_r("puedes matricularte");
|
||||
$allow = true;
|
||||
} else {
|
||||
print_r("NO PUEDES MATRICULARTE YA ESTAS EN ".$matriculados." Cursos");
|
||||
//print_r("NO PUEDES MATRICULARTE YA ESTAS EN ".$matriculados." Cursos");
|
||||
$allow = false;
|
||||
}
|
||||
|
||||
|
@ -134,26 +134,15 @@ class condition extends \core_availability\condition {
|
|||
* @return string Information string (for admin) about all restrictions on this item
|
||||
*/
|
||||
public function get_description($full, $not, \core_availability\info $info) {
|
||||
if ($this->languageid != '') {
|
||||
$installedlangs = get_string_manager()->get_list_of_translations(false);
|
||||
if (array_key_exists($this->languageid, $installedlangs)) {
|
||||
if ($this->ncoursesid != '') {
|
||||
$installedncourse = get_string_manager()->get_list_of_translations(false);
|
||||
if (array_key_exists($this->ncoursesid, $installedncourse)) {
|
||||
$snot = $not ? 'not' : '';
|
||||
return get_string('getdescription' . $snot, 'availability_language', $installedlangs[$this->languageid]);
|
||||
return get_string('getdescription' . $snot, 'availability_ncourses', $installedncourse[$this->ncourseid]);
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
/*
|
||||
public function get_description($full, $not, \core_availability\info $info) {
|
||||
if ($this->ncoursesid != '') {
|
||||
$installedlangs = get_string_manager()->get_list_of_translations(false);
|
||||
if (array_key_exists($this->ncourseslimit, $installedlangs)) {
|
||||
$snot = $not ? 'not' : '';
|
||||
return get_string('getdescription' . $snot, 'availability_ncourses', $installedlangs[$this->ncoursesid]);
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Obtains a representation of the options of this condition as a string,
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
/**
|
||||
* Language strings.
|
||||
*
|
||||
* @package availability_language
|
||||
* @copyright 2018 Renaat Debleu <info@eWallah.net>
|
||||
* @package availability_ncourse
|
||||
* @copyright 2022 Diego Hernández <dherna@dherna.info>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
/**
|
||||
* JavaScript for form editing language conditions.
|
||||
* JavaScript for form editing ncourses conditions.
|
||||
*
|
||||
* @module moodle-availability_language-form
|
||||
* @module moodle-availability_ncourses-form
|
||||
*/
|
||||
M.availability_ncourses = M.availability_ncourses || {};
|
||||
|
||||
// Class M.availability_language.form @extends M.core_availability.plugin.
|
||||
// Class M.availability_ncourses.form @extends M.core_availability.plugin.
|
||||
M.availability_ncourses.form = Y.Object(M.core_availability.plugin);
|
||||
|
||||
// Languages available for selection.
|
||||
// ncourses available for selection.
|
||||
M.availability_ncourses.form.ncourses = null; // si no entiendo mal esto podría ser el número por defecto.
|
||||
|
||||
/**
|
||||
* Initialises this plugin.
|
||||
*
|
||||
* @method initInner
|
||||
* @param {Array} languages Array of objects containing languageid => name
|
||||
* @param {Array} ncourses Array of objects containing ncoursesid => name
|
||||
*/
|
||||
M.availability_ncourses.form.initInner = function(ncourses) {
|
||||
this.ncourses = ncourses;
|
||||
|
@ -34,10 +34,6 @@ M.availability_ncourses.form.getNode = function(json) {
|
|||
html += '<option ' + selected + ' value="' + i + '">' + i + '</option>';
|
||||
}
|
||||
|
||||
/* for (var i = 0; i < this.ncourses.length; i++) {
|
||||
var language = this.ncourses[i];
|
||||
html += '<option value="' + ncourses.id + '">' + ncourses.name + '</option>';
|
||||
}*/
|
||||
html += '</select></span></label>';
|
||||
var node = Y.Node.create('<span class="form-inline">' + html + '</span>');
|
||||
|
||||
|
|
Loading…
Reference in New Issue