Merge remote-tracking branch 'mike/master' into dev
This commit is contained in:
commit
4cafa6280d
@ -324,12 +324,8 @@ class Display extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
$o .= '<div id="content-complete"></div>';
|
||||
|
||||
return $o;
|
||||
|
||||
|
||||
/*
|
||||
elseif((! $update) && (! {
|
||||
|
||||
if((! $update) && (! $items)) {
|
||||
|
||||
$r = q("SELECT id, item_flags FROM item WHERE id = '%s' OR mid = '%s' LIMIT 1",
|
||||
dbesc($item_hash),
|
||||
@ -348,7 +344,9 @@ class Display extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
return $o;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1291,7 +1291,7 @@ function fetch_xrd_links($url) {
|
||||
return array();
|
||||
|
||||
$h = parse_xml_string($xml);
|
||||
if(! $h)
|
||||
if($h === false)
|
||||
return array();
|
||||
|
||||
$arr = convert_xml_element_to_array($h);
|
||||
|
73
util/dcp
Executable file
73
util/dcp
Executable file
@ -0,0 +1,73 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
// file import to DAV utility
|
||||
|
||||
if(!file_exists('include/cli_startup.php')) {
|
||||
echo 'Run dcp from the top level Hubzilla web directory, as util/dcp <args>' . PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
require_once('include/cli_startup.php');
|
||||
require_once('include/attach.php');
|
||||
|
||||
cli_startup();
|
||||
|
||||
$srcfile = $argv[1];
|
||||
$dstfile = $argv[2];
|
||||
|
||||
if($argc != 3) {
|
||||
echo "Usage: " . $argv[0] . ' source destination' . "\n";
|
||||
echo 'Always run from the toplevel web directory.' . "\n";
|
||||
echo 'destination should begin with store/$nickname/desired/path/filename or $nickname/desired/path/filename' . "\n";
|
||||
echo 'destination must end with the destination filename (not a directory name).' . "\n";
|
||||
echo 'Example: util/dcp /etc/motd store/joe/etc/motd' . "\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(strpos($dstfile,'store/') === 0)
|
||||
$dstfile = substr($dstfile,6);
|
||||
|
||||
$nick = substr($dstfile,0,strpos($dstfile,'/'));
|
||||
|
||||
$dstfile = substr($dstfile,strlen($nick)+1);
|
||||
|
||||
$channel = channelx_by_nick($nick);
|
||||
if(! $channel)
|
||||
return;
|
||||
|
||||
|
||||
$arr = [
|
||||
'pathname' => dirname($dstfile),
|
||||
'allow_cid' => $channel['channel_allow_cid'],
|
||||
'allow_gid' => $channel['channel_allow_gid'],
|
||||
'deny_cid' => $channel['channel_deny_cid'],
|
||||
'deny_gid' => $channel['channel_deny_gid'],
|
||||
];
|
||||
|
||||
$folder = '';
|
||||
if(dirname($dstfile)) {
|
||||
$x = attach_mkdirp($channel,$channel['channel_hash'],$arr);
|
||||
if($x['success'])
|
||||
$folder = $x['data']['hash'];
|
||||
}
|
||||
|
||||
$arr = [
|
||||
'src' => $srcfile,
|
||||
'filename' => basename($srcfile),
|
||||
'hash' => random_string(),
|
||||
'allow_cid' => $channel['channel_allow_cid'],
|
||||
'allow_gid' => $channel['channel_allow_gid'],
|
||||
'deny_cid' => $channel['channel_deny_cid'],
|
||||
'deny_gid' => $channel['channel_deny_gid'],
|
||||
'preserve_original' => true,
|
||||
];
|
||||
|
||||
if($folder)
|
||||
$arr['folder'] = $folder;
|
||||
|
||||
attach_store($channel,$channel['channel_hash'],'import',$arr);
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".comment-edit-wrapper textarea").editor_autocomplete(baseurl+"/acl?f=&n=1");
|
||||
// make auto-complete work in more places
|
||||
$(".wall-item-comment-wrapper textarea").editor_autocomplete(baseurl+"/acl?f=&n=1");
|
||||
});
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user