Skip to content

Commit b504818

Browse files
committed
Merge branch 'dev_MOODLE26'
2 parents 7604091 + efc8e84 commit b504818

18 files changed

+267
-142
lines changed

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# About
22

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

55
Features:
66

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

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

21-
We recommend to use the etherpad-lite version 1.2.7
21+
We recommend to use the etherpad-lite version 1.3.0
2222

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

26-
*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*
26+
*we are using nodejs 0.8.26. But we test new ep-lite versions always with this node version, before updating productive*
2727

28-
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>
28+
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>
2929
*To access the admin area, uncomment the user section in settings.json*
3030

3131
### Working ep-lite installation
3232
- Ubuntu 12.04
33-
- apt-get nodejs, npm, git, nginx, abiword, make, g++
34-
- etherpad-lite from git (v1.2.7)
33+
- apt-get git, nginx, abiword, make, g++
34+
- donwload nodejs from nodejs.org and compile it (you can use 'n' to switch between versions <https://www.npmjs.org/package/n>)
35+
- etherpad-lite from git
3536
- ep-lite settings.json:
3637
- "requireSession":true
3738
- "editOnly":true
@@ -55,6 +56,4 @@ When you want, that the server is only accessible via Moodle, then i recommend t
5556
5. Session elapse time: How long should one session be valid?
5657
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)
5758
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
58-
8. Guests allowed to write?: As described
59-
60-
*tested with Moodle 2.3 & 2.4*
59+
8. Guests allowed to write?: As described

backup/moodle2/backup_etherpadlite_activity_task.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1717

