MOBILE-2539 url: Support display description setting

main
dpalou 2018-09-25 13:39:48 +02:00
parent f090f8f33a
commit 6d39cd5c4f
2 changed files with 7 additions and 1 deletions

View File

@ -10,7 +10,7 @@
<!-- Content. -->
<core-loading [hideUntil]="loaded" class="core-loading-center">
<core-course-module-description *ngIf="mode != 'iframe'" [description]="description" [component]="component" [componentId]="componentId"></core-course-module-description>
<core-course-module-description *ngIf="displayDescription" [description]="description" [component]="component" [componentId]="componentId"></core-course-module-description>
<div *ngIf="shouldEmbed" class="addon-mod_url-embedded-url">
<img *ngIf="isImage" title="{{name}}" [src]="url">

View File

@ -40,6 +40,7 @@ export class AddonModUrlIndexComponent extends CoreCourseModuleMainResourceCompo
isAudio = false;
isVideo = false;
mimetype: string;
displayDescription = true;
constructor(injector: Injector, private urlProvider: AddonModUrlProvider, private courseProvider: CoreCourseProvider,
private urlHelper: AddonModUrlHelperProvider, private mimeUtils: CoreMimetypeUtilsProvider,
@ -98,6 +99,11 @@ export class AddonModUrlIndexComponent extends CoreCourseModuleMainResourceCompo
this.description = url.intro || url.description;
this.dataRetrieved.emit(url);
if (canGetUrl && url.displayoptions) {
const unserialized = this.textUtils.unserialize(url.displayoptions);
this.displayDescription = typeof unserialized.printintro == 'undefined' || !!unserialized.printintro;
}
if (!canGetUrl) {
mod = url;