Skip to content

Commit

Permalink
Update comments and general cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
weilai-irl committed Nov 14, 2023
1 parent 2d73718 commit ee99bbd
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 59 deletions.
14 changes: 7 additions & 7 deletions ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Gets data from DB about the meeting
* Gets data from DB about the meeting.
*
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

define('AJAX_SCRIPT', true);

require_once(__DIR__ . '/../../../../../config.php');


require_login();

$url = required_param('url', PARAM_URL);
$result = '';
if (!empty($url)) {
$record = $DB->get_record_sql('SELECT * FROM {atto_teamsmeeting} WHERE ' . $DB->sql_compare_text('link') . ' = ' . $DB->sql_compare_text(':url'),
array('url' => $url), IGNORE_MISSING);
$result = json_encode([$CFG->wwwroot.'/lib/editor/atto/plugins/teamsmeeting/result.php', $record->title, $record->link, $record->options]);
$record = $DB->get_record_sql('SELECT * FROM {atto_teamsmeeting} WHERE ' . $DB->sql_compare_text('link') . ' = ' .
$DB->sql_compare_text(':url'), ['url' => $url]);
$result = json_encode([$CFG->wwwroot . '/lib/editor/atto/plugins/teamsmeeting/result.php', $record->title, $record->link,
$record->options]);
}

echo $result;
die();

4 changes: 2 additions & 2 deletions classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Privacy Subsystem implementation for block_activity_modules.
* Privacy Subsystem implementation for atto_teamsmeeting.
*
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand Down
2 changes: 1 addition & 1 deletion db/install.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/editor/atto/plugins/teamsmeeting/db" VERSION="20200326" COMMENT="XMLDB file for Moodle atto/teamsmeeting plugin"
<XMLDB PATH="lib/editor/atto/plugins/teamsmeeting/db" VERSION="20200326" COMMENT="XMLDB file for Moodle atto_teamsmeeting plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../xmldb/xmldb.xsd"
>
Expand Down
4 changes: 2 additions & 2 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Atto text editor Meetings integration upgrade file.
* Atto text editor Teams Meeting integration upgrade file.
*
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand Down
7 changes: 3 additions & 4 deletions lang/en/atto_teamsmeeting.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Strings for component 'atto_teamsmeeting', language 'en'.
*
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand All @@ -32,9 +32,8 @@
$string['meetingurl'] = 'Your meeting URL';
$string['openinnewwindow'] = 'Open in new window';
$string['pluginname'] = 'Teams Meeting';
$string['privacy:metadata:msteamsapp'] = 'The Atto Teams Meeting plugin does not store any data. However, it sends user
language code to Microsoft Teams application to provide user interface based on user language.';
$string['privacy:metadata:msteamsapp'] = 'The Atto Teams Meeting plugin does not store any data. However, it sends user language code to Microsoft Teams application to provide user interface based on user language.';
$string['privacy:metadata:msteamsapp:userlang'] = 'User language code sent to Microsoft Teams application.';
$string['settings'] = 'Teams Meeting Settings';
$string['legacy_setting_warning'] = '<br/>
<span style="color:red">WARNING: The Meetings app deployed at https://enovation.ie/msteams is deprecated and will be removed soon. A new app has been created at https://enomsteams.z16.web.core.windows.net.</span>';
<span style="color:red">WARNING: The Meetings app deployed at https://enovation.ie/msteams is deprecated and will be removed soon. A new app has been created at https://enomsteams.z16.web.core.windows.net.</span>';
17 changes: 9 additions & 8 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
* Atto text editor integration lib file.
*
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once(__DIR__ . '/../../../../../repository/url/locallib.php');
require_once($CFG->dirroot . '/repository/url/lib.php');

