зеркало из
1
0
Форкнуть 0

PR#277: Add Microsoft Teams Integration

This commit is contained in:
Tomasz Muras 2018-11-22 15:09:20 +01:00 коммит произвёл James McQuillan
Коммит 2f0e7d9749
75 изменённых файлов: 6656 добавлений и 0 удалений

3
README.md Normal file
Просмотреть файл

@ -0,0 +1,3 @@
# Installation
Copy the content of the repository into theme/boost_o365teams directory.
Follow https://docs.moodle.org/35/en/Installing_plugins#Installing_manually_at_the_server .

Просмотреть файл

@ -0,0 +1,45 @@
define(['jquery'], function ($) {
return {
init: function() {
if (window.location == window.parent.location) {
// not in iframe, show page elements
$('nav.navbar').show();
$('nav.navbar').css('display', 'flex');
$('div#nav-drawer').show();
$('section[data-region="blocks-column"]').show();
$('footer#page-footer').show();
$('div#course_page_title').css('display', 'none');
$('.popupicon').css('display', 'none');
} else {
// in iframe, hide page elements
$('body.drawer-open-left').css('margin-left', '0');
$('div#page').css('margin-top', '0');
$('section#region-main.has-blocks').css('width', '100%');
$('div#page-wrapper').css('margin-bottom', '0');
$('div.context-header-settings-menu').remove();
$('div.region-main-settings-menu').remove();
$('div.region_main_settings_menu_proxy').remove();
$('div.action-menu-trigger').remove();
$('div.ml-auto').remove();
$('a.printicon').remove();
$('header#page-header').css('display', 'none');
$('.activityinstance a').click(function() {
$(this).attr('target', '_blank');
});
$('.modtype_assign .activityinstance a').click(function() {
$(this).attr('target', '_self');
});
$('.modtype_quiz .activityinstance a').click(function() {
$(this).attr('target', '_self');
});
$('#page-mod-assign-view .submissionlinks a').click(function() {
$(this).attr('target', '_blank');
});
$('.quizattempt .singlebutton form').click(function() {
$(this).attr('target', '_blank');
});
}
$("body").fadeIn(150);
}
}
});

Просмотреть файл

@ -0,0 +1,19 @@
define(['jquery'], function($) {
return {
init: function() {
microsoftTeams.initialize();
microsoftTeams.getContext(function (context) {
theme = context.theme;
$("body").addClass("theme_" + theme);
});
microsoftTeams.registerOnThemeChangeHandler(function (theme) {
$("body").removeClass("theme_default");
$("body").removeClass("theme_dark");
$("body").removeClass("theme_contrast");
$("body").addClass("theme_" + theme);
});
}
}
});

45
amd/src/iframeChecker.js Normal file
Просмотреть файл

@ -0,0 +1,45 @@
define(['jquery'], function ($) {
return {
init: function() {
if (window.location == window.parent.location) {
// not in iframe, show page elements
$('nav.navbar').show();
$('nav.navbar').css('display', 'flex');
$('div#nav-drawer').show();
$('section[data-region="blocks-column"]').show();
$('footer#page-footer').show();
$('div#course_page_title').css('display', 'none');
$('.popupicon').css('display', 'none');
} else {
// in iframe, hide page elements
$('body.drawer-open-left').css('margin-left', '0');
$('div#page').css('margin-top', '0');
$('section#region-main.has-blocks').css('width', '100%');
$('div#page-wrapper').css('margin-bottom', '0');
$('div.context-header-settings-menu').remove();
$('div.region-main-settings-menu').remove();
$('div.region_main_settings_menu_proxy').remove();
$('div.action-menu-trigger').remove();
$('div.ml-auto').remove();
$('a.printicon').remove();
$('header#page-header').css('display', 'none');
$('.activityinstance a').click(function() {
$(this).attr('target', '_blank');
});
$('.modtype_assign .activityinstance a').click(function() {
$(this).attr('target', '_self');
});
$('.modtype_quiz .activityinstance a').click(function() {
$(this).attr('target', '_self');
});
$('#page-mod-assign-view .submissionlinks a').click(function() {
$(this).attr('target', '_blank');
});
$('.quizattempt .singlebutton form').click(function() {
$(this).attr('target', '_blank');
});
}
$("body").fadeIn(150);
}
}
});

Просмотреть файл

@ -0,0 +1,19 @@
define(['jquery'], function($) {
return {
init: function() {
microsoftTeams.initialize();
microsoftTeams.getContext(function (context) {
theme = context.theme;
$("body").addClass("theme_" + theme);
});
microsoftTeams.registerOnThemeChangeHandler(function (theme) {
$("body").removeClass("theme_default");
$("body").removeClass("theme_dark");
$("body").removeClass("theme_contrast");
$("body").addClass("theme_" + theme);
});
}
}
});

Просмотреть файл

@ -0,0 +1,151 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace theme_boost_o365teams\output;
use coding_exception;
use html_writer;
use tabobject;
use tabtree;
use custom_menu_item;
use custom_menu;
use block_contents;
use navigation_node;
use action_link;
use stdClass;
use moodle_url;
use preferences_groups;
use action_menu;
use help_icon;
use single_button;
use paging_bar;
use context_course;
use pix_icon;
defined('MOODLE_INTERNAL') || die;
class core_renderer extends \theme_boost\output\core_renderer {
/**
* Return header html.
* The header section includes custom content security policy setting, as well as reference to Microsoft teams JS
* lib.
*
* @return string
*/
public function standard_head_html() {
$output = parent::standard_head_html();
$output .= "<meta http-equiv=\"Content-Security-Policy\" content=\"default-src *; style-src 'self'
'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://statics.teams.microsoft.com;
font-src data: *\">\n";
$output .= "<script src=\"https://statics.teams.microsoft.com/sdk/v1.0/js/MicrosoftTeams.min.js\"></script>\n";
return $output;
}
/**
* Return HTML that shows logged in user link.
*
* @return string
* @throws \moodle_exception
*/
public function user_link() {
global $USER, $OUTPUT;
if (!empty($USER->id)) {
$profilepagelink = new moodle_url('/user/profile.php',
array('id' => $USER->id));
$profilepic = $OUTPUT->user_picture($USER, array('size' => 26, 'link' => false));
$userfullname = fullname($USER);
$piclink = html_writer::link($profilepagelink, $profilepic,
array('target' => '_blank', 'class' => 'user_details'));
$userprofile = html_writer::link($profilepagelink, $userfullname,
array('target' => '_blank'));
return $piclink . $userprofile;
} else {
return "";
}
}
/**
* Return page footer.
* Page footer contains JS calls to microsoft Teams JS lib.
*
* @return string
*/
public function footer() {
$footer = parent::footer();
$js = 'microsoftTeams.initialize();';
$footer .= html_writer::script($js);
return $footer;
}
/**
* Return HTML for feedback link.
*
* @return string
* @throws coding_exception
*/
public function feedback_link() {
$feedbacklink = '';
// Hardcoded URL.
$feedbacklinksetting = 'https://microsoftteams.uservoice.com/forums/916759-moodle';
if ($feedbacklinksetting) {
$feedbacklink = html_writer::link($feedbacklinksetting,
html_writer::tag('span',
get_string('feedback', 'theme_boost_o365teams')),
array('target' => '_blank', 'class' => 'feedbacklink',
'title' => get_string('share_feedback', 'theme_boost_o365teams')));
}
return $feedbacklink;
}
/**
* Return page footer stamp.
* Stamp is from user upload in theme settings, or Moodle logo if not uploaded.
*
* @return string
* @throws \moodle_exception
*/
public function get_footer_stamp() {
global $CFG, $PAGE, $OUTPUT;
if (!empty($PAGE->theme->setting_file_url('footer_stamp', 'footer_stamp'))) {
$fileurl = $PAGE->theme->setting_file_url('footer_stamp', 'footer_stamp');
// Get a URL suitable for moodle_url.
$relativebaseurl = preg_replace('|^https?://|i', '//', $CFG->wwwroot);
$relativefileurl = str_replace($relativebaseurl, '', $fileurl);
$url = new moodle_url($relativefileurl);
$img = html_writer::empty_tag('img', array("src" => $url));
$coursepageurl = $this->page->url;
$stamp = html_writer::link($coursepageurl, $img, array('target' => '_blank', 'class' => 'stamp'));
} else {
$img = html_writer::empty_tag('img', array("src" => $OUTPUT->image_url('moodlelogo', 'theme')));
$coursepageurl = $this->page->url;
$stamp = html_writer::link($coursepageurl, $img, array('target' => '_blank', 'class' => 'stamp'));
}
return $stamp;
}
}

