Filter_Office -> Filter\Office
This commit is contained in:
parent
eb170d6713
commit
3196f5fc91
@ -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\DocumentController'] = 'documents/ajax/documentController.php';
|
||||||
OC::$CLASSPATH['OCA\Documents\SessionController'] = 'documents/ajax/sessionController.php';
|
OC::$CLASSPATH['OCA\Documents\SessionController'] = 'documents/ajax/sessionController.php';
|
||||||
OC::$CLASSPATH['OCA\Documents\UserController'] = 'documents/ajax/userController.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
|
//Script for registering file actions
|
||||||
OCP\Util::addScript('documents', 'viewer/viewer');
|
OCP\Util::addScript('documents', 'viewer/viewer');
|
||||||
|
|
||||||
$docFilter = new OCA\Documents\Filter_Office(
|
$docFilter = new OCA\Documents\Filter\Office(
|
||||||
array(
|
array(
|
||||||
'read' =>
|
'read' =>
|
||||||
array (
|
array (
|
||||||
@ -60,7 +59,7 @@ $docFilter = new OCA\Documents\Filter_Office(
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$docxFilter = new OCA\Documents\Filter_Office(
|
$docxFilter = new OCA\Documents\Filter\Office(
|
||||||
array (
|
array (
|
||||||
'read' =>
|
'read' =>
|
||||||
array (
|
array (
|
||||||
|
@ -10,9 +10,9 @@
|
|||||||
* later.
|
* later.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCA\Documents;
|
namespace OCA\Documents\Filter;
|
||||||
|
|
||||||
class Filter_Office {
|
class Office {
|
||||||
const NATIVE_MIMETYPE = 'application/vnd.oasis.opendocument.text';
|
const NATIVE_MIMETYPE = 'application/vnd.oasis.opendocument.text';
|
||||||
|
|
||||||
private $readSpec;
|
private $readSpec;
|
||||||
@ -55,14 +55,14 @@ class Filter_Office {
|
|||||||
$this->readSpec = $mimeSpec['read'];
|
$this->readSpec = $mimeSpec['read'];
|
||||||
$this->writeSpec = $mimeSpec['write'];
|
$this->writeSpec = $mimeSpec['write'];
|
||||||
|
|
||||||
Filter::add($mimeSpec['write']['target'], $this);
|
\OCA\Documents\Filter::add($mimeSpec['write']['target'], $this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function read($data){
|
public function read($data){
|
||||||
return array(
|
return array(
|
||||||
'mimetype' => $this->readSpec['target'],
|
'mimetype' => $this->readSpec['target'],
|
||||||
'content' =>
|
'content' =>
|
||||||
Converter::convert(
|
\OCA\Documents\Converter::convert(
|
||||||
$data['content'],
|
$data['content'],
|
||||||
$this->readSpec['format'],
|
$this->readSpec['format'],
|
||||||
$this->readSpec['extension']
|
$this->readSpec['extension']
|
||||||
@ -74,7 +74,7 @@ class Filter_Office {
|
|||||||
return array(
|
return array(
|
||||||
'mimetype' => $this->writeSpec['target'],
|
'mimetype' => $this->writeSpec['target'],
|
||||||
'content' =>
|
'content' =>
|
||||||
Converter::convert(
|
\OCA\Documents\Converter::convert(
|
||||||
$data['content'],
|
$data['content'],
|
||||||
$this->writeSpec['format'],
|
$this->writeSpec['format'],
|
||||||
$this->writeSpec['extension']
|
$this->writeSpec['extension']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user