commit
d770cec140
@ -53,14 +53,15 @@ class DocumentController extends Controller{
|
||||
* @param array $args - array containing session id as an element with a key es_id
|
||||
*/
|
||||
public static function serve($args){
|
||||
|
||||
$session = new Db_Session();
|
||||
$sessionData = $session->load(@$args['es_id'])->getData();
|
||||
|
||||
$file = new File(@$sessionData['file_id']);
|
||||
if (!$file->isPublicShare()){
|
||||
self::preDispatch(false);
|
||||
self::preDispatch();
|
||||
} else {
|
||||
self::preDispatchGuest(false);
|
||||
self::preDispatchGuest();
|
||||
}
|
||||
|
||||
$filename = isset($sessionData['genesis_url']) ? $sessionData['genesis_url'] : '';
|
||||
|
@ -40,8 +40,8 @@ class UserController extends Controller{
|
||||
}
|
||||
|
||||
public static function rename($args){
|
||||
$memberId = @$args['member_id'];
|
||||
$name = @$_POST['name'];
|
||||
$memberId = Helper::getArrayValueByKey($args, 'member_id');
|
||||
$name = Helper::getArrayValueByKey($_POST, 'name');
|
||||
$member = new Db_Member();
|
||||
$member->load($memberId);
|
||||
$memberData = $member->getData();
|
||||
|
@ -45,8 +45,7 @@ define("owncloud/ServerFactory", [
|
||||
|
||||
server = new PullBoxServer(args);
|
||||
server.getGenesisUrl = function(sid) {
|
||||
// what a dirty hack :)
|
||||
return OC.generateUrl('apps/documents/ajax/genesis/{es_id}', {es_id: sid});
|
||||
return OC.generateUrl('apps/documents/ajax/genesis/{es_id}', {es_id: sid}) + '?requesttoken=' + oc_requesttoken;
|
||||
};
|
||||
return server;
|
||||
};
|
||||
|
@ -19,9 +19,8 @@ var documentsMain = {
|
||||
toolbar : '<div id="odf-toolbar" class="dijitToolbar">' +
|
||||
' <div id="document-title" class="icon-noise">' +
|
||||
'<div class="logo-wide"></div>' +
|
||||
'<div>' +
|
||||
'%title%' +
|
||||
' </div></div>' +
|
||||
'<div id="document-title-container"></div>' +
|
||||
'</div>' +
|
||||
' <span id="toolbar" class="claro">' +
|
||||
' <button id="odf-invite" class="drop">' +
|
||||
t('documents', 'Share') +
|
||||
@ -69,7 +68,8 @@ var documentsMain = {
|
||||
},
|
||||
|
||||
showEditor : function(title, canShare){
|
||||
$(document.body).prepend(documentsMain.UI.toolbar.replace(/%title%/g, title));
|
||||
$(document.body).prepend(documentsMain.UI.toolbar);
|
||||
$('#document-title-container').text(title);
|
||||
if (!canShare){
|
||||
$('#odf-invite').remove();
|
||||
} else {
|
||||
@ -132,9 +132,7 @@ var documentsMain = {
|
||||
|
||||
notify : function(message){
|
||||
OC.Notification.show(message);
|
||||
setTimeout(function() {
|
||||
OC.Notification.hide();
|
||||
}, 10000);
|
||||
setTimeout(OC.Notification.hide, 10000);
|
||||
}
|
||||
},
|
||||
|
||||
@ -420,7 +418,7 @@ var documentsMain = {
|
||||
}
|
||||
documentsMain.fileName = name;
|
||||
$('title').text(documentsMain.UI.mainTitle + '| ' + name);
|
||||
$('#document-title>div').text(name);
|
||||
$('#document-title-container').text(name);
|
||||
}
|
||||
);
|
||||
},
|
||||
|
@ -27,6 +27,13 @@ class Helper {
|
||||
return $path;
|
||||
}
|
||||
|
||||
public static function getArrayValueByKey($array, $key, $default=''){
|
||||
if (array_key_exists($key, $array)){
|
||||
return $array[$key];
|
||||
}
|
||||
return $default;
|
||||
}
|
||||
|
||||
public static function isVersionsEnabled(){
|
||||
return \OCP\App::isEnabled('files_versions');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user