Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Update strings in etherpad.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Jul 7, 2013
1 parent 327fee0 commit 2d1ee88
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 9 deletions.
29 changes: 27 additions & 2 deletions core/src/plugins/editor.etherpad/class.EtherpadClient.php
@@ -1,11 +1,36 @@
<?php
/*
* Copyright 2007-2011 Charles du Jeu <contact (at) cdujeu.me>
* This file is part of AjaXplorer.
*
* AjaXplorer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AjaXplorer 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with AjaXplorer. If not, see <http://www.gnu.org/licenses/>.
*
* The latest code can be found at <http://www.ajaxplorer.info/>.
*/

defined('AJXP_EXEC') or die( 'Access not allowed');

class EtherpadClient extends AJXP_Plugin{

var $baseURL = "http://10.211.55.3:9001";
var $baseURL = "http://localhost:9001";
var $apiKey = "";

public function switchAction($actionName, $httpVars, $fileVars){

$this->baseURL = rtrim($this->pluginConf["ETHERPAD_SERVER"], "/");
$this->apiKey = $this->pluginConf["ETHERPAD_APIKEY"];

if(isSet($httpVars["file"])){

$repository = ConfService::getRepository();
Expand All @@ -23,7 +48,7 @@ public function switchAction($actionName, $httpVars, $fileVars){
}

require_once("etherpad-client/etherpad-lite-client.php");
$client = new EtherpadLiteClient("nl8VJIWXZMHNj7aWj6rWy4CLct1mu97v",$this->baseURL."/api");
$client = new EtherpadLiteClient($this->apiKey,$this->baseURL."/api");
$userName = AuthService::getLoggedUser()->getId();
$res = $client->createAuthorIfNotExistsFor($userName, $userName);
$authorID = $res->authorID;
Expand Down
6 changes: 3 additions & 3 deletions core/src/plugins/editor.etherpad/class.EtherpadLauncher.js
Expand Up @@ -67,14 +67,14 @@ Class.create("EtherpadLauncher", AbstractEditor, {
files.push(label);
}
});
selector.insert(new Element('optgroup',{label:'Free boards'}));
selector.insert(new Element('optgroup',{label:MessageHash['etherpad.5']}));
frees.each(function(e){
selector.insert(new Element('option', {value:e}).update(e.replace('FREEPAD__', '')));
});
selector.insert(new Element('option', {value:-1}).update('Create new pad'));
selector.insert(new Element('option', {value:-1}).update(MessageHash['etherpad.9']));

if(files.size()){
selector.insert(new Element('optgroup', {label:'Files'}));
selector.insert(new Element('optgroup', {label:MessageHash['etherpad.6']}));
files.each(function(e){
selector.insert(new Element('option', {value:e}).update(e));
});
Expand Down
30 changes: 28 additions & 2 deletions core/src/plugins/editor.etherpad/i18n/en.php
@@ -1,7 +1,33 @@
<?php
/*
* Copyright 2007-2011 Charles du Jeu <contact (at) cdujeu.me>
* This file is part of AjaXplorer.
*
* AjaXplorer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AjaXplorer 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with AjaXplorer. If not, see <http://www.gnu.org/licenses/>.
*
* The latest code can be found at <http://www.ajaxplorer.info/>.
*/

$mess = array(
"1" => "Collaboration board",
"1b"=> "Create an empty collaboration pad",
"1b"=> "Create or join an empty collaboration pad",
"2" => "Collaborative Editor",
"3" => "Real-time collaborative edition"
"3" => "Real-time collaborative edition",
"4" => "Join an existing board or create a new one: ",
"5" => "Free boards",
"6" => "Files",
"7" => "Join",
"8" => "Board name",
"9" => "Create new board",
);
33 changes: 33 additions & 0 deletions core/src/plugins/editor.etherpad/i18n/fr.php
@@ -0,0 +1,33 @@
<?php
/*
* Copyright 2007-2011 Charles du Jeu <contact (at) cdujeu.me>
* This file is part of AjaXplorer.
*
* AjaXplorer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AjaXplorer 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with AjaXplorer. If not, see <http://www.gnu.org/licenses/>.
*
* The latest code can be found at <http://www.ajaxplorer.info/>.
*/

$mess = array(
"1" => "Ardoise de Collaboration",
"1b"=> "Créer ou rejoindre une ardoise",
"2" => "Edition collaborative",
"3" => "Edition collaborative en temps en réel",
"4" => "Rejoindre une ardoise de collaboration, ou en créer une nouvelle",
"5" => "Ardoises libres",
"6" => "Fichiers",
"7" => "Rejoindre",
"8" => "Nom de l'ardoise",
"9" => "Créer une nouvelle ardoise",
);
8 changes: 6 additions & 2 deletions core/src/plugins/editor.etherpad/manifest.xml
Expand Up @@ -9,6 +9,10 @@
<i18n path="plugins/editor.etherpad/i18n" namespace="etherpad"/>
</resources>
</client_settings>
<server_settings>
<global_param name="ETHERPAD_SERVER" type="string" label="Server Host" description="Etherpad server host"/>
<global_param name="ETHERPAD_APIKEY" type="string" label="Api Key" description="Etherpad api key"/>
</server_settings>
<clientForm id="ether_box"><![CDATA[
<div id="ether_box" action="editer" box_width="80%" box_height="90%" box_padding="0">
<div class="action_bar">
Expand Down Expand Up @@ -42,8 +46,8 @@
<clientForm id="etherpad_container"><![CDATA[
<div id="etherpad_container" box_width="80%" box_height="80%" box_resize="true" box_padding="0">
<div class="action_bar" style="padding-left: 10px;border-bottom: 1px solid #ccc;padding-bottom: 5px;">
Join an existing board or create a new one: <select name="pad_list"></select> <input type="text" name="new_pad_name" placeholder="Board name" style="display:none;">
<a id="join_pad" style="float:none;" class="icon-comments-alt" href="#" title="Join" style=""><span message_id="235" class="actionbar_button_label">Join</span></a>
AJXP_MESSAGE[etherpad.4]<select name="pad_list"></select> <input type="text" name="new_pad_name" placeholder="AJXP_MESSAGE[etherpad.8]" style="display:none;">
<a id="join_pad" style="float:none;" class="icon-comments-alt" href="#" title="Join" style=""><span message_id="235" class="actionbar_button_label">AJXP_MESSAGE[etherpad.7]</span></a>
</div>
<iframe id="ether_frame" style="width:100%;border: none;" src=""></iframe>
</div>
Expand Down

0 comments on commit 2d1ee88

Please sign in to comment.