forked from CIT/Vmeda.Online
		
	
						commit
						7c265ae769
					
				@ -47,6 +47,9 @@ export class AddonBlockCalendarMonthHandlerService extends CoreBlockBaseHandler
 | 
				
			|||||||
            component: CoreBlockOnlyTitleComponent,
 | 
					            component: CoreBlockOnlyTitleComponent,
 | 
				
			||||||
            link: AddonCalendar.getMainCalendarPagePath(),
 | 
					            link: AddonCalendar.getMainCalendarPagePath(),
 | 
				
			||||||
            linkParams: linkParams,
 | 
					            linkParams: linkParams,
 | 
				
			||||||
 | 
					            navOptions: {
 | 
				
			||||||
 | 
					                preferCurrentTab: false,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -47,6 +47,9 @@ export class AddonBlockCalendarUpcomingHandlerService extends CoreBlockBaseHandl
 | 
				
			|||||||
            component: CoreBlockOnlyTitleComponent,
 | 
					            component: CoreBlockOnlyTitleComponent,
 | 
				
			||||||
            link: AddonCalendar.getMainCalendarPagePath(),
 | 
					            link: AddonCalendar.getMainCalendarPagePath(),
 | 
				
			||||||
            linkParams: linkParams,
 | 
					            linkParams: linkParams,
 | 
				
			||||||
 | 
					            navOptions: {
 | 
				
			||||||
 | 
					                preferCurrentTab: false,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -39,6 +39,9 @@ export class AddonBlockLearningPlansHandlerService extends CoreBlockBaseHandler
 | 
				
			|||||||
            class: 'addon-block-learning-plans',
 | 
					            class: 'addon-block-learning-plans',
 | 
				
			||||||
            component: CoreBlockOnlyTitleComponent,
 | 
					            component: CoreBlockOnlyTitleComponent,
 | 
				
			||||||
            link: AddonCompetencyMainMenuHandlerService.PAGE_NAME,
 | 
					            link: AddonCompetencyMainMenuHandlerService.PAGE_NAME,
 | 
				
			||||||
 | 
					            navOptions: {
 | 
				
			||||||
 | 
					                preferCurrentTab: false,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -39,8 +39,11 @@ export class AddonBlockPrivateFilesHandlerService extends CoreBlockBaseHandler {
 | 
				
			|||||||
            title: 'addon.block_privatefiles.pluginname',
 | 
					            title: 'addon.block_privatefiles.pluginname',
 | 
				
			||||||
            class: 'addon-block-private-files',
 | 
					            class: 'addon-block-private-files',
 | 
				
			||||||
            component: CoreBlockOnlyTitleComponent,
 | 
					            component: CoreBlockOnlyTitleComponent,
 | 
				
			||||||
            link: '/main/' + AddonPrivateFilesMainMenuHandlerService.PAGE_NAME,
 | 
					            link: AddonPrivateFilesMainMenuHandlerService.PAGE_NAME,
 | 
				
			||||||
            linkParams: { root: 'my' },
 | 
					            linkParams: { root: 'my' },
 | 
				
			||||||
 | 
					            navOptions: {
 | 
				
			||||||
 | 
					                preferCurrentTab: false,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -21,6 +21,7 @@ import { CoreCourseBlock } from '../../course/services/course';
 | 
				
			|||||||
import { IonRefresher } from '@ionic/angular';
 | 
					import { IonRefresher } from '@ionic/angular';
 | 
				
			||||||
import { Params } from '@angular/router';
 | 
					import { Params } from '@angular/router';
 | 
				
			||||||
import { ContextLevel } from '@/core/constants';
 | 
					import { ContextLevel } from '@/core/constants';
 | 
				
			||||||
 | 
					import { CoreNavigationOptions } from '@services/navigator';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Template class to easily create components for blocks.
 | 
					 * Template class to easily create components for blocks.
 | 
				
			||||||
@ -36,6 +37,7 @@ export abstract class CoreBlockBaseComponent implements OnInit {
 | 
				
			|||||||
    @Input() instanceId!: number; // The instance ID associated with the context level.
 | 
					    @Input() instanceId!: number; // The instance ID associated with the context level.
 | 
				
			||||||
    @Input() link?: string; // Link to go when clicked.
 | 
					    @Input() link?: string; // Link to go when clicked.
 | 
				
			||||||
    @Input() linkParams?: Params; // Link params to go when clicked.
 | 
					    @Input() linkParams?: Params; // Link params to go when clicked.
 | 
				
			||||||
 | 
					    @Input() navOptions?: CoreNavigationOptions; // Navigation options.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    loaded = false; // If the component has been loaded.
 | 
					    loaded = false; // If the component has been loaded.
 | 
				
			||||||
    protected fetchContentDefaultError = ''; // Default error to show when loading contents.
 | 
					    protected fetchContentDefaultError = ''; // Default error to show when loading contents.
 | 
				
			||||||
 | 
				
			|||||||
@ -115,6 +115,7 @@ export class CoreBlockComponent implements OnInit, OnDestroy, DoCheck {
 | 
				
			|||||||
                instanceId: this.instanceId,
 | 
					                instanceId: this.instanceId,
 | 
				
			||||||
                link: data.link || null,
 | 
					                link: data.link || null,
 | 
				
			||||||
                linkParams: data.linkParams || null,
 | 
					                linkParams: data.linkParams || null,
 | 
				
			||||||
 | 
					                navOptions: data.navOptions || null,
 | 
				
			||||||
            }, this.extraData || {}, data.componentData || {});
 | 
					            }, this.extraData || {}, data.componentData || {});
 | 
				
			||||||
        } catch {
 | 
					        } catch {
 | 
				
			||||||
            // Ignore errors.
 | 
					            // Ignore errors.
 | 
				
			||||||
 | 
				
			|||||||
@ -43,7 +43,12 @@ export class CoreBlockOnlyTitleComponent extends CoreBlockBaseComponent implemen
 | 
				
			|||||||
     * Go to the block page.
 | 
					     * Go to the block page.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    gotoBlock(): void {
 | 
					    gotoBlock(): void {
 | 
				
			||||||
        CoreNavigator.navigateToSitePath(this.link!, { params: this.linkParams });
 | 
					        const navOptions = this.navOptions || {};
 | 
				
			||||||
 | 
					        if (this.linkParams) {
 | 
				
			||||||
 | 
					            navOptions.params = this.linkParams;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        CoreNavigator.navigateToSitePath(this.link!, navOptions);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -21,6 +21,7 @@ import { CoreCourseBlock } from '@features/course/services/course';
 | 
				
			|||||||
import { Params } from '@angular/router';
 | 
					import { Params } from '@angular/router';
 | 
				
			||||||
import { makeSingleton } from '@singletons';
 | 
					import { makeSingleton } from '@singletons';
 | 
				
			||||||
import { CoreBlockDefaultHandler } from './handlers/default-block';
 | 
					import { CoreBlockDefaultHandler } from './handlers/default-block';
 | 
				
			||||||
 | 
					import { CoreNavigationOptions } from '@services/navigator';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Interface that all blocks must implement.
 | 
					 * Interface that all blocks must implement.
 | 
				
			||||||
@ -80,6 +81,11 @@ export interface CoreBlockHandlerData {
 | 
				
			|||||||
     * Params of the link.
 | 
					     * Params of the link.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    linkParams?: Params;
 | 
					    linkParams?: Params;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Navigation options.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    navOptions?: CoreNavigationOptions;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 | 
				
			|||||||
@ -735,7 +735,7 @@ export class CoreCourseModulePrefetchDelegateService extends CoreDelegate<CoreCo
 | 
				
			|||||||
                    return;
 | 
					                    return;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                result.status = CoreFilepool.determinePackagesStatus(status, modStatus);
 | 
					                result.status = CoreFilepool.determinePackagesStatus(result.status, modStatus);
 | 
				
			||||||
                result[modStatus].push(module);
 | 
					                result[modStatus].push(module);
 | 
				
			||||||
                result.total++;
 | 
					                result.total++;
 | 
				
			||||||
            } catch (error) {
 | 
					            } catch (error) {
 | 
				
			||||||
@ -749,7 +749,7 @@ export class CoreCourseModulePrefetchDelegateService extends CoreDelegate<CoreCo
 | 
				
			|||||||
                    return;
 | 
					                    return;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                result.status = CoreFilepool.determinePackagesStatus(status, cacheStatus);
 | 
					                result.status = CoreFilepool.determinePackagesStatus(result.status, cacheStatus);
 | 
				
			||||||
                result[cacheStatus].push(module);
 | 
					                result[cacheStatus].push(module);
 | 
				
			||||||
                result.total++;
 | 
					                result.total++;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user