forked from CIT/Vmeda.Online
		
	MOBILE-3608 blocks: Add all only title blocks
This commit is contained in:
		
							parent
							
								
									6035865bc0
								
							
						
					
					
						commit
						da286a80e7
					
				@ -19,11 +19,18 @@ import { AddonBlockBadgesModule } from './block/badges/badges.module';
 | 
				
			|||||||
import { AddonBlockBlogMenuModule } from './block/blogmenu/blogmenu.module';
 | 
					import { AddonBlockBlogMenuModule } from './block/blogmenu/blogmenu.module';
 | 
				
			||||||
import { AddonBlockBlogRecentModule } from './block/blogrecent/blogrecent.module';
 | 
					import { AddonBlockBlogRecentModule } from './block/blogrecent/blogrecent.module';
 | 
				
			||||||
import { AddonBlockBlogTagsModule } from './block/blogtags/blogtags.module';
 | 
					import { AddonBlockBlogTagsModule } from './block/blogtags/blogtags.module';
 | 
				
			||||||
 | 
					import { AddonBlockCalendarMonthModule } from './block/calendarmonth/calendarmonth.module';
 | 
				
			||||||
 | 
					import { AddonBlockCalendarUpcomingModule } from './block/calendarupcoming/calendarupcoming.module';
 | 
				
			||||||
 | 
					import { AddonBlockCommentsModule } from './block/comments/comments.module';
 | 
				
			||||||
 | 
					import { AddonBlockCompletionStatusModule } from './block/completionstatus/completionstatus.module';
 | 
				
			||||||
import { AddonBlockGlossaryRandomModule } from './block/glossaryrandom/glossaryrandom.module';
 | 
					import { AddonBlockGlossaryRandomModule } from './block/glossaryrandom/glossaryrandom.module';
 | 
				
			||||||
import { AddonBlockHtmlModule } from './block/html/html.module';
 | 
					import { AddonBlockHtmlModule } from './block/html/html.module';
 | 
				
			||||||
 | 
					import { AddonBlockLearningPlansModule } from './block/learningplans/learningplans.module';
 | 
				
			||||||
import { AddonBlockNewsItemsModule } from './block/newsitems/newsitems.module';
 | 
					import { AddonBlockNewsItemsModule } from './block/newsitems/newsitems.module';
 | 
				
			||||||
import { AddonBlockOnlineUsersModule } from './block/onlineusers/onlineusers.module';
 | 
					import { AddonBlockOnlineUsersModule } from './block/onlineusers/onlineusers.module';
 | 
				
			||||||
 | 
					import { AddonBlockPrivateFilesModule } from './block/privatefiles/privatefiles.module';
 | 
				
			||||||
import { AddonBlockRssClientModule } from './block/rssclient/rssclient.module';
 | 
					import { AddonBlockRssClientModule } from './block/rssclient/rssclient.module';
 | 
				
			||||||
 | 
					import { AddonBlockSelfCompletionModule } from './block/selfcompletion/selfcompletion.module';
 | 
				
			||||||
import { AddonBlockTagsModule } from './block/tags/tags.module';
 | 
					import { AddonBlockTagsModule } from './block/tags/tags.module';
 | 
				
			||||||
import { AddonPrivateFilesModule } from './privatefiles/privatefiles.module';
 | 
					import { AddonPrivateFilesModule } from './privatefiles/privatefiles.module';
 | 
				
			||||||
import { AddonFilterModule } from './filter/filter.module';
 | 
					import { AddonFilterModule } from './filter/filter.module';
 | 
				
			||||||
