diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-14 18:33:11 +0300 |
---|---|---|
committer | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2015-05-25 19:06:23 +0300 |
commit | e9d95b6acd1dbae45de3fed83d7dd88b09ec8c78 (patch) | |
tree | 700ef036460c37f07e350be4aa0deca2fd199534 /appinfo/app.php | |
parent | 89fb78855ecc24fc150c6a6dfbc857f089449123 (diff) |
do not load scripts for all apps
Diffstat (limited to 'appinfo/app.php')
-rw-r--r-- | appinfo/app.php | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/appinfo/app.php b/appinfo/app.php index 284956af..c07de097 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -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', |