-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Teams theme - Accessing Moodle via Teams Integration also changes the theme on web access #1278
Comments
Hi Sam. I noticed the same thing and agree that i hope this is not expected behaviour. In Teams, the o365_boost theme is set for the user session, but if roaming back and forth between Teams & Moodle and the user session has been set to display teams theme, it fails when viewing Moodle directly via browser (outside of Teams). In our case, it actually falls back to Boost theme instead of the selected site theme for some reason. |
There is a check written in to it but looks like it's failing to notice that it's no longer in an iframe/mobile app and doesn't send it through the redirect. o365-moodle/local/o365/teams_tab.php Lines 76 to 78 in cf4184d
|
Hi @sgodbehere01, @tristdac, @cbrherms As the maintainer of the plugin, I confirm this is a known issue, and a technical solution to the issue is unlikely to be available. As @tristdac pointed out, the root of the issue is Moodle saves the theme to be used when a user accesses a Moodle page in session, and would use the theme until the session expires, or a change is made to the session to tell it to use a different theme. When a user accesses a Moodle tab from teams, the user effectively visits /local/o365/teams_tab.php, and it is on this page where the theme of the session is set, which means all future Moodle page visits in the same session will use theme_boost_o365teams. There is a new setting to disable this, but that's a different topic. So this means - if a user is using Teams from a browser window (i.e. Teams web app), all direct access to the Moodle page after loading any Moodle tab will use theme_boost_o365teams. This will NOT happen if Teams desktop or mobile apps are used though, because the desktop or mobile apps uses separate browser sessions as desktop browser or mobile browsers, therefore theme session variables made from desktop or mobile apps are not used by browsers. In theory, it should be possible to perform a check to see if the user's access to Moodle is from Teams web app, and revert to the default theme if not (thus achieving reverting back to normal theme); however, this cannot be achieved in a theme plugin, and would require Moodle core code change. Considering the potential impact of this change (which will require addition checks on every Moodle page load), it's unlikely that this will be accepted by Moodle core, therefore a decision was made to keep it as is. I hope this clarify the situation about the known issue better. Regards, |
Hi @cbrherms , the code snippet you referred is used to prevent direct access to Moodle teams tab content page, which should only be accessed from either Teams web app, or desktop/mobile app. It's unrelated to the issue in this post. Regards, |
My bad. I misinterpreted while trying to connect some dots. Thanks for the in depth explanation though. It's greatly appreciated! |
Thanks for clarification @weilai-irl . A potential solution would be to do it all with css/js. So add a few lines of js to identify if the page/site is loaded within an iframe in the teams tab, and add a class to the page body. When setting the theme to use in teams, just assign the same theme you are currently using as your main theme on the site. You could then write some css based on this extra body class which looks the way you like. Ie no navbar, flatnav or block region. You could even style it in the o365 teams theme way. This way, your not changing any theme at any time and users are free to roam back and forth between Teams and Moodle without any session theme issues. Your simply adding a class to a page which renders a whole new set of styles. The main site theme we use (RemUI) has something the developer calls "focus mode" which simply adds the class "focusmode" to the body tag. It works well as a simplified version of the course page and I can force it on when viewing inside teams with a few lines of js. A standardised method like this may be difficult to implement as everyone potentially uses a different theme, but perhaps a standard Boost version could be possible. |
Hi there,
This may simply be part of how the plug-in works as intended so apologies if that's the case but I'm unsure.
When using the Teams theme via the Web app or Desktop app and accessing Moodle, if the user opens a session outside of Teams for Moodle this appears to have also changed the Moodle's theme for that user to the Teams theme until the user has both exited the Moodle tab on teams and also logged out and back onto Moodle. Should the user be able to view the Moodle outside of teams with the "normal" theme whilst simultaneously view it in teams with the teams theme?
Kind regards,
Sam
The text was updated successfully, but these errors were encountered: