Move supported mimes to settings controller
This commit is contained in:
parent
45c30440b8
commit
815194cddb
@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - Documents App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Documents;
|
||||
|
||||
\OCP\JSON::success(
|
||||
array( 'mimes' => Filter::getAll())
|
||||
);
|
||||
|
||||
exit();
|
@ -33,14 +33,12 @@ $application->registerRoutes($this, array(
|
||||
array('name' => 'settings#savePersonal', 'url' => 'ajax/personal.php', 'verb' => 'POST'),
|
||||
array('name' => 'settings#setUnstable', 'url' => 'ajax/config/unstable', 'verb' => 'POST'),
|
||||
array('name' => 'settings#setConverter', 'url' => 'ajax/admin.php', 'verb' => 'POST'),
|
||||
array('name' => 'settings#getSupportedMimes', 'url' => 'ajax/mimes.php', 'verb' => 'GET'),
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
/** @var $this \OC\Route\Router */
|
||||
$this->create('documents_ajax_mimes', 'ajax/mimes.php')
|
||||
->actionInclude('documents/ajax/mimes.php');
|
||||
|
||||
$this->create('documents_ajax_otpoll', 'ajax/otpoll.php')
|
||||
->actionInclude('documents/ajax/otpoll.php');
|
||||
|
||||
|
@ -20,6 +20,7 @@ use \OCP\AppFramework\Http\JSONResponse;
|
||||
use OCA\Documents\Converter;
|
||||
use OCA\Documents\Config;
|
||||
use OCA\Documents\Helper;
|
||||
use OCA\Documents\Filter;
|
||||
|
||||
class SettingsController extends Controller{
|
||||
|
||||
@ -34,6 +35,17 @@ class SettingsController extends Controller{
|
||||
$this->l10n = $l10n;
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function getSupportedMimes(){
|
||||
return array(
|
||||
'status' => 'success',
|
||||
'mimes' => Filter::getAll()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
|
@ -108,7 +108,7 @@ $(document).ready(function() {
|
||||
&& typeof OCA.Files !== 'undefined'
|
||||
&& typeof OCA.Files.fileActions !== 'undefined'
|
||||
) {
|
||||
$.post(
|
||||
$.get(
|
||||
OC.filePath('documents', 'ajax', 'mimes.php'),
|
||||
{},
|
||||
odfViewer.register
|
||||
|
Loading…
x
Reference in New Issue
Block a user