148
config.php Normal file
Просмотреть файл

@ -0,0 +1,148 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Boost o365teams.
*
* @package theme_boost_o365teams
* @copyright 2018 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once(__DIR__ . '/lib.php');
$THEME->name = 'boost_o365teams';
$THEME->sheets = ['custom'];
$THEME->editor_sheets = [];
$THEME->parents = ['boost'];
$THEME->enable_dock = false;
$THEME->yuicssmodules = array();
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
$THEME->requiredblocks = '';
$THEME->addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;
$THEME->layouts = [
// Most backwards compatible layout without the blocks - this is the layout used by default.
'base' => array(
'file' => 'columns1.php',
'regions' => array(),
),
// Standard layout with blocks, this is recommended for most pages with general information.
'standard' => array(
'file' => 'columns2.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
),
// Main course page.
'course' => array(
'file' => 'columns2.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
'options' => array('langmenu' => true),
),
'coursecategory' => array(
'file' => 'columns2.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
),
// Part of course, typical for modules - default page layout if $cm specified in require_login().
'incourse' => array(
'file' => 'columns2.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
),
// The site home page.
'frontpage' => array(
'file' => 'columns2.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
'options' => array('nonavbar' => true),
),
// Server administration scripts.
'admin' => array(
'file' => 'columns2.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
),
// My dashboard page.
'mydashboard' => array(
'file' => 'columns2.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
'options' => array('nonavbar' => true, 'langmenu' => true),
),
// My public page.
'mypublic' => array(
'file' => 'columns2.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
),
'login' => array(
'file' => 'login.php',
'regions' => array(),
'options' => array('langmenu' => true),
),
// Pages that appear in pop-up windows - no navigation, no blocks, no header.
'popup' => array(
'file' => 'columns1.php',
'regions' => array(),
'options' => array('nofooter' => true, 'nonavbar' => true),
),
// No blocks and minimal footer - used for legacy frame layouts only!
'frametop' => array(
'file' => 'columns1.php',
'regions' => array(),
'options' => array('nofooter' => true, 'nocoursefooter' => true),
),
// Embeded pages, like iframe/object embeded in moodleform - it needs as much space as possible.
'embedded' => array(
'file' => 'embedded.php',
'regions' => array()
),
// Used during upgrade and install, and for the 'This site is undergoing maintenance' message.
// This must not have any blocks, links, or API calls that would lead to database or cache interaction.
// Please be extremely careful if you are modifying this layout.
'maintenance' => array(
'file' => 'maintenance.php',
'regions' => array(),
),
// Should display the content and basic headers only.
'print' => array(
'file' => 'columns1.php',
'regions' => array(),
'options' => array('nofooter' => true, 'nonavbar' => false),
),
// The pagelayout used when a redirection is occuring.
'redirect' => array(
'file' => 'embedded.php',
'regions' => array(),
),
// The pagelayout used for reports.
'report' => array(
'file' => 'columns2.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
),
// The pagelayout used for safebrowser and securewindow.
'secure' => array(
'file' => 'secure.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre'
)
];

Двоичные данные
fonts/TeamsAssets-Light.eot Normal file

Двоичный файл не отображается.

2499
fonts/TeamsAssets-Light.svg Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

После

Ширина:  |  Высота:  |  Размер: 452 KiB

Двоичные данные
fonts/TeamsAssets-Light.ttf Normal file

Двоичный файл не отображается.

Двоичные данные
fonts/TeamsAssets-Light.woff Normal file

Двоичный файл не отображается.

Двоичные данные
fonts/TeamsAssets-Light.woff2 Normal file

Двоичный файл не отображается.

Двоичные данные
fonts/TeamsAssets-Regular.eot Normal file

Двоичный файл не отображается.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

После

Ширина:  |  Высота:  |  Размер: 372 KiB

Двоичные данные
fonts/TeamsAssets-Regular.ttf Normal file

Двоичный файл не отображается.

Двоичные данные
fonts/TeamsAssets-Regular.woff Normal file

Двоичный файл не отображается.

Двоичные данные
fonts/TeamsAssets-Regular.woff2 Normal file

Двоичный файл не отображается.

Двоичные данные
fonts/segoeui.ttf Normal file

Двоичный файл не отображается.

Двоичные данные
fonts/segoeuib.ttf Normal file

Двоичный файл не отображается.

Двоичные данные
fonts/segoeuil.ttf Normal file

Двоичный файл не отображается.

Двоичные данные
fonts/segoeuisl.ttf Normal file

Двоичный файл не отображается.

Двоичные данные
fonts/seguisb.ttf Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,41 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Boost o365teams.
*
* @package theme_boost_o365teams
* @copyright 2018 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['choosereadme'] = 'Boost o365teams is a modern highly-customisable theme. This theme is intended to be used directly, or as a parent theme when creating new themes utilising Bootstrap 4.';
$string['pluginname'] = 'Boost Office365 Teams';
$string['region-side-pre'] = 'Right';
$string['placementfrontpage'] = 'Front page';
$string['editcourse'] = 'Edit course';
$string['footer_stamp_title'] = "Tabs Footer Stamp";
$string['footer_stamp_desc'] = "Displays Image or logo at bottom right of tabs.<br/>(Max-Height: 60px)";
$string['share_feedback'] = 'Share feedback';
$string['feedback'] = 'Feedback';
$string['edit_course'] = 'Edit course in browser window';
$string['open_course'] = 'Open course in browser window';
$string['navigatereturn'] = 'Return to quiz menu';

66
layout/columns2.php Normal file
Просмотреть файл

