Add mobidico plugin

ofaj
jmontoyaa 10 years ago
parent ff4be4c5a9
commit 2cbec0141c
  1. 2
      plugin/logintcc/LoginTCC.php
  2. 6
      plugin/logintcc/lang/english.php
  3. 53
      plugin/mobidico/Mobidico.php
  4. 1
      plugin/mobidico/index.php
  5. 4
      plugin/mobidico/install.php
  6. 5
      plugin/mobidico/lang/english.php
  7. 5
      plugin/mobidico/plugin.php
  8. 53
      plugin/mobidico/start.php
  9. 10
      plugin/mobidico/uninstall.php

@ -1,7 +1,7 @@
<?php
/**
* Class BBBPlugin
* Class LoginTCC
*/
class LoginTCC extends Plugin
{

@ -1,10 +1,4 @@
<?php
/**
*
* @copyright (c) 2012 University of Geneva
* @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
* @author Laurent Opprecht <laurent@opprecht.info>
*/
// Needed in order to show the plugin title
$strings['plugin_title'] = "Login TCC";
$strings['plugin_comment'] = "TCC connection";

@ -0,0 +1,53 @@
<?php
/**
* Class Mobidico
*/
class Mobidico extends Plugin
{
public $isCoursePlugin = true;
// When creating a new course this settings are added to the course
public $course_settings = [];
/**
* Constructor.
*/
protected function __construct()
{
parent::__construct(
'O.1',
'Julio Montoya',
[
'tool_enable' => 'boolean',
'api_key' => 'text',
'mobidico_url' => 'text'
]
);
}
/**
* @return Mobidico|null
*/
public static function create()
{
static $result = null;
return $result ? $result : $result = new self();
}
/**
* Install
*/
public function install()
{
}
/**
* Uninstall
*/
public function uninstall()
{
}
}

@ -0,0 +1,4 @@
<?php
//require_once __DIR__.'/config.php';
Mobidico::create()->install();

@ -0,0 +1,5 @@
<?php
// Needed in order to show the plugin title
$strings['plugin_title'] = "Mobidico";
$strings['plugin_comment'] = "Connects to Mobidico service";

@ -0,0 +1,5 @@
<?php
//require_once __DIR__.'/config.php';
$plugin_info = Mobidico::create()->get_info();

@ -0,0 +1,53 @@
<?php
require_once __DIR__ . '/../../main/inc/global.inc.php';
$course_plugin = 'mobidico'; //needed in order to load the plugin lang variables
$plugin = Mobidico::create();
if ($plugin->get('tool_enable') !== 'true') {
api_not_allowed(true);
}
$url = $plugin->get('mobidico_url');
$key = $plugin->get('api_key');
$tool_name = get_lang('Videoconference');
$htmlHeadXtra[] = '<script>
$(document).ready(function() {
var params = {
"chamiloid" : "2",
//"chamiloid" : "'.api_get_user_id().'",
"API_KEY" : "'.$key.'"
};
$.ajax({
url: "'.$url.'/app/desktop/php/authenticate.php",
type: "POST",
data: params,
success: function(data) {
var parsed = jQuery.parseJSON(data);
if (parsed.STATUS == "OK") {
if (parsed.SESSION != "") {
var url = "'.$url.'/app/index.html?session="+parsed.SESSION;
var win = window.open(url, "_blank");
win.focus();
}
} else {
console.log(parsed.ERROR);
}
}
});
});
</script>';
$tpl = new Template('Mobidico');
$content = '';
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -0,0 +1,10 @@
<?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
* @package chamilo.plugin.bigbluebutton
*/
//require_once __DIR__.'/config.php';
Mobidico::create()->uninstall();
Loading…
Cancel
Save