/**
* Set params for this button.
Expand Down Expand Up @@ -51,11 +52,11 @@ function atto_teamsmeeting_params_for_js($elementid, $options, $fpoptions) {
function atto_teamsmeeting_strings_for_js() {
global $PAGE;

$PAGE->requires->strings_for_js(array(
'addlink',
'createteamsmeeting',
'meetingurl',
'openinnewwindow'),
'atto_teamsmeeting');
$PAGE->requires->strings_for_js([
'addlink',
'createteamsmeeting',
'meetingurl',
'openinnewwindow'],
'atto_teamsmeeting');
}

35 changes: 17 additions & 18 deletions result.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Atto text editor integration result file.
*
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand All @@ -31,16 +31,15 @@
$preview = optional_param('preview', null, PARAM_RAW);
$optionslink = optional_param('options', null, PARAM_RAW);


$meetingoptions = null;

if (!empty($preview)) {
$htmlDom = new DOMDocument;
@$htmlDom->loadHTML($preview);
$links = $htmlDom->getElementsByTagName('a');
foreach($links as $link){
foreach ($links as $link) {
$href = $link->getAttribute('href');
if ($href && strpos($href, 'meetingOptions') !== FALSE) {
if ($href && strpos($href, 'meetingOptions') !== false) {
$meetingoptions = $href;
break;
}
Expand All @@ -52,7 +51,7 @@
$meetingdata->options = $meetingoptions;
$meetingdata->timecreated = time();
$DB->insert_record('atto_teamsmeeting', $meetingdata);
} else if(!empty($optionslink)) {
} else if (!empty($optionslink)) {
$meetingoptions = $optionslink;
}

Expand All @@ -72,22 +71,22 @@
0 24 0zm7.9 17.1c-.6 0-1.2.2-1.6.7l-8.5 8.5-3-3c-.4-.4-1-.7-1.6-.7-.3 0-.6.1-.8.2-.3.1-.5.3-.7.5s-.4.4-.5.7c-.2.3-.2.5-.2.8
0 .6.2 1.2.7 1.6l4.6 4.6c.4.4 1 .7 1.6.7.6 0 1.2-.2 1.6-.7l10.1-10.1c.4-.5.7-1
.7-1.6 0-.3-.1-.6-.2-.8-.1-.3-.3-.5-.5-.7s-.4-.4-.7-.5c-.4-.2-.7-.2-1-.2z" fill="#599c00"></path></svg>
<span class="meetingcreatedheader" style="font-size: 20px; font-weight: 600; display: block; text-align: center;">'.
get_string('meetingcreatedsuccess', 'atto_teamsmeeting', $title).
'</span>';
if(!empty($meetinglink)) {
echo '<span class="meetinglink" style="display: block; text-align: center;"><a class="btn btn-primary" href="'.
$meetinglink.'" style="display: inline-block; font-weight: 600; text-align: center; vertical-align: middle;
<span class="meetingcreatedheader" style="font-size: 20px; font-weight: 600; display: block; text-align: center;">' .
get_string('meetingcreatedsuccess', 'atto_teamsmeeting', $title) .
'</span>';
if (!empty($meetinglink)) {
echo '<span class="meetinglink" style="display: block; text-align: center;"><a class="btn btn-primary" href="' .
$meetinglink . '" style="display: inline-block; font-weight: 600; text-align: center; vertical-align: middle;
border: 1px solid hsla(0,0%,100%,.04); user-select: none; font-size: .875rem; line-height: 1.5; border-radius: 3px;
color: #fff; background-color: #6264a7; margin-top: 1rem; padding: .375rem .75rem; text-decoration: none;" target="_blank">'.
get_string('gotomeeting', 'atto_teamsmeeting').'</a></span>';
color: #fff; background-color: #6264a7; margin-top: 1rem; padding: .375rem .75rem; text-decoration: none;" target="_blank">' .
get_string('gotomeeting', 'atto_teamsmeeting') . '</a></span>';
}
if(!empty($meetingoptions)) {
echo '<span class="meetingoptions" style="display: block; text-align: center;"><a class="btn btn-primary" href="'.
$meetingoptions.'" style="display: inline-block; font-weight: 600; text-align: center; vertical-align: middle;
if (!empty($meetingoptions)) {
echo '<span class="meetingoptions" style="display: block; text-align: center;"><a class="btn btn-primary" href="' .
$meetingoptions . '" style="display: inline-block; font-weight: 600; text-align: center; vertical-align: middle;
border: 1px solid hsla(0,0%,100%,.04); user-select: none; font-size: .875rem; line-height: 1.5; border-radius: 3px;
color: #fff; background-color: #6264a7; margin-top: 1rem; padding: .375rem .75rem; text-decoration: none;" target="_blank">'.
get_string('meetingoptions', 'atto_teamsmeeting').'</a></span>';
color: #fff; background-color: #6264a7; margin-top: 1rem; padding: .375rem .75rem; text-decoration: none;" target="_blank">' .
get_string('meetingoptions', 'atto_teamsmeeting') . '</a></span>';
}
echo '</div>';

Expand Down
4 changes: 2 additions & 2 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Settings for the Teams Meetings application atto plugin.
* Settings for the Teams Meeting atto plugin.
*
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand Down
14 changes: 7 additions & 7 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Atto text editor integration version file.
* Plugin version information.
*
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2020032705; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2016052318; // Requires this Moodle version.
$plugin->component = 'atto_teamsmeeting'; // Full name of the plugin (used for diagnostics).
$plugin->maturity = MATURITY_STABLE; // Maturity level of this plugin version
$plugin->release = 'v1.2.5';
$plugin->version = 2020032706;
$plugin->requires = 2016052318;
$plugin->component = 'atto_teamsmeeting';
$plugin->maturity = MATURITY_STABLE;
$plugin->release = 'v1.2.6';
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ YUI.add('moodle-atto_teamsmeeting-button', function (Y, NAME) {
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/*
/**
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand All @@ -32,7 +32,6 @@ YUI.add('moodle-atto_teamsmeeting-button', function (Y, NAME) {
* @class button
* @extends M.editor_atto.EditorPlugin
*/

var COMPONENTNAME = 'atto_teamsmeeting',
CSS = {
NEWWINDOW: 'atto_teamsmeeting_openinnewwindow',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ YUI.add('moodle-atto_teamsmeeting-button', function (Y, NAME) {
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/*
/**
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand Down
5 changes: 2 additions & 3 deletions yui/src/button/js/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/*
/**
* @package atto_teamsmeeting
* @copyright 2020 Enovation
* @copyright 2020 Enovation Solutions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand All @@ -30,7 +30,6 @@
* @class button
* @extends M.editor_atto.EditorPlugin
*/

var COMPONENTNAME = 'atto_teamsmeeting',
CSS = {
NEWWINDOW: 'atto_teamsmeeting_openinnewwindow',
Expand Down

0 comments on commit ee99bbd

Please sign in to comment.