$bz = getBzByPath($path); switch ($type) { case 'NewTxt': $filename = '新建文本文档.txt'; if (!perm_check::checkperm_Container($path, 'newtype', $bz)) { exit(json_encode(array('error' => '没有权限'))); } break; case 'NewDzzDoc': $filename = '新建Dzz文档.dzzdoc'; if (!perm_check::checkperm_Container($path, 'dzzdoc', $bz)) { exit(json_encode(array('error' => '没有权限'))); } break; } if ($arr = IO::upload_by_content(' ', $path, $filename)) { if ($arr['error']) { } else { $arr['msg'] = 'success'; } } else { $arr = array(); $arr['error'] = lang('template', '新建失败'); } echo json_encode($arr); exit; } elseif ($do == 'deleteIco') { $arr = array(); $names = array(); $i = 0; $icoids = $_GET['icoids'];
} } if (!preg_match("/^(http|ftp|https|mms)\\:\\/\\/.{4,300}\$/i", $link)) { topshowmessage('网址格式错误!'); } $icoarr = io_dzz::linktourl($link, $pfid); } elseif ($_GET['type'] == 'dzzdoc') { $aid = empty($_GET['aid']) ? 0 : intval($_GET['aid']); $attach = C::t('attachment')->fetch($aid); if (!$attach) { topshowmessage(lang('message', 'attachment_nonexistence')); } if (!empty($_GET['filename'])) { $attach['filename'] = trim($_GET['filename']); } $icoarr = IO::upload_by_content(IO::getFileContent('attach::' . $attach['aid']), $pfid, trim($attach['filename'], '.dzzdoc') . '.dzzdoc'); } else { $aid = empty($_GET['aid']) ? 0 : intval($_GET['aid']); $attach = C::t('attachment')->fetch($aid); if (!$attach) { topshowmessage(lang('message', 'attachment_nonexistence')); } if (!empty($_GET['filename'])) { $attach['filename'] = trim($_GET['filename']); } $icoarr = io_dzz::uploadToattachment($attach, $pfid); } if (isset($icoarr['error'])) { topshowmessage($icoarr['error']); } include template('common/header_simple');