@ -0,0 +1,66 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* A two column layout for the boost theme.
*
* @package theme_boost_o365teams
* @copyright 2018 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
user_preference_allow_ajax_update('drawer-open-nav', PARAM_ALPHA);
require_once($CFG->libdir . '/behat/lib.php');
if (isloggedin()) {
$navdraweropen = (get_user_preferences('drawer-open-nav', 'true') == 'true');
} else {
$navdraweropen = false;
}
$extraclasses = [];
if ($navdraweropen) {
$extraclasses[] = 'drawer-open-left';
}
$bodyattributes = $OUTPUT->body_attributes($extraclasses);
$blockshtml = $OUTPUT->blocks('side-pre');
$hasblocks = strpos($blockshtml, 'data-block=') !== false;
$regionmainsettingsmenu = $OUTPUT->region_main_settings_menu();
$coursepage = $CFG->wwwroot . '/course/view.php?id=' . $PAGE->course->id;
$url = $PAGE->url;
$iscourseoverview = false;
if ((strpos($url, 'course/view.php') !== false) && (strpos($url, 'section=') == false)) {
$iscourseoverview = false;
} else {
$iscourseoverview = true;
}
$templatecontext = [
'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]),
'output' => $OUTPUT,
'sidepreblocks' => $blockshtml,
'hasblocks' => $hasblocks,
'bodyattributes' => $bodyattributes,
'navdraweropen' => $navdraweropen,
'regionmainsettingsmenu' => $regionmainsettingsmenu,
'hasregionmainsettingsmenu' => !empty($regionmainsettingsmenu),
'course_page' => $coursepage,
'is_course_overview' => $iscourseoverview,
];
$templatecontext['flatnavigation'] = $PAGE->flatnav;
echo $OUTPUT->render_from_template('theme_boost_o365teams/columns2', $templatecontext);

36
layout/login.php Normal file
Просмотреть файл

@ -0,0 +1,36 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* A login page layout for the boost theme.
*
* @package theme_boost_o365teams
* @copyright 2018 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$bodyattributes = $OUTPUT->body_attributes();
$templatecontext = [
'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]),
'output' => $OUTPUT,
'bodyattributes' => $bodyattributes
];
echo $OUTPUT->render_from_template('theme_boost_o365teams/login', $templatecontext);

57
lib.php Normal file
Просмотреть файл

@ -0,0 +1,57 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Boost o365teams.
*
* @package theme_boost_o365teams
* @copyright 2018 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
use theme_boost_o365teams\css_processor;
/**
* Serve any files associated with the theme settings.
*
* @param stdClass $course
* @param stdClass $cm
* @param context $context
* @param string $filearea
* @param array $args
* @param bool $forcedownload
* @param array $options
* @return bool
*/
function theme_boost_o365teams_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options = array()) {
static $theme;
if (empty($theme)) {
$theme = theme_config::load('boost_o365teams');
}
if ($context->contextlevel == CONTEXT_SYSTEM) {
if ($filearea === 'footer_stamp') {
return $theme->setting_file_serve('footer_stamp', $args, $forcedownload, $options);
} else {
send_file_not_found();
}
} else {
send_file_not_found();
}
}

Двоичные данные
pix/favicon.ico Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Двоичные данные
pix/moodlelogo.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.9 KiB

Двоичные данные
pix/screenshot.jpg Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 135 KiB

Двоичные данные
pix_core/f/document-128.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 7.9 KiB

Двоичные данные
pix_core/f/document-24.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 585 B

Двоичные данные
pix_core/f/document-256.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 15 KiB

Двоичные данные
pix_core/f/document-32.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.6 KiB

Двоичные данные
pix_core/f/document-48.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.8 KiB

Двоичные данные
pix_core/f/document-64.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.9 KiB

Двоичные данные
pix_core/f/document-72.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.0 KiB

Двоичные данные
pix_core/f/document-80.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.8 KiB

Двоичные данные
pix_core/f/document-96.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.1 KiB

Двоичные данные
pix_core/f/document.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.4 KiB

Двоичные данные
pix_core/f/pdf-128.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 14 KiB

Двоичные данные
pix_core/f/pdf-24.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.9 KiB

Двоичные данные
pix_core/f/pdf-256.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 31 KiB

Двоичные данные
pix_core/f/pdf-32.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.5 KiB

Двоичные данные
pix_core/f/pdf-48.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.2 KiB

Двоичные данные
pix_core/f/pdf-64.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.6 KiB

Двоичные данные
pix_core/f/pdf-72.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 6.6 KiB

Двоичные данные
pix_core/f/pdf-80.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 7.7 KiB

Двоичные данные
pix_core/f/pdf-96.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 10 KiB

Двоичные данные
pix_core/f/pdf.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.3 KiB

Двоичные данные
pix_core/f/powerpoint-128.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 7.8 KiB

Двоичные данные
pix_core/f/powerpoint-24.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 540 B

Двоичные данные
pix_core/f/powerpoint-256.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 13 KiB

Двоичные данные
pix_core/f/powerpoint-32.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.7 KiB

Двоичные данные
pix_core/f/powerpoint-48.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.8 KiB

Двоичные данные
pix_core/f/powerpoint-64.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.9 KiB

Двоичные данные
pix_core/f/powerpoint-72.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.0 KiB

Двоичные данные
pix_core/f/powerpoint-80.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.8 KiB

Двоичные данные
pix_core/f/powerpoint-96.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.2 KiB

Двоичные данные
pix_core/f/powerpoint.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.4 KiB

Двоичные данные
pix_core/f/spreadsheet-128.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 10 KiB

Двоичные данные
pix_core/f/spreadsheet-24.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 543 B

Двоичные данные
pix_core/f/spreadsheet-256.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 11 KiB

Двоичные данные
pix_core/f/spreadsheet-32.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.6 KiB

Двоичные данные
pix_core/f/spreadsheet-48.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.8 KiB

Двоичные данные
pix_core/f/spreadsheet-64.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Двоичные данные
pix_core/f/spreadsheet-72.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.0 KiB

Двоичные данные
pix_core/f/spreadsheet-80.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 6.4 KiB

Двоичные данные
pix_core/f/spreadsheet-96.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.1 KiB

Двоичные данные
pix_core/f/spreadsheet.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.4 KiB

308
renderers.php Normal file
Просмотреть файл

