| 
									
										
										
										
											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'), | 
					
						
							| 
									
										
										
										
											2016-07-22 11:02:53 +02:00
										 |  |  | 		'icon' => $c->query('ServerContainer')->getURLGenerator()->imagePath('richdocuments', 'app.svg'), | 
					
						
							| 
									
										
										
										
											2016-07-19 20:49:04 +02:00
										 |  |  | 		'name' => $c->query('L10N')->t('Office') | 
					
						
							| 
									
										
										
										
											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
 | 
					
						
							| 
									
										
										
										
											2016-07-18 23:47:01 +02:00
										 |  |  | $eventDispatcher = \OC::$server->getEventDispatcher(); | 
					
						
							|  |  |  | $eventDispatcher->addListener( | 
					
						
							|  |  |  | 	'OCA\Files::loadAdditionalScripts', | 
					
						
							|  |  |  | 	function() { | 
					
						
							| 
									
										
										
										
											2015-12-16 17:57:44 +03:00
										 |  |  | 		\OCP\Util::addScript('richdocuments', 'viewer/viewer'); | 
					
						
							| 
									
										
										
										
											2016-06-15 22:36:14 +05:30
										 |  |  | 		\OCP\Util::addStyle('richdocuments', 'viewer/odfviewer'); | 
					
						
							| 
									
										
										
										
											2015-07-10 08:11:44 +02:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2016-07-18 23:47:01 +02:00
										 |  |  | ); | 
					
						
							| 
									
										
										
										
											2013-10-20 21:51:03 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-09-07 21:26:22 +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"); |