diff --git a/src/addons/block/myoverview/components/myoverview/addon-block-myoverview.html b/src/addons/block/myoverview/components/myoverview/addon-block-myoverview.html
index 6c3d9ffa6..dbdf6d578 100644
--- a/src/addons/block/myoverview/components/myoverview/addon-block-myoverview.html
+++ b/src/addons/block/myoverview/components/myoverview/addon-block-myoverview.html
@@ -4,7 +4,7 @@
-
1" class="core-button-spinner">
+
1" class="core-button-spinner">
@@ -77,8 +77,8 @@
-
+
diff --git a/src/addons/block/myoverview/components/myoverview/myoverview.ts b/src/addons/block/myoverview/components/myoverview/myoverview.ts
index 97258edd6..5b676a067 100644
--- a/src/addons/block/myoverview/components/myoverview/myoverview.ts
+++ b/src/addons/block/myoverview/components/myoverview/myoverview.ts
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-import { Component, OnInit, Input, OnDestroy, OnChanges, SimpleChange } from '@angular/core';
+import { Component, OnInit, OnDestroy } from '@angular/core';
import { ModalOptions } from '@ionic/core';
import { CoreEventObserver, CoreEvents } from '@singletons/events';
import { CoreTimeUtils } from '@services/utils/time';
@@ -40,9 +40,7 @@ const FILTER_PRIORITY: AddonBlockMyOverviewTimeFilters[] = ['all', 'inprogress',
selector: 'addon-block-myoverview',
templateUrl: 'addon-block-myoverview.html',
})
-export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implements OnInit, OnChanges, OnDestroy {
-
- @Input() downloadEnabled = false;
+export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implements OnInit, OnDestroy {
filteredCourses: CoreEnrolledCourseDataWithOptions[] = [];
@@ -197,16 +195,6 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem
});
}
- /**
- * @inheritdoc
- */
- ngOnChanges(changes: {[name: string]: SimpleChange}): void {
- if (changes.downloadEnabled && !changes.downloadEnabled.previousValue && this.downloadEnabled && this.loaded) {
- // Download all courses is enabled now, initialize it.
- this.initPrefetchCoursesIcons();
- }
- }
-
/**
* @inheritdoc
*/
@@ -431,7 +419,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem
* @return Promise resolved when done.
*/
async initPrefetchCoursesIcons(): Promise {
- if (this.prefetchIconsInitialized || !this.downloadEnabled) {
+ if (this.prefetchIconsInitialized) {
// Already initialized.
return;
}
diff --git a/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/addon-block-recentlyaccessedcourses.html b/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/addon-block-recentlyaccessedcourses.html
index 113048db0..6ba01b2f2 100644
--- a/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/addon-block-recentlyaccessedcourses.html
+++ b/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/addon-block-recentlyaccessedcourses.html
@@ -16,8 +16,8 @@
diff --git a/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/recentlyaccessedcourses.ts b/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/recentlyaccessedcourses.ts
index f3b99dcd6..eefd70ac4 100644
--- a/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/recentlyaccessedcourses.ts
+++ b/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/recentlyaccessedcourses.ts
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-import { Component, OnInit, OnDestroy, Input } from '@angular/core';
+import { Component, OnInit, OnDestroy } from '@angular/core';
import { CoreEventObserver, CoreEvents } from '@singletons/events';
import { CoreSites } from '@services/sites';
import {
@@ -41,17 +41,13 @@ import { CoreSite } from '@classes/site';
})
export class AddonBlockRecentlyAccessedCoursesComponent extends CoreBlockBaseComponent implements OnInit, OnDestroy {
- @Input() downloadEnabled = false;
-
courses: AddonBlockRecentlyAccessedCourse[] = [];
- downloadCourseEnabled = false;
scrollElementId!: string;
protected site!: CoreSite;
protected isDestroyed = false;
protected coursesObserver?: CoreEventObserver;
- protected updateSiteObserver?: CoreEventObserver;
protected fetchContentDefaultError = 'Error getting recent courses data.';
constructor() {
@@ -69,15 +65,6 @@ export class AddonBlockRecentlyAccessedCoursesComponent extends CoreBlockBaseCom
this.scrollElementId = `addon-block-recentlyaccessedcourses-scroll-${scrollId}`;
- // Refresh the enabled flags if enabled.
- this.downloadCourseEnabled = !CoreCourses.isDownloadCourseDisabledInSite();
-
- // Refresh the enabled flags if site is updated.
- this.updateSiteObserver = CoreEvents.on(CoreEvents.SITE_UPDATED, () => {
- this.downloadCourseEnabled = !CoreCourses.isDownloadCourseDisabledInSite();
-
- }, this.site.getId());
-
this.coursesObserver = CoreEvents.on(
CoreCoursesProvider.EVENT_MY_COURSES_UPDATED,
(data) => {
@@ -208,7 +195,6 @@ export class AddonBlockRecentlyAccessedCoursesComponent extends CoreBlockBaseCom
ngOnDestroy(): void {
this.isDestroyed = true;
this.coursesObserver?.off();
- this.updateSiteObserver?.off();
}
}
diff --git a/src/addons/block/sitemainmenu/components/sitemainmenu/sitemainmenu.ts b/src/addons/block/sitemainmenu/components/sitemainmenu/sitemainmenu.ts
index d550062d7..836a5850c 100644
--- a/src/addons/block/sitemainmenu/components/sitemainmenu/sitemainmenu.ts
+++ b/src/addons/block/sitemainmenu/components/sitemainmenu/sitemainmenu.ts
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-import { Component, OnInit, Input } from '@angular/core';
+import { Component, OnInit } from '@angular/core';
import { CoreSites } from '@services/sites';
import { CoreCourse } from '@features/course/services/course';
import { CoreCourseHelper, CoreCourseSection } from '@features/course/services/course-helper';
@@ -29,8 +29,6 @@ import { CoreBlockBaseComponent } from '@features/block/classes/base-block-compo
})
export class AddonBlockSiteMainMenuComponent extends CoreBlockBaseComponent implements OnInit {
- @Input() downloadEnabled = false;
-
component = 'AddonBlockSiteMainMenu';
mainMenuBlock?: CoreCourseSection;
siteHomeId = 1;
diff --git a/src/addons/block/starredcourses/components/starredcourses/addon-block-starredcourses.html b/src/addons/block/starredcourses/components/starredcourses/addon-block-starredcourses.html
index fd6a1a860..1ff007fce 100644
--- a/src/addons/block/starredcourses/components/starredcourses/addon-block-starredcourses.html
+++ b/src/addons/block/starredcourses/components/starredcourses/addon-block-starredcourses.html
@@ -16,8 +16,8 @@
diff --git a/src/addons/block/starredcourses/components/starredcourses/starredcourses.ts b/src/addons/block/starredcourses/components/starredcourses/starredcourses.ts
index fc1c47de5..c6e6fc447 100644
--- a/src/addons/block/starredcourses/components/starredcourses/starredcourses.ts
+++ b/src/addons/block/starredcourses/components/starredcourses/starredcourses.ts
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-import { Component, OnInit, OnDestroy, Input } from '@angular/core';
+import { Component, OnInit, OnDestroy } from '@angular/core';
import { CoreEventObserver, CoreEvents } from '@singletons/events';
import { CoreSites } from '@services/sites';
import { CoreCoursesProvider, CoreCoursesMyCoursesUpdatedEventData, CoreCourses } from '@features/courses/services/courses';
@@ -36,17 +36,13 @@ import { AddonBlockStarredCourse, AddonBlockStarredCourses } from '../../service
})
export class AddonBlockStarredCoursesComponent extends CoreBlockBaseComponent implements OnInit, OnDestroy {
- @Input() downloadEnabled = false;
-
courses: AddonBlockStarredCoursesCourse[] = [];
- downloadCourseEnabled = false;
scrollElementId!: string;
protected site: CoreSite;
protected isDestroyed = false;
protected coursesObserver?: CoreEventObserver;
- protected updateSiteObserver?: CoreEventObserver;
protected fetchContentDefaultError = 'Error getting starred courses data.';
constructor() {
@@ -64,14 +60,6 @@ export class AddonBlockStarredCoursesComponent extends CoreBlockBaseComponent im
this.scrollElementId = `addon-block-starredcourses-scroll-${scrollId}`;
- // Refresh the enabled flags if enabled.
- this.downloadCourseEnabled = !CoreCourses.isDownloadCourseDisabledInSite();
-
- // Refresh the enabled flags if site is updated.
- this.updateSiteObserver = CoreEvents.on(CoreEvents.SITE_UPDATED, () => {
- this.downloadCourseEnabled = !CoreCourses.isDownloadCourseDisabledInSite();
- }, CoreSites.getCurrentSiteId());
-
this.coursesObserver = CoreEvents.on(
CoreCoursesProvider.EVENT_MY_COURSES_UPDATED,
(data) => {
@@ -194,7 +182,6 @@ export class AddonBlockStarredCoursesComponent extends CoreBlockBaseComponent im
ngOnDestroy(): void {
this.isDestroyed = true;
this.coursesObserver?.off();
- this.updateSiteObserver?.off();
}
}
diff --git a/src/core/features/courses/pages/dashboard/dashboard.html b/src/core/features/courses/pages/dashboard/dashboard.html
index e59e44e43..e73f8a108 100644
--- a/src/core/features/courses/pages/dashboard/dashboard.html
+++ b/src/core/features/courses/pages/dashboard/dashboard.html
@@ -2,11 +2,6 @@
-
-
-
@@ -16,8 +11,7 @@
-
+
diff --git a/src/core/features/courses/pages/dashboard/dashboard.ts b/src/core/features/courses/pages/dashboard/dashboard.ts
index 7f87e6f32..24046259f 100644
--- a/src/core/features/courses/pages/dashboard/dashboard.ts
+++ b/src/core/features/courses/pages/dashboard/dashboard.ts
@@ -15,7 +15,7 @@
import { Component, OnDestroy, OnInit, QueryList, ViewChildren } from '@angular/core';
import { IonRefresher } from '@ionic/angular';
-import { CoreCourses, CoreCoursesProvider } from '../../services/courses';
+import { CoreCourses } from '../../services/courses';
import { CoreEventObserver, CoreEvents } from '@singletons/events';
import { CoreSites } from '@services/sites';
import { CoreCoursesDashboard } from '@features/courses/services/dashboard';
@@ -39,7 +39,6 @@ export class CoreCoursesDashboardPage implements OnInit, OnDestroy {
hasSideBlocks = false;
searchEnabled = false;
- downloadEnabled = false;
downloadCourseEnabled = false;
downloadCoursesEnabled = false;
userId?: number;
@@ -47,7 +46,6 @@ export class CoreCoursesDashboardPage implements OnInit, OnDestroy {
loaded = false;
protected updateSiteObserver: CoreEventObserver;
- protected downloadEnabledObserver: CoreEventObserver;
constructor() {
// Refresh the enabled flags if site is updated.
@@ -56,12 +54,7 @@ export class CoreCoursesDashboardPage implements OnInit, OnDestroy {
this.downloadCourseEnabled = !CoreCourses.isDownloadCourseDisabledInSite();
this.downloadCoursesEnabled = !CoreCourses.isDownloadCoursesDisabledInSite();
- this.downloadEnabled = (this.downloadCourseEnabled || this.downloadCoursesEnabled) && this.downloadEnabled;
}, CoreSites.getCurrentSiteId());
-
- this.downloadEnabledObserver = CoreEvents.on(CoreCoursesProvider.EVENT_DASHBOARD_DOWNLOAD_ENABLED_CHANGED, (data) => {
- this.downloadEnabled = (this.downloadCourseEnabled || this.downloadCoursesEnabled) && data.enabled;
- });
}
/**
@@ -72,9 +65,6 @@ export class CoreCoursesDashboardPage implements OnInit, OnDestroy {
this.downloadCourseEnabled = !CoreCourses.isDownloadCourseDisabledInSite();
this.downloadCoursesEnabled = !CoreCourses.isDownloadCoursesDisabledInSite();
- this.downloadEnabled =
- (this.downloadCourseEnabled || this.downloadCoursesEnabled) && CoreCourses.getCourseDownloadOptionsEnabled();
-
this.loadContent();
}
@@ -153,13 +143,6 @@ export class CoreCoursesDashboardPage implements OnInit, OnDestroy {
});
}
- /**
- * Switch download enabled.
- */
- switchDownload(): void {
- CoreCourses.setCourseDownloadOptionsEnabled(this.downloadEnabled);
- }
-
/**
* Go to search courses.
*/
@@ -172,7 +155,6 @@ export class CoreCoursesDashboardPage implements OnInit, OnDestroy {
*/
ngOnDestroy(): void {
this.updateSiteObserver.off();
- this.downloadEnabledObserver.off();
}
}
diff --git a/src/core/features/courses/pages/my/my.html b/src/core/features/courses/pages/my/my.html
index b7ef04ec2..f53075af7 100644
--- a/src/core/features/courses/pages/my/my.html
+++ b/src/core/features/courses/pages/my/my.html
@@ -48,8 +48,7 @@
-
+
diff --git a/src/core/features/siteplugins/components/course-format/course-format.ts b/src/core/features/siteplugins/components/course-format/course-format.ts
index 9fd9e6459..3f87875e8 100644
--- a/src/core/features/siteplugins/components/course-format/course-format.ts
+++ b/src/core/features/siteplugins/components/course-format/course-format.ts
@@ -34,7 +34,6 @@ export class CoreSitePluginsCourseFormatComponent implements OnChanges {
@Input() course?: CoreCourseAnyCourseData; // The course to render.
@Input() sections?: CoreCourseSection[]; // List of course sections. The status will be calculated in this component.
- @Input() downloadEnabled?: boolean; // Whether the download of sections and modules is enabled.
@Input() initialSectionId?: number; // The section to load first (by ID).
@Input() initialSectionNumber?: number; // The section to load first (by number).
@Input() moduleId?: number; // The module ID to scroll to. Must be inside the initial selected section.
@@ -71,7 +70,6 @@ export class CoreSitePluginsCourseFormatComponent implements OnChanges {
this.method = handler.handlerSchema.method;
this.args = {
courseid: this.course.id,
- downloadenabled: this.downloadEnabled,
};
this.initResult = handler.initResult;
}
@@ -81,7 +79,6 @@ export class CoreSitePluginsCourseFormatComponent implements OnChanges {
this.data = {
course: this.course,
sections: this.sections,
- downloadEnabled: this.downloadEnabled,
initialSectionId: this.initialSectionId,
initialSectionNumber: this.initialSectionNumber,
moduleId: this.moduleId,