@ -38,11 +45,18 @@ import { AddonUserProfileFieldModule } from './userprofilefield/userprofilefield
 | 
				
			|||||||
        AddonBlockBlogMenuModule,
 | 
					        AddonBlockBlogMenuModule,
 | 
				
			||||||
        AddonBlockBlogRecentModule,
 | 
					        AddonBlockBlogRecentModule,
 | 
				
			||||||
        AddonBlockBlogTagsModule,
 | 
					        AddonBlockBlogTagsModule,
 | 
				
			||||||
 | 
					        AddonBlockCalendarMonthModule,
 | 
				
			||||||
 | 
					        AddonBlockCalendarUpcomingModule,
 | 
				
			||||||
 | 
					        AddonBlockCommentsModule,
 | 
				
			||||||
 | 
					        AddonBlockCompletionStatusModule,
 | 
				
			||||||
        AddonBlockGlossaryRandomModule,
 | 
					        AddonBlockGlossaryRandomModule,
 | 
				
			||||||
        AddonBlockHtmlModule,
 | 
					        AddonBlockHtmlModule,
 | 
				
			||||||
 | 
					        AddonBlockLearningPlansModule,
 | 
				
			||||||
        AddonBlockNewsItemsModule,
 | 
					        AddonBlockNewsItemsModule,
 | 
				
			||||||
        AddonBlockOnlineUsersModule,
 | 
					        AddonBlockOnlineUsersModule,
 | 
				
			||||||
 | 
					        AddonBlockPrivateFilesModule,
 | 
				
			||||||
        AddonBlockRssClientModule,
 | 
					        AddonBlockRssClientModule,
 | 
				
			||||||
 | 
					        AddonBlockSelfCompletionModule,
 | 
				
			||||||
        AddonBlockTagsModule,
 | 
					        AddonBlockTagsModule,
 | 
				
			||||||
        AddonUserProfileFieldModule,
 | 
					        AddonUserProfileFieldModule,
 | 
				
			||||||
    ],
 | 
					    ],
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										36
									
								
								src/addons/block/calendarmonth/calendarmonth.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								src/addons/block/calendarmonth/calendarmonth.module.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,36 @@
 | 
				
			|||||||
 | 
					// (C) Copyright 2015 Moodle Pty Ltd.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					// you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					// You may obtain a copy of the License at
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//     http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					// distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					// See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					// limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { APP_INITIALIZER, NgModule } from '@angular/core';
 | 
				
			||||||
 | 
					import { IonicModule } from '@ionic/angular';
 | 
				
			||||||
 | 
					import { TranslateModule } from '@ngx-translate/core';
 | 
				
			||||||
 | 
					import { CoreBlockDelegate } from '@features/block/services/block-delegate';
 | 
				
			||||||
 | 
					import { AddonBlockCalendarMonthHandler } from './services/block-handler';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@NgModule({
 | 
				
			||||||
 | 
					    imports: [
 | 
				
			||||||
 | 
					        IonicModule,
 | 
				
			||||||
 | 
					        TranslateModule.forChild(),
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					    providers: [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            provide: APP_INITIALIZER,
 | 
				
			||||||
 | 
					            multi: true,
 | 
				
			||||||
 | 
					            useValue: () => {
 | 
				
			||||||
 | 
					                CoreBlockDelegate.instance.registerHandler(AddonBlockCalendarMonthHandler.instance);
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					export class AddonBlockCalendarMonthModule {}
 | 
				
			||||||
							
								
								
									
										3
									
								
								src/addons/block/calendarmonth/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/calendarmonth/lang.json
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					{
 | 
				
			||||||
 | 
					    "pluginname": "Calendar"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										61
									
								
								src/addons/block/calendarmonth/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								src/addons/block/calendarmonth/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,61 @@
 | 
				
			|||||||
 | 
					// (C) Copyright 2015 Moodle Pty Ltd.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					// you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					// You may obtain a copy of the License at
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//     http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					// distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					// See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					// limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { Injectable } from '@angular/core';
 | 
				
			||||||
 | 
					import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
 | 
				
			||||||
 | 
					import { CoreBlockOnlyTitleComponent } from '@features/block/components/only-title-block/only-title-block';
 | 
				
			||||||
 | 
					import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
 | 
				
			||||||
 | 
					// import { AddonCalendar } from '@addon/calendar/services/calendar';
 | 
				
			||||||
 | 
					import { CoreCourseBlock } from '@features/course/services/course';
 | 
				
			||||||
 | 
					import { Params } from '@angular/router';
 | 
				
			||||||
 | 
					import { makeSingleton } from '@singletons';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Block handler.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					@Injectable({ providedIn: 'root' })
 | 
				
			||||||
 | 
					export class AddonBlockCalendarMonthHandlerService extends CoreBlockBaseHandler {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    name = 'AddonBlockCalendarMonth';
 | 
				
			||||||
 | 
					    blockName = 'calendar_month';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns the data needed to render the block.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param block The block to render.
 | 
				
			||||||
 | 
					     * @param contextLevel The context where the block will be used.
 | 
				
			||||||
 | 
					     * @param instanceId The instance ID associated with the context level.
 | 
				
			||||||
 | 
					     * @return Data or promise resolved with the data.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    getDisplayData(block: CoreCourseBlock, contextLevel: string, instanceId: number): CoreBlockHandlerData {
 | 
				
			||||||
 | 
					        // @todo
 | 
				
			||||||
 | 
					        const link = 'AddonCalendarListPage';
 | 
				
			||||||
 | 
					        const linkParams: Params = contextLevel == 'course' ? { courseId: instanceId } : {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /* if (AddonCalendar.instance.canViewMonthInSite()) {
 | 
				
			||||||
 | 
					            link = 'AddonCalendarIndexPage';
 | 
				
			||||||
 | 
					        }*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return {
 | 
				
			||||||
 | 
					            title: 'addon.block_calendarmonth.pluginname',
 | 
				
			||||||
 | 
					            class: 'addon-block-calendar-month',
 | 
				
			||||||
 | 
					            component: CoreBlockOnlyTitleComponent,
 | 
				
			||||||
 | 
					            link: link,
 | 
				
			||||||
 | 
					            linkParams: linkParams,
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export class AddonBlockCalendarMonthHandler extends makeSingleton(AddonBlockCalendarMonthHandlerService) {}
 | 
				
			||||||
							
								
								
									
										36
									
								
								src/addons/block/calendarupcoming/calendarupcoming.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								src/addons/block/calendarupcoming/calendarupcoming.module.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,36 @@
 | 
				
			|||||||
 | 
					// (C) Copyright 2015 Moodle Pty Ltd.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					// you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					// You may obtain a copy of the License at
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//     http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					// distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					// See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					// limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { APP_INITIALIZER, NgModule } from '@angular/core';
 | 
				
			||||||
 | 
					import { IonicModule } from '@ionic/angular';
 | 
				
			||||||
 | 
					import { TranslateModule } from '@ngx-translate/core';
 | 
				
			||||||
 | 
					import { CoreBlockDelegate } from '@features/block/services/block-delegate';
 | 
				
			||||||
 | 
					import { AddonBlockCalendarUpcomingHandler } from './services/block-handler';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@NgModule({
 | 
				
			||||||
 | 
					    imports: [
 | 
				
			||||||
 | 
					        IonicModule,
 | 
				
			||||||
 | 
					        TranslateModule.forChild(),
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					    providers: [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            provide: APP_INITIALIZER,
 | 
				
			||||||
 | 
					            multi: true,
 | 
				
			||||||
 | 
					            useValue: () => {
 | 
				
			||||||
 | 
					                CoreBlockDelegate.instance.registerHandler(AddonBlockCalendarUpcomingHandler.instance);
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					export class AddonBlockCalendarUpcomingModule {}
 | 
				
			||||||
							
								
								
									
										3
									
								
								src/addons/block/calendarupcoming/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/calendarupcoming/lang.json
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					{
 | 
				
			||||||
 | 
					    "pluginname": "Upcoming events"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										62
									
								
								src/addons/block/calendarupcoming/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								src/addons/block/calendarupcoming/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,62 @@
 | 
				
			|||||||
 | 
					// (C) Copyright 2015 Moodle Pty Ltd.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					// you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					// You may obtain a copy of the License at
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//     http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					// distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					// See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					// limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { Injectable } from '@angular/core';
 | 
				
			||||||
 | 
					import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
 | 
				
			||||||
 | 
					import { CoreBlockOnlyTitleComponent } from '@features/block/components/only-title-block/only-title-block';
 | 
				
			||||||
 | 
					import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
 | 
				
			||||||
 | 
					// import { AddonCalendar } from '@addon/calendar/services/calendar';
 | 
				
			||||||
 | 
					import { CoreCourseBlock } from '@features/course/services/course';
 | 
				
			||||||
 | 
					import { Params } from '@angular/router';
 | 
				
			||||||
 | 
					import { makeSingleton } from '@singletons';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Block handler.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					@Injectable({ providedIn: 'root' })
 | 
				
			||||||
 | 
					export class AddonBlockCalendarUpcomingHandlerService extends CoreBlockBaseHandler {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    name = 'AddonBlockCalendarUpcoming';
 | 
				
			||||||
 | 
					    blockName = 'calendar_upcoming';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns the data needed to render the block.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param block The block to render.
 | 
				
			||||||
 | 
					     * @param contextLevel The context where the block will be used.
 | 
				
			||||||
 | 
					     * @param instanceId The instance ID associated with the context level.
 | 
				
			||||||
 | 
					     * @return Data or promise resolved with the data.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    getDisplayData(block: CoreCourseBlock, contextLevel: string, instanceId: number): CoreBlockHandlerData {
 | 
				
			||||||
 | 
					        // @todo
 | 
				
			||||||
 | 
					        const link = 'AddonCalendarListPage';
 | 
				
			||||||
 | 
					        const linkParams: Params = contextLevel == 'course' ? { courseId: instanceId } : {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /* if (AddonCalendar.instance.canViewMonthInSite()) {
 | 
				
			||||||
 | 
					            link = 'AddonCalendarIndexPage';
 | 
				
			||||||
 | 
					            linkParams.upcoming = true;
 | 
				
			||||||
 | 
					        }*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return {
 | 
				
			||||||
 | 
					            title: 'addon.block_calendarupcoming.pluginname',
 | 
				
			||||||
 | 
					            class: 'addon-block-calendar-upcoming',
 | 
				
			||||||
 | 
					            component: CoreBlockOnlyTitleComponent,
 | 
				
			||||||
 | 
					            link: link,
 | 
				
			||||||
 | 
					            linkParams: linkParams,
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export class AddonBlockCalendarUpcomingHandler extends makeSingleton(AddonBlockCalendarUpcomingHandlerService) {}
 | 
				
			||||||
							
								
								
									
										36
									
								
								src/addons/block/comments/comments.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								src/addons/block/comments/comments.module.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,36 @@
 | 
				
			|||||||
 | 
					// (C) Copyright 2015 Moodle Pty Ltd.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					// you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					// You may obtain a copy of the License at
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//     http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					// distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					// See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					// limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { APP_INITIALIZER, NgModule } from '@angular/core';
 | 
				
			||||||
 | 
					import { IonicModule } from '@ionic/angular';
 | 
				
			||||||
 | 
					import { TranslateModule } from '@ngx-translate/core';
 | 
				
			||||||
 | 
					import { CoreBlockDelegate } from '@features/block/services/block-delegate';
 | 
				
			||||||
 | 
					import { AddonBlockCommentsHandler } from './services/block-handler';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@NgModule({
 | 
				
			||||||
 | 
					    imports: [
 | 
				
			||||||
 | 
					        IonicModule,
 | 
				
			||||||
 | 
					        TranslateModule.forChild(),
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					    providers: [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            provide: APP_INITIALIZER,
 | 
				
			||||||
 | 
					            multi: true,
 | 
				
			||||||
 | 
					            useValue: () => {
 | 
				
			||||||
 | 
					                CoreBlockDelegate.instance.registerHandler(AddonBlockCommentsHandler.instance);
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					export class AddonBlockCommentsModule {}
 | 
				
			||||||
							
								
								
									
										3
									
								
								src/addons/block/comments/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/comments/lang.json
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					{
 | 
				
			||||||
 | 
					    "pluginname": "Comments"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										59
									
								
								src/addons/block/comments/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								src/addons/block/comments/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,59 @@
 | 
				
			|||||||
 | 
					// (C) Copyright 2015 Moodle Pty Ltd.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					// you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					// You may obtain a copy of the License at
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//     http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					// distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					// See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					// limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { Injectable } from '@angular/core';
 | 
				
			||||||
 | 
					import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
 | 
				
			||||||
 | 
					import { CoreBlockOnlyTitleComponent } from '@features/block/components/only-title-block/only-title-block';
 | 
				
			||||||
 | 
					import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
 | 
				
			||||||
 | 
					import { CoreCourseBlock } from '@features/course/services/course';
 | 
				
			||||||
 | 
					import { makeSingleton } from '@singletons';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Block handler.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					@Injectable({ providedIn: 'root' })
 | 
				
			||||||
 | 
					export class AddonBlockCommentsHandlerService extends CoreBlockBaseHandler {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    name = 'AddonBlockComments';
 | 
				
			||||||
 | 
					    blockName = 'comments';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns the data needed to render the block.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param block The block to render.
 | 
				
			||||||
 | 
					     * @param contextLevel The context where the block will be used.
 | 
				
			||||||
 | 
					     * @param instanceId The instance ID associated with the context level.
 | 
				
			||||||
 | 
					     * @return Data or promise resolved with the data.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    getDisplayData(block: CoreCourseBlock, contextLevel: string, instanceId: number): CoreBlockHandlerData {
 | 
				
			||||||
 | 
					        // @todo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return {
 | 
				
			||||||
 | 
					            title: 'addon.block_comments.pluginname',
 | 
				
			||||||
 | 
					            class: 'addon-block-comments',
 | 
				
			||||||
 | 
					            component: CoreBlockOnlyTitleComponent,
 | 
				
			||||||
 | 
					            link: 'CoreCommentsViewerPage',
 | 
				
			||||||
 | 
					            linkParams: {
 | 
				
			||||||
 | 
					                contextLevel: contextLevel,
 | 
				
			||||||
 | 
					                instanceId: instanceId,
 | 
				
			||||||
 | 
					                componentName: 'block_comments',
 | 
				
			||||||
 | 
					                area: 'page_comments',
 | 
				
			||||||
 | 
					                itemId: 0,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export class AddonBlockCommentsHandler extends makeSingleton(AddonBlockCommentsHandlerService) {}
 | 
				
			||||||
							
								
								
									
										36
									
								
								src/addons/block/completionstatus/completionstatus.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								src/addons/block/completionstatus/completionstatus.module.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,36 @@
 | 
				
			|||||||
 | 
					// (C) Copyright 2015 Moodle Pty Ltd.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					// you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					// You may obtain a copy of the License at
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//     http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					// distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					// See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					// limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { APP_INITIALIZER, NgModule } from '@angular/core';
 | 
				
			||||||
 | 
					import { IonicModule } from '@ionic/angular';
 | 
				
			||||||
 | 
					import { TranslateModule } from '@ngx-translate/core';
 | 
				
			||||||
 | 
					import { CoreBlockDelegate } from '@features/block/services/block-delegate';
 | 
				
			||||||
 | 
					import { AddonBlockCompletionStatusHandler } from './services/block-handler';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@NgModule({
 | 
				
			||||||
 | 
					    imports: [
 | 
				
			||||||
 | 
					        IonicModule,
 | 
				
			||||||
 | 
					        TranslateModule.forChild(),
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					    providers: [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            provide: APP_INITIALIZER,
 | 
				
			||||||
 | 
					            multi: true,
 | 
				
			||||||
 | 
					            useValue: () => {
 | 
				
			||||||
 | 
					                CoreBlockDelegate.instance.registerHandler(AddonBlockCompletionStatusHandler.instance);
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					export class AddonBlockCompletionStatusModule {}
 | 
				
			||||||
							
								
								
									
										3
									
								
								src/addons/block/completionstatus/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/completionstatus/lang.json
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					{
 | 
				
			||||||
 | 
					    "pluginname": "Course completion status"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										55
									
								
								src/addons/block/completionstatus/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								src/addons/block/completionstatus/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,55 @@
 | 
				
			|||||||
 | 
					// (C) Copyright 2015 Moodle Pty Ltd.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					// you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					// You may obtain a copy of the License at
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//     http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					// distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					// See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					// limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { Injectable } from '@angular/core';
 | 
				
			||||||
 | 
					import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
 | 
				
			||||||
 | 
					import { CoreBlockOnlyTitleComponent } from '@features/block/components/only-title-block/only-title-block';
 | 
				
			||||||
 | 
					import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
 | 
				
			||||||
 | 
					import { CoreCourseBlock } from '@features/course/services/course';
 | 
				
			||||||
 | 
					import { makeSingleton } from '@singletons';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Block handler.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					@Injectable({ providedIn: 'root' })
 | 
				
			||||||
 | 
					export class AddonBlockCompletionStatusHandlerService extends CoreBlockBaseHandler {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    name = 'AddonBlockCompletionStatus';
 | 
				
			||||||
 | 
					    blockName = 'completionstatus';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns the data needed to render the block.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param block The block to render.
 | 
				
			||||||
 | 
					     * @param contextLevel The context where the block will be used.
 | 
				
			||||||
 | 
					     * @param instanceId The instance ID associated with the context level.
 | 
				
			||||||
 | 
					     * @return Data or promise resolved with the data.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    getDisplayData(block: CoreCourseBlock, contextLevel: string, instanceId: number): CoreBlockHandlerData {
 | 
				
			||||||
 | 
					        // @todo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return {
 | 
				
			||||||
 | 
					            title: 'addon.block_completionstatus.pluginname',
 | 
				
			||||||
 | 
					            class: 'addon-block-completion-status',
 | 
				
			||||||
 | 
					            component: CoreBlockOnlyTitleComponent,
 | 
				
			||||||
 | 
					            link: 'AddonCourseCompletionReportPage',
 | 
				
			||||||
 | 
					            linkParams: {
 | 
				
			||||||
 | 
					                courseId: instanceId,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export class AddonBlockCompletionStatusHandler extends makeSingleton(AddonBlockCompletionStatusHandlerService) {}
 | 
				
			||||||
							
								
								
									
										3
									
								
								src/addons/block/learningplans/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/learningplans/lang.json
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					{
 | 
				
			||||||
 | 
					    "pluginname": "Learning plans"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										38
									
								
								src/addons/block/learningplans/learningplans.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								src/addons/block/learningplans/learningplans.module.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,38 @@
 | 
				
			|||||||
 | 
					// (C) Copyright 2015 Moodle Pty Ltd.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					// you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					// You may obtain a copy of the License at
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//     http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					// distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					// See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					// limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { APP_INITIALIZER, NgModule } from '@angular/core';
 | 
				
			||||||
 | 
					import { IonicModule } from '@ionic/angular';
 | 
				
			||||||
 | 
					import { TranslateModule } from '@ngx-translate/core';
 | 
				
			||||||
 | 
					import { CoreBlockDelegate } from '@features/block/services/block-delegate';
 | 
				
			||||||
 | 
					import { AddonBlockLearningPlansHandler } from './services/block-handler';
 | 
				
			||||||
 | 
					import { CoreBlockComponentsModule } from '@features/block/components/components.module';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@NgModule({
 | 
				
			||||||
 | 
					    imports: [
 | 
				
			||||||
 | 
					        IonicModule,
 | 
				
			||||||
 | 
					        CoreBlockComponentsModule,
 | 
				
			||||||
 | 
					        TranslateModule.forChild(),
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					    providers: [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            provide: APP_INITIALIZER,
 | 
				
			||||||
 | 
					            multi: true,
 | 
				
			||||||
 | 
					            useValue: () => {
 | 
				
			||||||
 | 
					                CoreBlockDelegate.instance.registerHandler(AddonBlockLearningPlansHandler.instance);
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					export class AddonBlockLearningPlansModule {}
 | 
				
			||||||
							
								
								
									
										48
									
								
								src/addons/block/learningplans/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								src/addons/block/learningplans/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,48 @@
 | 
				
			|||||||
 | 
					// (C) Copyright 2015 Moodle Pty Ltd.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					// you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					// You may obtain a copy of the License at
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//     http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					// distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					// See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					// limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { Injectable } from '@angular/core';
 | 
				
			||||||
 | 
					import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
 | 
				
			||||||
 | 
					import { CoreBlockOnlyTitleComponent } from '@features/block/components/only-title-block/only-title-block';
 | 
				
			||||||
 | 
					import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
 | 
				
			||||||
 | 
					import { makeSingleton } from '@singletons';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Block handler.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					@Injectable({ providedIn: 'root' })
 | 
				
			||||||
 | 
					export class AddonBlockLearningPlansHandlerService extends CoreBlockBaseHandler {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    name = 'AddonBlockLearningPlans';
 | 
				
			||||||
 | 
					    blockName = 'lp';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns the data needed to render the block.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return Data or promise resolved with the data.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    getDisplayData(): CoreBlockHandlerData {
 | 
				
			||||||
 | 
					        // @todo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return {
 | 
				
			||||||
 | 
					            title: 'addon.block_learningplans.pluginname',
 | 
				
			||||||
 | 
					            class: 'addon-block-learning-plans',
 | 
				
			||||||
 | 
					            component: CoreBlockOnlyTitleComponent,
 | 
				
			||||||
 | 
					            link: 'AddonCompetencyPlanListPage',
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export class AddonBlockLearningPlansHandler extends makeSingleton(AddonBlockLearningPlansHandlerService) {}
 | 
				
			||||||
							
								
								
									
										3
									
								
								src/addons/block/privatefiles/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/privatefiles/lang.json
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					{
 | 
				
			||||||
 | 
					    "pluginname": "Private files"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										36
									
								
								src/addons/block/privatefiles/privatefiles.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								src/addons/block/privatefiles/privatefiles.module.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,36 @@
 | 
				
			|||||||
 | 
					// (C) Copyright 2015 Moodle Pty Ltd.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					// you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					// You may obtain a copy of the License at
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//     http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					// distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					// See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					// limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { APP_INITIALIZER, NgModule } from '@angular/core';
 | 
				
			||||||
 | 
					import { IonicModule } from '@ionic/angular';
 | 
				
			||||||
 | 
					import { TranslateModule } from '@ngx-translate/core';
 | 
				
			||||||
 | 
					import { CoreBlockDelegate } from '@features/block/services/block-delegate';
 | 
				
			||||||
 | 
					import { AddonBlockPrivateFilesHandler } from './services/block-handler';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@NgModule({
 | 
				
			||||||
 | 
					    imports: [
 | 
				
			||||||
 | 
					        IonicModule,
 | 
				
			||||||
 | 
					        TranslateModule.forChild(),
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					    providers: [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            provide: APP_INITIALIZER,
 | 
				
			||||||
 | 
					            multi: true,
 | 
				
			||||||
 | 
					            useValue: () => {
 | 
				
			||||||
 | 
					                CoreBlockDelegate.instance.registerHandler(AddonBlockPrivateFilesHandler.instance);
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					export class AddonBlockPrivateFilesModule {}
 | 
				
			||||||
							
								
								
									
										49
									
								
								src/addons/block/privatefiles/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								src/addons/block/privatefiles/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,49 @@
 | 
				
			|||||||
 | 
					// (C) Copyright 2015 Moodle Pty Ltd.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					// you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					// You may obtain a copy of the License at
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//     http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					// distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					// See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					// limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { Injectable } from '@angular/core';
 | 
				
			||||||
 | 
					import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
 | 
				
			||||||
 | 
					import { CoreBlockOnlyTitleComponent } from '@features/block/components/only-title-block/only-title-block';
 | 
				
			||||||
 | 
					import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
 | 
				
			||||||
 | 
					import { AddonPrivateFilesMainMenuHandlerService } from '@/addons/privatefiles/services/handlers/mainmenu';
 | 
				
			||||||
 | 
					import { makeSingleton } from '@singletons';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Block handler.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					@Injectable({ providedIn: 'root' })
 | 
				
			||||||
 | 
					export class AddonBlockPrivateFilesHandlerService extends CoreBlockBaseHandler {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    name = 'AddonBlockPrivateFiles';
 | 
				
			||||||
 | 
					    blockName = 'private_files';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns the data needed to render the block.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return Data or promise resolved with the data.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    getDisplayData(): CoreBlockHandlerData {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return {
 | 
				
			||||||
 | 
					            title: 'addon.block_privatefiles.pluginname',
 | 
				
			||||||
 | 
					            class: 'addon-block-private-files',
 | 
				
			||||||
 | 
					            component: CoreBlockOnlyTitleComponent,
 | 
				
			||||||
 | 
					            link: '/main/' + AddonPrivateFilesMainMenuHandlerService.PAGE_NAME,
 | 
				
			||||||
 | 
					            linkParams: { root: 'my' },
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export class AddonBlockPrivateFilesHandler extends makeSingleton(AddonBlockPrivateFilesHandlerService) {}
 | 
				
			||||||
							
								
								
									
										3
									
								
								src/addons/block/selfcompletion/lang.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/addons/block/selfcompletion/lang.json
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					{
 | 
				
			||||||
 | 
					    "pluginname": "Self completion"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										36
									
								
								src/addons/block/selfcompletion/selfcompletion.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								src/addons/block/selfcompletion/selfcompletion.module.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,36 @@
 | 
				
			|||||||
 | 
					// (C) Copyright 2015 Moodle Pty Ltd.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					// you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					// You may obtain a copy of the License at
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//     http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					// distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					// See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					// limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { APP_INITIALIZER, NgModule } from '@angular/core';
 | 
				
			||||||
 | 
					import { IonicModule } from '@ionic/angular';
 | 
				
			||||||
 | 
					import { TranslateModule } from '@ngx-translate/core';
 | 
				
			||||||
 | 
					import { CoreBlockDelegate } from '@features/block/services/block-delegate';
 | 
				
			||||||
 | 
					import { AddonBlockSelfCompletionHandler } from './services/block-handler';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@NgModule({
 | 
				
			||||||
 | 
					    imports: [
 | 
				
			||||||
 | 
					        IonicModule,
 | 
				
			||||||
 | 
					        TranslateModule.forChild(),
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					    providers: [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            provide: APP_INITIALIZER,
 | 
				
			||||||
 | 
					            multi: true,
 | 
				
			||||||
 | 
					            useValue: () => {
 | 
				
			||||||
 | 
					                CoreBlockDelegate.instance.registerHandler(AddonBlockSelfCompletionHandler.instance);
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					export class AddonBlockSelfCompletionModule {}
 | 
				
			||||||
							
								
								
									
										53
									
								
								src/addons/block/selfcompletion/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								src/addons/block/selfcompletion/services/block-handler.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,53 @@
 | 
				
			|||||||
 | 
					// (C) Copyright 2015 Moodle Pty Ltd.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					// you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					// You may obtain a copy of the License at
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//     http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					// distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					// See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					// limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { Injectable } from '@angular/core';
 | 
				
			||||||
 | 
					import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
 | 
				
			||||||
 | 
					import { CoreBlockOnlyTitleComponent } from '@features/block/components/only-title-block/only-title-block';
 | 
				
			||||||
 | 
					import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
 | 
				
			||||||
 | 
					import { CoreCourseBlock } from '@features/course/services/course';
 | 
				
			||||||
 | 
					import { makeSingleton } from '@singletons';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Block handler.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					@Injectable({ providedIn: 'root' })
 | 
				
			||||||
 | 
					export class AddonBlockSelfCompletionHandlerService extends CoreBlockBaseHandler {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    name = 'AddonBlockSelfCompletion';
 | 
				
			||||||
 | 
					    blockName = 'selfcompletion';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Returns the data needed to render the block.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param block The block to render.
 | 
				
			||||||
 | 
					     * @param contextLevel The context where the block will be used.
 | 
				
			||||||
 | 
					     * @param instanceId The instance ID associated with the context level.
 | 
				
			||||||
 | 
					     * @return Data or promise resolved with the data.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    getDisplayData(block: CoreCourseBlock, contextLevel: string, instanceId: number): CoreBlockHandlerData {
 | 
				
			||||||
 | 
					        // @todo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return {
 | 
				
			||||||
 | 
					            title: 'addon.block_selfcompletion.pluginname',
 | 
				
			||||||
 | 
					            class: 'addon-block-self-completion',
 | 
				
			||||||
 | 
					            component: CoreBlockOnlyTitleComponent,
 | 
				
			||||||
 | 
					            link: 'AddonCourseCompletionReportPage',
 | 
				
			||||||
 | 
					            linkParams: { courseId: instanceId },
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export class AddonBlockSelfCompletionHandler extends makeSingleton(AddonBlockSelfCompletionHandlerService) {}
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user