Merge pull request #109 from timar/master

remove unused 'Save new documents to' setting, fixes #76
pull/1/head
Lukas Reschke 8 years ago committed by GitHub
commit 0806876fd0

@ -39,7 +39,6 @@ $application->registerRoutes($this, [
['name' => 'document#wopiGetFile', 'url' => 'wopi/files/{fileId}/contents', 'verb' => 'GET'],
['name' => 'document#wopiPutFile', 'url' => 'wopi/files/{fileId}/contents', 'verb' => 'POST'],
//settings
['name' => 'settings#savePersonal', 'url' => 'ajax/personal.php', 'verb' => 'POST'],
['name' => 'settings#setSettings', 'url' => 'ajax/admin.php', 'verb' => 'POST'],
['name' => 'settings#getSupportedMimes', 'url' => 'ajax/mimes.php', 'verb' => 'GET'],
]

@ -262,7 +262,6 @@ class DocumentController extends Controller {
$maxUploadFilesize = \OCP\Util::maxUploadFilesize("/");
$response = new TemplateResponse('richdocuments', 'documents', [
'enable_previews' => $this->settings->getSystemValue('enable_previews', true),
'savePath' => $this->settings->getUserValue($this->uid, 'richdocuments', 'save_path', '/'),
'uploadMaxFilesize' => $maxUploadFilesize,
'uploadMaxHumanFilesize' => \OCP\Util::humanFileSize($maxUploadFilesize),
'allowShareWithLink' => $this->settings->getAppValue('core', 'shareapi_allow_links', 'yes'),
@ -293,10 +292,7 @@ class DocumentController extends Controller {
$view = new View('/' . $this->uid . '/files');
if (!$dir){
$dir = $this->settings->getUserValue($this->uid, $this->appName, 'save_path', '/');
if (!$view->is_dir($dir)){
$dir = '/';
}
$dir = '/';
}
$basename = $this->l10n->t('New Document.odt');

@ -219,7 +219,7 @@ class SessionController extends Controller{
if ($this->uid){
$view = new View('/' . $this->uid . '/files');
$dir = \OC::$server->getConfig()->getUserValue($this->uid, 'richdocuments', 'save_path', '');
$dir = '/';
$path = Helper::getNewFileName($view, $dir . 'New Document.odt');
} else {
throw $e;

@ -43,19 +43,6 @@ class SettingsController extends Controller{
);
}
/**
* @NoAdminRequired
* @NoCSRFRequired
*/
public function personalIndex(){
return new TemplateResponse(
$this->appName,
'personal',
[ 'save_path' => $this->appConfig->getUserValue($this->userId, 'save_path') ],
'blank'
);
}
/**
* @NoCSRFRequired
*/
@ -81,35 +68,6 @@ class SettingsController extends Controller{
);
}
/**
* @NoAdminRequired
*/
public function savePersonal($savePath){
if (is_null($savePath)){
$savePath = '/';
}
$status = true;
if (\OC\Files\Filesystem::file_exists($savePath) === false ){
$status = \OC\Files\Filesystem::mkdir($savePath);
}
if ($status){
$this->appConfig->setUserValue($this->userId, 'save_path', $savePath);
$response = array(
'status' => 'success',
'data' => array('message'=> $this->l10n->t('Directory saved successfully.'))
);
} else {
$response = array(
'status' => 'error',
'data' => array(
'message'=> $this->l10n->t('An error occurred while changing directory.')
)
);
}
return $response;
}
public function setSettings($wopi_url){
if (!is_null($wopi_url)){
$this->appConfig->setAppValue('wopi_url', $wopi_url);

@ -1,21 +0,0 @@
$(document).ready(function(){
var documentsSettings = {
save : function() {
var data = {
savePath : $('#documents-default-path').val()
};
OC.msg.startSaving('#documents-personal .msg');
$.post(OC.filePath('richdocuments', 'ajax', 'personal.php'), data, documentsSettings.afterSave);
},
afterSave : function(data){
OC.msg.finishedSaving('#documents-personal .msg', data);
}
};
$('#documents-default-path').blur(documentsSettings.save);
$('#documents-default-path').keypress(function( event ) {
if (event.which == 13) {
event.preventDefault();
documentsSettings.save();
}
});
});

@ -1,19 +0,0 @@
<?php
/**
* ownCloud - Richdocuments 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\Richdocuments;
use \OCA\Richdocuments\AppInfo\Application;
$app = new Application();
$response = $app->getContainer()->query('\OCA\Richdocuments\Controller\SettingsController')->personalIndex();
return $response->render();

@ -35,7 +35,6 @@ script('files', 'jquery.fileupload');
<input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" id="requesttoken" />
<input type="hidden" class="max_human_file_size"
value="(max <?php p($_['uploadMaxHumanFilesize']); ?>)" />
<input type="hidden" name="dir" value="<?php p($_['savePath']) ?>" id="dir" />
<input type="file" id="file_upload_start" name='files[]' />
<a href="#" class="icon-upload upload svg">
<label><?php p($l->t('Upload')) ?></label></a>

@ -1,10 +0,0 @@
<?php
script('richdocuments', 'personal');
?>
<div class="section" id="richdocuments-personal">
<h2><?php p($l->t('Collabora Online')); ?></h2>
<div>
<label for="documents-default-path"><?php p($l->t('Save new documents to')) ?></label>
<input type="text" id="documents-default-path" value="<?php p($_['save_path']) ?>" /><span class="msg"></span>
</div>
</div>
Loading…
Cancel
Save