Refactor sharing UI; bug fixes, code clean-up, and more efficient with less ajax calls
This commit is contained in:
parent
d764585d8b
commit
ef9511c713
|
@ -1,36 +1,69 @@
|
||||||
<?php
|
<?php
|
||||||
//$RUNTIME_NOAPPS = true;
|
require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
|
||||||
|
|
||||||
|
|
||||||
OCP\JSON::checkAppEnabled('files_sharing');
|
OCP\JSON::checkAppEnabled('files_sharing');
|
||||||
require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
|
OCP\JSON::checkLoggedIn();
|
||||||
|
|
||||||
$userDirectory = "/".OCP\USER::getUser()."/files";
|
$item = array();
|
||||||
$source = $userDirectory.$_GET['source'];
|
$userDirectory = '/'.OCP\USER::getUser().'/files';
|
||||||
|
$source = $userDirectory.$_GET['item'];
|
||||||
$path = $source;
|
$path = $source;
|
||||||
$users = array();
|
// Search for item and shared parent folders
|
||||||
if ($users = OC_Share::getMySharedItem($source)) {
|
while ($path != $userDirectory) {
|
||||||
for ($i = 0; $i < count($users); $i++) {
|
if ($rows = OC_Share::getMySharedItem($path)) {
|
||||||
if ($users[$i]['uid_shared_with'] == OC_Share::PUBLICLINK) {
|
for ($i = 0; $i < count($rows); $i++) {
|
||||||
$users[$i]['token'] = OC_Share::getTokenFromSource($source);
|
$uid_shared_with = $rows[$i]['uid_shared_with'];
|
||||||
}
|
if ($uid_shared_with == OC_Share::PUBLICLINK && !isset($item['privateLink'])) {
|
||||||
}
|
$token = OC_Share::getTokenFromSource($path);
|
||||||
}
|
if ($path == $source) {
|
||||||
$source = dirname($source);
|
$item['privateLink'] = $token;
|
||||||
while ($source != "" && $source != "/" && $source != "." && $source != $userDirectory) {
|
} else {
|
||||||
if ($values = OC_Share::getMySharedItem($source)) {
|
// If in parent folder, include a path parameter to get direct access to file
|
||||||
$values = array_values($values);
|
$item['privateLink'] = $token.'&path='.substr($source, strlen($path));
|
||||||
$parentUsers = array();
|
}
|
||||||
for ($i = 0; $i < count($values); $i++) {
|
} else {
|
||||||
if ($values[$i]['uid_shared_with'] == OC_Share::PUBLICLINK) {
|
// Check if uid_shared_with is a group
|
||||||
$values[$i]['token'] = OC_Share::getTokenFromSource($source)."&path=".substr($path, strlen($source));
|
if (($pos = strpos($uid_shared_with, '@')) !== false) {
|
||||||
|
$gid = substr($uid_shared_with, $pos + 1);
|
||||||
|
// Include users in the group so the users can be removed from the list of people to share with
|
||||||
|
if ($path == $source) {
|
||||||
|
$group = array(array('gid' => $gid, 'permissions' => $rows[$i]['permissions'], 'users' => OC_Group::usersInGroup($gid), 'parentFolder' => false));
|
||||||
|
} else {
|
||||||
|
$group = array(array('gid' => $gid, 'permissions' => $rows[$i]['permissions'], 'users' => OC_Group::usersInGroup($gid), 'parentFolder' => basename($path)));
|
||||||
|
}
|
||||||
|
if (!isset($item['groups'])) {
|
||||||
|
$item['groups'] = $group;
|
||||||
|
} else if (is_array($item['groups'])) {
|
||||||
|
$gidExists = false;
|
||||||
|
$currentGroups = $item['groups'];
|
||||||
|
// Check if the group is already included
|
||||||
|
foreach ($currentGroups as $g) {
|
||||||
|
if ($g['gid'] == $gid) {
|
||||||
|
$gidExists = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!$gidExists) {
|
||||||
|
$item['groups'] = array_merge($item['groups'], $group);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($path == $source) {
|
||||||
|
$user = array(array('uid' => $uid_shared_with, 'permissions' => $rows[$i]['permissions'], 'parentFolder' => false));
|
||||||
|
} else {
|
||||||
|
$user = array(array('uid' => $uid_shared_with, 'permissions' => $rows[$i]['permissions'], 'parentFolder' => basename($path)));
|
||||||
|
}
|
||||||
|
if (!isset($item['users'])) {
|
||||||
|
$item['users'] = $user;
|
||||||
|
} else if (is_array($item['users'])) {
|
||||||
|
$item['users'] = array_merge($item['users'], $user);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$parentUsers[basename($source)."-".$i] = $values[$i];
|
|
||||||
}
|
}
|
||||||
$users = array_merge($users, $parentUsers);
|
|
||||||
}
|
}
|
||||||
$source = dirname($source);
|
$path = dirname($path);
|
||||||
}
|
|
||||||
if (!empty($users)) {
|
|
||||||
OCP\JSON::encodedPrint($users);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OCP\JSON::success(array('data' => $item));
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
|
||||||
|
|
||||||
|
OCP\JSON::checkAppEnabled('files_sharing');
|
||||||
|
OCP\JSON::checkLoggedIn();
|
||||||
|
|
||||||
|
$items = array();
|
||||||
|
$userDirectory = '/'.OCP\USER::getUser().'/files';
|
||||||
|
$dirLength = strlen($userDirectory);
|
||||||
|
if ($rows = OC_Share::getMySharedItems()) {
|
||||||
|
for ($i = 0; $i < count($rows); $i++) {
|
||||||
|
$source = $rows[$i]['source'];
|
||||||
|
// Strip out user directory
|
||||||
|
$item = substr($source, $dirLength);
|
||||||
|
if ($rows[$i]['uid_shared_with'] == OC_Share::PUBLICLINK) {
|
||||||
|
$items[$item] = true;
|
||||||
|
} else {
|
||||||
|
$items[$item] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OCP\JSON::success(array('data' => $items));
|
||||||
|
|
||||||
|
?>
|
|
@ -1,13 +1,14 @@
|
||||||
<?php
|
<?php
|
||||||
//$RUNTIME_NOAPPS = true;
|
|
||||||
|
|
||||||
|
|
||||||
OCP\JSON::checkAppEnabled('files_sharing');
|
|
||||||
require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
|
require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
|
||||||
|
|
||||||
$source = "/".OCP\USER::getUser()."/files".$_GET['source'];
|
OCP\JSON::checkAppEnabled('files_sharing');
|
||||||
$uid_shared_with = $_GET['uid_shared_with'];
|
OCP\JSON::checkLoggedIn();
|
||||||
$permissions = $_GET['permissions'];
|
|
||||||
|
$source = '/'.OCP\USER::getUser().'/files'.$_POST['source'];
|
||||||
|
$uid_shared_with = $_POST['uid_shared_with'];
|
||||||
|
$permissions = $_POST['permissions'];
|
||||||
OC_Share::setPermissions($source, $uid_shared_with, $permissions);
|
OC_Share::setPermissions($source, $uid_shared_with, $permissions);
|
||||||
|
|
||||||
|
OCP\JSON::success();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,31 +1,33 @@
|
||||||
<?php
|
<?php
|
||||||
//$RUNTIME_NOAPPS = true;
|
|
||||||
|
|
||||||
|
|
||||||
OCP\JSON::checkAppEnabled('files_sharing');
|
|
||||||
require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
|
require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
|
||||||
|
|
||||||
$userDirectory = "/".OCP\USER::getUser()."/files";
|
OCP\JSON::checkAppEnabled('files_sharing');
|
||||||
$sources = explode(";", $_POST['sources']);
|
OCP\JSON::checkLoggedIn();
|
||||||
|
|
||||||
|
$userDirectory = '/'.OCP\USER::getUser().'/files';
|
||||||
|
$sources = explode(';', $_POST['sources']);
|
||||||
$uid_shared_with = $_POST['uid_shared_with'];
|
$uid_shared_with = $_POST['uid_shared_with'];
|
||||||
$permissions = $_POST['permissions'];
|
$permissions = $_POST['permissions'];
|
||||||
foreach ($sources as $source) {
|
foreach ($sources as $source) {
|
||||||
// Make sure file exists and can be shared
|
$path = ltrim($source, '/');
|
||||||
if ($source && OC_FILESYSTEM::file_exists($source) && OC_FILESYSTEM::is_readable($source)) {
|
$source = $userDirectory.$source;
|
||||||
$source = $userDirectory.$source;
|
// Check if the file exists or if the file is being reshared
|
||||||
// If the file doesn't exist, it may be shared with the current user
|
if ($source && (OC_FILESYSTEM::file_exists($path) && OC_FILESYSTEM::is_readable($path) || OC_Share::getSource($source))) {
|
||||||
} else if (!$source = OC_Share::getSource($userDirectory.$source)) {
|
try {
|
||||||
OCP\Util::writeLog('files_sharing',"Shared file doesn't exists :".$source,OCP\Util::ERROR);
|
$shared = new OC_Share($source, $uid_shared_with, $permissions);
|
||||||
echo "false";
|
// If this is a private link, return the token
|
||||||
}
|
if ($uid_shared_with == OC_Share::PUBLICLINK) {
|
||||||
try {
|
OCP\JSON::success(array('data' => $shared->getToken()));
|
||||||
$shared = new OC_Share($source, $uid_shared_with, $permissions);
|
} else {
|
||||||
if ($uid_shared_with == OC_Share::PUBLICLINK) {
|
OCP\JSON::success();
|
||||||
echo $shared->getToken();
|
}
|
||||||
|
} catch (Exception $exception) {
|
||||||
|
OCP\Util::writeLog('files_sharing', 'Unexpected Error : '.$exception->getMessage(),OCP\Util::ERROR);
|
||||||
|
OCP\JSON::error();
|
||||||
}
|
}
|
||||||
} catch (Exception $exception) {
|
} else {
|
||||||
OCP\Util::writeLog('files_sharing',"Unexpected Error : ".$exception->getMessage(),OCP\Util::ERROR);
|
OCP\Util::writeLog('files_sharing', 'File does not exist or is not readable :'.$source,OCP\Util::ERROR);
|
||||||
echo "false";
|
OCP\JSON::error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
//$RUNTIME_NOAPPS = true;
|
|
||||||
|
|
||||||
|
|
||||||
OCP\JSON::checkAppEnabled('files_sharing');
|
|
||||||
require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
|
require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
|
||||||
|
|
||||||
$source = "/".OCP\USER::getUser()."/files".$_GET['source'];
|
OCP\JSON::checkAppEnabled('files_sharing');
|
||||||
$uid_shared_with = $_GET['uid_shared_with'];
|
OCP\JSON::checkLoggedIn();
|
||||||
|
|
||||||
|
$source = '/'.OCP\USER::getUser().'/files'.$_POST['source'];
|
||||||
|
$uid_shared_with = $_POST['uid_shared_with'];
|
||||||
OC_Share::unshare($source, $uid_shared_with);
|
OC_Share::unshare($source, $uid_shared_with);
|
||||||
|
|
||||||
|
OCP\JSON::success();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
//$RUNTIME_NOAPPS = true;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('files_sharing');
|
OCP\JSON::checkAppEnabled('files_sharing');
|
||||||
|
@ -14,12 +11,17 @@ $users[] = "<optgroup label='Users'>";
|
||||||
$groups[] = "<optgroup label='Groups'>";
|
$groups[] = "<optgroup label='Groups'>";
|
||||||
foreach ($userGroups as $group) {
|
foreach ($userGroups as $group) {
|
||||||
$groupUsers = OC_Group::usersInGroup($group);
|
$groupUsers = OC_Group::usersInGroup($group);
|
||||||
|
$userCount = 0;
|
||||||
foreach ($groupUsers as $user) {
|
foreach ($groupUsers as $user) {
|
||||||
if ($user != $self) {
|
if ($user != $self) {
|
||||||
$users[] = "<option value='".$user."'>".$user."</option>";
|
$users[] = "<option value='".$user."'>".$user."</option>";
|
||||||
|
$userCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$groups[] = "<option value='".$group."'>".$group."</option>";
|
// Don't include the group if only the current user is a member of it
|
||||||
|
if ($userCount > 0) {
|
||||||
|
$groups[] = "<option value='".$group."(group)'>".$group." (group) </option>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$users[] = "</optgroup>";
|
$users[] = "</optgroup>";
|
||||||
$groups[] = "</optgroup>";
|
$groups[] = "</optgroup>";
|
||||||
|
|
|
@ -6,8 +6,9 @@
|
||||||
-moz-box-shadow:0 1px 1px #777; -webkit-box-shadow:0 1px 1px #777; box-shadow:0 1px 1px #777;
|
-moz-box-shadow:0 1px 1px #777; -webkit-box-shadow:0 1px 1px #777; box-shadow:0 1px 1px #777;
|
||||||
-moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em;
|
-moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em;
|
||||||
-moz-border-radius-bottomright:1em; -webkit-border-bottom-right-radius:1em; border-bottom-right-radius:1em; }
|
-moz-border-radius-bottomright:1em; -webkit-border-bottom-right-radius:1em; border-bottom-right-radius:1em; }
|
||||||
#shared_list { padding:0.5em; list-style-type: none; }
|
#sharedWithList { padding:0.5em; list-style-type: none; }
|
||||||
#public { border-top:1px solid #ddd; padding-top:0.5em; }
|
#privateLink { border-top:1px solid #ddd; padding-top:0.5em; }
|
||||||
a.unshare { float:right; display:inline; margin:0 .5em; padding:.3em .3em 0 .3em !important; opacity:.5; }
|
a.unshare { float:right; display:inline; margin:0 .5em; padding:.3em .3em 0 .3em !important; opacity:.5; }
|
||||||
a.unshare:hover { opacity:1; }
|
a.unshare:hover { opacity:1; }
|
||||||
#share_with { width: 16em; }
|
#share_with { width: 16em; }
|
||||||
|
#privateLink label, .edit { font-weight:normal; }
|
||||||
|
|
|
@ -1,100 +1,270 @@
|
||||||
$(document).ready(function() {
|
OC.Share={
|
||||||
var shared_status = {};
|
icons:[],
|
||||||
if (typeof FileActions !== 'undefined') {
|
itemUsers:[],
|
||||||
FileActions.register('all', 'Share', function(filename) {
|
itemGroups:[],
|
||||||
if (scanFiles.scanning){return;}//workaround to prevent additional http request block scanning feedback
|
itemPrivateLink:false,
|
||||||
var icon;
|
usersAndGroups:[],
|
||||||
if (typeof filename == 'undefined') {
|
loadIcons:function() {
|
||||||
return false;
|
// Cache all icons for shared files
|
||||||
}
|
$.getJSON(OC.filePath('files_sharing', 'ajax', 'getstatuses.php'), function(result) {
|
||||||
var file = $('#dir').val()+'/'+filename;
|
if (result && result.status === 'success') {
|
||||||
if(shared_status[file])
|
$.each(result.data, function(item, hasPrivateLink) {
|
||||||
return shared_status[file].icon;
|
if (hasPrivateLink) {
|
||||||
$.ajax({
|
OC.Share.icons[item] = OC.imagePath('core', 'actions/public');
|
||||||
type: 'GET',
|
|
||||||
url: OC.linkTo('files_sharing', 'ajax/getitem.php'),
|
|
||||||
dataType: 'json',
|
|
||||||
data: {source: file},
|
|
||||||
async: false,
|
|
||||||
success: function(users) {
|
|
||||||
if (users) {
|
|
||||||
icon = OC.imagePath('core', 'actions/shared');
|
|
||||||
$.each(users, function(index, row) {
|
|
||||||
if (row.uid_shared_with == 'public') {
|
|
||||||
icon = OC.imagePath('core', 'actions/public');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
icon = OC.imagePath('core', 'actions/share');
|
OC.Share.icons[item] = OC.imagePath('core', 'actions/shared');
|
||||||
}
|
|
||||||
shared_status[file]= { timestamp: new Date().getTime(), icon: icon };
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return icon;
|
|
||||||
}, function(filename) {
|
|
||||||
if (($('#dropdown').length > 0)) {
|
|
||||||
$('#dropdown').hide('blind', function() {
|
|
||||||
var dropdownFile = $('#dropdown').data('file')
|
|
||||||
var file = $('#dir').val()+'/'+filename;
|
|
||||||
$('#dropdown').remove();
|
|
||||||
$('tr').removeClass('mouseOver');
|
|
||||||
if (dropdownFile != file) {
|
|
||||||
createDropdown(filename, file);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
loadItem:function(item) {
|
||||||
|
$.ajax({type: 'GET', url: OC.filePath('files_sharing', 'ajax', 'getitem.php'), data: { item: item }, async: false, success: function(result) {
|
||||||
|
if (result && result.status === 'success') {
|
||||||
|
var item = result.data;
|
||||||
|
OC.Share.itemUsers = item.users;
|
||||||
|
OC.Share.itemGroups = item.groups;
|
||||||
|
OC.Share.itemPrivateLink = item.privateLink;
|
||||||
|
}
|
||||||
|
}});
|
||||||
|
},
|
||||||
|
share:function(source, uid_shared_with, permissions, callback) {
|
||||||
|
$.post(OC.filePath('files_sharing', 'ajax', 'share.php'), { sources: source, uid_shared_with: uid_shared_with, permissions: permissions }, function(result) {
|
||||||
|
if (result && result.status === 'success') {
|
||||||
|
if (callback) {
|
||||||
|
callback(result.data);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
createDropdown(filename, $('#dir').val()+'/'+filename);
|
OC.dialogs.alert('Error', 'Error while sharing');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
unshare:function(source, uid_shared_with, callback) {
|
||||||
|
$.post(OC.filePath('files_sharing', 'ajax', 'unshare.php'), { source: source, uid_shared_with: uid_shared_with }, function(result) {
|
||||||
|
if (result && result.status === 'success') {
|
||||||
|
if (callback) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
OC.dialogs.alert('Error', 'Error while unsharing');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
changePermissions:function(source, uid_shared_with, permissions) {
|
||||||
|
$.post(OC.filePath('files_sharing','ajax','setpermissions.php'), { source: source, uid_shared_with: uid_shared_with, permissions: permissions }, function(result) {
|
||||||
|
if (!result || result.status !== 'success') {
|
||||||
|
OC.dialogs.alert('Error', 'Error while changing permissions');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
showDropDown:function(item, appendTo) {
|
||||||
|
OC.Share.loadItem(item);
|
||||||
|
var html = '<div id="dropdown" class="drop" data-item="'+item+'">';
|
||||||
|
html += '<select data-placeholder="User or Group" id="share_with" class="chzen-select">';
|
||||||
|
html += '<option value=""></option>';
|
||||||
|
html += '</select>';
|
||||||
|
html += '<div id="sharedWithList">';
|
||||||
|
html += '<ul id="userList"></ul>';
|
||||||
|
html += '<div id="groups" style="display:none;">';
|
||||||
|
html += '<br />';
|
||||||
|
html += 'Groups: ';
|
||||||
|
html += '<ul id="groupList"></ul>';
|
||||||
|
html += '</div>';
|
||||||
|
html += '</div>';
|
||||||
|
html += '<div id="privateLink">';
|
||||||
|
html += '<input type="checkbox" name="privateLinkCheckbox" id="privateLinkCheckbox" value="1" /><label for="privateLinkCheckbox">Share with private link</label>';
|
||||||
|
html += '<br />';
|
||||||
|
html += '<input id="privateLinkText" style="display:none; width:90%;" />';
|
||||||
|
html += '<input id="email" style="display:none; width:65%;" value="" placeholder="Email link to person" />';
|
||||||
|
html += '<input id="emailButton" style="display:none;" type="submit" value="Send" />';
|
||||||
|
html += '</div>';
|
||||||
|
$(html).appendTo(appendTo);
|
||||||
|
if (OC.Share.usersAndGroups.length < 1) {
|
||||||
|
$.getJSON(OC.filePath('files_sharing', 'ajax', 'userautocomplete.php'), function(users) {
|
||||||
|
if (users) {
|
||||||
|
OC.Share.usersAndGroups = users;
|
||||||
|
$.each(users, function(index, user) {
|
||||||
|
$(user).appendTo('#share_with');
|
||||||
|
});
|
||||||
|
$('#share_with').trigger('liszt:updated');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$.each(OC.Share.usersAndGroups, function(index, user) {
|
||||||
|
$(user).appendTo('#share_with');
|
||||||
|
});
|
||||||
|
$('#share_with').trigger('liszt:updated');
|
||||||
|
}
|
||||||
|
if (OC.Share.itemUsers) {
|
||||||
|
$.each(OC.Share.itemUsers, function(index, user) {
|
||||||
|
if (user.parentFolder) {
|
||||||
|
OC.Share.addSharedWith(user.uid, user.permissions, false, user.parentFolder);
|
||||||
|
} else {
|
||||||
|
OC.Share.addSharedWith(user.uid, user.permissions, false, false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (OC.Share.itemGroups) {
|
||||||
|
$.each(OC.Share.itemGroups, function(index, group) {
|
||||||
|
if (group.parentFolder) {
|
||||||
|
OC.Share.addSharedWith(group.gid, group.permissions, group.users, group.parentFolder);
|
||||||
|
} else {
|
||||||
|
OC.Share.addSharedWith(group.gid, group.permissions, group.users, false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (OC.Share.itemPrivateLink) {
|
||||||
|
OC.Share.showPrivateLink(item, OC.Share.itemPrivateLink);
|
||||||
|
}
|
||||||
|
$('#dropdown').show('blind');
|
||||||
|
$('#share_with').chosen();
|
||||||
|
},
|
||||||
|
hideDropDown:function(callback) {
|
||||||
|
$('#dropdown').hide('blind', function() {
|
||||||
|
$('#dropdown').remove();
|
||||||
|
if (callback) {
|
||||||
|
callback.call();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
addSharedWith:function(uid_shared_with, permissions, isGroup, parentFolder) {
|
||||||
|
if (parentFolder) {
|
||||||
|
var sharedWith = '<li>Parent folder '+parentFolder+' shared with '+uid_shared_with+'</li>';
|
||||||
|
} else {
|
||||||
|
var checked = ((permissions > 0) ? 'checked="checked"' : 'style="display:none;"');
|
||||||
|
var style = ((permissions == 0) ? 'style="display:none;"' : '');
|
||||||
|
var sharedWith = '<li data-uid_shared_with="'+uid_shared_with+'">';
|
||||||
|
sharedWith += '<a href="" class="unshare" style="display:none;"><img class="svg" alt="Unshare" src="'+OC.imagePath('core','actions/delete')+'"/></a>';
|
||||||
|
sharedWith += uid_shared_with;
|
||||||
|
sharedWith += '<input type="checkbox" name="permissions" id="'+uid_shared_with+'" class="permissions" '+checked+' />';
|
||||||
|
sharedWith += '<label class="edit" for="'+uid_shared_with+'" '+style+'>can edit</label>';
|
||||||
|
sharedWith += '</li>';
|
||||||
|
}
|
||||||
|
if (isGroup) {
|
||||||
|
// Groups are added to a different list
|
||||||
|
$('#groups').show();
|
||||||
|
$(sharedWith).appendTo('#groupList');
|
||||||
|
// Remove group from select form
|
||||||
|
$('#share_with option[value="'+uid_shared_with+'(group)"]').remove();
|
||||||
|
$('#share_with').trigger('liszt:updated');
|
||||||
|
// Remove users in group from select form
|
||||||
|
$.each(isGroup, function(index, user) {
|
||||||
|
$('#share_with option[value="'+user+'"]').remove();
|
||||||
|
$('#share_with').trigger('liszt:updated');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$(sharedWith).appendTo('#userList');
|
||||||
|
// Remove user from select form
|
||||||
|
$('#share_with option[value="'+uid_shared_with+'"]').remove();
|
||||||
|
$('#share_with').trigger('liszt:updated');
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
removeSharedWith:function(uid_shared_with) {
|
||||||
|
$('#sharedWithList li[data-uid_shared_with="'+uid_shared_with+'"]').remove();
|
||||||
|
if ($('#groupList li').length < 1) {
|
||||||
|
$('#groups').hide();
|
||||||
|
}
|
||||||
|
var option = '<option value="'+uid_shared_with+'">'+uid_shared_with+'</option>';
|
||||||
|
$(option).appendTo('#share_with');
|
||||||
|
$('#share_with').trigger('liszt:updated');
|
||||||
|
},
|
||||||
|
showPrivateLink:function(item, token) {
|
||||||
|
$('#privateLinkCheckbox').attr('checked', true);
|
||||||
|
var link = parent.location.protocol+'//'+location.host+OC.linkTo('files_sharing','get.php')+'?token='+token;
|
||||||
|
if (token.indexOf('&path=') == -1) {
|
||||||
|
link += '&file=' + item;
|
||||||
|
} else {
|
||||||
|
// Disable checkbox if inside a shared parent folder
|
||||||
|
$('#privateLinkCheckbox').attr('disabled', 'true');
|
||||||
|
}
|
||||||
|
$('#privateLinkText').val(link);
|
||||||
|
$('#privateLinkText').show('blind', function() {
|
||||||
|
$('#privateLinkText').after('<br id="emailBreak" />');
|
||||||
|
$('#email').show();
|
||||||
|
$('#emailButton').show();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
hidePrivateLink:function() {
|
||||||
|
$('#privateLinkText').hide('blind');
|
||||||
|
$('#emailBreak').remove();
|
||||||
|
$('#email').hide();
|
||||||
|
$('#emailButton').hide();
|
||||||
|
},
|
||||||
|
emailPrivateLink:function() {
|
||||||
|
$('#email').css('font-weight', 'bold');
|
||||||
|
$('#email').animate({ fontWeight: 'normal' }, 2000, function() {
|
||||||
|
$(this).val('');
|
||||||
|
}).val('Email sent');
|
||||||
|
$.post(OC.filePath('files_sharing', 'ajax', 'email.php'), 'toaddress='+$('#email').val()+'&link='+$('#link').val());
|
||||||
|
},
|
||||||
|
dirname:function(path) {
|
||||||
|
return path.replace(/\\/g,'/').replace(/\/[^\/]*$/, '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
OC.Share.loadIcons();
|
||||||
|
|
||||||
|
if (typeof FileActions !== 'undefined') {
|
||||||
|
FileActions.register('all', 'Share', function(filename) {
|
||||||
|
// Return the correct sharing icon
|
||||||
|
if (scanFiles.scanning) { return; } // workaround to prevent additional http request block scanning feedback
|
||||||
|
var item = $('#dir').val() + '/' + filename;
|
||||||
|
// Check if icon is in cache
|
||||||
|
if (OC.Share.icons[item]) {
|
||||||
|
return OC.Share.icons[item];
|
||||||
|
} else {
|
||||||
|
var last = '';
|
||||||
|
var path = OC.Share.dirname(item);
|
||||||
|
// Search for possible parent folders that are shared
|
||||||
|
while (path != last) {
|
||||||
|
if (OC.Share.icons[path]) {
|
||||||
|
OC.Share.icons[item] = OC.Share.icons[path];
|
||||||
|
return OC.Share.icons[item];
|
||||||
|
}
|
||||||
|
last = path;
|
||||||
|
path = OC.Share.dirname(path);
|
||||||
|
}
|
||||||
|
OC.Share.icons[item] = OC.imagePath('core', 'actions/share');
|
||||||
|
return OC.Share.icons[item];
|
||||||
|
}
|
||||||
|
}, function(filename) {
|
||||||
|
var file = $('#dir').val() + '/' + filename;
|
||||||
|
var appendTo = $('tr').filterAttr('data-file',filename).find('td.filename');
|
||||||
|
// Check if drop down is already visible for a different file
|
||||||
|
if (($('#dropdown').length > 0)) {
|
||||||
|
if (file != $('#dropdown').data('item')) {
|
||||||
|
OC.Share.hideDropDown(function () {
|
||||||
|
$('tr').removeClass('mouseOver');
|
||||||
|
$('tr').filterAttr('data-file',filename).addClass('mouseOver');
|
||||||
|
OC.Share.showDropDown(file, appendTo);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$('tr').filterAttr('data-file',filename).addClass('mouseOver');
|
||||||
|
OC.Share.showDropDown(file, appendTo);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$('.share').click(function(event) {
|
|
||||||
event.preventDefault();
|
|
||||||
event.stopPropagation();
|
|
||||||
var filenames = getSelectedFiles('name');
|
|
||||||
var length = filenames.length;
|
|
||||||
var files = '';
|
|
||||||
for (var i = 0; i < length; i++) {
|
|
||||||
files += $('#dir').val()+'/'+filenames[i]+';';
|
|
||||||
}
|
|
||||||
createDropdown(false, files);
|
|
||||||
});
|
|
||||||
|
|
||||||
$(this).click(function(event) {
|
$(this).click(function(event) {
|
||||||
if (!($(event.target).hasClass('drop')) && $(event.target).parents().index($('#dropdown')) == -1) {
|
if (!($(event.target).hasClass('drop')) && $(event.target).parents().index($('#dropdown')) == -1) {
|
||||||
if ($('#dropdown').is(':visible')) {
|
if ($('#dropdown').is(':visible')) {
|
||||||
delete shared_status[$('#dropdown').data('file')]; //Remove File from icon cache
|
OC.Share.hideDropDown(function() {
|
||||||
$('#dropdown').hide('blind', function() {
|
|
||||||
$('#dropdown').remove();
|
|
||||||
$('tr').removeClass('mouseOver');
|
$('tr').removeClass('mouseOver');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#share_with').live('change', function() {
|
$('#sharedWithList li').live('mouseenter', function(event) {
|
||||||
var source = $('#dropdown').data('file');
|
// Show permissions and unshare button
|
||||||
var uid_shared_with = $(this).val();
|
|
||||||
var permissions = 0;
|
|
||||||
var data = 'sources='+encodeURIComponent(source)+'&uid_shared_with='+encodeURIComponent(uid_shared_with)+'&permissions='+encodeURIComponent(permissions);
|
|
||||||
$.ajax({
|
|
||||||
type: 'POST',
|
|
||||||
url: OC.linkTo('files_sharing','ajax/share.php'),
|
|
||||||
cache: false,
|
|
||||||
data: data,
|
|
||||||
success: function(result) {
|
|
||||||
if (result !== 'false') {
|
|
||||||
addUser(uid_shared_with, permissions, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#shared_list > li').live('mouseenter', function(event) {
|
|
||||||
$(':hidden', this).show();
|
$(':hidden', this).show();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#shared_list > li').live('mouseleave', function(event) {
|
$('#sharedWithList li').live('mouseleave', function(event) {
|
||||||
|
// Hide permissions and unshare button
|
||||||
$('a', this).hide();
|
$('a', this).hide();
|
||||||
if (!$('input:[type=checkbox]', this).is(':checked')) {
|
if (!$('input:[type=checkbox]', this).is(':checked')) {
|
||||||
$('input:[type=checkbox]', this).hide();
|
$('input:[type=checkbox]', this).hide();
|
||||||
|
@ -102,161 +272,85 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.permissions').live('change', function() {
|
$('#share_with').live('change', function() {
|
||||||
var permissions = (this.checked) ? 1 : 0;
|
var item = $('#dropdown').data('item');
|
||||||
var source = $('#dropdown').data('file');
|
var uid_shared_with = $(this).val();
|
||||||
var uid_shared_with = $(this).parent().data('uid_shared_with');
|
var pos = uid_shared_with.indexOf('(group)');
|
||||||
var data = 'source='+encodeURIComponent(source)+'&uid_shared_with='+encodeURIComponent(uid_shared_with)+'&permissions='+encodeURIComponent(permissions);
|
var isGroup = false;
|
||||||
$.ajax({
|
if (pos != -1) {
|
||||||
type: 'GET',
|
// Remove '(group)' from uid_shared_with
|
||||||
url: OC.linkTo('files_sharing','ajax/setpermissions.php'),
|
uid_shared_with = uid_shared_with.substr(0, pos);
|
||||||
cache: false,
|
isGroup = true;
|
||||||
data: data
|
}
|
||||||
});
|
OC.Share.share(item, uid_shared_with, 0, function() {
|
||||||
});
|
if (isGroup) {
|
||||||
|
// Reload item because we don't know which users are in the group
|
||||||
$('.unshare').live('click', function(event) {
|
OC.Share.loadItem(item);
|
||||||
event.preventDefault();
|
var users;
|
||||||
var user = $(this).parent();
|
$.each(OC.Share.itemGroups, function(index, group) {
|
||||||
var source = $('#dropdown').data('file');
|
if (group.gid == uid_shared_with) {
|
||||||
var uid_shared_with = user.data('uid_shared_with');
|
users = group.users;
|
||||||
var data = 'source='+encodeURIComponent(source)+'&uid_shared_with='+encodeURIComponent(uid_shared_with);
|
}
|
||||||
$.ajax({
|
});
|
||||||
type: 'GET',
|
OC.Share.addSharedWith(uid_shared_with, 0, users, false);
|
||||||
url: OC.linkTo('files_sharing','ajax/unshare.php'),
|
} else {
|
||||||
cache: false,
|
OC.Share.addSharedWith(uid_shared_with, 0, false, false);
|
||||||
data: data,
|
}
|
||||||
success: function() {
|
// Change icon
|
||||||
var option = '<option value="'+uid_shared_with+'">'+uid_shared_with+'</option>';
|
if (!OC.Share.itemPrivateLink) {
|
||||||
$(user).remove();
|
OC.Share.icons[item] = OC.imagePath('core', 'actions/shared');
|
||||||
$(option).appendTo('#share_with');
|
|
||||||
$('#share_with').trigger('liszt:updated');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#makelink').live('change', function() {
|
$('.unshare').live('click', function() {
|
||||||
|
var item = $('#dropdown').data('item');
|
||||||
|
var uid_shared_with = $(this).parent().data('uid_shared_with');
|
||||||
|
OC.Share.unshare(item, uid_shared_with, function() {
|
||||||
|
OC.Share.removeSharedWith(uid_shared_with);
|
||||||
|
// Reload item to update cached users and groups for the icon check
|
||||||
|
OC.Share.loadItem(item);
|
||||||
|
// Change icon
|
||||||
|
if (!OC.Share.itemPrivateLink && !OC.Share.itemUsers && !OC.Share.itemGroups) {
|
||||||
|
OC.Share.icons[item] = OC.imagePath('core', 'actions/share');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.permissions').live('change', function() {
|
||||||
|
var permissions = (this.checked) ? 1 : 0;
|
||||||
|
OC.Share.changePermissions($('#dropdown').data('item'), $(this).parent().data('uid_shared_with'), permissions);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#privateLinkCheckbox').live('change', function() {
|
||||||
|
var item = $('#dropdown').data('item');
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
var source = $('#dropdown').data('file');
|
// Create a private link
|
||||||
var uid_shared_with = 'public';
|
OC.Share.share(item, 'public', 0, function(token) {
|
||||||
var permissions = 0;
|
OC.Share.showPrivateLink(item, token);
|
||||||
var data = 'sources='+encodeURIComponent(source)+'&uid_shared_with='+encodeURIComponent(uid_shared_with)+'&permissions='+encodeURIComponent(permissions);
|
// Change icon
|
||||||
$.ajax({
|
OC.Share.icons[item] = OC.imagePath('core', 'actions/public');
|
||||||
type: 'POST',
|
|
||||||
url: OC.linkTo('files_sharing','ajax/share.php'),
|
|
||||||
cache: false,
|
|
||||||
data: data,
|
|
||||||
success: function(token) {
|
|
||||||
if (token) {
|
|
||||||
showPublicLink(token, source.substr(source.lastIndexOf('/')));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
var source = $('#dropdown').data('file');
|
// Delete private link
|
||||||
var uid_shared_with = 'public';
|
OC.Share.unshare(item, 'public', function() {
|
||||||
var data = 'source='+encodeURIComponent(source)+'&uid_shared_with='+encodeURIComponent(uid_shared_with);
|
OC.Share.hidePrivateLink();
|
||||||
$.ajax({
|
// Change icon
|
||||||
type: 'GET',
|
if (OC.Share.itemUsers || OC.Share.itemGroups) {
|
||||||
url: OC.linkTo('files_sharing','ajax/unshare.php'),
|
OC.Share.icons[item] = OC.imagePath('core', 'actions/shared');
|
||||||
cache: false,
|
} else {
|
||||||
data: data,
|
OC.Share.icons[item] = OC.imagePath('core', 'actions/share');
|
||||||
success: function(){
|
|
||||||
$('#link').hide('blind');
|
|
||||||
$('#emailBreak').remove();
|
|
||||||
$('#email').hide();
|
|
||||||
$('#emailButton').hide();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#link').live('click', function() {
|
$('#privateLinkText').live('click', function() {
|
||||||
$(this).focus();
|
$(this).focus();
|
||||||
$(this).select();
|
$(this).select();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#emailButton').live('click', function() {
|
$('#emailButton').live('click', function() {
|
||||||
$('#email').css('font-weight', 'bold');
|
OC.Share.emailPrivateLink();
|
||||||
$('#email').animate({ fontWeight: 'normal' }, 2000, function() {
|
|
||||||
$(this).val('');
|
|
||||||
}).val('Email sent');
|
|
||||||
$.post(OC.filePath('files_sharing','ajax','email.php'), 'toaddress='+$('#email').val()+'&link='+$('#link').val());
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function createDropdown(filename, files) {
|
|
||||||
var html = '<div id="dropdown" class="drop" data-file="'+files+'">';
|
|
||||||
html += '<div id="private">';
|
|
||||||
html += '<select data-placeholder="User or Group" id="share_with" class="chzen-select">';
|
|
||||||
html += '<option value=""></option>';
|
|
||||||
html += '</select>';
|
|
||||||
html += '<ul id="shared_list"></ul>';
|
|
||||||
html += '</div>';
|
|
||||||
html += '<div id="public">';
|
|
||||||
html += '<input type="checkbox" name="makelink" id="makelink" value="1" /><label for="makelink">Share with private link</label>';
|
|
||||||
//html += '<input type="checkbox" name="public_link_write" id="public_link_write" value="1" /><label for="public_link_write">allow upload</label>';
|
|
||||||
html += '<br />';
|
|
||||||
html += '<input id="link" style="display:none; width:90%;" />';
|
|
||||||
html += '<input id="email" style="display:none; width:65%;" value="" placeholder="Email link to person" />';
|
|
||||||
html += '<input id="emailButton" style="display:none;" type="submit" value="Send" />';
|
|
||||||
html += '</div>';
|
|
||||||
if (filename) {
|
|
||||||
$('tr').filterAttr('data-file',filename).addClass('mouseOver');
|
|
||||||
$(html).appendTo($('tr').filterAttr('data-file',filename).find('td.filename'));
|
|
||||||
} else {
|
|
||||||
$(html).appendTo($('thead .share'));
|
|
||||||
}
|
|
||||||
$.getJSON(OC.linkTo('files_sharing', 'ajax/userautocomplete.php'), function(users) {
|
|
||||||
if (users) {
|
|
||||||
$.each(users, function(index, row) {
|
|
||||||
$(row).appendTo('#share_with');
|
|
||||||
});
|
|
||||||
$('#share_with').trigger('liszt:updated');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$.getJSON(OC.linkTo('files_sharing', 'ajax/getitem.php'), { source: files }, function(users) {
|
|
||||||
if (users) {
|
|
||||||
$.each(users, function(index, row) {
|
|
||||||
if (row.uid_shared_with == 'public') {
|
|
||||||
showPublicLink(row.token, '/'+filename);
|
|
||||||
} else if (isNaN(index)) {
|
|
||||||
addUser(row.uid_shared_with, row.permissions, index.substr(0, index.lastIndexOf('-')));
|
|
||||||
} else {
|
|
||||||
addUser(row.uid_shared_with, row.permissions, false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$('#dropdown').show('blind');
|
|
||||||
$('#share_with').chosen();
|
|
||||||
}
|
|
||||||
|
|
||||||
function addUser(uid_shared_with, permissions, parentFolder) {
|
|
||||||
if (parentFolder) {
|
|
||||||
var user = '<li>Parent folder '+parentFolder+' shared with '+uid_shared_with+'</li>';
|
|
||||||
} else {
|
|
||||||
var checked = ((permissions > 0) ? 'checked="checked"' : 'style="display:none;"');
|
|
||||||
var style = ((permissions == 0) ? 'style="display:none;"' : '');
|
|
||||||
var user = '<li data-uid_shared_with="'+uid_shared_with+'">';
|
|
||||||
user += '<a href="" class="unshare" style="display:none;"><img class="svg" alt="Unshare" src="'+OC.imagePath('core','actions/delete')+'"/></a>';
|
|
||||||
user += uid_shared_with;
|
|
||||||
user += '<input type="checkbox" name="permissions" id="'+uid_shared_with+'" class="permissions" '+checked+' />';
|
|
||||||
user += '<label for="'+uid_shared_with+'" '+style+'>can edit</label>';
|
|
||||||
user += '</li>';
|
|
||||||
}
|
|
||||||
$('#share_with option[value="'+uid_shared_with+'"]').remove();
|
|
||||||
$('#share_with').trigger('liszt:updated');
|
|
||||||
$(user).appendTo('#shared_list');
|
|
||||||
}
|
|
||||||
|
|
||||||
function showPublicLink(token, file) {
|
|
||||||
$('#makelink').attr('checked', true);
|
|
||||||
$('#link').data('token', token);
|
|
||||||
$('#link').val(parent.location.protocol+'//'+location.host+OC.linkTo('files_sharing','get.php')+'?token='+token+'&f='+file);
|
|
||||||
$('#link').show('blind', function() {
|
|
||||||
$('#link').after('<br id="emailBreak" />');
|
|
||||||
$('#email').show();
|
|
||||||
$('#emailButton').show();
|
|
||||||
});
|
|
||||||
}
|
|
|
@ -69,7 +69,7 @@ class OC_Share {
|
||||||
}
|
}
|
||||||
foreach ($uid_shared_with as $uid) {
|
foreach ($uid_shared_with as $uid) {
|
||||||
// Check if this item is already shared with the user
|
// Check if this item is already shared with the user
|
||||||
$checkSource = OCP\DB::prepare("SELECT source FROM *PREFIX*sharing WHERE source = ? AND uid_shared_with ".self::getUsersAndGroups($uid));
|
$checkSource = OCP\DB::prepare("SELECT source FROM *PREFIX*sharing WHERE source = ? AND uid_shared_with ".self::getUsersAndGroups($uid, false));
|
||||||
$resultCheckSource = $checkSource->execute(array($source))->fetchAll();
|
$resultCheckSource = $checkSource->execute(array($source))->fetchAll();
|
||||||
// TODO Check if the source is inside a folder
|
// TODO Check if the source is inside a folder
|
||||||
if (count($resultCheckSource) > 0 && !isset($gid)) {
|
if (count($resultCheckSource) > 0 && !isset($gid)) {
|
||||||
|
@ -125,7 +125,7 @@ class OC_Share {
|
||||||
* @param $uid (Optional) The uid to get the user groups for, a gid to get the users in a group, or if not set the current user
|
* @param $uid (Optional) The uid to get the user groups for, a gid to get the users in a group, or if not set the current user
|
||||||
* @return An IN operator as a string
|
* @return An IN operator as a string
|
||||||
*/
|
*/
|
||||||
private static function getUsersAndGroups($uid = null) {
|
private static function getUsersAndGroups($uid = null, $includePrivateLinks = true) {
|
||||||
$in = " IN(";
|
$in = " IN(";
|
||||||
if (isset($uid) && OC_Group::groupExists($uid)) {
|
if (isset($uid) && OC_Group::groupExists($uid)) {
|
||||||
$users = OC_Group::usersInGroup($uid);
|
$users = OC_Group::usersInGroup($uid);
|
||||||
|
@ -152,7 +152,9 @@ class OC_Share {
|
||||||
$in .= ", '".$uid."@".$group."'";
|
$in .= ", '".$uid."@".$group."'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$in .= ", '".self::PUBLICLINK."'";
|
if ($includePrivateLinks) {
|
||||||
|
$in .= ", '".self::PUBLICLINK."'";
|
||||||
|
}
|
||||||
$in .= ")";
|
$in .= ")";
|
||||||
return $in;
|
return $in;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue