57 lines
1.9 KiB
PHP
Raw Normal View History

2013-06-30 20:53:42 +02:00
<?php
/**
2015-12-16 17:57:44 +03:00
* ownCloud - Richdocuments App
2013-06-30 20:53:42 +02:00
*
* @author Frank Karlitschek
2014-04-09 19:04:33 +03:00
* @copyright 2013-2014 Frank Karlitschek karlitschek@kde.org
2015-01-14 16:33:11 +01:00
*
2013-06-30 20:53:42 +02:00
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
2015-01-14 16:33:11 +01:00
* License as published by the Free Software Foundation; either
2013-06-30 20:53:42 +02:00
* version 3 of the License, or any later version.
2015-01-14 16:33:11 +01:00
*
2013-06-30 20:53:42 +02:00
* This library 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.
2015-01-14 16:33:11 +01:00
*
2014-05-17 15:29:51 -04:00
* You should have received a copy of the GNU Affero General Public
2013-06-30 20:53:42 +02:00
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
2015-01-14 16:33:11 +01:00
*
2013-06-30 20:53:42 +02:00
*/
2015-12-16 17:57:44 +03:00
namespace OCA\Richdocuments\AppInfo;
2015-06-16 19:32:25 +03:00
2015-12-16 17:57:44 +03:00
use OCA\Richdocuments\Config;
2015-06-16 19:32:25 +03:00
$app = new Application();
$c = $app->getContainer();
2015-12-16 17:57:44 +03:00
\OCP\App::registerAdmin('richdocuments', 'admin');
\OCP\App::registerPersonal('richdocuments', 'personal');
2013-06-30 20:53:42 +02:00
2015-06-16 19:32:25 +03:00
$navigationEntry = function () use ($c) {
return [
2015-12-16 17:57:44 +03:00
'id' => 'richdocuments_index',
2015-06-16 19:32:25 +03:00
'order' => 2,
2015-12-16 17:57:44 +03:00
'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')
2015-06-16 19:32:25 +03:00
];
};
$c->getServer()->getNavigationManager()->add($navigationEntry);
2013-07-01 21:48:49 +03:00
2013-10-20 21:51:03 +03:00
//Script for registering file actions
$eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener(
'OCA\Files::loadAdditionalScripts',
function() {
2015-12-16 17:57:44 +03:00
\OCP\Util::addScript('richdocuments', 'viewer/viewer');
\OCP\Util::addStyle('richdocuments', 'viewer/odfviewer');
}
);
2013-10-20 21:51:03 +03:00
//Listen to delete file signal
2015-12-16 17:57:44 +03:00
\OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Richdocuments\Storage", "onDelete");