commit
1b13ffd444
|
@ -555,6 +555,10 @@ export class CoreCoursesProvider {
|
|||
* @return {Promise<any>} Promise resolved with administration options for each course.
|
||||
*/
|
||||
getUserAdministrationOptions(courseIds: number[], siteId?: string): Promise<any> {
|
||||
if (!courseIds || courseIds.length == 0) {
|
||||
return Promise.resolve({});
|
||||
}
|
||||
|
||||
return this.sitesProvider.getSite(siteId).then((site) => {
|
||||
const params = {
|
||||
courseids: courseIds
|
||||
|
@ -597,6 +601,10 @@ export class CoreCoursesProvider {
|
|||
* @return {Promise<any>} Promise resolved with navigation options for each course.
|
||||
*/
|
||||
getUserNavigationOptions(courseIds: number[], siteId?: string): Promise<any> {
|
||||
if (!courseIds || courseIds.length == 0) {
|
||||
return Promise.resolve({});
|
||||
}
|
||||
|
||||
return this.sitesProvider.getSite(siteId).then((site) => {
|
||||
const params = {
|
||||
courseids: courseIds
|
||||
|
|
|
@ -85,6 +85,10 @@ export class CoreGradesHelperProvider {
|
|||
let content = String(tableRow[name].content);
|
||||
|
||||
if (name == 'itemname') {
|
||||
row['id'] = parseInt(tableRow[name].id.split('_')[1], 10);
|
||||
row['colspan'] = tableRow[name].colspan;
|
||||
row['rowspan'] = (tableRow['leader'] && tableRow['leader'].rowspan) || 1;
|
||||
|
||||
this.setRowIcon(row, content);
|
||||
row['rowclass'] = tableRow[name].class.indexOf('leveleven') < 0 ? 'odd' : 'even';
|
||||
row['rowclass'] += tableRow[name].class.indexOf('hidden') >= 0 ? ' hidden' : '';
|
||||
|
@ -92,10 +96,6 @@ export class CoreGradesHelperProvider {
|
|||
|
||||
content = content.replace(/<\/span>/gi, '\n');
|
||||
content = this.textUtils.cleanTags(content);
|
||||
|
||||
row['id'] = parseInt(tableRow[name].id.split('_')[1], 10);
|
||||
row['colspan'] = tableRow[name].colspan;
|
||||
row['rowspan'] = (tableRow['leader'] && tableRow['leader'].rowspan) || 1;
|
||||
name = 'gradeitem';
|
||||
} else {
|
||||
content = this.textUtils.replaceNewLines(content, '<br>');
|
||||
|
@ -439,9 +439,17 @@ export class CoreGradesHelperProvider {
|
|||
row['image'] = this.courseProvider.getModuleIconSrc(module[1],
|
||||
this.domUtils.convertToElement(text).querySelector('img').getAttribute('src'));
|
||||
}
|
||||
} else {
|
||||
if (row['rowspan']) {
|
||||
row['itemtype'] = 'category';
|
||||
row['icon'] = 'fa-folder';
|
||||
} else if (text.indexOf('src=') > -1) {
|
||||
const src = text.match(/src="([^"]*)"/);
|
||||
row['image'] = src[1];
|
||||
} else if (text.indexOf('<i ') > -1) {
|
||||
const src = text.match(/class="fa-([^ ]*)"/);
|
||||
row['icon'] = src[1];
|
||||
}
|
||||
}
|
||||
|
||||
return row;
|
||||
|
|
Loading…
Reference in New Issue