diff --git a/appinfo/app.php b/appinfo/app.php index 641c8876..e2a19d96 100755 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -38,12 +38,11 @@ OC::$CLASSPATH['OCA\Documents\Controller'] = 'documents/ajax/controller.php'; OC::$CLASSPATH['OCA\Documents\DocumentController'] = 'documents/ajax/documentController.php'; OC::$CLASSPATH['OCA\Documents\SessionController'] = 'documents/ajax/sessionController.php'; OC::$CLASSPATH['OCA\Documents\UserController'] = 'documents/ajax/userController.php'; -OC::$CLASSPATH['OCA\Documents\Filter_Office'] = 'documents/lib/filter/office.php'; //Script for registering file actions OCP\Util::addScript('documents', 'viewer/viewer'); -$docFilter = new OCA\Documents\Filter_Office( +$docFilter = new OCA\Documents\Filter\Office( array( 'read' => array ( @@ -60,7 +59,7 @@ $docFilter = new OCA\Documents\Filter_Office( ) ); -$docxFilter = new OCA\Documents\Filter_Office( +$docxFilter = new OCA\Documents\Filter\Office( array ( 'read' => array ( diff --git a/lib/filter/office.php b/lib/filter/office.php index 6b375d7f..c4f000ea 100644 --- a/lib/filter/office.php +++ b/lib/filter/office.php @@ -10,9 +10,9 @@ * later. */ -namespace OCA\Documents; +namespace OCA\Documents\Filter; -class Filter_Office { +class Office { const NATIVE_MIMETYPE = 'application/vnd.oasis.opendocument.text'; private $readSpec; @@ -55,14 +55,14 @@ class Filter_Office { $this->readSpec = $mimeSpec['read']; $this->writeSpec = $mimeSpec['write']; - Filter::add($mimeSpec['write']['target'], $this); + \OCA\Documents\Filter::add($mimeSpec['write']['target'], $this); } public function read($data){ return array( 'mimetype' => $this->readSpec['target'], 'content' => - Converter::convert( + \OCA\Documents\Converter::convert( $data['content'], $this->readSpec['format'], $this->readSpec['extension'] @@ -74,7 +74,7 @@ class Filter_Office { return array( 'mimetype' => $this->writeSpec['target'], 'content' => - Converter::convert( + \OCA\Documents\Converter::convert( $data['content'], $this->writeSpec['format'], $this->writeSpec['extension']