@ -0,0 +1,308 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Boost o365teams.
*
* @package theme_boost_o365teams
* @copyright 2018 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/course/renderer.php');
require_once($CFG->dirroot . '/mod/assign/renderer.php');
require_once($CFG->dirroot . '/mod/quiz/renderer.php');
class theme_boost_o365teams_mod_assign_renderer extends mod_assign_renderer {
/**
* Render the header.
*
* @param assign_header $header
* @return string
*/
public function render_assign_header(assign_header $header) {
$o = '';
if ($header->subpage) {
$this->page->navbar->add($header->subpage);
}
$heading = format_string($header->assign->name, false, array('context' => $header->context));
$this->page->set_title($heading);
$this->page->set_heading($this->page->course->fullname);
$o .= $this->output->header();
if ($header->preface) {
$o .= $header->preface;
}
if ($header->showintro) {
$o .= $this->output->box_start('generalbox boxaligncenter', 'intro');
$o .= format_module_intro('assign', $header->assign, $header->coursemoduleid);
$o .= $header->postfix;
$o .= $this->output->box_end();
}
return $o;
}
}
class theme_boost_o365teams_core_course_renderer extends core_course_renderer {
public function course_section_cm($course, &$completioninfo, cm_info $mod, $sectionreturn, $displayoptions = array()) {
$output = '';
// We return empty string (because course module will not be displayed at all) if
// 1) The activity is not visible to users; and
// 2) The 'availableinfo' is empty, i.e. the activity was
// hidden in a way that leaves no info, such as using the
// eye icon.
if (!$mod->is_visible_on_course_page()) {
return $output;
}
$indentclasses = 'mod-indent';
if (!empty($mod->indent)) {
$indentclasses .= ' mod-indent-' . $mod->indent;
if ($mod->indent > 15) {
$indentclasses .= ' mod-indent-huge';
}
}
$output .= html_writer::start_tag('div');
if ($this->page->user_is_editing()) {
$output .= course_get_cm_move($mod, $sectionreturn);
}
$output .= html_writer::start_tag('div', array('class' => 'mod-indent-outer'));
// This div is used to indent the content.
$output .= html_writer::div('', $indentclasses);
// Start a wrapper for the actual content to keep the indentation consistent.
$output .= html_writer::start_tag('div');
// If there is content but NO link (eg label),
// then display the content here (BEFORE any icons).
// In this case cons must be
// displayed after the content so that it makes more sense visually
// and for accessibility reasons, e.g. if you have a one-line label
// it should work similarly (at least in terms of ordering) to an
// activity.
$contentpart = $this->course_section_cm_text($mod, $displayoptions);
$url = $mod->url;
$modicons = '';
if ($this->page->user_is_editing()) {
$editactions = course_get_cm_edit_actions($mod, $mod->indent, $sectionreturn);
$modicons .= ' ' . $this->course_section_cm_edit_actions($editactions, $mod, $displayoptions);
$modicons .= $mod->afterediticons;
}
$modicons .= $this->course_section_cm_completion($course, $completioninfo, $mod, $displayoptions);
if (!empty($modicons)) {
$output .= html_writer::span($modicons, 'actions');
}
// Display the link to the module (or do nothing if module has no url).
$cmname = $this->course_section_cm_name($mod, $displayoptions);
if (!empty($cmname)) {
// Start the div for the activity title, excluding the edit icons.
$output .= html_writer::start_tag('div', array('class' => 'activityinstance'));
$output .= $cmname;
// Module can put text after the link (e.g. forum unread).
$output .= $mod->afterlink;
// Closing the tag which contains everything but edit icons. Content part of the module should not be part of this.
$output .= html_writer::end_tag('div');
}
if (empty($url)) {
$output .= $contentpart;
}
// Show availability info (if module is not available).
$output .= $this->course_section_cm_availability($mod, $displayoptions);
// If there is content AND a link, then display the content here
// (AFTER any icons). Otherwise it was displayed before.
if (!empty($url)) {
$output .= $contentpart;
}
$output .= html_writer::end_tag('div');
// End of indentation div.
$output .= html_writer::end_tag('div');
$output .= html_writer::end_tag('div');
return $output;
}
public function course_section_cm_name_title(cm_info $mod, $displayoptions = array()) {
$output = '';
$url = $mod->url;
if (!$mod->is_visible_on_course_page() || !$url) {
// Nothing to be displayed to the user.
return $output;
}
// Accessibility: for files get description via icon, this is very ugly hack!
$instancename = $mod->get_formatted_name();
$altname = $mod->modfullname;
// Avoid unnecessary duplication: if e.g. a forum name already
// includes the word forum (or Forum, etc) then it is unhelpful
// to include that in the accessible description that is added.
if (false !== strpos(core_text::strtolower($instancename),
core_text::strtolower($altname))) {
$altname = '';
}
// File type after name, for alphabetic lists (screen reader).
if ($altname) {
$altname = get_accesshide(' ' . $altname);
}
list($linkclasses, $textclasses) = $this->course_section_cm_classes($mod);
// Get on-click attribute value if specified and decode the onclick - it
// has already been encoded for display (puke).
$onclick = htmlspecialchars_decode($mod->onclick, ENT_QUOTES);
// Display link itself.
$activitylink = html_writer::empty_tag('img', array('src' => $mod->get_icon_url(),
'class' => 'iconlarge activityicon', 'alt' => ' ', 'role' => 'presentation')) .
html_writer::tag('span', $instancename . $altname, array('class' => 'instancename')) .
html_writer::tag('span', '', array('class' => 'fa fa-external-link popupicon'));
if ($mod->uservisible) {
$output .= html_writer::link($url, $activitylink, array('class' => $linkclasses, 'onclick' => $onclick));
} else {
// We may be displaying this just in order to show information
// about visibility, without the actual link ($mod->is_visible_on_course_page()).
$output .= html_writer::tag('div', $activitylink, array('class' => $textclasses));
}
return $output;
}
}
class theme_boost_o365teams_mod_quiz_renderer extends mod_quiz_renderer {
/**
* Ouputs the form for making an attempt
*
* @param quiz_attempt $attemptobj
* @param int $page Current page number
* @param array $slots Array of integers relating to questions
* @param int $id ID of the attempt
* @param int $nextpage Next page number
*/
public function attempt_form($attemptobj, $page, $slots, $id, $nextpage) {
$output = '';
// Start the form.
$output .= html_writer::start_tag('form',
array('action' => new moodle_url($attemptobj->processattempt_url(),
array('cmid' => $attemptobj->get_cmid())), 'method' => 'post',
'enctype' => 'multipart/form-data', 'accept-charset' => 'utf-8',
'id' => 'responseform'));
$output .= html_writer::start_tag('div');
// Print all the questions.
foreach ($slots as $slot) {
$output .= $attemptobj->render_question($slot, false, $this,
$attemptobj->attempt_url($slot, $page), $this);
}
$navmethod = $attemptobj->get_quiz()->navmethod;
$output .= $this->attempt_navigation_buttons_with_link($page, $attemptobj->is_last_page($page), $navmethod,
$attemptobj->view_url());
// Some hidden fields to trach what is going on.
$output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'attempt',
'value' => $attemptobj->get_attemptid()));
$output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'thispage',
'value' => $page, 'id' => 'followingpage'));
$output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'nextpage',
'value' => $nextpage));
$output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'timeup',
'value' => '0', 'id' => 'timeup'));
$output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey',
'value' => sesskey()));
$output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'scrollpos',
'value' => '', 'id' => 'scrollpos'));
// Add a hidden field with questionids. Do this at the end of the form, so
// if you navigate before the form has finished loading, it does not wipe all
// the student's answers.
$output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'slots',
'value' => implode(',', $attemptobj->get_active_slots($page))));
// Finish the form.
$output .= html_writer::end_tag('div');
$output .= html_writer::end_tag('form');
$output .= $this->connection_warning();
return $output;
}
/**
* Display the prev/next buttons that go at the bottom of each page of the attempt.
* A new "return to quiz menu" button is added in the custom renderer function.
*
* This function is created based on attemp_navigation_buttons() function of parent class.
*
* @param int $page the page number. Starts at 0 for the first page.
* @param bool $lastpage is this the last page in the quiz?
* @param string $navmethod Optional quiz attribute, 'free' (default) or 'sequential'
* @param string|bool $viewurl URL to the view quiz page.
* @return string HTML fragment.
*/
protected function attempt_navigation_buttons_with_link($page, $lastpage, $navmethod = 'free', $viewurl = null) {
$output = '';
$output .= html_writer::start_tag('div', array('class' => 'submitbtns submitbtns_with_return'));
if ($page > 0 && $navmethod == 'free') {
$output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'previous',
'value' => get_string('navigateprevious', 'quiz'), 'class' => 'mod_quiz-prev-nav btn btn-secondary'));
}
if ($lastpage) {
$nextlabel = get_string('endtest', 'quiz');
} else {
$nextlabel = get_string('navigatenext', 'quiz');
}
$output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'next',
'value' => $nextlabel, 'class' => 'mod_quiz-next-nav btn btn-primary'));
if ($viewurl) {
// Return button.
$output .= html_writer::link($viewurl, get_string('navigatereturn', 'theme_boost_o365teams'),
array('class' => 'btn btn-secondary mod_quiz-return-nav'));
}
$output .= html_writer::end_tag('div');
return $output;
}
public function no_questions_message($canedit, $editurl) {
$output = '';
$output .= $this->notification(get_string('noquestions', 'quiz'));
if ($canedit) {
$output .= $this->single_button($editurl, get_string('editquiz', 'quiz'), 'get', array("primary" => true));
}
return $output;
}
}

