do not load scripts for all apps

pull/1/head
Bernhard Posselt 9 years ago committed by Victor Dubiniuk
parent 89fb78855e
commit e9d95b6acd

@ -5,20 +5,20 @@
*
* @author Frank Karlitschek
* @copyright 2013-2014 Frank Karlitschek karlitschek@kde.org
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
*
* 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.
*
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
OCP\App::register(array('order' => 70, 'id' => 'documents', 'name' => 'Documents'));
@ -27,26 +27,30 @@ OCP\App::register(array('order' => 70, 'id' => 'documents', 'name' => 'Documents
OCP\App::registerPersonal('documents', 'personal');
OCP\App::addNavigationEntry(array(
'id' => 'documents_index',
'id' => 'documents_index',
'order' => 2,
'href' => OCP\Util::linkTo('documents/', 'index.php'),
'href' => OCP\Util::linkTo('documents/', 'index.php'),
'icon' => OCP\Util::imagePath('documents', 'documents.svg'),
'name' => OCA\Documents\Config::getL10n()->t('Documents'))
);
//Script for registering file actions
OCP\Util::addScript('documents', 'viewer/viewer');
$url = OC::$server->getRequest()->server['REQUEST_URI'];
if (preg_match('%index.php/apps/files(/.*)?%', $url)) {
OCP\Util::addScript('documents', 'viewer/viewer');
}
if (OCA\Documents\Config::getConverter() !== 'off'){
$docFilter = new OCA\Documents\Filter\Office(
array(
'read' =>
'read' =>
array (
'target' => 'application/vnd.oasis.opendocument.text',
'format' => 'odt:writer8',
'extension' => 'odt'
),
'write' =>
'write' =>
array (
'target' => 'application/msword',
'format' => 'doc',
@ -57,13 +61,13 @@ if (OCA\Documents\Config::getConverter() !== 'off'){
$docxFilter = new OCA\Documents\Filter\Office(
array (
'read' =>
'read' =>
array (
'target' => 'application/vnd.oasis.opendocument.text',
'format' => 'odt:writer8',
'extension' => 'odt'
),
'write' =>
'write' =>
array (
'target' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'format' => 'docx',

Loading…
Cancel
Save