MDL-64227 nextcloud: Small layout for login links

When we need to show a login link, we don't want the normal page layout because we are in an iframe
already. Use the embedded layout to reduce the clutter of the page.
This commit is contained in:
Damyon Wiese
2018-11-28 12:51:31 +08:00
parent 0225ad42ea
commit da868a1e32
+7 -3
View File
@@ -428,7 +428,7 @@ class repository_nextcloud extends repository {
}
if (!$this->client->is_logged_in()) {
$this->print_login_popup(['style' => 'margin-top: 250px']);
$this->print_login_popup(['style' => 'margin-top: 250px'], $options['embed']);
return;
}
@@ -803,8 +803,12 @@ class repository_nextcloud extends repository {
*
* @param array|null $attr Custom attributes to be applied to popup div.
*/
private function print_login_popup($attr = null) {
global $OUTPUT;
private function print_login_popup($attr = null, $embed = false) {
global $OUTPUT, $PAGE;
if ($embed) {
$PAGE->set_pagelayout('embedded');
}
$this->client = $this->get_user_oauth_client();
$url = new moodle_url($this->client->get_login_url());