Skip to content

Commit

Permalink
Merge branch 'dev_MOODLE26'
Browse files Browse the repository at this point in the history
  • Loading branch information
tjwelde committed Feb 11, 2015
2 parents 7604091 + efc8e84 commit b504818
Show file tree
Hide file tree
Showing 18 changed files with 267 additions and 142 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# About

This is a module, which integrates etherpad-lite in Moodle 2.3 - 2.4
This is a module, which integrates etherpad-lite in Moodle 2.5 - 2.x

Features:

Expand All @@ -18,20 +18,21 @@ You need an etherpad-lite server, which is running on at least the same 2nd-leve

On the github page you'll find all information you need, to install the server: https://github.com/ether/etherpad-lite

We recommend to use the etherpad-lite version 1.2.7
We recommend to use the etherpad-lite version 1.3.0

It's also recommended to use the latest stable release of nodejs
(http://nodejs.org/)

*we are using nodejs 0.6.12, installed over apt-get for our productive server. But we test new ep-lite versions always with this node version, before updating productive*
*we are using nodejs 0.8.26. But we test new ep-lite versions always with this node version, before updating productive*

When you want, that the server is only accessible via Moodle, then i recommend to install ep_remove_embed over the ep-lite admin interface. This removes the embed link.<br>
When you want, that the server is only accessible via Moodle, then I recommend to install ep_remove_embed over the ep-lite admin interface. This removes the embed link.<br>
*To access the admin area, uncomment the user section in settings.json*

### Working ep-lite installation
- Ubuntu 12.04
- apt-get nodejs, npm, git, nginx, abiword, make, g++
- etherpad-lite from git (v1.2.7)
- apt-get git, nginx, abiword, make, g++
- donwload nodejs from nodejs.org and compile it (you can use 'n' to switch between versions <https://www.npmjs.org/package/n>)
- etherpad-lite from git
- ep-lite settings.json:
- "requireSession":true
- "editOnly":true
Expand All @@ -55,6 +56,4 @@ When you want, that the server is only accessible via Moodle, then i recommend t
5. Session elapse time: How long should one session be valid?
6. Https Redirect: This redirects moodle to https, so that the user feels secure <br>(later this should be used to delete sessions on the etherpadlite server)
7. Verify HTTPS cert: This lets curl check, if the https cert of the etherpadlite server is valid, to prevent man in the middle attacks
8. Guests allowed to write?: As described

*tested with Moodle 2.3 & 2.4*
8. Guests allowed to write?: As described
3 changes: 1 addition & 2 deletions backup/moodle2/backup_etherpadlite_activity_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* @package mod
* @subpackage etherpadlite
* @package mod_etherpadlite
*
* @author Timo Welde <[email protected]>
* @copyright 2012 Humboldt-Universität zu Berlin <[email protected]>
Expand Down
3 changes: 1 addition & 2 deletions backup/moodle2/backup_etherpadlite_settingslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* @package mod
* @subpackage etherpadlite
* @package mod_etherpadlite
*
* @author Timo Welde <[email protected]>
* @copyright 2012 Humboldt-Universität zu Berlin <[email protected]>
Expand Down
13 changes: 6 additions & 7 deletions backup/moodle2/backup_etherpadlite_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* @package mod
* @subpackage etherpadlite
* @package mod_etherpadlite
*
* @author Timo Welde <[email protected]>
* @copyright 2012 Humboldt-Universität zu Berlin <[email protected]>
Expand Down Expand Up @@ -51,14 +50,14 @@ protected function define_structure() {
// Define sources
$eplite->set_source_table('etherpadlite', array('id' => backup::VAR_ACTIVITYID));

// All the rest of elements only happen if we are including user info
// All the rest of elements only happen if we are including user info
if ($userinfo) {
// The HTML content of the pad
$modid = $this->task->get_activityid();
$padID = $DB->get_field('etherpadlite', 'uri', array('id' => $modid));
// The HTML content of the pad
$modid = $this->task->get_activityid();
$padID = $DB->get_field('etherpadlite', 'uri', array('id' => $modid));
$html = $instance->getHTML($padID);
$text = $instance->getText($padID);


$content->set_source_array(array((object)array('html'=>$html->html, 'text'=>$text->text)));
}

Expand Down
3 changes: 1 addition & 2 deletions backup/moodle2/restore_etherpadlite_activity_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* @package mod
* @subpackage etherpadlite
* @package mod_etherpadlite
*
* @author Timo Welde <[email protected]>
* @copyright 2012 Humboldt-Universität zu Berlin <[email protected]>
Expand Down
75 changes: 37 additions & 38 deletions backup/moodle2/restore_etherpadlite_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* @package mod
* @subpackage etherpadlite
* @package mod_etherpadlite
*
* @author Timo Welde <[email protected]>
* @copyright 2012 Humboldt-Universität zu Berlin <[email protected]>
Expand Down Expand Up @@ -52,31 +51,31 @@ protected function process_etherpadlite($data) {
$oldid = $data->id;
$data->course = $this->get_courseid();

// php.ini separator.output auf '&' setzen
$separator = ini_get('arg_separator.output');
ini_set('arg_separator.output', '&');

$instance = new EtherpadLiteClient($config->apikey,$config->url.'api');

try {
$createGroup = $instance->createGroup();
$groupID = $createGroup->groupID;
//echo "New GroupID is $groupID\n\n";
} catch (Exception $e) {
// the group already exists or something else went wrong
echo "\n\ncreateGroup Failed with message ". $e->getMessage();
}

try {
$newpad = $instance->createGroupPad($groupID, $config->padname);
$padID = $newpad->padID;
//echo "Created new pad with padID: $padID\n\n";
} catch (Exception $e) {
// the pad already exists or something else went wrong
echo "\n\ncreateGroupPad Failed with message ". $e->getMessage();
}

// seperator.output wieder zur�cksetzen
// php.ini separator.output auf '&' setzen
$separator = ini_get('arg_separator.output');
ini_set('arg_separator.output', '&');

$instance = new EtherpadLiteClient($config->apikey,$config->url.'api');

try {
$createGroup = $instance->createGroup();
$groupID = $createGroup->groupID;
//echo "New GroupID is $groupID\n\n";
} catch (Exception $e) {
// the group already exists or something else went wrong
echo "\n\ncreateGroup Failed with message ". $e->getMessage();
}

try {
$newpad = $instance->createGroupPad($groupID, $config->padname);
$padID = $newpad->padID;
//echo "Created new pad with padID: $padID\n\n";
} catch (Exception $e) {
// the pad already exists or something else went wrong
echo "\n\ncreateGroupPad Failed with message ". $e->getMessage();
}

// seperator.output wieder zur�cksetzen
ini_set('arg_separator.output', $separator);

$data->uri = $padID;
Expand All @@ -101,20 +100,20 @@ protected function process_etherpadlite_content($data) {
$padID = $etherpadlite->uri;


// php.ini separator.output auf '&' setzen
$separator = ini_get('arg_separator.output');
ini_set('arg_separator.output', '&');

// php.ini separator.output auf '&' setzen
$separator = ini_get('arg_separator.output');
ini_set('arg_separator.output', '&');

$instance = new EtherpadLiteClient($config->apikey,$config->url.'api');

try {
$instance->setHTML($padID, '<html>'.$data->html.'</html>');
} catch (Exception $e) {
// something went wrong
echo "\n\nsetHTML Failed with message ". $e->getMessage();
}
try {
$instance->setHTML($padID, '<html>'.$data->html.'</html>');
} catch (Exception $e) {
// something went wrong
echo "\n\nsetHTML Failed with message ". $e->getMessage();
}

// seperator.output wieder zur�cksetzen
// seperator.output wieder zur�cksetzen
ini_set('arg_separator.output', $separator);
}

Expand Down
5 changes: 2 additions & 3 deletions db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
/**
* Plugin capabilities
*
* @package mod
* @subpackage etherpadlite
*
* @package mod_etherpadlite
*
* @author Timo Welde <[email protected]>
* @copyright 2012 Humboldt-Universität zu Berlin <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Expand Down
5 changes: 2 additions & 3 deletions db/log.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
/**
* Definition of log events
*
* @package mod
* @subpackage etherpadlite
*
* @package mod_etherpadlite
*
* @author Timo Welde <[email protected]>
* @copyright 2012 Humboldt-Universität zu Berlin <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Expand Down
19 changes: 16 additions & 3 deletions db/upgrade.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
<?php //$Id: upgrade.php,v 1.2 2007/08/08 22:36:54 stronk7 Exp $
<?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/>.

/**
* This file keeps track of upgrades to
* the etherpadlite module
*
* @package mod
* @subpackage etherpadlite
* @package mod_etherpadlite
*
* @author Timo Welde <[email protected]>
* @copyright 2012 Humboldt-Universität zu Berlin <[email protected]>
Expand Down
17 changes: 15 additions & 2 deletions etherpad-lite-client.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
<?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/>.

/**
* This is a helper class to communicate with the etherpadlite server
*
* @package mod
* @subpackage etherpadlite
* @package mod_etherpadlite
*
* @author Timo Welde <[email protected]>
* @link https://github.com/TomNomNom/etherpad-lite-client
Expand Down
19 changes: 16 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
<?php // $Id: index.php,v 1.7.2.3 2009/08/31 22:00:00 mudrd8mz Exp $
<?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/>.

/**
* This page lists all the instances of etherpadlite in a particular course
*
* @package mod
* @subpackage etherpadlite
* @package mod_etherpadlite
*
* @author Timo Welde <[email protected]>
* @copyright 2012 Humboldt-Universität zu Berlin <[email protected]>
Expand Down
35 changes: 24 additions & 11 deletions lang/de/etherpadlite.php
Original file line number Diff line number Diff line change
@@ -1,19 +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/>.

/**
* This file holds the german language
*
* @package mod
* @subpackage etherpadlite
*
* @author Timo Welde <[email protected]>
* @copyright 2012 Humboldt-Universität zu Berlin <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
/**
* This file holds the german language
*
* @package mod_etherpadlite
*
* @author Timo Welde <[email protected]>
* @copyright 2012 Humboldt-Universität zu Berlin <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

$string['etherpadlite'] = 'Etherpad Lite (beta)';
$string['modulename_help'] = 'Das Etherpad Lite modul erlaubt es Studenten und Lehrenden kollaborativ zu schreiben (Der Text wird synchronisiert, während sie schreiben)
$string['modulename_help'] = 'Das Etherpad Lite modul erlaubt es Studenten und Lehrenden kollaborativ zu schreiben (Der Text wird synchronisiert, während sie schreiben)
(Der Etherpad-Server, welcher hinter diesem Modul steht, ist noch im beta Stadium. Deshalb können Probleme auftreten, was allerdings nicht erwartet wird)';

$string['etherpadlite:addinstance'] = 'Neues Pad hinzufügen';
Expand Down
35 changes: 24 additions & 11 deletions lang/en/etherpadlite.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
<?php

/**
* This file holds the english language
*
* @package mod
* @subpackage etherpadlite
*
* @author Timo Welde <[email protected]>
* @copyright 2012 Humboldt-Universität zu Berlin <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
// 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/>.

/**
* This file holds the english language
*
* @package mod_etherpadlite
*
* @author Timo Welde <[email protected]>
* @copyright 2012 Humboldt-Universität zu Berlin <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

$string['etherpadlite'] = 'Etherpad Lite';
Expand Down Expand Up @@ -49,7 +62,7 @@
$string['ssl'] = 'Https Redirect';
$string['ssldesc'] = 'With this set, your site will redirect itself to https, if an etherpad is opened (eyecandy for the user)';

$string['checkssl'] = 'Verify HTTPS cert';
$string['checkssl'] = 'Verify HTTPS cert';
$string['checkssldesc'] = 'With this set, the HTTPS certificate of the etherpadlite server will be checked, to prevent man in the middle attacks';

$string['adminguests'] = 'Guests allowed to write?';
Expand Down
Loading

0 comments on commit b504818

Please sign in to comment.