web: update window title depending on active module

Fixes #4982
This commit is contained in:
Francis Lachapelle
2022-05-16 17:43:35 -04:00
parent 0cf025b0af
commit dd0730947f
12 changed files with 52 additions and 21 deletions
+5
View File
@@ -43,6 +43,11 @@
[super dealloc];
}
- (NSString *) moduleName
{
return [self commonLabelForKey: @"Administration"];
}
- (NSString *) modulePath
{
return @"Administration";
+8 -10
View File
@@ -1,7 +1,7 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
Copyright (C) 2005-2015 Inverse inc.
Copyright (C) 2005-2022 Inverse inc.
This file is part of SOGo.
@@ -91,15 +91,13 @@
NSString *pageTitle;
SOGoSystemDefaults *sd;
if ([self isUIxDebugEnabled])
pageTitle = title;
else
{
sd = [SOGoSystemDefaults sharedSystemDefaults];
pageTitle = [sd pageTitle];
if (pageTitle == nil || ![pageTitle length])
pageTitle = (@"SOGo");
}
sd = [SOGoSystemDefaults sharedSystemDefaults];
pageTitle = [sd pageTitle];
if (pageTitle == nil || ![pageTitle length])
pageTitle = (@"SOGo");
if ([title length])
pageTitle = [NSString stringWithFormat: @"%@ | %@", title, pageTitle];
return pageTitle;
}
+6 -1
View File
@@ -1,6 +1,6 @@
/* UIxContactFoldersView.m - this file is part of SOGo
*
* Copyright (C) 2006-2021 Inverse inc.
* Copyright (C) 2006-2022 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -60,6 +60,11 @@ Class SOGoContactSourceFolderK, SOGoGCSFolderK;
return self;
}
- (NSString *) moduleName
{
return [self commonLabelForKey: @"Address Book"];
}
- (NSString *) modulePath
{
return @"Contacts";
+6 -1
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 2007-2014 Inverse inc.
Copyright (C) 2007-2022 Inverse inc.
This file is part of SOGo.
@@ -74,6 +74,11 @@
[super dealloc];
}
- (NSString *) moduleName
{
return [self commonLabelForKey: @"Mail"];
}
- (NSString *) modulePath
{
return @"Mail";
+6 -1
View File
@@ -1,6 +1,6 @@
/* UIxPreferences.m - this file is part of SOGo
*
* Copyright (C) 2007-2021 Inverse inc.
* Copyright (C) 2007-2022 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -160,6 +160,11 @@ static NSArray *reminderValues = nil;
[super dealloc];
}
- (NSString *) moduleName
{
return [self commonLabelForKey: @"Preferences"];
}
- (NSString *) modulePath
{
return @"Preferences";
+7 -1
View File
@@ -1,6 +1,6 @@
/* UIxCalMainView.m - this file is part of SOGo
*
* Copyright (C) 2006-2019 Inverse inc.
* Copyright (C) 2006-2022 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -39,6 +39,12 @@
@implementation UIxCalMainView
- (NSString *) moduleName
{
return [self commonLabelForKey: @"Calendar"];
}
- (NSString *) modulePath
{
return @"Calendar";
@@ -6,7 +6,7 @@
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
className="UIxPageFrame"
title="title"
title="moduleName"
const:jsFiles="Common.js, Administration.js,
Administration.services.js, Preferences.services.js,
Contacts.services.js, Scheduler.services.js">
@@ -7,7 +7,7 @@
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
className="UIxPageFrame"
title="title"
title="moduleName"
const:jsFiles="vendor/ckeditor/ckeditor.js, Common/sgCkeditor.component.js, Common.js, Preferences.services.js, Mailer.services.js, Contacts.js, Contacts.services.js, vendor/angular-file-upload.min.js, vendor/FileSaver.min.js">
<script type="text/javascript">
var contactFolders = <var:string value="contactFolders.jsonRepresentation" const:escapeHTML="NO" />;
+1 -1
View File
@@ -7,7 +7,7 @@
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
className="UIxPageFrame"
title="title"
title="moduleName"
const:jsFiles="vendor/ckeditor/ckeditor.js, Common/sgCkeditor.component.js, Common.js, Preferences.services.js, Contacts.services.js, Scheduler.services.js, Mailer.js, Mailer.services.js, vendor/angular-file-upload.min.js, vendor/FileSaver.min.js">
<script type="text/javascript">
var mailAccounts = <var:string value="mailAccounts" const:escapeHTML="NO" />;
@@ -7,7 +7,7 @@
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
className="UIxPageFrame"
title="title"
title="moduleName"
const:jsFiles="vendor/ckeditor/ckeditor.js, Common/sgCkeditor.component.js, vendor/angular-file-upload.min.js, vendor/ng-sortable.min.js, vendor/qrcode.min.js, Common.js, Preferences.js, Preferences.services.js, Mailer.services.js, Contacts.services.js">
<main layout-fill="layout-fill" ui-view="preferences"
+1 -1
View File
@@ -7,7 +7,7 @@
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
className="UIxPageFrame"
title="title"
title="moduleName"
const:jsFiles="vendor/ckeditor/ckeditor.js, vendor/ng-sortable.min.js, Common/sgCkeditor.component.js, Common.js, Preferences.services.js, Contacts.services.js, Mailer.services.js, vendor/angular-file-upload.min.js, Scheduler.js, Scheduler.services.js, vendor/FileSaver.min.js">
<script type="text/javascript">
var firstDayOfWeek = <var:string value="firstDayOfWeek"/>;
@@ -8,7 +8,8 @@
*/
AddressBookController.$inject = ['$scope', '$q', '$window', '$state', '$timeout', '$mdDialog', '$mdToast', 'Account', 'Card', 'AddressBook', 'sgFocus', 'Dialog', 'sgConstant', 'sgHotkeys', 'stateAddressbooks', 'stateAddressbook'];
function AddressBookController($scope, $q, $window, $state, $timeout, $mdDialog, $mdToast, Account, Card, AddressBook, focus, Dialog, sgConstant, sgHotkeys, stateAddressbooks, stateAddressbook) {
var vm = this, hotkeys = [], sortLabels;
var vm = this, hotkeys = [], sortLabels,
defaultWindowTitle = angular.element($window.document).find('title').attr('sg-default') || "SOGo";
sortLabels = {
c_cn: 'Name',
@@ -36,8 +37,14 @@
sgHotkeys.deregisterHotkey(key);
});
});
};
// Update window's title with name of selected addressbook
$scope.$watch(function() { return vm.selectedFolder.name; }, function(selectedAddressbookName) {
var title = selectedAddressbookName;
title += ' | ' + defaultWindowTitle;
$window.document.title = title;
});
};
function _registerHotkeys(keys) {
keys.push(sgHotkeys.createHotkey({