Fix appid
This commit is contained in:
Родитель
840a124b66
Коммит
447610b260
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace OCA\Documents;
|
||||
namespace OCA\Richdocuments;
|
||||
|
||||
use \OCA\Documents\AppInfo\Application;
|
||||
use \OCA\Richdocuments\AppInfo\Application;
|
||||
|
||||
$app = new Application();
|
||||
$response = $app->getContainer()->query('\OCA\Documents\Controller\SettingsController')->adminIndex();
|
||||
$response = $app->getContainer()->query('\OCA\Richdocuments\Controller\SettingsController')->adminIndex();
|
||||
return $response->render();
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Frank Karlitschek
|
||||
* @copyright 2013-2014 Frank Karlitschek karlitschek@kde.org
|
||||
|
@ -21,23 +21,23 @@
|
|||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Documents\AppInfo;
|
||||
namespace OCA\Richdocuments\AppInfo;
|
||||
|
||||
use OCA\Documents\Filter\Office;
|
||||
use OCA\Documents\Config;
|
||||
use OCA\Richdocuments\Filter\Office;
|
||||
use OCA\Richdocuments\Config;
|
||||
|
||||
$app = new Application();
|
||||
$c = $app->getContainer();
|
||||
|
||||
\OCP\App::registerAdmin('documents', 'admin');
|
||||
\OCP\App::registerPersonal('documents', 'personal');
|
||||
\OCP\App::registerAdmin('richdocuments', 'admin');
|
||||
\OCP\App::registerPersonal('richdocuments', 'personal');
|
||||
|
||||
$navigationEntry = function () use ($c) {
|
||||
return [
|
||||
'id' => 'documents_index',
|
||||
'id' => 'richdocuments_index',
|
||||
'order' => 2,
|
||||
'href' => $c->query('ServerContainer')->getURLGenerator()->linkToRoute('documents.document.index'),
|
||||
'icon' => $c->query('ServerContainer')->getURLGenerator()->imagePath('documents', 'documents.svg'),
|
||||
'href' => $c->query('ServerContainer')->getURLGenerator()->linkToRoute('richdocuments.document.index'),
|
||||
'icon' => $c->query('ServerContainer')->getURLGenerator()->imagePath('richdocuments', 'documents.svg'),
|
||||
'name' => $c->query('L10N')->t('Collabora Online Development Edition')
|
||||
];
|
||||
};
|
||||
|
@ -49,7 +49,7 @@ if (isset($request->server['REQUEST_URI'])) {
|
|||
$url = $request->server['REQUEST_URI'];
|
||||
|
||||
if (preg_match('%index.php/apps/files(/.*)?%', $url)) {
|
||||
\OCP\Util::addScript('documents', 'viewer/viewer');
|
||||
\OCP\Util::addScript('richdocuments', 'viewer/viewer');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -311,4 +311,4 @@ if ($c->query('AppConfig')->isConverterEnabled()){
|
|||
}
|
||||
|
||||
//Listen to delete file signal
|
||||
\OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Documents\Storage", "onDelete");
|
||||
\OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Richdocuments\Storage", "onDelete");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -9,19 +9,19 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents\AppInfo;
|
||||
namespace OCA\Richdocuments\AppInfo;
|
||||
|
||||
use \OCP\AppFramework\App;
|
||||
|
||||
use \OCA\Documents\Controller\UserController;
|
||||
use \OCA\Documents\Controller\SessionController;
|
||||
use \OCA\Documents\Controller\DocumentController;
|
||||
use \OCA\Documents\Controller\SettingsController;
|
||||
use \OCA\Documents\AppConfig;
|
||||
use \OCA\Richdocuments\Controller\UserController;
|
||||
use \OCA\Richdocuments\Controller\SessionController;
|
||||
use \OCA\Richdocuments\Controller\DocumentController;
|
||||
use \OCA\Richdocuments\Controller\SettingsController;
|
||||
use \OCA\Richdocuments\AppConfig;
|
||||
|
||||
class Application extends App {
|
||||
public function __construct (array $urlParams = array()) {
|
||||
parent::__construct('documents', $urlParams);
|
||||
parent::__construct('richdocuments', $urlParams);
|
||||
|
||||
$container = $this->getContainer();
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<overwrite>false</overwrite>
|
||||
<charset>utf8</charset>
|
||||
<table>
|
||||
<name>*dbprefix*documents_session</name>
|
||||
<name>*dbprefix*richdocuments_session</name>
|
||||
<declaration>
|
||||
|
||||
<field>
|
||||
|
@ -43,7 +43,7 @@
|
|||
</field>
|
||||
|
||||
<index>
|
||||
<name>documents_session_ei_idx</name>
|
||||
<name>richdocuments_session_ei_idx</name>
|
||||
<primary>true</primary>
|
||||
<unique>true</unique>
|
||||
<field>
|
||||
|
@ -56,7 +56,7 @@
|
|||
</table>
|
||||
|
||||
<table>
|
||||
<name>*dbprefix*documents_member</name>
|
||||
<name>*dbprefix*richdocuments_member</name>
|
||||
<declaration>
|
||||
|
||||
<field>
|
||||
|
@ -119,7 +119,7 @@
|
|||
</table>
|
||||
|
||||
<table>
|
||||
<name>*dbprefix*documents_op</name>
|
||||
<name>*dbprefix*richdocuments_op</name>
|
||||
<declaration>
|
||||
|
||||
<field>
|
||||
|
@ -162,7 +162,7 @@
|
|||
</field>
|
||||
|
||||
<index>
|
||||
<name>seq_pKey</name>
|
||||
<name>richdocs_seq_pKey</name>
|
||||
<primary>true</primary>
|
||||
<field>
|
||||
<name>seq</name>
|
||||
|
@ -170,7 +170,7 @@
|
|||
</field>
|
||||
</index>
|
||||
<index>
|
||||
<name>documents_op_eis_idx</name>
|
||||
<name>richdocuments_op_eis_idx</name>
|
||||
<unique>true</unique>
|
||||
<field>
|
||||
<name>es_id</name>
|
||||
|
@ -185,7 +185,7 @@
|
|||
</declaration>
|
||||
</table>
|
||||
<table>
|
||||
<name>*dbprefix*documents_invite</name>
|
||||
<name>*dbprefix*richdocuments_invite</name>
|
||||
<declaration>
|
||||
|
||||
<field>
|
||||
|
@ -218,7 +218,7 @@
|
|||
</declaration>
|
||||
</table>
|
||||
<table>
|
||||
<name>*dbprefix*documents_revisions</name>
|
||||
<name>*dbprefix*richdocuments_revisions</name>
|
||||
<declaration>
|
||||
|
||||
<field>
|
||||
|
@ -259,7 +259,7 @@
|
|||
</field>
|
||||
|
||||
<index>
|
||||
<name>documents_rev_eis_idx</name>
|
||||
<name>richdocuments_rev_eis_idx</name>
|
||||
<unique>true</unique>
|
||||
<field>
|
||||
<name>es_id</name>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<info>
|
||||
<id>documents</id>
|
||||
<id>richdocuments</id>
|
||||
<name>Collabora Online Development Edition</name>
|
||||
<description>An ownCloud app to work with office documents</description>
|
||||
<licence>AGPL</licence>
|
||||
|
@ -13,7 +13,6 @@
|
|||
<owncloud min-version="8.1" max-version="9.0" />
|
||||
</dependencies>
|
||||
<public>
|
||||
<documents>public.php</documents>
|
||||
<richdocuments>public.php</richdocuments>
|
||||
</public>
|
||||
<ocsid>168711</ocsid>
|
||||
</info>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2013-2014 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -9,9 +9,9 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents;
|
||||
namespace OCA\Richdocuments;
|
||||
|
||||
$application = new \OCA\Documents\AppInfo\Application();
|
||||
$application = new \OCA\Richdocuments\AppInfo\Application();
|
||||
$application->registerRoutes($this, [
|
||||
'routes' => [
|
||||
//users
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
*/
|
||||
|
||||
$config = \OC::$server->getConfig();
|
||||
$dbConnection = \OC::$server->getDatabaseConnection();
|
||||
$installedVersion = $config->getAppValue('documents', 'installed_version');
|
||||
|
||||
$cleanup = $dbConnection->prepare('DELETE FROM `*PREFIX*documents_member` WHERE `last_activity`=0 or `last_activity` is NULL');
|
||||
$cleanup->execute();
|
||||
|
||||
if (version_compare($installedVersion, '0.7', '<=')) {
|
||||
$config->setAppValue('documents', 'unstable', 'false');
|
||||
$session = new \OCA\Documents\Db\Session();
|
||||
|
||||
$query = $dbConnection->prepare('UPDATE `*PREFIX*documents_session` SET `genesis_url`=? WHERE `es_id`=?');
|
||||
|
||||
foreach ($session->getCollection() as $sessionData){
|
||||
$sessionData['genesis_url'] = \OCA\Documents\Genesis::DOCUMENTS_DIRNAME . $sessionData['genesis_url'];
|
||||
$query->execute(array(
|
||||
$sessionData['genesis_url'],
|
||||
$sessionData['es_id']
|
||||
));
|
||||
|
||||
}
|
||||
}
|
||||
if (version_compare($installedVersion, '0.8', '<')) {
|
||||
$query = $dbConnection->prepare('UPDATE `*PREFIX*documents_member` SET `is_guest`=1 WHERE `uid` LIKE \'%(guest)\' ');
|
||||
$query->execute(array());
|
||||
}
|
||||
|
||||
if (version_compare($installedVersion, '0.9', '<')) {
|
||||
$query = $dbConnection->prepare('UPDATE `*PREFIX*documents_op` SET `optype`=? WHERE `seq`=?');
|
||||
$ops = new \OCA\Documents\Db\Op();
|
||||
foreach ($ops->getCollection() as $opData){
|
||||
$opSpec = json_decode($opData['opspec'], true);
|
||||
$query->execute(
|
||||
array(
|
||||
$opSpec['optype'],
|
||||
$opData['seq']
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -9,7 +9,7 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents\Controller;
|
||||
namespace OCA\Richdocuments\Controller;
|
||||
|
||||
use \OCP\AppFramework\Controller;
|
||||
use \OCP\IRequest;
|
||||
|
@ -19,13 +19,13 @@ use \OCP\AppFramework\Http\ContentSecurityPolicy;
|
|||
use \OCP\AppFramework\Http\JSONResponse;
|
||||
use \OCP\AppFramework\Http\TemplateResponse;
|
||||
|
||||
use \OCA\Documents\Db;
|
||||
use \OCA\Documents\Helper;
|
||||
use \OCA\Documents\Storage;
|
||||
use \OCA\Documents\Download;
|
||||
use \OCA\Documents\DownloadResponse;
|
||||
use \OCA\Documents\File;
|
||||
use OCA\Documents\Genesis;
|
||||
use \OCA\Richdocuments\Db;
|
||||
use \OCA\Richdocuments\Helper;
|
||||
use \OCA\Richdocuments\Storage;
|
||||
use \OCA\Richdocuments\Download;
|
||||
use \OCA\Richdocuments\DownloadResponse;
|
||||
use \OCA\Richdocuments\File;
|
||||
use OCA\Richdocuments\Genesis;
|
||||
use \OC\Files\View;
|
||||
|
||||
class DocumentController extends Controller{
|
||||
|
@ -49,12 +49,12 @@ class DocumentController extends Controller{
|
|||
* @NoCSRFRequired
|
||||
*/
|
||||
public function index(){
|
||||
\OC::$server->getNavigationManager()->setActiveEntry( 'documents_index' );
|
||||
\OC::$server->getNavigationManager()->setActiveEntry( 'richdocuments_index' );
|
||||
$maxUploadFilesize = \OCP\Util::maxUploadFilesize("/");
|
||||
$response = new TemplateResponse('documents', 'documents', [
|
||||
$response = new TemplateResponse('richdocuments', 'documents', [
|
||||
'enable_previews' => $this->settings->getSystemValue('enable_previews', true),
|
||||
'useUnstable' => $this->settings->getAppValue('documents', 'unstable', 'false'),
|
||||
'savePath' => $this->settings->getUserValue($this->uid, 'documents', 'save_path', '/'),
|
||||
'useUnstable' => $this->settings->getAppValue('richdocuments', 'unstable', 'false'),
|
||||
'savePath' => $this->settings->getUserValue($this->uid, 'richdocuments', 'save_path', '/'),
|
||||
'uploadMaxFilesize' => $maxUploadFilesize,
|
||||
'uploadMaxHumanFilesize' => \OCP\Util::humanFileSize($maxUploadFilesize),
|
||||
'allowShareWithLink' => $this->settings->getAppValue('core', 'shareapi_allow_links', 'yes'),
|
||||
|
@ -240,7 +240,7 @@ class DocumentController extends Controller{
|
|||
$fullPath = '/files' . $path;
|
||||
$fileInfo = \OC\Files\Filesystem::getFileInfo($path);
|
||||
if ($fileInfo){
|
||||
if($fileInfo->getMimeType() !== \OCA\Documents\Filter\Office::NATIVE_MIMETYPE){
|
||||
if($fileInfo->getMimeType() !== \OCA\Richdocuments\Filter\Office::NATIVE_MIMETYPE){
|
||||
$file = new File($fileInfo->getId());
|
||||
$genesis = new Genesis($file);
|
||||
$fullPath = $genesis->getPath();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -9,17 +9,17 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents\Controller;
|
||||
namespace OCA\Richdocuments\Controller;
|
||||
|
||||
use \OCP\AppFramework\Controller;
|
||||
use \OCP\IRequest;
|
||||
use \OCP\AppFramework\Http;
|
||||
use \OCP\AppFramework\Http\JSONResponse;
|
||||
|
||||
use \OCA\Documents\Db;
|
||||
use \OCA\Documents\File;
|
||||
use \OCA\Documents\Helper;
|
||||
use OCA\Documents\Filter;
|
||||
use \OCA\Richdocuments\Db;
|
||||
use \OCA\Richdocuments\File;
|
||||
use \OCA\Richdocuments\Helper;
|
||||
use OCA\Richdocuments\Filter;
|
||||
use \OC\Files\View;
|
||||
|
||||
class BadRequestException extends \Exception {
|
||||
|
@ -219,7 +219,7 @@ class SessionController extends Controller{
|
|||
if ($this->uid){
|
||||
$view = new View('/' . $this->uid . '/files');
|
||||
|
||||
$dir = \OC::$server->getConfig()->getUserValue($this->uid, 'documents', 'save_path', '');
|
||||
$dir = \OC::$server->getConfig()->getUserValue($this->uid, 'richdocuments', 'save_path', '');
|
||||
$path = Helper::getNewFileName($view, $dir . 'New Document.odt');
|
||||
} else {
|
||||
throw $e;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -9,7 +9,7 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents\Controller;
|
||||
namespace OCA\Richdocuments\Controller;
|
||||
|
||||
use \OCP\AppFramework\Controller;
|
||||
use \OCP\IRequest;
|
||||
|
@ -17,9 +17,9 @@ use \OCP\IL10N;
|
|||
use \OCP\AppFramework\Http\JSONResponse;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
|
||||
use OCA\Documents\AppConfig;
|
||||
use OCA\Documents\Converter;
|
||||
use OCA\Documents\Filter;
|
||||
use OCA\Richdocuments\AppConfig;
|
||||
use OCA\Richdocuments\Converter;
|
||||
use OCA\Richdocuments\Filter;
|
||||
|
||||
class SettingsController extends Controller{
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -10,13 +10,13 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OCA\Documents\Controller;
|
||||
namespace OCA\Richdocuments\Controller;
|
||||
|
||||
use \OCP\AppFramework\Controller;
|
||||
use \OCP\IRequest;
|
||||
use \OCP\AppFramework\Http\JSONResponse;
|
||||
|
||||
use \OCA\Documents\Db;
|
||||
use \OCA\Richdocuments\Db;
|
||||
|
||||
class UserController extends Controller {
|
||||
|
||||
|
|
|
@ -25,11 +25,11 @@
|
|||
/*global runtime, define, document, core, odf, gui, ops*/
|
||||
|
||||
define("webodf/editor/EditorSession", [
|
||||
"dojo/text!" + OC.filePath('documents', 'css', 'fonts.css')
|
||||
"dojo/text!" + OC.filePath('richdocuments', 'css', 'fonts.css')
|
||||
], function (fontsCSS) { // fontsCSS is retrieved as a string, using dojo's text retrieval AMD plugin
|
||||
"use strict";
|
||||
|
||||
fontsCSS = fontsCSS.replace(/\.\/fonts/g, OC.appswebroots['documents']+'/css/fonts');
|
||||
fontsCSS = fontsCSS.replace(/\.\/fonts/g, OC.appswebroots['richdocuments']+'/css/fonts');
|
||||
|
||||
runtime.loadClass("core.Async");
|
||||
runtime.loadClass("core.DomUtils");
|
||||
|
|
|
@ -43,7 +43,7 @@ define("owncloud/ServerFactory", [
|
|||
|
||||
server = new PullBoxServer(args);
|
||||
server.getGenesisUrl = function(sid) {
|
||||
return OC.generateUrl('apps/documents/ajax/genesis/{es_id}', {es_id: sid}) + '?requesttoken=' + encodeURIComponent(oc_requesttoken);
|
||||
return OC.generateUrl('apps/richdocuments/ajax/genesis/{es_id}', {es_id: sid}) + '?requesttoken=' + encodeURIComponent(oc_requesttoken);
|
||||
};
|
||||
return server;
|
||||
};
|
||||
|
|
|
@ -13,9 +13,9 @@ $(document).ready(function(){
|
|||
data.url = $('#docs_url').val();
|
||||
}
|
||||
|
||||
OC.msg.startAction('#documents-admin-msg', t('documents', 'Saving...'));
|
||||
OC.msg.startAction('#documents-admin-msg', t('richdocuments', 'Saving...'));
|
||||
$.post(
|
||||
OC.filePath('documents', 'ajax', 'admin.php'),
|
||||
OC.filePath('richdocuments', 'ajax', 'admin.php'),
|
||||
data,
|
||||
documentsSettings.afterSave
|
||||
);
|
||||
|
|
|
@ -78,7 +78,7 @@ $.widget('oc.documentGrid', {
|
|||
_load : function (){
|
||||
var that = this;
|
||||
var def = new $.Deferred();
|
||||
$.getJSON(OC.generateUrl('apps/documents/ajax/documents/list'))
|
||||
$.getJSON(OC.generateUrl('apps/richdocuments/ajax/documents/list'))
|
||||
.done(function (data) {
|
||||
that.options.documents = data.documents;
|
||||
that.options.sessions = data.sessions;
|
||||
|
@ -86,7 +86,7 @@ $.widget('oc.documentGrid', {
|
|||
def.resolve();
|
||||
})
|
||||
.fail(function(data){
|
||||
console.log(t('documents','Failed to load documents.'));
|
||||
console.log(t('richdocuments','Failed to load documents.'));
|
||||
});
|
||||
return def;
|
||||
},
|
||||
|
@ -121,7 +121,7 @@ $.widget('oc.documentGrid', {
|
|||
|
||||
if (!hasDocuments){
|
||||
$(this.options.context).before('<div id="emptycontent">'
|
||||
+ t('documents', 'No documents were found. Upload or create a document to get started!')
|
||||
+ t('richdocuments', 'No documents were found. Upload or create a document to get started!')
|
||||
+ '</div>'
|
||||
);
|
||||
} else {
|
||||
|
@ -239,7 +239,7 @@ var documentsMain = {
|
|||
$('#memberList .memberListButton').css({opacity : 0.3});
|
||||
$('#ocToolbar').children(':not(#document-title)').hide();
|
||||
$('<div id="connection-lost"></div>').prependTo('#memberList');
|
||||
$('<div id="warning-connection-lost">' + t('documents', 'No connection to server. Trying to reconnect.') +'<img src="'+ OC.imagePath('core', 'loading-dark.gif') +'" alt="" /></div>').prependTo('#ocToolbar');
|
||||
$('<div id="warning-connection-lost">' + t('richdocuments', 'No connection to server. Trying to reconnect.') +'<img src="'+ OC.imagePath('core', 'loading-dark.gif') +'" alt="" /></div>').prependTo('#ocToolbar');
|
||||
},
|
||||
|
||||
hideLostConnection : function() {
|
||||
|
@ -289,7 +289,7 @@ var documentsMain = {
|
|||
documentsMain.isEditorMode = true;
|
||||
documentsMain.overlay.documentOverlay('show');
|
||||
$(window).on('beforeunload', function(){
|
||||
return t('documents', "Leaving this page in Editor mode might cause unsaved data. It is recommended to use 'Close' button instead.");
|
||||
return t('richdocuments', "Leaving this page in Editor mode might cause unsaved data. It is recommended to use 'Close' button instead.");
|
||||
});
|
||||
$(window).on("unload", documentsMain.onTerminate);
|
||||
},
|
||||
|
@ -308,7 +308,7 @@ var documentsMain = {
|
|||
$(documentsMain.toolbar).appendTo('#header');
|
||||
|
||||
if (!response || !response.status || response.status==='error'){
|
||||
documentsMain.onEditorShutdown(t('documents', 'Failed to load this document. Please check if it can be opened with an external editor. This might also mean it has been unshared or deleted recently.'));
|
||||
documentsMain.onEditorShutdown(t('richdocuments', 'Failed to load this document. Please check if it can be opened with an external editor. This might also mean it has been unshared or deleted recently.'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -320,11 +320,11 @@ var documentsMain = {
|
|||
}
|
||||
|
||||
var pollUrl = documentsMain.isGuest
|
||||
? OC.generateUrl('apps/documents/session/guest/poll/{token}', {'token' : $("[name='document']").val()})
|
||||
: OC.generateUrl('apps/documents/session/user/poll'),
|
||||
? OC.generateUrl('apps/richdocuments/session/guest/poll/{token}', {'token' : $("[name='document']").val()})
|
||||
: OC.generateUrl('apps/richdocuments/session/user/poll'),
|
||||
saveUrl = documentsMain.isGuest
|
||||
? OC.generateUrl('apps/documents/session/guest/save/{token}', {'token' : $("[name='document']").val()})
|
||||
: OC.generateUrl('apps/documents/session/user/save')
|
||||
? OC.generateUrl('apps/richdocuments/session/guest/save/{token}', {'token' : $("[name='document']").val()})
|
||||
: OC.generateUrl('apps/richdocuments/session/user/save')
|
||||
;
|
||||
documentsMain.canShare = !documentsMain.isGuest
|
||||
&& typeof OC.Share !== 'undefined' && response.permissions & OC.PERMISSION_SHARE;
|
||||
|
@ -341,7 +341,7 @@ var documentsMain = {
|
|||
documentsMain.loadDocument();
|
||||
|
||||
if (documentsMain.isGuest){
|
||||
$('#odf-close').text(t('documents', 'Save') );
|
||||
$('#odf-close').text(t('richdocuments', 'Save') );
|
||||
$('#odf-close').removeClass('icon-view-close');
|
||||
}
|
||||
});
|
||||
|
@ -352,9 +352,9 @@ var documentsMain = {
|
|||
console.log('joining session '+fileId);
|
||||
var url;
|
||||
if (documentsMain.isGuest){
|
||||
url = OC.generateUrl('apps/documents/session/guest/join/{token}', {token: fileId});
|
||||
url = OC.generateUrl('apps/richdocuments/session/guest/join/{token}', {token: fileId});
|
||||
} else {
|
||||
url = OC.generateUrl('apps/documents/session/user/join/{file_id}', {file_id: fileId});
|
||||
url = OC.generateUrl('apps/richdocuments/session/user/join/{file_id}', {file_id: fileId});
|
||||
}
|
||||
$.post(
|
||||
url,
|
||||
|
@ -364,7 +364,7 @@ var documentsMain = {
|
|||
},
|
||||
|
||||
view : function(id){
|
||||
OC.addScript('documents', 'viewer/viewer', function() {
|
||||
OC.addScript('richdocuments', 'viewer/viewer', function() {
|
||||
documentsMain.prepareGrid();
|
||||
$(window).off('beforeunload');
|
||||
$(window).off('unload');
|
||||
|
@ -396,7 +396,7 @@ var documentsMain = {
|
|||
docElem.insertAfter('.documentslist .template');
|
||||
docElem.show();
|
||||
$.post(
|
||||
OC.generateUrl('apps/documents/ajax/documents/create'),
|
||||
OC.generateUrl('apps/richdocuments/ajax/documents/create'),
|
||||
{ mimetype : mimetype },
|
||||
function(response){
|
||||
if (response && response.fileid){
|
||||
|
@ -414,7 +414,7 @@ var documentsMain = {
|
|||
},
|
||||
|
||||
changeNick: function(memberId, name, node){
|
||||
var url = OC.generateUrl('apps/documents/ajax/user/rename');
|
||||
var url = OC.generateUrl('apps/richdocuments/ajax/user/rename');
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
|
@ -489,7 +489,7 @@ var documentsMain = {
|
|||
},
|
||||
|
||||
loadDocument: function() {
|
||||
var url = OC.generateUrl('apps/documents/load/{file_id}', {file_id: documentsMain.fileId});
|
||||
var url = OC.generateUrl('apps/richdocuments/load/{file_id}', {file_id: documentsMain.fileId});
|
||||
$.post(
|
||||
url,
|
||||
{},
|
||||
|
@ -498,7 +498,7 @@ var documentsMain = {
|
|||
if (result.message){
|
||||
documentsMain.IU.notify(result.message);
|
||||
}
|
||||
documentsMain.onEditorShutdown(t('documents', 'Failed to load this document. Please check if it can be opened with an external editor. This might also mean it has been unshared or deleted recently.'));
|
||||
documentsMain.onEditorShutdown(t('richdocuments', 'Failed to load this document. Please check if it can be opened with an external editor. This might also mean it has been unshared or deleted recently.'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -511,7 +511,7 @@ var documentsMain = {
|
|||
},
|
||||
|
||||
saveDocumentBack: function() {
|
||||
var url = OC.generateUrl('apps/documents/save/{file_id}', {file_id: documentsMain.fileId});
|
||||
var url = OC.generateUrl('apps/richdocuments/save/{file_id}', {file_id: documentsMain.fileId});
|
||||
$.post(
|
||||
url,
|
||||
{ basename : documentsMain.baseName },
|
||||
|
@ -520,7 +520,7 @@ var documentsMain = {
|
|||
if (result.message){
|
||||
documentsMain.IU.notify(result.message);
|
||||
}
|
||||
documentsMain.onEditorShutdown(t('documents', 'Failed to save this document. Please check if it can be saved with an external editor. This might also mean it has been unshared or deleted recently.'));
|
||||
documentsMain.onEditorShutdown(t('richdocuments', 'Failed to save this document. Please check if it can be saved with an external editor. This might also mean it has been unshared or deleted recently.'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -528,7 +528,7 @@ var documentsMain = {
|
|||
},
|
||||
|
||||
closeDocument: function() {
|
||||
var url = OC.generateUrl('apps/documents/close/{file_id}', {file_id: documentsMain.fileId});
|
||||
var url = OC.generateUrl('apps/richdocuments/close/{file_id}', {file_id: documentsMain.fileId});
|
||||
$.post(
|
||||
url,
|
||||
{ basename : documentsMain.baseName }
|
||||
|
@ -536,7 +536,7 @@ var documentsMain = {
|
|||
},
|
||||
|
||||
renameDocument: function(name) {
|
||||
var url = OC.generateUrl('apps/documents/ajax/documents/rename/{file_id}', {file_id: documentsMain.fileId});
|
||||
var url = OC.generateUrl('apps/richdocuments/ajax/documents/rename/{file_id}', {file_id: documentsMain.fileId});
|
||||
$.post(
|
||||
url,
|
||||
{ name : name },
|
||||
|
@ -592,9 +592,9 @@ var documentsMain = {
|
|||
onTerminate: function(){
|
||||
var url = '';
|
||||
if (documentsMain.isGuest){
|
||||
url = OC.generateUrl('apps/documents/ajax/user/disconnectGuest/{member_id}', {member_id: documentsMain.memberId});
|
||||
url = OC.generateUrl('apps/richdocuments/ajax/user/disconnectGuest/{member_id}', {member_id: documentsMain.memberId});
|
||||
} else {
|
||||
url = OC.generateUrl('apps/documents/ajax/user/disconnect/{member_id}', {member_id: documentsMain.memberId});
|
||||
url = OC.generateUrl('apps/richdocuments/ajax/user/disconnect/{member_id}', {member_id: documentsMain.memberId});
|
||||
}
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
|
@ -613,7 +613,7 @@ var documentsMain = {
|
|||
if (documentsMain.isGuest){
|
||||
return;
|
||||
}
|
||||
documentsMain.UI.showProgress(t('documents', 'Loading documents...'));
|
||||
documentsMain.UI.showProgress(t('richdocuments', 'Loading documents...'));
|
||||
documentsMain.docs.documentGrid('render');
|
||||
documentsMain.UI.hideProgress();
|
||||
}
|
||||
|
|
96
js/locale.js
96
js/locale.js
|
@ -1,48 +1,48 @@
|
|||
t('documents', 'Align Left');
|
||||
t('documents', 'Alignment');
|
||||
t('documents', 'Align Right');
|
||||
t('documents', 'Annotate');
|
||||
t('documents', 'Background');
|
||||
t('documents', 'Bold');
|
||||
t('documents', 'Bottom');
|
||||
t('documents', 'Cancel');
|
||||
t('documents', 'Center');
|
||||
t('documents', 'Clone');
|
||||
t('documents', 'Clone this Style');
|
||||
t('documents', 'Close');
|
||||
t('documents', 'Color');
|
||||
t('documents', 'Create');
|
||||
t('documents', 'Decrease Indent');
|
||||
t('documents', 'Default Style');
|
||||
t('documents', 'Delete');
|
||||
t('documents', 'Family');
|
||||
t('documents', 'Font');
|
||||
t('documents', 'Font Effects');
|
||||
t('documents', 'Format');
|
||||
t('documents', 'Increase Indent');
|
||||
t('documents', 'Insert Image');
|
||||
t('documents', 'Invite Members');
|
||||
t('documents', 'Italic');
|
||||
t('documents', 'Justified');
|
||||
t('documents', 'Justify');
|
||||
t('documents', 'Left');
|
||||
t('documents', 'Loading');
|
||||
t('documents', 'Members');
|
||||
t('documents', 'New Name:');
|
||||
t('documents', 'OK');
|
||||
t('documents', 'Open');
|
||||
t('documents', 'Options');
|
||||
t('documents', 'Paragraph...');
|
||||
t('documents', 'Paragraph Styles');
|
||||
t('documents', 'Redo');
|
||||
t('documents', 'Right');
|
||||
t('documents', 'Save');
|
||||
t('documents', 'Size');
|
||||
t('documents', 'Spacing');
|
||||
t('documents', 'Strikethrough');
|
||||
t('documents', 'Style');
|
||||
t('documents', 'Text');
|
||||
t('documents', 'Top');
|
||||
t('documents', 'Underline');
|
||||
t('documents', 'Undo');
|
||||
t('documents', 'Unknown Author');
|
||||
t('richdocuments', 'Align Left');
|
||||
t('richdocuments', 'Alignment');
|
||||
t('richdocuments', 'Align Right');
|
||||
t('richdocuments', 'Annotate');
|
||||
t('richdocuments', 'Background');
|
||||
t('richdocuments', 'Bold');
|
||||
t('richdocuments', 'Bottom');
|
||||
t('richdocuments', 'Cancel');
|
||||
t('richdocuments', 'Center');
|
||||
t('richdocuments', 'Clone');
|
||||
t('richdocuments', 'Clone this Style');
|
||||
t('richdocuments', 'Close');
|
||||
t('richdocuments', 'Color');
|
||||
t('richdocuments', 'Create');
|
||||
t('richdocuments', 'Decrease Indent');
|
||||
t('richdocuments', 'Default Style');
|
||||
t('richdocuments', 'Delete');
|
||||
t('richdocuments', 'Family');
|
||||
t('richdocuments', 'Font');
|
||||
t('richdocuments', 'Font Effects');
|
||||
t('richdocuments', 'Format');
|
||||
t('richdocuments', 'Increase Indent');
|
||||
t('richdocuments', 'Insert Image');
|
||||
t('richdocuments', 'Invite Members');
|
||||
t('richdocuments', 'Italic');
|
||||
t('richdocuments', 'Justified');
|
||||
t('richdocuments', 'Justify');
|
||||
t('richdocuments', 'Left');
|
||||
t('richdocuments', 'Loading');
|
||||
t('richdocuments', 'Members');
|
||||
t('richdocuments', 'New Name:');
|
||||
t('richdocuments', 'OK');
|
||||
t('richdocuments', 'Open');
|
||||
t('richdocuments', 'Options');
|
||||
t('richdocuments', 'Paragraph...');
|
||||
t('richdocuments', 'Paragraph Styles');
|
||||
t('richdocuments', 'Redo');
|
||||
t('richdocuments', 'Right');
|
||||
t('richdocuments', 'Save');
|
||||
t('richdocuments', 'Size');
|
||||
t('richdocuments', 'Spacing');
|
||||
t('richdocuments', 'Strikethrough');
|
||||
t('richdocuments', 'Style');
|
||||
t('richdocuments', 'Text');
|
||||
t('richdocuments', 'Top');
|
||||
t('richdocuments', 'Underline');
|
||||
t('richdocuments', 'Undo');
|
||||
t('richdocuments', 'Unknown Author');
|
||||
|
|
|
@ -5,7 +5,7 @@ $(document).ready(function(){
|
|||
savePath : $('#documents-default-path').val()
|
||||
};
|
||||
OC.msg.startSaving('#documents-personal .msg');
|
||||
$.post(OC.filePath('documents', 'ajax', 'personal.php'), data, documentsSettings.afterSave);
|
||||
$.post(OC.filePath('richdocuments', 'ajax', 'personal.php'), data, documentsSettings.afterSave);
|
||||
},
|
||||
afterSave : function(data){
|
||||
OC.msg.finishedSaving('#documents-personal .msg', data);
|
||||
|
|
|
@ -5,7 +5,7 @@ $(document).ready(function(){
|
|||
var data = {
|
||||
unstable : $('#webodf-unstable').attr('checked')==="checked"
|
||||
};
|
||||
$.post(OC.generateUrl('apps/documents/ajax/config/unstable'), data, documentsSettings.afterSave);
|
||||
$.post(OC.generateUrl('apps/richdocuments/ajax/config/unstable'), data, documentsSettings.afterSave);
|
||||
},
|
||||
afterSave : function(){
|
||||
documentsMain.useUnstable = $('#webodf-unstable').attr('checked')==="checked";
|
||||
|
|
|
@ -60,7 +60,7 @@ var odfViewer = {
|
|||
OC.PERMISSION_UPDATE,
|
||||
OC.imagePath('core', 'actions/rename'),
|
||||
odfViewer.onEdit,
|
||||
t('documents', 'Edit')
|
||||
t('richdocuments', 'Edit')
|
||||
);
|
||||
OCA.Files.fileActions.setDefault(mimeReadWrite, 'Edit');
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ var odfViewer = {
|
|||
|
||||
onEdit : function(fileName, context){
|
||||
var fileId = context.$file.attr('data-id');
|
||||
window.location = OC.generateUrl('apps/documents/index#{file_id}', {file_id: fileId});
|
||||
window.location = OC.generateUrl('apps/richdocuments/index#{file_id}', {file_id: fileId});
|
||||
},
|
||||
|
||||
onView: function(filename, context) {
|
||||
|
@ -119,7 +119,7 @@ $(document).ready(function() {
|
|||
&& typeof OCA.Files.fileActions !== 'undefined'
|
||||
) {
|
||||
$.get(
|
||||
OC.filePath('documents', 'ajax', 'mimes.php'),
|
||||
OC.filePath('richdocuments', 'ajax', 'mimes.php'),
|
||||
{},
|
||||
odfViewer.register
|
||||
);
|
||||
|
|
|
@ -5,7 +5,7 @@ define("owncloud/widgets/ocShare",
|
|||
return declare("OcShare", [_WidgetBase, _TemplatedMixin], {
|
||||
templateString: '<div class="dijit" style="float:left;margin-top:3px">'
|
||||
+ '<button id="odf-invite" class="drop icon-share svg" data-dojo-attach-event="onclick: showDropdown">' +
|
||||
t('documents', 'Share') +
|
||||
t('richdocuments', 'Share') +
|
||||
'</button></div>',
|
||||
postCreate: function () {
|
||||
this.inherited(arguments);
|
||||
|
@ -21,7 +21,7 @@ define("owncloud/widgets/ocShare",
|
|||
var target = OC.Share.showLink;
|
||||
OC.Share.showLink = function () {
|
||||
var r = target.apply(this, arguments);
|
||||
$('#linkText').val($('#linkText').val().replace('index.php/s/', 'public.php?service=documents&t='));
|
||||
$('#linkText').val($('#linkText').val().replace('index.php/s/', 'public.php?service=richdocuments&t='));
|
||||
return r;
|
||||
};
|
||||
})();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2015 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -9,12 +9,12 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents;
|
||||
namespace OCA\Richdocuments;
|
||||
|
||||
use \OCP\IConfig;
|
||||
|
||||
class AppConfig{
|
||||
private $appName = 'documents';
|
||||
private $appName = 'richdocuments';
|
||||
private $defaults = [
|
||||
'converter' => 'off',
|
||||
'converter_url' => 'http://localhost:16080',
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -10,9 +10,9 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents;
|
||||
namespace OCA\Richdocuments;
|
||||
|
||||
use OCA\Documents\AppInfo\Application;
|
||||
use OCA\Richdocuments\AppInfo\Application;
|
||||
|
||||
class Converter {
|
||||
|
||||
|
@ -41,7 +41,7 @@ class Converter {
|
|||
if (!$exists){
|
||||
\OC::$server->getLogger()->warn(
|
||||
'Conversion test failed. Raw output:' . $result,
|
||||
['app' => 'documents']
|
||||
['app' => 'richdocuments']
|
||||
|
||||
);
|
||||
return false;
|
||||
|
@ -61,7 +61,7 @@ class Converter {
|
|||
if (empty($output)){
|
||||
\OC::$server->getLogger()->warn(
|
||||
'Empty conversion output',
|
||||
['app' => 'documents']
|
||||
['app' => 'richdocuments']
|
||||
|
||||
);
|
||||
throw new \RuntimeException('Empty conversion output');
|
||||
|
@ -129,7 +129,7 @@ class Converter {
|
|||
if (curl_errno($ch)){
|
||||
\OC::$server->getLogger()->debug(
|
||||
'cURL error' . curl_errno($ch) . ':' . curl_error($ch),
|
||||
['app' => 'documents']
|
||||
['app' => 'richdocuments']
|
||||
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -9,7 +9,7 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents;
|
||||
namespace OCA\Richdocuments;
|
||||
|
||||
/**
|
||||
* Generic DB class
|
||||
|
@ -49,7 +49,7 @@ abstract class Db {
|
|||
/**
|
||||
* Get single record by primary key
|
||||
* @param int $value primary key value
|
||||
* @return \OCA\Documents\Db
|
||||
* @return \OCA\Richdocuments\Db
|
||||
*/
|
||||
public function load($value){
|
||||
if (!is_array($value)){
|
||||
|
@ -69,7 +69,7 @@ abstract class Db {
|
|||
* Get single record matching condition
|
||||
* @param string $field for WHERE condition
|
||||
* @param mixed $value matching value(s)
|
||||
* @return \OCA\Documents\Db
|
||||
* @return \OCA\Richdocuments\Db
|
||||
* @throws Exception
|
||||
*/
|
||||
public function loadBy($field, $value){
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -10,7 +10,7 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents\Db;
|
||||
namespace OCA\Richdocuments\Db;
|
||||
|
||||
/**
|
||||
* @method boolean getIsGuest()
|
||||
|
@ -19,24 +19,24 @@ namespace OCA\Documents\Db;
|
|||
* @method int getStatus()
|
||||
*/
|
||||
|
||||
class Member extends \OCA\Documents\Db{
|
||||
class Member extends \OCA\Richdocuments\Db{
|
||||
|
||||
const DB_TABLE = '`*PREFIX*documents_member`';
|
||||
const DB_TABLE = '`*PREFIX*richdocuments_member`';
|
||||
|
||||
const ACTIVITY_THRESHOLD = 90; // 1.5 Minutes
|
||||
|
||||
const MEMBER_STATUS_ACTIVE = 1;
|
||||
const MEMBER_STATUS_INACTIVE = 2;
|
||||
|
||||
protected $tableName = '`*PREFIX*documents_member`';
|
||||
protected $tableName = '`*PREFIX*richdocuments_member`';
|
||||
|
||||
protected $insertStatement = 'INSERT INTO `*PREFIX*documents_member` (`es_id`, `uid`, `color`, `last_activity`, `is_guest`, `token`)
|
||||
protected $insertStatement = 'INSERT INTO `*PREFIX*richdocuments_member` (`es_id`, `uid`, `color`, `last_activity`, `is_guest`, `token`)
|
||||
VALUES (?, ?, ?, ?, ?, ?)';
|
||||
|
||||
protected $loadStatement = 'SELECT * FROM `*PREFIX*documents_member` WHERE `member_id`= ?';
|
||||
protected $loadStatement = 'SELECT * FROM `*PREFIX*richdocuments_member` WHERE `member_id`= ?';
|
||||
|
||||
public static function getGuestPostfix(){
|
||||
return '(' . \OC::$server->getL10n('documents')->t('guest') . ')';
|
||||
return '(' . \OC::$server->getL10n('richdocuments')->t('guest') . ')';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -9,15 +9,15 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents\Db;
|
||||
namespace OCA\Richdocuments\Db;
|
||||
|
||||
class Op extends \OCA\Documents\Db {
|
||||
class Op extends \OCA\Richdocuments\Db {
|
||||
|
||||
const DB_TABLE = '`*PREFIX*documents_op`';
|
||||
const DB_TABLE = '`*PREFIX*richdocuments_op`';
|
||||
|
||||
protected $tableName = '`*PREFIX*documents_op`';
|
||||
protected $tableName = '`*PREFIX*richdocuments_op`';
|
||||
|
||||
protected $insertStatement = 'INSERT INTO `*PREFIX*documents_op` (`es_id`, `optype`, `member`, `opspec`) VALUES (?, ?, ?, ?)';
|
||||
protected $insertStatement = 'INSERT INTO `*PREFIX*richdocuments_op` (`es_id`, `optype`, `member`, `opspec`) VALUES (?, ?, ?, ?)';
|
||||
|
||||
public static function addOpsArray($esId, $memberId, $ops){
|
||||
$opObj = new Op();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -10,11 +10,11 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents\Db;
|
||||
namespace OCA\Richdocuments\Db;
|
||||
|
||||
use OCP\Security\ISecureRandom;
|
||||
|
||||
use OCA\Documents\Filter;
|
||||
use OCA\Richdocuments\Filter;
|
||||
|
||||
/**
|
||||
* Session management
|
||||
|
@ -26,29 +26,29 @@ use OCA\Documents\Filter;
|
|||
* @method string getGenesisHash()
|
||||
*
|
||||
*/
|
||||
class Session extends \OCA\Documents\Db {
|
||||
class Session extends \OCA\Richdocuments\Db {
|
||||
|
||||
/**
|
||||
* DB table
|
||||
*/
|
||||
const DB_TABLE = '`*PREFIX*documents_session`';
|
||||
protected $tableName = '`*PREFIX*documents_session`';
|
||||
const DB_TABLE = '`*PREFIX*richdocuments_session`';
|
||||
protected $tableName = '`*PREFIX*richdocuments_session`';
|
||||
|
||||
protected $insertStatement = 'INSERT INTO `*PREFIX*documents_session` (`es_id`, `genesis_url`, `genesis_hash`, `owner`, `file_id`)
|
||||
protected $insertStatement = 'INSERT INTO `*PREFIX*richdocuments_session` (`es_id`, `genesis_url`, `genesis_hash`, `owner`, `file_id`)
|
||||
VALUES (?, ?, ?, ?, ?)';
|
||||
|
||||
protected $loadStatement = 'SELECT * FROM `*PREFIX*documents_session` WHERE `es_id`= ?';
|
||||
protected $loadStatement = 'SELECT * FROM `*PREFIX*richdocuments_session` WHERE `es_id`= ?';
|
||||
|
||||
/**
|
||||
* Start a editing session or return an existing one
|
||||
* @param string $uid of the user starting a session
|
||||
* @param \OCA\Documents\File $file - file object
|
||||
* @param \OCA\Richdocuments\File $file - file object
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function start($uid, $file){
|
||||
// Create a directory to store genesis
|
||||
$genesis = new \OCA\Documents\Genesis($file);
|
||||
$genesis = new \OCA\Richdocuments\Genesis($file);
|
||||
|
||||
$oldSession = new Session();
|
||||
$oldSession->loadBy('file_id', $file->getFileId());
|
||||
|
@ -72,8 +72,8 @@ class Session extends \OCA\Documents\Db {
|
|||
->getData()
|
||||
;
|
||||
|
||||
$memberColor = \OCA\Documents\Helper::getMemberColor($uid);
|
||||
$member = new \OCA\Documents\Db\Member([
|
||||
$memberColor = \OCA\Richdocuments\Helper::getMemberColor($uid);
|
||||
$member = new \OCA\Richdocuments\Db\Member([
|
||||
$sessionData['es_id'],
|
||||
$uid,
|
||||
$memberColor,
|
||||
|
@ -95,11 +95,11 @@ class Session extends \OCA\Documents\Db {
|
|||
}
|
||||
|
||||
$displayName = $file->isPublicShare()
|
||||
? $uid . ' ' . \OCA\Documents\Db\Member::getGuestPostfix()
|
||||
? $uid . ' ' . \OCA\Richdocuments\Db\Member::getGuestPostfix()
|
||||
: \OC::$server->getUserSession()->getUser()->getDisplayName($uid)
|
||||
;
|
||||
$userId = $file->isPublicShare() ? $displayName : \OC::$server->getUserSession()->getUser()->getUID();
|
||||
$op = new \OCA\Documents\Db\Op();
|
||||
$op = new \OCA\Richdocuments\Db\Op();
|
||||
$op->addMember(
|
||||
$sessionData['es_id'],
|
||||
$sessionData['member_id'],
|
||||
|
@ -119,17 +119,17 @@ class Session extends \OCA\Documents\Db {
|
|||
$session = new Session();
|
||||
$session->deleteBy('es_id', $esId);
|
||||
|
||||
$member = new \OCA\Documents\Db\Member();
|
||||
$member = new \OCA\Richdocuments\Db\Member();
|
||||
$member->deleteBy('es_id', $esId);
|
||||
|
||||
$op= new \OCA\Documents\Db\Op();
|
||||
$op= new \OCA\Richdocuments\Db\Op();
|
||||
$op->deleteBy('es_id', $esId);
|
||||
}
|
||||
|
||||
|
||||
public function syncOps($memberId, $currentHead, $clientHead, $clientOps){
|
||||
$hasOps = count($clientOps)>0;
|
||||
$op = new \OCA\Documents\Db\Op();
|
||||
$op = new \OCA\Richdocuments\Db\Op();
|
||||
|
||||
// TODO handle the case ($currentHead == "") && ($seqHead != "")
|
||||
if ($clientHead == $currentHead) {
|
||||
|
@ -137,7 +137,7 @@ class Session extends \OCA\Documents\Db {
|
|||
if ($hasOps) {
|
||||
// incoming ops without conflict
|
||||
// Add incoming ops, respond with a new head
|
||||
$newHead = \OCA\Documents\Db\Op::addOpsArray($this->getEsId(), $memberId, $clientOps);
|
||||
$newHead = \OCA\Richdocuments\Db\Op::addOpsArray($this->getEsId(), $memberId, $clientOps);
|
||||
$result = array(
|
||||
'result' => 'added',
|
||||
'head_seq' => $newHead ? $newHead : $currentHead
|
||||
|
@ -169,7 +169,7 @@ class Session extends \OCA\Documents\Db {
|
|||
|
||||
public function updateGenesisHash($esId, $genesisHash){
|
||||
return $this->execute(
|
||||
'UPDATE `*PREFIX*documents_session` SET `genesis_hash`=? WHERE `es_id`=?',
|
||||
'UPDATE `*PREFIX*richdocuments_session` SET `genesis_hash`=? WHERE `es_id`=?',
|
||||
array(
|
||||
$genesisHash, $esId
|
||||
)
|
||||
|
@ -180,7 +180,7 @@ class Session extends \OCA\Documents\Db {
|
|||
$result = $this->execute('
|
||||
SELECT `s`.*, COUNT(`m`.`member_id`) AS `users`
|
||||
FROM ' . $this->tableName . ' AS `s`
|
||||
LEFT JOIN `*PREFIX*documents_member` AS `m` ON `s`.`es_id`=`m`.`es_id`
|
||||
LEFT JOIN `*PREFIX*richdocuments_member` AS `m` ON `s`.`es_id`=`m`.`es_id`
|
||||
AND `m`.`status`=' . Db\Member::MEMBER_STATUS_ACTIVE . '
|
||||
AND `m`.`uid` != ?
|
||||
WHERE `s`.`es_id` = ?
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -9,7 +9,7 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents;
|
||||
namespace OCA\Richdocuments;
|
||||
|
||||
use \OCP\AppFramework\Http;
|
||||
use \OCP\IRequest;
|
||||
|
@ -44,7 +44,7 @@ class DownloadResponse extends \OCP\AppFramework\Http\Response {
|
|||
$this->ETag = $info['etag'];
|
||||
|
||||
$content = $this->view->file_get_contents($this->path);
|
||||
$data = \OCA\Documents\Filter::read($content, $info['mimetype']);
|
||||
$data = \OCA\Richdocuments\Filter::read($content, $info['mimetype']);
|
||||
$size = strlen($data['content']);
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Documents;
|
||||
namespace OCA\Richdocuments;
|
||||
|
||||
use \OC\Files\View;
|
||||
|
||||
|
@ -190,7 +190,7 @@ class File {
|
|||
|
||||
$mimetype = $this->ownerView->getMimeType($this->path);
|
||||
if (!Filter::isSupportedMimetype($mimetype)){
|
||||
throw new \Exception( $this->path . ' is ' . $mimetype . ' and is not supported by Documents app');
|
||||
throw new \Exception( $this->path . ' is ' . $mimetype . ' and is not supported by RichDocuments app');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -10,7 +10,7 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents;
|
||||
namespace OCA\Richdocuments;
|
||||
|
||||
class Filter {
|
||||
protected static $filters = array();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - RichDocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -10,7 +10,7 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents\Filter;
|
||||
namespace OCA\Richdocuments\Filter;
|
||||
|
||||
class Office {
|
||||
const NATIVE_MIMETYPE = 'application/vnd.oasis.opendocument.text';
|
||||
|
@ -55,14 +55,14 @@ class Office {
|
|||
$this->readSpec = $mimeSpec['read'];
|
||||
$this->writeSpec = $mimeSpec['write'];
|
||||
|
||||
\OCA\Documents\Filter::add($mimeSpec['write']['target'], $this);
|
||||
\OCA\Richdocuments\Filter::add($mimeSpec['write']['target'], $this);
|
||||
}
|
||||
|
||||
public function read($data){
|
||||
return array(
|
||||
'mimetype' => $this->readSpec['target'],
|
||||
'content' =>
|
||||
\OCA\Documents\Converter::convert(
|
||||
\OCA\Richdocuments\Converter::convert(
|
||||
$data['content'],
|
||||
$this->readSpec['format'],
|
||||
$this->readSpec['extension']
|
||||
|
@ -74,7 +74,7 @@ class Office {
|
|||
return array(
|
||||
'mimetype' => $this->writeSpec['target'],
|
||||
'content' =>
|
||||
\OCA\Documents\Converter::convert(
|
||||
\OCA\Richdocuments\Converter::convert(
|
||||
$data['content'],
|
||||
$this->writeSpec['format'],
|
||||
$this->writeSpec['extension']
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Documents;
|
||||
namespace OCA\Richdocuments;
|
||||
|
||||
use \OC\Files\View;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -10,11 +10,11 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents;
|
||||
namespace OCA\Richdocuments;
|
||||
|
||||
class Helper {
|
||||
|
||||
const APP_ID = 'documents';
|
||||
const APP_ID = 'richdocuments';
|
||||
|
||||
public static function getNewFileName($view, $path, $prepend = ' '){
|
||||
$fileNum = 1;
|
||||
|
@ -162,12 +162,12 @@ class Helper {
|
|||
if (empty($cmd)){
|
||||
\OC::$server->getLogger()->warn(
|
||||
'Pure configuration issue. Missing open office binary that is mandatory for conversion.',
|
||||
['app' => 'documents']
|
||||
['app' => 'richdocuments']
|
||||
|
||||
);
|
||||
\OC::$server->getLogger()->debug(
|
||||
'If openoffice or libreoffice is already installed please specify the path to it using preview_libreoffice_path config. Refer to admin manual for details.',
|
||||
['app' => 'documents']
|
||||
['app' => 'richdocuments']
|
||||
|
||||
);
|
||||
throw new \RuntimeException('Missing open office binary that is mandatory for conversion.');
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Frank Karlitschek
|
||||
* @copyright 2013-2014 Frank Karlitschek frank@owncloud.org
|
||||
|
@ -22,7 +22,7 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OCA\Documents;
|
||||
namespace OCA\Richdocuments;
|
||||
|
||||
class Storage {
|
||||
public static $MIMETYPE_LIBREOFFICE_WORDPROCESSOR = array(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -10,10 +10,10 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents;
|
||||
namespace OCA\Richdocuments;
|
||||
|
||||
use \OCA\Documents\AppInfo\Application;
|
||||
use \OCA\Richdocuments\AppInfo\Application;
|
||||
|
||||
$app = new Application();
|
||||
$response = $app->getContainer()->query('\OCA\Documents\Controller\SettingsController')->personalIndex();
|
||||
$response = $app->getContainer()->query('\OCA\Richdocuments\Controller\SettingsController')->personalIndex();
|
||||
return $response->render();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -11,7 +11,7 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OCA\Documents;
|
||||
namespace OCA\Richdocuments;
|
||||
|
||||
\OCP\JSON::checkAppEnabled('documents');
|
||||
|
||||
|
@ -33,8 +33,8 @@ if (isset($_GET['t'])) {
|
|||
}
|
||||
$tmpl->assign('hasPassword', true);
|
||||
} else {
|
||||
\OCP\Util::addStyle( 'documents', '3rdparty/webodf/dojo-app');
|
||||
\OCP\Util::addScript('documents', 'documents');
|
||||
\OCP\Util::addStyle( 'richdocuments', '3rdparty/webodf/dojo-app');
|
||||
\OCP\Util::addScript('richdocuments', 'documents');
|
||||
if ($file->getFileId()){
|
||||
$session = new Db\Session();
|
||||
$session->loadBy('file_id', $file->getFileId());
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -10,10 +10,10 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents;
|
||||
namespace OCA\Richdocuments;
|
||||
|
||||
use \OCA\Documents\AppInfo\Application;
|
||||
use \OCA\Richdocuments\AppInfo\Application;
|
||||
|
||||
$app = new Application();
|
||||
$response = $app->getContainer()->query('\OCA\Documents\Controller\SettingsController')->settingsIndex();
|
||||
$response = $app->getContainer()->query('\OCA\Richdocuments\Controller\SettingsController')->settingsIndex();
|
||||
return $response->render();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
script('documents', 'admin');
|
||||
script('richdocuments', 'admin');
|
||||
?>
|
||||
<div class="section" id="documents">
|
||||
<h2><?php p($l->t('Documents')) ?></h2>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
style( 'documents', 'share' );
|
||||
style( 'documents', 'style' );
|
||||
style( 'documents', '3rdparty/webodf/dojo-app' );
|
||||
script('documents', 'share');
|
||||
script('documents', 'documents');
|
||||
style( 'richdocuments', 'share' );
|
||||
style( 'richdocuments', 'style' );
|
||||
style( 'richdocuments', '3rdparty/webodf/dojo-app' );
|
||||
script('richdocuments', 'share');
|
||||
script('richdocuments', 'documents');
|
||||
script('files', 'file-upload');
|
||||
script('files', 'jquery.iframe-transport');
|
||||
script('files', 'jquery.fileupload');
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
script('documents', 'personal');
|
||||
script('richdocuments', 'personal');
|
||||
?>
|
||||
<div class="section" id="documents-personal">
|
||||
<h2><?php p($l->t('Documents')); ?></h2>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
style( 'documents', 'style' );
|
||||
style( 'richdocuments', 'style' );
|
||||
?>
|
||||
<div id="notification-container">
|
||||
<div id="notification" style="display: none;"></div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
script('documents', 'settings');
|
||||
script('richdocuments', 'settings');
|
||||
?>
|
||||
<div id="documents" class="section">
|
||||
<h2><?php p($l->t('Documents')) ?></h2>
|
||||
|
|
|
@ -9,5 +9,5 @@ require_once __DIR__.'/../../../lib/base.php';
|
|||
if(!class_exists('PHPUnit_Framework_TestCase')) {
|
||||
require_once('PHPUnit/Autoload.php');
|
||||
}
|
||||
\OC_App::loadApp('documents');
|
||||
\OC_App::loadApp('richdocuments');
|
||||
OC_Hook::clear();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
* ownCloud - Richdocuments App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
|
@ -9,10 +9,10 @@
|
|||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents\Controller;
|
||||
namespace OCA\Richdocuments\Controller;
|
||||
|
||||
class DocumentControllerTest extends \PHPUnit_Framework_TestCase {
|
||||
private $appName = 'documents';
|
||||
private $appName = 'richdocuments';
|
||||
private $request;
|
||||
private $l10n;
|
||||
private $settings;
|
||||
|
|
Загрузка…
Ссылка в новой задаче