54
settings.php Normal file
Просмотреть файл

@ -0,0 +1,54 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Boost o365teams.
*
* @package theme_boost_o365teams
* @copyright 2018 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
use theme_boost_o365teams\css_processor;
if ($ADMIN->fulltree) {
$themename = 'boost_o365teams';
$themedir = $CFG->dirroot . '/theme/' . $themename;
$component = 'theme_' . $themename;
$theme = theme_config::load($themename);
// If theme is being installed for the first time, show all settings and expand all collapsible containers.
// This will prevent uninitialized defaults.
$wasinstalled = (isset ($theme->settings->enablestyleoverrides)) ? true : false;
$settings = new theme_boost_admin_settingspage_tabs('themesettingboost_o365teams', get_string('configtitle', 'theme_boost'));
// Add logo stamp.
$name = "theme_boost_o365teams/footer_stamp";
$title = get_string('footer_stamp_title', 'theme_boost_o365teams');
$description = get_string('footer_stamp_desc', 'theme_boost_o365teams');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'footer_stamp');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
$settings->add($page);
}

728
style/custom.css Normal file
Просмотреть файл

@ -0,0 +1,728 @@
@font-face { /* where FontName and fontname represents the name of the font you want to add */
font-family: 'Segoe UI';
src: url([[font:theme|segoeui.ttf]]) format('truetype');
font-weight: 400;
font-style: normal;
}
@font-face { /* where FontName and fontname represents the name of the font you want to add */
font-family: 'Segoe UIB';
src: url([[font:theme|segoeuib.ttf]]) format('truetype');
font-weight: 700;
font-style: normal;
}
@font-face { /* where FontName and fontname represents the name of the font you want to add */
font-family: 'Segoe UIL';
src: url([[font:theme|segoeuil.ttf]]) format('truetype');
font-weight: 100;
font-style: normal;
}
@font-face { /* where FontName and fontname represents the name of the font you want to add */
font-family: 'Segoe UISL';
src: url([[font:theme|segoeuisl.ttf]]) format('truetype');
font-weight: 300;
font-style: normal;
}
@font-face { /* where FontName and fontname represents the name of the font you want to add */
font-family: 'Segoe UISB';
src: url([[font:theme|seguisb.ttf]]) format('truetype');
font-weight: 600;
font-style: normal;
}
body {
font-family: "Segoe UI","Helvetica Neue","Apple Color Emoji","Segoe UI Emoji",Helvetica,Arial,sans-serif;
}
div.felement select option {
font-family: "Segoe UI","Helvetica Neue","Apple Color Emoji","Segoe UI Emoji",Helvetica,Arial,sans-serif;
}
form .felement input {
font-family: "Segoe UI","Helvetica Neue","Apple Color Emoji","Segoe UI Emoji",Helvetica,Arial,sans-serif;
}
/* topics format START */
.format-topics.path-course-view .completionprogress {
float: left;
}
.format-topics .section .activity {
background-color: #ffffff;
padding: 10px;
padding-left: 20px;
margin-top: 2px;
}
.theme_dark.format-topics .section .activity {
background-color: #2d2c2c;
}
.theme_contrast.format-topics .section .activity {
background-color: #000000;
}
.format-topics .sectionname {
font-size: 1em;
}
.format-topics #completionprogressid {
display: none;
}
.format-topics .section_availability .ishidden {
padding-left: 32px;
}
.format-topics .availabilityinfo.ishidden {
display: none;
}
/*topics format END */
/* weeks format START */
.format-weeks.path-course-view .completionprogress {
float: left;
}
.format-weeks .weeks .section .activity{
background-color: #ffffff;
padding: 10px;
padding-left: 20px;
margin-top: 2px;
}
.theme_dark.format-weeks .weeks .section .activity {
background-color: #2d2c2c;
}
.theme_contrast.format-weeks .weeks .section .activity {
background-color: #000000;
}
.format-weeks .weeks .sectionname {
font-size: 1em;
}
.format-weeks .course-content .current::before {
border: 0px;
}
.format-weeks .section_availability .ishidden {
padding-left: 32px;
}
.format-weeks .availabilityinfo.ishidden {
display: none;
}
/* weeks format END */
/* collapsable topics format START */
.format-collapsibletopics.path-course-view .completionprogress {
float: left;
}
.course-content ul.collapsibletopics li.section ul.section {
padding-left: 0px;
}
.format-collapsibletopics .section .activity {
background-color: #ffffff;
padding: 10px;
padding-left: 20px;
margin-top: 2px;
}
.theme_dark.format-collapsibletopics .section .activity {
background-color: #2d2c2c;
}
.theme_contrast .format-collapsibletopics .section .activity {
background-color: #000000;
}
.format-collapsibletopics .course-content ul.collapsibletopics li.section .sectionname {
font-size: 15px;
color: #000000;
}
.theme_default .course-content ul.collapsibletopics li.section .sectionname {
color: #000000;
}
.theme_dark .course-content ul.collapsibletopics li.section .sectionname {
color: #ffffff;
}
.theme_contrast .course-content ul.collapsibletopics li.section .sectionname {
color: #ffffff;
}
.format-collapsibletopics .course-content ul.collapsibletopics a.sectiontoggle[aria-expanded="true"], .course-content ul.collapsibletopics a.sectiontoggle[aria-expanded="false"] {
background-size: 13px 13px;
font-size: 0.8rem;
}
.format-collapsibletopics .course-content ul.collapsibletopics .sectiontoggle ~ .section-summary-activities,
.format-collapsibletopics .course-content ul.collapsibletopics .sectiontoggle.collapsed ~ .section-summary-activities{
padding-left:20px;
}
/*.format-collapsibletopics .course-content ul.collapsibletopics .sectiontoggle ~ .section-summary-activities,*/
/*.format-collapsibletopics .course-content ul.collapsibletopics .sectiontoggle.collapsed ~ .section-summary-activities{*/
/*display: none;*/
/*}*/
.format-collapsibletopics .availabilityinfo.ishidden {
display: none;
}
/*.format-collapsibletopics .expandall {*/
/*display: none;*/
/*}*/
/*.format-collapsibletopics #completionprogressid {*/
/*display: none;*/
/*}*/
/* collapsable topics format END */
/* collapsable weeks format START */
.format-collapsibleweeks.path-course-view .completionprogress {
float: left;
}
.course-content ul.collapsibleweeks li.section ul.section {
padding-left: 0px;
}
.format-collapsibleweeks .section .activity {
background-color: #ffffff;
padding: 10px;
padding-left: 20px;
margin-top: 2px;
}
.theme_dark.format-collapsibleweeks .section .activity {
background-color: #2d2c2c;
}
.theme_contrast.format-collapsibleweeks .section .activity {
background-color: #000000;
}
.format-collapsibleweeks .course-content ul.collapsibleweeks a.sectiontoggle[aria-expanded="true"],
.format-collapsibleweeks .course-content ul.collapsibleweeks a.sectiontoggle[aria-expanded="false"] {
background-size: 13px 13px;
font-size: 0.8rem;
}
.format-collapsibleweeks .course-content ul.collapsibleweeks li.section .sectionname {
font-size: 15px;
color: #000000;
}
.theme_default .course-content ul.collapsibleweeks li.section .sectionname {
color: #000000;
}
.theme_dark .course-content ul.collapsibleweeks li.section .sectionname {
color: #ffffff;
}
.theme_contrast .course-content ul.collapsibleweeks li.section .sectionname {
color: #ffffff;
}
.format-collapsibleweeks .section_availability .ishidden {
padding-left: 32px;
}
.format-collapsibleweeks .course-content ul.collapsibleweeks .sectiontoggle ~ .section-summary-activities,
.format-collapsibleweeks .course-content ul.collapsibleweeks .sectiontoggle.collapsed ~ .section-summary-activities{
padding-left:20px;
}
/*.format-collapsibleweeks .course-content ul.collapsibleweeks .sectiontoggle ~ .section-summary-activities,*/
/*.format-collapsibleweeks .course-content ul.collapsibleweeks .sectiontoggle.collapsed ~ .section-summary-activities{*/
/*display: none;*/
/*}*/
/*.format-collapsibleweeks .expandall {*/
/*display: none;*/
/*}*/
/*.format-collapsibleweeks #completionprogressid {*/
/*display: none;*/
/*}*/
.format-collapsibleweeks .availabilityinfo.ishidden {
display: none;
}
/* collapsable weeks format END */
/* multi-page topics format START */
/* main page */
.format-topics .course-content .section-summary {
border: 0;
}
.format-topics .course-content .topics .section-summary .section-title {
margin: 0;
}
/*.format-topics .course-content ul.topics .section-summary-activities {*/
/*display: none;*/
/*}*/
/* section page */
.format-topics .single-section h3.sectionname {
text-align: unset;
font-size: 1em;
}
.format-topics .course-content .single-section .section-navigation .mdl-right,
.format-topics .course-content .single-section .section-navigation .mdl-left {
display:none;
}
.format-topics #sectionmenu {
display: none;
}
/*!* multi-page topics format END *!*/
/*!* multi-page weeks format START *!*/
.format-weeks .course-content .section-summary {
border: 0;
}
.format-weeks .course-content .weeks .section-summary .section-title {
margin: 0;
}
/*.format-weeks .course-content ul.weeks .section-summary-activities {*/
/*display: none;*/
/*}*/
/* section page */
.format-weeks .single-section h3.sectionname {
text-align: unset;
font-size: 1em;
}
.course-content .single-section .section-navigation {
margin-bottom: 0;
}
.section-navigation .jumpmenu {
width: unset;
}
#page-course-view-weeks .navigationtitle .mdl-left,
#page-course-view-weeks .navigationtitle .mdl-right {
display:none;
}
/*.format-weeks .course-content .single-section .section-navigation .mdl-right,*/
/*.format-weeks .course-content .single-section .section-navigation .mdl-left {*/
/*display:none;*/
/*}*/
/*.format-weeks #sectionmenu {*/
/*display: none;*/
/*}*/
.format-weeks .availabilityinfo.ishidden {
display: none;
}
.format-weeks .availabilityinfo.ishidden span {
display: none;
}
/*!* multi-page weeks format END *!*/
/* header START */
#course_page_title {
position: relative;
background-color: #fff;
border-left: 8px #fc852c solid;
font-size: 28px;
padding-left: 40px;
}
.theme_dark #course_page_title {
background-color: #2d2c2c;
}
.theme_contrast #course_page_title {
background-color: #000000;
}
body .back_course_main {
position: relative;
display: block;
font-size: 16px;
padding-left: 6px;
padding-top: 18px;
}
.back #course_page_title .page_title a {
padding-right: 33px;
}
#course_page_title .page_title {
padding-bottom: 20px;
padding-top: 28px;
}
.page_title a:active, .page_title a:hover {
text-decoration:none;
}
@media (max-width:800px){
body #course_page_title {
font-size: 21px;
}
}
@media (max-width:640px) {
body #course_page_title {
font-size: 17px;
}
}
@media (max-width:550px) {
body #course_page_title {
font-size: 16px;
}
}
/* header END */
/* Section page START */
.section-summary-activities {
text-align: left;
padding-left: 10px;
}
/* Section page END */
/*!* all course formats START *!*/
.card-body {
background-color: #f3f2f1;
padding: 0;
}
.theme_dark .card-body {
background-color: #201F1F;
}
.theme_contrast .card-body {
background-color: #000000;
}
.container-fluid {
padding-right: 0;
padding-left: 0;
}
body, body.theme_default {
background-color: #f3f2f1;
font-size: 0.875rem;
color: #484644;
}
body.theme_dark {
background-color: #201F1F;
color: #ffffff;
}
body.theme_contrast {
background-color: #000000;
color: #ffffff;
}
#region-main-box {
padding-right: 0;
padding-left: 0;
}
/* course body START */
.pagelayout-incourse .card-body {
background-color: #ffffff;
}
.theme_dark.pagelayout-incourse .card-body {
background-color: #201F1F;
}
.theme_contrast.pagelayout-incourse .card-body {
background-color: #000000;
}
.pagelayout-incourse .card-body div[role="main"] {
border-top: solid 2px #f3f2f1;
padding-right: 15px;
}
.form-group div[data-fieldtype="filemanager"] {
padding-right: 0px;
}
.course-content ul li.section.main {
border-bottom: 0;
}
#region-main .card {
border: 0;
}
.row {
margin-right: 0px;
margin-left: 0px;
}
a, theme_default a {
color: #484644;;
}
.theme_dark a {
color: #6264A7;
}
.theme_contrast a {
color: #FFFF00;
}
/* course body END */
/* activity list START */
.sectionname {
font-family: 'Segoe UISB';
}
.section .activity .actions {
float:left;
position: static;
}
.section .activity .actions {
margin-right:4px;
}
.section .activity .activityinstance, .section .activity .activityinstance > a {
float:left;
}
.section .activity .contentwithoutlink, .section .activity .activityinstance {
min-width: 15%;
}
.section .activity .availabilityinfo, .section .activity .contentafterlink {
float: left;
width: 99%;
}
.section .activity .mod-indent-outer {
width: 100%;
}
.section .label .mod-indent-outer {
padding-left: 0;
}
.section .activity.modtype_label.label {
padding-top: 10px;
padding-right: 10px;
padding-bottom: 10px;
padding-left: 20px;
}
/* activity list END */
/* footer START */
.footerlogo {
width:100%;
color:gold;
height:60px;
position: fixed;
bottom: 0px;
background-color: #f3f2f1;
padding-top:10px;
padding-bottom:10px;
}
.theme_dark .footerlogo {
background-color: #201F1F;
}
.theme_contrast .footerlogo {
background-color: #000000;
}
.footerlogo .stamp img {
float:right;
}
.user_details {
color: black;
}
div.footerleft {
display: inline;
float: left;
}
div.footerright {
display: inline;
float: right;
}
a.feedbacklink {
margin-right: 20px;
color: #6264A7;
display: inline-block;
padding-top: 10px;
font-size: 0.9375rem;
}
.theme_default a.feedbacklink {
color: #6264A7;
}
.theme_dark a.feedbacklink {
color: #c8c6c4;
}
.theme_contrast a.feedbacklink {
color: #FFFF00;
}
.fa-lightbulb-o {
font-family: "FontAwesome" !important;
font-size: 15px !important;
border-radius: 5px !important;
}
.fa-lightbulb-o:before {
padding: 5px;
}
/* footer END */
/* popup icon START */
.modtype_assign .popupicon, .modtype_quiz .popupicon {
display: none;
}
.popupicon {
margin-left: 4px;
display: inline;
}
/* popup icon END */
/* ALL BUTTONS */
button {
text-rendering: auto;
color: initial;
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
display: inline-block;
text-align: start;
margin: 0em;
font: 400 13.3333px Arial;
}
/* ENABLED SECONDARY BUTTON */
/* secondary button */
.btn-secondary {
background: #ffffff;
border: 0.125rem solid;
border-color: #bdbdbd;
border-radius: 0.1875rem;
box-sizing: border-box;
color: #5c5b5b;
cursor: pointer;
font-family: "Segoe UI", Tahoma, Helvetica, sans-serif;
height: 2rem;
min-width: 6rem;
padding: 0.25rem;
white-space: nowrap;
-webkit-box-shadow: unset !important;
box-shadow: unset !important;
}
/* secondary button :active*/
.btn-secondary:not(:disabled):not(.disabled):active {
background: #414040;
border-color: transparent;
color: #FFFFFF;
}
/* secondary button :hover*/
.btn-secondary:hover, .btn-secondary:focus:enabled {
background: rgb(200,200,200);
border-color: transparent;
color: #000;
}
/* secondary button :focus*/
.btn-secondary:focus, .btn-secondary:focus:enabled {
background: #636262;
border-color: transparent;
color: #FFFFFF;
outline: 0.125rem solid #FFFFFF;
outline-offset: -0.25rem;
}
/* secondary button (checked)*/
.fp-viewbar:not(.disabled) a.checked:not(:disabled):not(.disabled) {
color: #fff;
background-color: #1f2021;
border-color: #191a1b;
}
/* DISABLED SECONDARY BUTTON */
/* secondary button */
div.disabled .btn-secondary {
background: #2d2c2c;
border-color: #2b2a2a;
color: #636262;
cursor: default;
}
/* ENABLED PRIMARY BUTTON */
/* primary button */
.btn-primary, .btn-default {
background: #6264A7;
border: 0.125rem solid;
border-color: transparent;
border-radius: 0.1875rem;
box-sizing: border-box;
color: #201F1F;
cursor: pointer;
font: inherit;
height: 2rem;
min-width: 6rem;
padding: 0.25rem;
white-space: nowrap;
-webkit-box-shadow: unset !important;
box-shadow: unset !important;
color: #FFFFFF;
}
/* primary button :active*/
.btn-primary:not(:disabled):not(.disabled):active, .btn-default:not(:disabled):not(.disabled):active {
background: #A6A7DC;
border-color: transparent;
color: #201F1F;
}
/* primary button :hover*/
.btn-primary:hover, .btn-primary:focus:enabled, .btn-default:hover, .btn-default:focus:enabled {
background: #464775;
border-color: transparent;
color: #FFFFFF;
}
/* primary button :focus*/
.btn-primary:focus, .btn-primary:focus:enabled, .btn-default:focus, .btn-default:focus:enabled {
}
body {
display: none;
}
body#page-login-index {
display: block;
}
nav.navbar {
display: none;
}
div#nav-drawer {
display: none;
}
section[data-region="blocks-column"] {
display: none;
}
footer#page-footer {
display: none;
}
#page-mod-assign-grader {
display: unset;
}
header#page-header {
clear: both;
}
.btn {
font-size: 0.875rem;
height:unset;
}
.course-content ul.section {
margin: 0;
}
.path-course-view .completionprogress {
margin-left: 0;
margin-top: 20px;
margin-bottom: 10px;
font-family: "Segoe UISB";
font-size: 15px;
}
ul {
padding-left: 0;
}
#page-wrapper::after {
content: none;
}
#page-wrapper {
margin-bottom: 50px !important;
}
/*!* modules START *!*/
.path-mod .card-body div[role="main"] {
padding-right:15px;
padding-left:48px;
}
#prev-activity-link {
margin-left:33px;
}
/*.editsubmissionform .col-md-3 {*/
/*display: none;*/
/*}*/
.editsubmissionform .form-group {
margin-left: -15px;
}
.editsubmissionform .felement {
flex: unset;
max-width: unset;
}
.table-striped tbody tr:nth-of-type(odd), table.collection tbody tr:nth-of-type(odd), table#explaincaps tbody tr:nth-of-type(odd), table#defineroletable tbody tr:nth-of-type(odd), table.grading-report tbody tr:nth-of-type(odd), table#listdirectories tbody tr:nth-of-type(odd), table.rolecaps tbody tr:nth-of-type(odd), table.userenrolment tbody tr:nth-of-type(odd), form#movecourses table tbody tr:nth-of-type(odd), #page-admin-course-index .editcourse tbody tr:nth-of-type(odd), .forumheaderlist tbody tr:nth-of-type(odd), table.flexible tbody tr:nth-of-type(odd), .generaltable tbody tr:nth-of-type(odd) {
background-color: #f2f2f2;
}
/* Assignment Module START */
.path-mod-assign td.submissionstatussubmitted, .path-mod-assign div.submissionstatussubmitted, .path-mod-assign a:link.submissionstatussubmitted,
.path-mod-assign td.submissionnotgraded, .path-mod-assign div.submissionnotgraded,
.path-mod-assign td.latesubmission, .path-mod-assign a:link.latesubmission, .path-mod-assign div.latesubmission,
.path-mod-assign td.submissiongraded, .path-mod-assign div.submissiongraded
{
color: inherit;
background-color: inherit;
}
.table-hover tbody tr:hover, table.grading-report tbody tr:hover, .forumheaderlist tbody tr:hover, .generaltable tbody tr:hover, table.flexible tbody tr:hover, .category_subcategories tbody tr:hover, table#modules tbody tr:hover, table#permissions tbody tr:hover {
background-color: #f2f2f2;
}
/* Assignment Module END */
/* Quiz Module START */
#page-mod-quiz-attempt .card div[role="main"], #page-mod-quiz-view .card div[role="main"] {
padding-top: 10px;
}
.card .quizattempt .continuebutton {
display: inline-block;
margin-left: 3px;
}
/* Quiz Module END */
/*!* modules END *!*/
.m-t-2, .m-b-1 {
padding-top: 25px;
}
.section .activity .availabilityinfo, .section .activity .contentafterlink {
padding-right: 30px;
}
.submitbtns_with_return {
text-align: center !important;
}
.mod_quiz-prev-nav {
float: left;
}
.mod_quiz-return-nav {
margin: 0 auto;
}