1818
/**
19-
* @package mod
20-
* @subpackage etherpadlite
19+
* @package mod_etherpadlite
2120
*
2221
* @author Timo Welde <tjwelde@gmail.com>
2322
* @copyright 2012 Humboldt-Universität zu Berlin <moodle-support@cms.hu-berlin.de>

backup/moodle2/backup_etherpadlite_settingslib.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1717

1818
/**
19-
* @package mod
20-
* @subpackage etherpadlite
19+
* @package mod_etherpadlite
2120
*
2221
* @author Timo Welde <tjwelde@gmail.com>
2322
* @copyright 2012 Humboldt-Universität zu Berlin <moodle-support@cms.hu-berlin.de>

backup/moodle2/backup_etherpadlite_stepslib.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1717

1818
/**
19-
* @package mod
20-
* @subpackage etherpadlite
19+
* @package mod_etherpadlite
2120
*
2221
* @author Timo Welde <tjwelde@gmail.com>
2322
* @copyright 2012 Humboldt-Universität zu Berlin <moodle-support@cms.hu-berlin.de>
@@ -51,14 +50,14 @@ protected function define_structure() {
5150
// Define sources
5251
$eplite->set_source_table('etherpadlite', array('id' => backup::VAR_ACTIVITYID));
5352

54-
// All the rest of elements only happen if we are including user info
53+
// All the rest of elements only happen if we are including user info
5554
if ($userinfo) {
56-
// The HTML content of the pad
57-
$modid = $this->task->get_activityid();
58-
$padID = $DB->get_field('etherpadlite', 'uri', array('id' => $modid));
55+
// The HTML content of the pad
56+
$modid = $this->task->get_activityid();
57+
$padID = $DB->get_field('etherpadlite', 'uri', array('id' => $modid));
5958
$html = $instance->getHTML($padID);
6059
$text = $instance->getText($padID);
61-
60+
6261
$content->set_source_array(array((object)array('html'=>$html->html, 'text'=>$text->text)));
6362
}
6463

backup/moodle2/restore_etherpadlite_activity_task.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1717

1818
/**
19-
* @package mod
20-
* @subpackage etherpadlite
19+
* @package mod_etherpadlite
2120
*
2221
* @author Timo Welde <tjwelde@gmail.com>
2322
* @copyright 2012 Humboldt-Universität zu Berlin <moodle-support@cms.hu-berlin.de>

backup/moodle2/restore_etherpadlite_stepslib.php

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1717

1818
/**
19-
* @package mod
20-
* @subpackage etherpadlite
19+
* @package mod_etherpadlite
2120
*
2221
* @author Timo Welde <tjwelde@gmail.com>
2322
* @copyright 2012 Humboldt-Universität zu Berlin <moodle-support@cms.hu-berlin.de>
@@ -52,31 +51,31 @@ protected function process_etherpadlite($data) {
5251
$oldid = $data->id;
5352
$data->course = $this->get_courseid();
5453

55-
// php.ini separator.output auf '&' setzen
56-
$separator = ini_get('arg_separator.output');
57-
ini_set('arg_separator.output', '&');
58-
59-
$instance = new EtherpadLiteClient($config->apikey,$config->url.'api');
60-
61-
try {
62-
$createGroup = $instance->createGroup();
63-
$groupID = $createGroup->groupID;
64-
//echo "New GroupID is $groupID\n\n";
65-
} catch (Exception $e) {
66-
// the group already exists or something else went wrong
67-
echo "\n\ncreateGroup Failed with message ". $e->getMessage();
68-
}
69-
70-
try {
71-
$newpad = $instance->createGroupPad($groupID, $config->padname);
72-
$padID = $newpad->padID;
73-
//echo "Created new pad with padID: $padID\n\n";
74-
} catch (Exception $e) {
75-
// the pad already exists or something else went wrong
76-
echo "\n\ncreateGroupPad Failed with message ". $e->getMessage();
77-
}
78-
79-
// seperator.output wieder zur�cksetzen
54+
// php.ini separator.output auf '&' setzen
55+
$separator = ini_get('arg_separator.output');
56+
ini_set('arg_separator.output', '&');
57+
58+
$instance = new EtherpadLiteClient($config->apikey,$config->url.'api');
59+
60+
try {
61+
$createGroup = $instance->createGroup();
62+
$groupID = $createGroup->groupID;
63+
//echo "New GroupID is $groupID\n\n";
64+
} catch (Exception $e) {
65+
// the group already exists or something else went wrong
66+
echo "\n\ncreateGroup Failed with message ". $e->getMessage();
67+
}
68+
69+
try {
70+
$newpad = $instance->createGroupPad($groupID, $config->padname);
71+
$padID = $newpad->padID;
72+
//echo "Created new pad with padID: $padID\n\n";
73+
} catch (Exception $e) {
74+
// the pad already exists or something else went wrong
75+
echo "\n\ncreateGroupPad Failed with message ". $e->getMessage();
76+
}
77+
78+
// seperator.output wieder zur�cksetzen
8079
ini_set('arg_separator.output', $separator);
8180

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

103102

104-
// php.ini separator.output auf '&' setzen
105-
$separator = ini_get('arg_separator.output');
106-
ini_set('arg_separator.output', '&');
107-
103+
// php.ini separator.output auf '&' setzen
104+
$separator = ini_get('arg_separator.output');
105+
ini_set('arg_separator.output', '&');
106+
108107
$instance = new EtherpadLiteClient($config->apikey,$config->url.'api');
109108

110-
try {
111-
$instance->setHTML($padID, '<html>'.$data->html.'</html>');
112-
} catch (Exception $e) {
113-
// something went wrong
114-
echo "\n\nsetHTML Failed with message ". $e->getMessage();
115-
}
109+
try {
110+
$instance->setHTML($padID, '<html>'.$data->html.'</html>');
111+
} catch (Exception $e) {
112+
// something went wrong
113+
echo "\n\nsetHTML Failed with message ". $e->getMessage();
114+
}
116115

117-
// seperator.output wieder zur�cksetzen
116+
// seperator.output wieder zur�cksetzen
118117
ini_set('arg_separator.output', $separator);
119118
}
120119

db/access.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
/**
1818
* Plugin capabilities
1919
*
20-
* @package mod
21-
* @subpackage etherpadlite
22-
*
20+
* @package mod_etherpadlite
21+
*
2322
* @author Timo Welde <tjwelde@gmail.com>
2423
* @copyright 2012 Humboldt-Universität zu Berlin <moodle-support@cms.hu-berlin.de>
2524
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

db/log.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
/**
1919
* Definition of log events
2020
*
21-
* @package mod
22-
* @subpackage etherpadlite
23-
*
21+
* @package mod_etherpadlite
22+
*
2423
* @author Timo Welde <tjwelde@gmail.com>
2524
* @copyright 2012 Humboldt-Universität zu Berlin <moodle-support@cms.hu-berlin.de>
2625
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

db/upgrade.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1-
<?php //$Id: upgrade.php,v 1.2 2007/08/08 22:36:54 stronk7 Exp $
1+
<?php
2+
// This file is part of Moodle - http://moodle.org/
3+
//
4+
// Moodle is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// Moodle is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
216

317
/**
418
* This file keeps track of upgrades to
519
* the etherpadlite module
620
*
7-
* @package mod
8-
* @subpackage etherpadlite
21+
* @package mod_etherpadlite
922
*
1023
* @author Timo Welde <tjwelde@gmail.com>
1124
* @copyright 2012 Humboldt-Universität zu Berlin <moodle-support@cms.hu-berlin.de>

etherpad-lite-client.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
<?php
2+
// This file is part of Moodle - http://moodle.org/
3+
//
4+
// Moodle is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// Moodle is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
216

317
/**
418
* This is a helper class to communicate with the etherpadlite server
519
*
6-
* @package mod
7-
* @subpackage etherpadlite
20+
* @package mod_etherpadlite
821
*
922
* @author Timo Welde <tjwelde@gmail.com>
1023
* @link https://github.com/TomNomNom/etherpad-lite-client

0 commit comments

Comments
 (0)