//分4种情况:a:本地到api;b:api到api;c:api到本地;d:本地到本地; foreach ($icoids as $icoid) { //在目标位置创建 $opath = rawurldecode($icoid); $path = rawurldecode(str_replace(array('_dock_', 'icosContainer_folder_', 'icosContainer_body_'), '', $container)); $return = IO::CopyTo($opath, $path, $iscopy); if (!$iscopy) { $return = IO::DeleteByData($return); } if ($return['success'] === true) { $data['icoarr'][] = $return['newdata']; if (!$tbz) { addtoconfig($return['newdata'], $ticoid); } if ($return['newdata']['type'] == 'folder') { $data['folderarr'][] = IO::getFolderByIcosdata($return['newdata']); } $data['successicos'][$return['icoid']] = $return['newdata']['icoid']; } else { $data['error'][] = $return['name'] . ':' . $return['success']; } } if ($data['successicos']) { $data['msg'] = 'success'; if (isset($data['error'])) { $data['error'] = implode(';', $data['error']); } echo json_encode_gbk($data); exit; } else { $data['error'] = implode(';', $data['error']);
$name = io_dzz::name_filter(trim($_GET['name'])); if ($icoarr['name'] != $name || $icoarr['type'] == 'folder' && $icoarr['gid'] > 0) { C::t('icos')->update_by_name($icoid, $name); if ($icoarr['type'] == 'folder' && $icoarr['gid'] > 0 && (C::t('organization_admin')->ismoderator_by_uid_orgid($icoarr['gid'], $_G['uid']) || $_G['adminid'] == 1)) { C::t('folder')->update($icoarr['fid'], array('perm' => intval($_GET['perm']))); } $return = C::t('icos')->fetch_by_icoid($icoid); $return['msg'] = 'success'; } } else { $name = io_dzz::name_filter(trim($_GET['name'])); if ($icoarr['name'] != $name) { $return = IO::rename($icoid, $name); if (empty($return['error'])) { if ($return['type'] == 'folder') { $return['folderdata'] = IO::getFolderByIcosdata($return); } $return['msg'] = 'success'; $return['oicoid'] = $icoarr['icoid']; } } } showmessage('do_success', $refer . '', $return, array()); } else { $info = array(); $info['icon'] = $icoarr['img'] ? $icoarr['img'] : geticonfromext($icoarr['ext'], $icoarr['type']); $info['name'] = getstr($icoarr['name'], 30); $info['ftype'] = $icoarr['ftype']; //获取路径 if ($icoarr['bz']) { $bzarr = explode(':', $icoarr['path']);
$order = $marker; $limit = $perpage; } $icosdata = IO::listFiles($path, $by, $order, $limit, $force); if ($icosdata['error']) { exit(json_encode($icosdata)); } $folderdata = array(); $ignore = 0; foreach ($icosdata as $key => $value) { if ($value['error']) { $ignore++; continue; } if ($value['type'] == 'folder') { $folder = IO::getFolderByIcosdata($value); $folderdata[$folder['fid']] = $folder; } if (strpos($bz, 'ftp') === false) { if (trim($value['path'], '/') == trim($path, '/')) { $ignore++; continue; } } $userdata[$value['uid']] = $value['username']; $data[$key] = $value; } //$sid=md5(rawurldecode($sid)); //$data=$icosdata; $bz = $bz; //print_r($data); exit($sid);