133
templates/columns2.mustache Normal file
Просмотреть файл

@ -0,0 +1,133 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template theme_boost_o365teams/columns2
Admin time setting template.
Boost 2 column layout template.
Context variables required for this template:
* sitename - The name of the site
* output - The core renderer for the page
* bodyattributes - attributes for the body tag as a string of html attributes
* sidepreblocks - HTML for the blocks
* hasblocks - true if there are blocks on this page
* navdraweropen - true if the nav drawer should be open on page load
* regionmainsettingsmenu - HTML for the region main settings menu
* hasregionmainsettingsmenu - There is a region main settings menu on this page.
Example context (json):
{
"sitename": "Moodle",
"output": {
"doctype": "<!DOCTYPE html>",
"page_title": "Test page",
"favicon": "favicon.ico",
"main_content": "<h1>Headings make html validators happier</h1>"
},
"bodyattributes":"",
"sidepreblocks": "<h2>Blocks html goes here</h2>",
"hasblocks":true,
"navdraweropen":true,
"regionmainsettingsmenu": "",
"hasregionmainsettingsmenu": false
}
}}
{{> theme_boost/head }}
<body {{{ bodyattributes }}}>
<div id="page-wrapper">
{{{ output.standard_top_of_body_html }}}
{{>theme_boost/navbar}}
<div id="page" class="container-fluid">
{{{ output.full_header }}}
<div id="page-content" class="row">
<div id="region-main-box" class="col-12">
{{#hasregionmainsettingsmenu}}
<div id="region-main-settings-menu" class="d-print-none {{#hasblocks}}has-blocks{{/hasblocks}}">
<div> {{{ output.region_main_settings_menu }}} </div>
</div>
{{/hasregionmainsettingsmenu}}
<section id="region-main" {{#hasblocks}}class="has-blocks mb-3"{{/hasblocks}}>
<div class="card">
<div class="card-body">
{{#hasregionmainsettingsmenu}}
<div class="region_main_settings_menu_proxy"></div>
{{/hasregionmainsettingsmenu}}
{{#is_course_overview}}
{{{ output.course_content_header }}}
<span class="back">
<div id="course_page_title">
<div class="back_course_main"><a href="{{{course_page}}}">< Course Overview</a></div>
<div class="page_title"><a href="{{{ course_page }}}">{{{ output.page_title }}}</a></div>
</div>
</span>
{{/is_course_overview}}
{{^is_course_overview}}
{{{ output.course_content_header }}}
<span class="no_back">
<div id="course_page_title">
<div class="page_title"><a href="{{{ course_page }}}">{{{ output.page_title }}}</a></div>
</div>
</span>
{{/is_course_overview}}
{{{ output.main_content }}}
{{{ output.activity_navigation }}}
{{{ output.course_content_footer }}}
</div>
</div>
</section>
{{#hasblocks}}
<section data-region="blocks-column" class="d-print-none">
{{{ sidepreblocks }}}
</section>
{{/hasblocks}}
</div>
</div>
</div>
{{> theme_boost/nav-drawer }}
</div>
<div class="footerlogo">
<div class="footerleft">
{{{ output.user_link }}}
</div>
<div class="footerright">
{{{ output.feedback_link }}}
{{{ output.get_footer_stamp }}}
</div>
</div>
{{> theme_boost/footer }}
</body>
</html>
{{#js}}
require(['theme_boost/loader']);
require(['theme_boost/drawer'], function(mod) {
mod.init();
});
require(['theme_boost_o365teams/iframeChecker'], function(iframeChecker) {
iframeChecker.init();
});
require(['theme_boost_o365teams/teamsThemeChecker'], function(teamsThemeChecker) {
teamsThemeChecker.init();
});
{{/js}}

78
templates/login.mustache Normal file
Просмотреть файл

@ -0,0 +1,78 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template theme_boost_o365teams/login
Login page template
Example context (json):
{
"output": {
"doctype": "<!DOCTYPE html>",
"page_title": "Login page",
"favicon": "favicon.ico",
"main_content": "<h1>Headers keep HTML validators happy</h1>"
}
}
}}
{{> theme_boost/head }}
<script src="https://statics.teams.microsoft.com/sdk/v1.0/js/MicrosoftTeams.min.js" crossorigin="anonymous"></script>
<script type="text/javascript">
//<![CDATA[
microsoftTeams.initialize();
//]]>
</script>
<body {{{ bodyattributes }}}>
<div id="page-wrapper">
{{{ output.standard_top_of_body_html }}}
<div id="page" class="container-fluid mt-0">
<div id="page-content" class="row">
<div id="region-main-box" class="col-12">
<section id="region-main" class="col-12">
{{{ output.course_content_header }}}
{{{ output.main_content }}}
{{{ output.course_content_footer }}}
</section>
</div>
</div>
</div>
</div>
<footer id="page-footer" class="py-3 bg-dark text-light">
<div class="container">
<div id="course-footer">{{{ output.course_footer }}}</div>
{{# output.page_doc_link }}
<p class="helplink">{{{ output.page_doc_link }}}</p>
{{/ output.page_doc_link }}
{{{ output.login_info }}}
{{{ output.home_link }}}
{{{ output.standard_footer_html }}}
{{{ output.standard_end_of_body_html }}}
</div>
</footer>
</body>
</html>
{{#js}}
require(['theme_boost/loader']);
{{/js}}

32
version.php Normal file
Просмотреть файл

@ -0,0 +1,32 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Boost o365teams.
*
* @package theme_boost_o365teams
* @copyright 2018 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2018091003;
$plugin->requires = 2018051700;
$plugin->component = 'theme_boost_o365teams';
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '3.5.0.0';