MOBILE-4460 core: Hide informative links if needed
parent
ee9daad783
commit
b668af193b
|
@ -86,6 +86,10 @@ export class AddonModForumPostOptionsMenuComponent implements OnInit {
|
||||||
*/
|
*/
|
||||||
protected setOpenInBrowserUrl(): void {
|
protected setOpenInBrowserUrl(): void {
|
||||||
const site = CoreSites.getRequiredCurrentSite();
|
const site = CoreSites.getRequiredCurrentSite();
|
||||||
|
if (!CoreSites.shouldDisplayInformativeLinks(site)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.url = site.createSiteUrl('/mod/forum/discuss.php', { d: this.post.discussionid.toString() }, 'p' + this.post.id);
|
this.url = site.createSiteUrl('/mod/forum/discuss.php', { d: this.post.discussionid.toString() }, 'p' + this.post.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -165,8 +165,11 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const currentSite = CoreSites.getCurrentSite();
|
||||||
this.isOnline = CoreNetwork.isOnline();
|
this.isOnline = CoreNetwork.isOnline();
|
||||||
this.externalUrl = CoreSites.getCurrentSite()?.createSiteUrl('/mod/forum/discuss.php', { d: this.discussionId.toString() });
|
this.externalUrl = currentSite && CoreSites.shouldDisplayInformativeLinks(currentSite) ?
|
||||||
|
currentSite.createSiteUrl('/mod/forum/discuss.php', { d: this.discussionId.toString() }) :
|
||||||
|
undefined;
|
||||||
this.onlineObserver = CoreNetwork.onChange().subscribe(() => {
|
this.onlineObserver = CoreNetwork.onChange().subscribe(() => {
|
||||||
// Execute the callback in the Angular zone, so change detection doesn't stop working.
|
// Execute the callback in the Angular zone, so change detection doesn't stop working.
|
||||||
NgZone.run(() => {
|
NgZone.run(() => {
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
<h2>
|
<h2>
|
||||||
<core-format-text [text]="site.siteName" clean="true" [siteId]="site.id"></core-format-text>
|
<core-format-text [text]="site.siteName" clean="true" [siteId]="site.id"></core-format-text>
|
||||||
</h2>
|
</h2>
|
||||||
<p *ngIf="!site.isDemoModeSite">
|
<p *ngIf="displaySiteUrl(site)">
|
||||||
<a [href]="site.siteUrl" core-link [autoLogin]="isCurrentSite ? 'yes' : 'no'">
|
<a [href]="site.siteUrl" core-link [autoLogin]="isCurrentSite ? 'yes' : 'no'">
|
||||||
{{ site.siteUrlWithoutProtocol }}
|
{{ site.siteUrlWithoutProtocol }}
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
import { Component, ContentChild, Input, Output, TemplateRef, EventEmitter } from '@angular/core';
|
import { Component, ContentChild, Input, Output, TemplateRef, EventEmitter } from '@angular/core';
|
||||||
|
|
||||||
import { CoreSiteBasicInfo } from '@services/sites';
|
import { CoreSiteBasicInfo, CoreSites } from '@services/sites';
|
||||||
import { CoreAccountsList } from '@features/login/services/login-helper';
|
import { CoreAccountsList } from '@features/login/services/login-helper';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -77,4 +77,14 @@ export class CoreSitesListComponent<T extends CoreSiteBasicInfo> {
|
||||||
this.onSiteClicked.emit(site);
|
this.onSiteClicked.emit(site);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check whether site URL should be displayed.
|
||||||
|
*
|
||||||
|
* @param site Site to check.
|
||||||
|
* @returns Whether to display URL.
|
||||||
|
*/
|
||||||
|
displaySiteUrl(site: CoreSiteBasicInfo): boolean {
|
||||||
|
return CoreSites.shouldDisplayInformativeLinks(site.siteUrl);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<ion-item class="ion-text-wrap">
|
<ion-item class="ion-text-wrap">
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<h2 class="item-heading">{{ 'core.contentlinks.chooseaccounttoopenlink' | translate }}</h2>
|
<h2 class="item-heading">{{ 'core.contentlinks.chooseaccounttoopenlink' | translate }}</h2>
|
||||||
<p>{{ url }}</p>
|
<p *ngIf="displaySiteUrl">{{ url }}</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item *ngFor="let site of sites" (click)="siteClicked(site.id)" detail="false" button>
|
<ion-item *ngFor="let site of sites" (click)="siteClicked(site.id)" detail="false" button>
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
<p>
|
<p>
|
||||||
<core-format-text [text]="site.siteName" clean="true" [siteId]="site.id"></core-format-text>
|
<core-format-text [text]="site.siteName" clean="true" [siteId]="site.id"></core-format-text>
|
||||||
</p>
|
</p>
|
||||||
<p *ngIf="!site.isDemoModeSite">{{site.siteUrl}}</p>
|
<p *ngIf="displaySiteUrl">{{site.siteUrl}}</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
|
|
|
@ -34,6 +34,7 @@ export class CoreContentLinksChooseSiteModalComponent implements OnInit {
|
||||||
|
|
||||||
sites: CoreSiteBasicInfo[] = [];
|
sites: CoreSiteBasicInfo[] = [];
|
||||||
loaded = false;
|
loaded = false;
|
||||||
|
displaySiteUrl = false;
|
||||||
protected action?: CoreContentLinksAction;
|
protected action?: CoreContentLinksAction;
|
||||||
protected isRootURL = false;
|
protected isRootURL = false;
|
||||||
|
|
||||||
|
@ -70,6 +71,9 @@ export class CoreContentLinksChooseSiteModalComponent implements OnInit {
|
||||||
|
|
||||||
// Get the sites that can perform the action.
|
// Get the sites that can perform the action.
|
||||||
this.sites = await CoreSites.getSites(siteIds);
|
this.sites = await CoreSites.getSites(siteIds);
|
||||||
|
|
||||||
|
// All sites have the same URL, use the first one.
|
||||||
|
this.displaySiteUrl = CoreSites.shouldDisplayInformativeLinks(this.sites[0].siteUrl);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.showErrorModalDefault(error, 'core.contentlinks.errornosites', true);
|
CoreDomUtils.showErrorModalDefault(error, 'core.contentlinks.errornosites', true);
|
||||||
this.closeModal();
|
this.closeModal();
|
||||||
|
|
|
@ -101,7 +101,7 @@ export class CoreCourseModuleSummaryComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.displayOptions = Object.assign({
|
this.displayOptions = Object.assign({
|
||||||
displayOpenInBrowser: true,
|
displayOpenInBrowser: CoreSites.shouldDisplayInformativeLinks(),
|
||||||
displayDescription: true,
|
displayDescription: true,
|
||||||
displayRefresh: true,
|
displayRefresh: true,
|
||||||
displayPrefetch: true,
|
displayPrefetch: true,
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-chip>
|
</ion-chip>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
<ion-button fill="clear" [href]="courseUrl" core-link [showBrowserWarning]="false"
|
<ion-button *ngIf="displayOpenInBrowser" fill="clear" [href]="courseUrl" core-link [showBrowserWarning]="false"
|
||||||
[attr.aria-label]="'core.openinbrowser' | translate" slot="end">
|
[attr.aria-label]="'core.openinbrowser' | translate" slot="end">
|
||||||
<ion-icon name="fas-up-right-from-square" slot="icon-only" aria-hidden="true"></ion-icon>
|
<ion-icon name="fas-up-right-from-square" slot="icon-only" aria-hidden="true"></ion-icon>
|
||||||
</ion-button>
|
</ion-button>
|
||||||
|
|
|
@ -72,6 +72,7 @@ export class CoreCourseSummaryPage implements OnInit, OnDestroy {
|
||||||
courseUrl = '';
|
courseUrl = '';
|
||||||
progress?: number;
|
progress?: number;
|
||||||
courseMenuHandlers: CoreCourseOptionsMenuHandlerToDisplay[] = [];
|
courseMenuHandlers: CoreCourseOptionsMenuHandlerToDisplay[] = [];
|
||||||
|
displayOpenInBrowser = false;
|
||||||
|
|
||||||
protected actionSheet?: HTMLIonActionSheetElement;
|
protected actionSheet?: HTMLIonActionSheetElement;
|
||||||
protected waitStart = 0;
|
protected waitStart = 0;
|
||||||
|
@ -137,6 +138,7 @@ export class CoreCourseSummaryPage implements OnInit, OnDestroy {
|
||||||
const currentSiteUrl = CoreSites.getRequiredCurrentSite().getURL();
|
const currentSiteUrl = CoreSites.getRequiredCurrentSite().getURL();
|
||||||
this.enrolUrl = CorePath.concatenatePaths(currentSiteUrl, 'enrol/index.php?id=' + this.courseId);
|
this.enrolUrl = CorePath.concatenatePaths(currentSiteUrl, 'enrol/index.php?id=' + this.courseId);
|
||||||
this.courseUrl = CorePath.concatenatePaths(currentSiteUrl, 'course/view.php?id=' + this.courseId);
|
this.courseUrl = CorePath.concatenatePaths(currentSiteUrl, 'course/view.php?id=' + this.courseId);
|
||||||
|
this.displayOpenInBrowser = CoreSites.shouldDisplayInformativeLinks();
|
||||||
|
|
||||||
await this.getCourse();
|
await this.getCourse();
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
</ion-title>
|
</ion-title>
|
||||||
|
|
||||||
<ion-buttons slot="end">
|
<ion-buttons slot="end">
|
||||||
<ion-button fill="clear" *ngIf="module.url && module.uservisible && !unsupported" [href]="module.url" core-link
|
<ion-button fill="clear" *ngIf="displayOpenInBrowser && module.url && module.uservisible && !unsupported" [href]="module.url"
|
||||||
[showBrowserWarning]="false" [attr.aria-label]="'core.openinbrowser' | translate">
|
core-link [showBrowserWarning]="false" [attr.aria-label]="'core.openinbrowser' | translate">
|
||||||
<ion-icon name="fas-up-right-from-square" slot="icon-only" aria-hidden="true"></ion-icon>
|
<ion-icon name="fas-up-right-from-square" slot="icon-only" aria-hidden="true"></ion-icon>
|
||||||
</ion-button>
|
</ion-button>
|
||||||
<ion-button fill="clear" (click)="openModuleSummary()" aria-haspopup="true" [attr.aria-label]="'core.info' | translate">
|
<ion-button fill="clear" (click)="openModuleSummary()" aria-haspopup="true" [attr.aria-label]="'core.info' | translate">
|
||||||
|
|
|
@ -22,6 +22,7 @@ import { CoreCourseHelper, CoreCourseModuleData, CoreCourseSection } from '@feat
|
||||||
import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate';
|
import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate';
|
||||||
import { IonRefresher } from '@ionic/angular';
|
import { IonRefresher } from '@ionic/angular';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
|
|
||||||
|
@ -43,6 +44,7 @@ export class CoreCourseModulePreviewPage implements OnInit {
|
||||||
unsupported = false;
|
unsupported = false;
|
||||||
isDisabledInSite = false;
|
isDisabledInSite = false;
|
||||||
showManualCompletion = false;
|
showManualCompletion = false;
|
||||||
|
displayOpenInBrowser = false;
|
||||||
|
|
||||||
protected debouncedUpdateModule?: () => void; // Update the module after a certain time.
|
protected debouncedUpdateModule?: () => void; // Update the module after a certain time.
|
||||||
|
|
||||||
|
@ -62,6 +64,7 @@ export class CoreCourseModulePreviewPage implements OnInit {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.displayOpenInBrowser = CoreSites.shouldDisplayInformativeLinks();
|
||||||
this.debouncedUpdateModule = CoreUtils.debounce(() => {
|
this.debouncedUpdateModule = CoreUtils.debounce(() => {
|
||||||
this.doRefresh();
|
this.doRefresh();
|
||||||
}, 10000);
|
}, 10000);
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<h2 *ngIf="siteName" class="ion-margin-top ion-no-padding core-sitename">
|
<h2 *ngIf="siteName" class="ion-margin-top ion-no-padding core-sitename">
|
||||||
<core-format-text [text]="siteName" [filter]="false"></core-format-text>
|
<core-format-text [text]="siteName" [filter]="false"></core-format-text>
|
||||||
</h2>
|
</h2>
|
||||||
<p class="core-siteurl" *ngIf="!isDemoModeSite">{{siteUrl}}</p>
|
<p class="core-siteurl" *ngIf="displaySiteUrl">{{siteUrl}}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<core-login-exceeded-attempts *ngIf="exceededAttemptsHTML && supportConfig && loginAttempts >= 3"
|
<core-login-exceeded-attempts *ngIf="exceededAttemptsHTML && supportConfig && loginAttempts >= 3"
|
||||||
|
|
|
@ -62,6 +62,7 @@ export class CoreLoginCredentialsPage implements OnInit, OnDestroy {
|
||||||
siteConfig?: CoreSitePublicConfigResponse;
|
siteConfig?: CoreSitePublicConfigResponse;
|
||||||
siteCheckError = '';
|
siteCheckError = '';
|
||||||
isDemoModeSite = false;
|
isDemoModeSite = false;
|
||||||
|
displaySiteUrl = false;
|
||||||
|
|
||||||
protected siteCheck?: CoreSiteCheckResponse;
|
protected siteCheck?: CoreSiteCheckResponse;
|
||||||
protected eventThrown = false;
|
protected eventThrown = false;
|
||||||
|
@ -97,6 +98,7 @@ export class CoreLoginCredentialsPage implements OnInit, OnDestroy {
|
||||||
undefined;
|
undefined;
|
||||||
this.urlToOpen = CoreNavigator.getRouteParam('urlToOpen');
|
this.urlToOpen = CoreNavigator.getRouteParam('urlToOpen');
|
||||||
this.supportConfig = this.siteConfig && new CoreUserGuestSupportConfig(this.siteConfig);
|
this.supportConfig = this.siteConfig && new CoreUserGuestSupportConfig(this.siteConfig);
|
||||||
|
this.displaySiteUrl = CoreSites.shouldDisplayInformativeLinks(this.siteUrl);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.showErrorModal(error);
|
CoreDomUtils.showErrorModal(error);
|
||||||
|
|
||||||
|
|
|
@ -82,12 +82,12 @@
|
||||||
<ion-item class="ion-text-wrap ion-text-center">
|
<ion-item class="ion-text-wrap ion-text-center">
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<!-- If no sitename show big siteurl. -->
|
<!-- If no sitename show big siteurl. -->
|
||||||
<p *ngIf="!siteName && !isDemoModeSite" class="ion-padding item-heading">{{siteUrl}}</p>
|
<p *ngIf="!siteName && displaySiteUrl" class="ion-padding item-heading">{{siteUrl}}</p>
|
||||||
<!-- If sitename, show big sitename and small siteurl. -->
|
<!-- If sitename, show big sitename and small siteurl. -->
|
||||||
<p *ngIf="siteName" class="ion-padding item-heading">
|
<p *ngIf="siteName" class="ion-padding item-heading">
|
||||||
<core-format-text [text]="siteName" [filter]="false"></core-format-text>
|
<core-format-text [text]="siteName" [filter]="false"></core-format-text>
|
||||||
</p>
|
</p>
|
||||||
<p *ngIf="siteName">{{siteUrl}}</p>
|
<p *ngIf="siteName && displaySiteUrl">{{siteUrl}}</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,7 @@ export class CoreLoginEmailSignupPage implements OnInit {
|
||||||
signupForm: FormGroup;
|
signupForm: FormGroup;
|
||||||
siteUrl!: string;
|
siteUrl!: string;
|
||||||
isDemoModeSite = false;
|
isDemoModeSite = false;
|
||||||
|
displaySiteUrl = false;
|
||||||
siteConfig?: CoreSitePublicConfigResponse;
|
siteConfig?: CoreSitePublicConfigResponse;
|
||||||
siteName?: string;
|
siteName?: string;
|
||||||
authInstructions = '';
|
authInstructions = '';
|
||||||
|
@ -130,6 +131,7 @@ export class CoreLoginEmailSignupPage implements OnInit {
|
||||||
|
|
||||||
this.siteUrl = siteUrl;
|
this.siteUrl = siteUrl;
|
||||||
this.isDemoModeSite = CoreLoginHelper.isDemoModeSite(this.siteUrl);
|
this.isDemoModeSite = CoreLoginHelper.isDemoModeSite(this.siteUrl);
|
||||||
|
this.displaySiteUrl = CoreSites.shouldDisplayInformativeLinks(this.siteUrl);
|
||||||
|
|
||||||
// Fetch the data.
|
// Fetch the data.
|
||||||
this.fetchData().finally(() => {
|
this.fetchData().finally(() => {
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
<p *ngIf="siteInfo?.siteName" class="ion-no-margin ion-no-padding core-sitename">
|
<p *ngIf="siteInfo?.siteName" class="ion-no-margin ion-no-padding core-sitename">
|
||||||
<core-format-text [text]="siteInfo?.siteName" [filter]="false"></core-format-text>
|
<core-format-text [text]="siteInfo?.siteName" [filter]="false"></core-format-text>
|
||||||
</p>
|
</p>
|
||||||
<p class="core-siteurl" *ngIf="!isDemoModeSite">{{siteUrl}}</p>
|
<p class="core-siteurl" *ngIf="displaySiteUrl">{{siteUrl}}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="core-login-user">
|
<div class="core-login-user">
|
||||||
|
|
|
@ -48,6 +48,7 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
|
||||||
siteUrl!: string;
|
siteUrl!: string;
|
||||||
isDemoModeSite = false;
|
isDemoModeSite = false;
|
||||||
logoUrl?: string;
|
logoUrl?: string;
|
||||||
|
displaySiteUrl = false;
|
||||||
showForgottenPassword = true;
|
showForgottenPassword = true;
|
||||||
showUserAvatar = false;
|
showUserAvatar = false;
|
||||||
isBrowserSSO = false;
|
isBrowserSSO = false;
|
||||||
|
@ -103,6 +104,7 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
|
||||||
|
|
||||||
this.siteUrl = site.getURL();
|
this.siteUrl = site.getURL();
|
||||||
this.isDemoModeSite = site.isDemoModeSite();
|
this.isDemoModeSite = site.isDemoModeSite();
|
||||||
|
this.displaySiteUrl = CoreSites.shouldDisplayInformativeLinks(site);
|
||||||
|
|
||||||
this.siteInfo = {
|
this.siteInfo = {
|
||||||
id: this.siteId,
|
id: this.siteId,
|
||||||
|
@ -114,7 +116,6 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
|
||||||
siteName: await site.getSiteName(),
|
siteName: await site.getSiteName(),
|
||||||
userpictureurl: site.infos.userpictureurl,
|
userpictureurl: site.infos.userpictureurl,
|
||||||
loggedOut: true, // Not used.
|
loggedOut: true, // Not used.
|
||||||
isDemoModeSite: this.isDemoModeSite,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.username = site.infos.username;
|
this.username = site.infos.username;
|
||||||
|
|
|
@ -127,7 +127,7 @@
|
||||||
</ion-thumbnail>
|
</ion-thumbnail>
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p *ngIf="site.title" class="item-heading ion-text-wrap">{{site.title}}</p>
|
<p *ngIf="site.title" class="item-heading ion-text-wrap">{{site.title}}</p>
|
||||||
<p *ngIf="site.noProtocolUrl">{{site.noProtocolUrl}}</p>
|
<p *ngIf="displaySiteUrl(site.noProtocolUrl)">{{site.noProtocolUrl}}</p>
|
||||||
<p *ngIf="site.location">{{site.location}}</p>
|
<p *ngIf="site.location">{{site.location}}</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
|
@ -629,6 +629,20 @@ export class CoreLoginSitePage implements OnInit {
|
||||||
CoreNavigator.navigate('/settings');
|
CoreNavigator.navigate('/settings');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check whether site URL should be displayed.
|
||||||
|
*
|
||||||
|
* @param siteUrl Site URL.
|
||||||
|
* @returns Whether to display URL.
|
||||||
|
*/
|
||||||
|
displaySiteUrl(siteUrl?: string): boolean {
|
||||||
|
if (!siteUrl) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CoreSites.shouldDisplayInformativeLinks(siteUrl);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -15,8 +15,9 @@
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<core-loading [hideUntil]="siteLogoLoaded && handlersLoaded">
|
<core-loading [hideUntil]="siteLogoLoaded && handlersLoaded">
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-item button class="core-usermenu-siteinfo ion-text-wrap" *ngIf="siteInfo" lines="full" detail="false" [href]="siteUrl"
|
<!-- Site info with URL and clickable. -->
|
||||||
core-link auto-login="yes">
|
<ion-item button class="core-usermenu-siteinfo ion-text-wrap" *ngIf="siteInfo && displaySiteUrl" lines="full" detail="false"
|
||||||
|
[href]="siteUrl" core-link auto-login="yes">
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<!-- Show site logo. -->
|
<!-- Show site logo. -->
|
||||||
<img class="core-usermenu-site-logo" *ngIf="siteLogo && siteLogoLoaded" [src]="siteLogo" role="presentation" alt=""
|
<img class="core-usermenu-site-logo" *ngIf="siteLogo && siteLogoLoaded" [src]="siteLogo" role="presentation" alt=""
|
||||||
|
@ -28,6 +29,19 @@
|
||||||
<a [href]="siteUrl" core-link auto-login="yes" class="core-usermenu-siteurl">{{ siteUrl }}</a>
|
<a [href]="siteUrl" core-link auto-login="yes" class="core-usermenu-siteurl">{{ siteUrl }}</a>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
<!-- Site info without URL and not clickable. -->
|
||||||
|
<ion-item class="core-usermenu-siteinfo ion-text-wrap" *ngIf="siteInfo && !displaySiteUrl" lines="full" detail="false">
|
||||||
|
<ion-label>
|
||||||
|
<!-- Show site logo. -->
|
||||||
|
<img class="core-usermenu-site-logo" *ngIf="siteLogo && siteLogoLoaded" [src]="siteLogo" role="presentation" alt=""
|
||||||
|
onError="this.class='image-not-found'">
|
||||||
|
<p class="core-usermenu-sitename">
|
||||||
|
<core-format-text [text]="siteName" contextLevel="system" [contextInstanceId]="0" [wsNotFiltered]="true">
|
||||||
|
</core-format-text>
|
||||||
|
</p>
|
||||||
|
</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
<ion-item button class="core-usermenu-handler ion-text-wrap" *ngIf="siteInfo" lines="full" (click)="openUserProfile($event)"
|
<ion-item button class="core-usermenu-handler ion-text-wrap" *ngIf="siteInfo" lines="full" (click)="openUserProfile($event)"
|
||||||
detail="true" [attr.aria-label]="'core.user.profile' | translate">
|
detail="true" [attr.aria-label]="'core.user.profile' | translate">
|
||||||
<core-user-avatar [user]="siteInfo" [userId]="siteInfo.userid" [linkProfile]="false" slot="start"></core-user-avatar>
|
<core-user-avatar [user]="siteInfo" [userId]="siteInfo.userid" [linkProfile]="false" slot="start"></core-user-avatar>
|
||||||
|
|
|
@ -49,6 +49,7 @@ export class CoreMainMenuUserMenuComponent implements OnInit, OnDestroy {
|
||||||
siteLogo?: string;
|
siteLogo?: string;
|
||||||
siteLogoLoaded = false;
|
siteLogoLoaded = false;
|
||||||
siteUrl?: string;
|
siteUrl?: string;
|
||||||
|
displaySiteUrl = false;
|
||||||
handlers: CoreUserProfileHandlerData[] = [];
|
handlers: CoreUserProfileHandlerData[] = [];
|
||||||
handlersLoaded = false;
|
handlersLoaded = false;
|
||||||
user?: CoreUserProfile;
|
user?: CoreUserProfile;
|
||||||
|
@ -70,6 +71,7 @@ export class CoreMainMenuUserMenuComponent implements OnInit, OnDestroy {
|
||||||
this.displaySwitchAccount = !currentSite.isFeatureDisabled('NoDelegate_SwitchAccount');
|
this.displaySwitchAccount = !currentSite.isFeatureDisabled('NoDelegate_SwitchAccount');
|
||||||
this.displayContactSupport = new CoreUserAuthenticatedSupportConfig(currentSite).canContactSupport();
|
this.displayContactSupport = new CoreUserAuthenticatedSupportConfig(currentSite).canContactSupport();
|
||||||
this.removeAccountOnLogout = !!CoreConstants.CONFIG.removeaccountonlogout;
|
this.removeAccountOnLogout = !!CoreConstants.CONFIG.removeaccountonlogout;
|
||||||
|
this.displaySiteUrl = CoreSites.shouldDisplayInformativeLinks(currentSite);
|
||||||
|
|
||||||
this.loadSiteLogo(currentSite);
|
this.loadSiteLogo(currentSite);
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
<p class="item-heading">{{ 'core.settings.siteinfo' | translate }}<ng-container *ngIf="deviceInfo.isPrefixedUrl">
|
<p class="item-heading">{{ 'core.settings.siteinfo' | translate }}<ng-container *ngIf="deviceInfo.isPrefixedUrl">
|
||||||
*</ng-container>
|
*</ng-container>
|
||||||
</p>
|
</p>
|
||||||
<p><a [href]="deviceInfo.siteUrl" core-link auto-login="yes">{{ deviceInfo.siteUrl }}</a></p>
|
<p *ngIf="displaySiteUrl"><a [href]="deviceInfo.siteUrl" core-link auto-login="yes">{{ deviceInfo.siteUrl }}</a></p>
|
||||||
<p *ngIf="deviceInfo.siteVersion">{{ deviceInfo.siteVersion }}</p>
|
<p *ngIf="deviceInfo.siteVersion">{{ deviceInfo.siteVersion }}</p>
|
||||||
<p *ngIf="deviceInfo.siteId">{{ deviceInfo.siteId }}</p>
|
<p *ngIf="deviceInfo.siteId">{{ deviceInfo.siteId }}</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
|
|
|
@ -76,6 +76,7 @@ export class CoreSettingsDeviceInfoPage implements OnDestroy {
|
||||||
currentLangName?: string;
|
currentLangName?: string;
|
||||||
fsClickable = false;
|
fsClickable = false;
|
||||||
showDevOptions = false;
|
showDevOptions = false;
|
||||||
|
displaySiteUrl = false;
|
||||||
protected devOptionsClickCounter = 0;
|
protected devOptionsClickCounter = 0;
|
||||||
protected devOptionsForced = false;
|
protected devOptionsForced = false;
|
||||||
protected devOptionsClickTimeout?: number;
|
protected devOptionsClickTimeout?: number;
|
||||||
|
@ -201,6 +202,7 @@ export class CoreSettingsDeviceInfoPage implements OnDestroy {
|
||||||
|
|
||||||
this.deviceInfo.siteUrl = currentSite?.getURL() || firstUrl || undefined;
|
this.deviceInfo.siteUrl = currentSite?.getURL() || firstUrl || undefined;
|
||||||
this.deviceInfo.isPrefixedUrl = !!sites.length;
|
this.deviceInfo.isPrefixedUrl = !!sites.length;
|
||||||
|
this.displaySiteUrl = !!this.deviceInfo.siteUrl && CoreSites.shouldDisplayInformativeLinks(this.deviceInfo.siteUrl);
|
||||||
|
|
||||||
if (fileProvider.isAvailable()) {
|
if (fileProvider.isAvailable()) {
|
||||||
const basepath = await fileProvider.getBasePath();
|
const basepath = await fileProvider.getBasePath();
|
||||||
|
|
|
@ -1329,7 +1329,6 @@ export class CoreSitesProvider {
|
||||||
userpictureurl: siteInfo?.userpictureurl,
|
userpictureurl: siteInfo?.userpictureurl,
|
||||||
siteHomeId: siteInfo?.siteid || 1,
|
siteHomeId: siteInfo?.siteid || 1,
|
||||||
loggedOut: !!site.loggedOut,
|
loggedOut: !!site.loggedOut,
|
||||||
isDemoModeSite,
|
|
||||||
};
|
};
|
||||||
formattedSites.push(basicInfo);
|
formattedSites.push(basicInfo);
|
||||||
}
|
}
|
||||||
|
@ -2138,6 +2137,30 @@ export class CoreSitesProvider {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check whether informative links should be displayed for a certain site, or current site.
|
||||||
|
*
|
||||||
|
* @param siteOrUrl Site instance or site URL. If not defined, current site.
|
||||||
|
* @returns Whether informative links should be displayed.
|
||||||
|
*/
|
||||||
|
shouldDisplayInformativeLinks(siteOrUrl?: CoreSite | string): boolean {
|
||||||
|
if (CoreConstants.CONFIG.hideInformativeLinks) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't display informative links for demo sites either.
|
||||||
|
siteOrUrl = siteOrUrl ?? this.getCurrentSite();
|
||||||
|
if (!siteOrUrl) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof siteOrUrl === 'string') {
|
||||||
|
return !CoreLoginHelper.isDemoModeSite(siteOrUrl);
|
||||||
|
} else {
|
||||||
|
return !siteOrUrl.isDemoModeSite();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CoreSites = makeSingleton(CoreSitesProvider);
|
export const CoreSites = makeSingleton(CoreSitesProvider);
|
||||||
|
@ -2209,7 +2232,6 @@ export type CoreSiteBasicInfo = {
|
||||||
badge?: number; // Badge to display in the site.
|
badge?: number; // Badge to display in the site.
|
||||||
siteHomeId?: number; // Site home ID.
|
siteHomeId?: number; // Site home ID.
|
||||||
loggedOut: boolean; // If Site is logged out.
|
loggedOut: boolean; // If Site is logged out.
|
||||||
isDemoModeSite: boolean;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -74,4 +74,5 @@ export interface EnvironmentConfig {
|
||||||
callWSInBackgroundExpirationTime?: number; // Ms to consider an entry expired when calling WS in background. Default: 1 week.
|
callWSInBackgroundExpirationTime?: number; // Ms to consider an entry expired when calling WS in background. Default: 1 week.
|
||||||
disableTokenFile: boolean; // Disable the use of tokenpluginfile.php for downloading files (so it fallbacks to pluginfile.php)
|
disableTokenFile: boolean; // Disable the use of tokenpluginfile.php for downloading files (so it fallbacks to pluginfile.php)
|
||||||
demoMode?: boolean; // Whether to run the app in "demo mode".
|
demoMode?: boolean; // Whether to run the app in "demo mode".
|
||||||
|
hideInformativeLinks?: boolean; // Whether to hide informative links.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue