Adding first bits of BigBlueButton videoconference integration plugin

skala
Yannick Warnier 15 years ago
parent 2be3d5d69e
commit f587578f9e
  1. 6
      plugin/bbb/course_index.php
  2. 14
      plugin/bbb/course_install.php
  3. 3
      plugin/bbb/index.php
  4. 41
      plugin/bbb/install.php
  5. 20
      plugin/bbb/plugin.php
  6. 1
      plugin/bbb/readme.txt
  7. 31
      plugin/bbb/uninstall.php

@ -0,0 +1,6 @@
<?php
/**
* This script is included by the course_home.php script (indirectly) and is
* used to show the link to the plugin from inside the course's tools list
*/
echo "Videoconference";

@ -0,0 +1,14 @@
<?php
/**
* This script should be included by add_course.lib.inc.php when adding a new course
*/
//$cdb is defined inside the fillDbCourse() function which is calling this script
$t_course = Database::get_course_table(TABLE_COURSE_SETTING,$cdb);
$sql_course = "INSERT INTO $t_course (variable,value,category) VALUES ('big_blue_button_meeting_name','','plugins')";
$r = Database::query($sql_course);
$sql_course = "INSERT INTO $t_course (variable,value,category) VALUES ('big_blue_button_attendee_password','','plugins')";
$r = Database::query($sql_course);
$sql_course = "INSERT INTO $t_course (variable,value,category) VALUES ('big_blue_button_moderator_password','','plugins')";
$r = Database::query($sql_course);
$sql_course = "INSERT INTO $t_course (variable,value,category) VALUES ('big_blue_button_welcome_message','','plugins')";
$r = Database::query($sql_course);

@ -0,0 +1,3 @@
<?php
// should contain the code to access the plugin from outside a course
?>

@ -0,0 +1,41 @@
<?php
/**
* This script is included by main/admin/settings.lib.php and generally
* includes things to execute in the main database (settings_current table)
*/
$t_settings = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$t_options = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
$sql = "INSERT INTO $t_settings
(variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable)
VALUES
('bbb_plugin', '', 'radio', 'Extra', 'false', 'BigBlueButtonEnableTitle','BigBlueButtonEnableComment',NULL,NULL, 1)";
Database::query($sql);
$sql = "INSERT INTO $t_options (variable, value, display_text) VALUES ('bbb_plugin', 'true', 'Yes')";
Database::query($sql);
$sql = "INSERT INTO $t_options (variable, value, display_text) VALUES ('bbb_plugin', 'false', 'No')";
Database::query($sql);
$sql = "INSERT INTO $t_settings
(variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable)
VALUES
('bbb_plugin_host', '', 'textfield', 'Extra', '192.168.0.100', 'BigBlueButtonHostTitle','BigBlueButtonHostComment',NULL,NULL, 1)";
Database::query($sql);
$sql = "INSERT INTO $t_settings
(variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable)
VALUES
('bbb_plugin_salt', '', 'textfield', 'Extra', '', 'BigBlueButtonSecuritySaltTitle','BigBlueButtonSecuritySaltComment',NULL,NULL, 1)";
Database::query($sql);
// update existing courses to add conference settings
$t_courses = Database::get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT id, code, db_name FROM $t_courses ORDER BY id";
$res = Database::query($sql);
while ($row = Database::fetch_assoc($res)) {
$t_course = Database::get_course_table(TABLE_COURSE_SETTING,$row['db_name']);
$sql_course = "INSERT INTO $t_course (variable,value,category) VALUES ('big_blue_button_meeting_name','','plugins')";
$r = Database::query($sql_course);
$sql_course = "INSERT INTO $t_course (variable,value,category) VALUES ('big_blue_button_attendee_password','','plugins')";
$r = Database::query($sql_course);
$sql_course = "INSERT INTO $t_course (variable,value,category) VALUES ('big_blue_button_moderator_password','','plugins')";
$r = Database::query($sql_course);
$sql_course = "INSERT INTO $t_course (variable,value,category) VALUES ('big_blue_button_welcome_message','','plugins')";
$r = Database::query($sql_course);
}

@ -0,0 +1,20 @@
<?php
/**
* This script is a configuration file for the BigBlueButton plugin. You can use it as a master for other course plugins.
* These settings will be used in the administration interface for plugins (Chamilo configuration settings->Plugins)
* @package chamilo.plugin
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
* Plugin details (must be present)
*/
//the plugin title
$plugin_info['title']='BigBlueButton';
//the comments that go with the plugin
$plugin_info['comment']="Open Source Videoconference tool";
//the locations where this plugin can be shown
$plugin_info['location']=array('course_tool_plugin');
//the plugin version
$plugin_info['version']='0.9';
//the plugin author
$plugin_info['author']='Yannick Warnier';

@ -0,0 +1 @@
This plugin will create a link in existing and new courses for the teachers to start a videoconference room, as well as the administration settings to configure this tool.

@ -0,0 +1,31 @@
<?php
/**
* This script is included by main/admin/settings.lib.php when unselecting a plugin
* and is meant to remove things installed by the install.php script in both
* the global database and the courses tables
*/
$t_settings = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$t_options = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
$sql = "DELETE FROM $t_settings WHERE variable = 'bbb_plugin'";
Database::query($sql);
$sql = "DELETE FROM $t_options WHERE variable = 'bbb_plugin'";
Database::query($sql);
$sql = "DELETE FROM $t_settings WHERE variable = 'bbb_plugin_host'";
Database::query($sql);
$sql = "DELETE FROM $t_settings WHERE variable = 'bbb_plugin_salt'";
Database::query($sql);
// update existing courses to add conference settings
$t_courses = Database::get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT id, code, db_name FROM $t_courses ORDER BY id";
$res = Database::query($sql);
while ($row = Database::fetch_assoc($res)) {
$t_course = Database::get_course_table(TABLE_COURSE_SETTING,$row['db_name']);
$sql_course = "DELETE FROM $t_course WHERE variable = 'big_blue_button_meeting_name'";
$r = Database::query($sql_course);
$sql_course = "DELETE FROM $t_course WHERE variable = 'big_blue_button_attendee_password'";
$r = Database::query($sql_course);
$sql_course = "DELETE FROM $t_course WHERE variable = 'big_blue_button_moderator_password'";
$r = Database::query($sql_course);
$sql_course = "DELETE FROM $t_course WHERE variable = 'big_blue_button_welcome_message'";
$r = Database::query($sql_course);
}
Loading…
Cancel
Save