function losslesslyOptimiseImage($path, $jpegOrPng) { $originalModifiedTime = filemtime($path); $originalFilesize = filesize($path); if ($jpegOrPng == 'jpeg') { $response = shellCommand('jpegoptim -o ' . $path); } elseif ($jpegOrPng == 'png') { $response = shellCommand('optipng -o7 ' . $path); } clearstatcache(); $optimisedFilesize = filesize($path); $optimisedModifiedTime = filemtime($path); if ($originalModifiedTime != $optimisedModifiedTime || $originalFilesize != $optimisedFilesize) { $this->logError(basename($path) . ' &image-optimised-from; ' . formatFileSize($originalFilesize) . ' &to; ' . formatFileSize($optimisedFilesize) . ' (' . round($optimisedFilesize / $originalFilesize * 100) . '&percent;)', 'note'); } else { if (strpos($response, 'not found') !== false) { if ($jpegOrPng == 'jpeg') { $this->logError('&jpegoptim-not-available;', 'warning'); } elseif ($jpegOrPng == 'png') { $this->logError('&optipng-not-available;', 'warning'); } } else { } } }
function createDownloadsArray($result) { global $CONFIG; global $downloads_dir; $downloads = array(); while ($data = mysql_fetch_array($result)) { $id = $data['id']; $category = $data['category']; $type = $data['type']; $ttitle = $data['title']; $description = $data['description']; $filename = $data['location']; $numdownloads = $data['downloads']; $clientsonly = $data['clientsonly']; $filesize = @filesize($downloads_dir . $filename); $filesize = formatFileSize($filesize); $fileext = end(explode(".", $filename)); if ($fileext == "doc") { $type = "doc"; } if ($fileext == "gif" || $fileext == "jpg" || $fileext == "jpeg" || $fileext == "png") { $type = "picture"; } if ($fileext == "txt") { $type = "txt"; } if ($fileext == "zip") { $type = "zip"; } $type = "<img src=\"images/" . $type . ".png\" align=\"absmiddle\" alt=\"\" />"; $downloads[] = array("type" => $type, "title" => $ttitle, "urlfriendlytitle" => getModRewriteFriendlyString($ttitle), "description" => $description, "downloads" => $numdownloads, "filesize" => $filesize, "clientsonly" => $clientsonly, "link" => $CONFIG['SystemURL'] . ("/dl.php?type=d&id=" . $id)); } return $downloads; }
/** * 上传文件,返回上传文件的地址 * @param HttpRequest $request */ public function index(HttpRequest $request) { $userid = $request->getParameter('userid', 'intval'); $mediaId = $request->getParameter('media_id', 'intval'); $type = $request->getParameter('type', 'trim'); //图片的最大尺寸,大于这个尺寸就等比例裁剪 $width = $request->getParameter('width', 'intval'); if ($width <= 0) { $width = 800; } if (!$type) { $type = 'image'; } $__uploadDir = $type . '/' . date('Y') . '/' . date('m') . '/' . date('d'); $uploadDir = getConfig('upload_dir') . $__uploadDir; //上传图片 $config = array("upload_dir" => $uploadDir, 'max_size' => 2048000); $upload = new FileUpload($config); $result = $upload->upload('Filedata'); if ($result && $result['is_image'] == 1) { //缩放图片 if ($width < $result['image_width']) { $src = $result['file_path']; $thumb = ImageThumb::getInstance(); $thumb->setFlag(2); //规定宽度,等比缩放 $filename = $thumb->makeThumb(array($width, 0), $src, null, true); //重新获取图片的尺寸和大小 $info = getimagesize($filename); $result['image_width'] = $info[0]; $result['image_height'] = $info[1]; $result['file_size'] = filesize($filename); } //添加图片图片信息到数据库 $service = Beans::get('image.image.service'); $url = '/res/upload/' . $__uploadDir . '/' . $result['file_name']; $data = array('userid' => $userid, 'media_id' => $mediaId, 'url' => $url, 'filename' => $result['local_name'], 'type' => $type, 'filesize' => formatFileSize($result['file_size']), 'width' => intval($result['image_width']), 'height' => intval($result['image_height']), 'add_time' => time(), 'grabed' => 1); //保存到数据库失败 if (!$service->add($data)) { //删除图片 @unlink($result['file_path']); } AjaxResult::ajaxResult(1, $url); } else { @unlink($result['file_path']); AjaxResult::ajaxResult(0, '图片上传失败,' . $upload->getUploadMessage()); } }
function makeFileList($path) { $filelist = scandir($path); $list = array(); foreach ($filelist as $file) { if (!is_dir($path . '/' . $file)) { $item = array(); $item['name'] = $file; $item['extension'] = pathinfo($path . '/' . $file, PATHINFO_EXTENSION); $item['size'] = filesize($path . '/' . $file); $item['size_str'] = formatFileSize($item['size']); $item['url'] = $path . '/' . $file; $list[] = $item; } } return $list; }
/** * 管理 */ public function indexAction() { $iframe = $this->get('iframe') ? 1 : 0; $dir = $this->get('dir') ? base64_decode($this->get('dir')) : ''; $dir = substr($dir, 0, 1) == '/' ? substr($dir, 1) : $dir; $dir = str_replace('//', '/', $dir); if ($this->checkFileName($dir)) { $this->adminMsg(lang('m-con-20')); } $list = array(); if ($this->isPostForm()) { $name = $this->post('kw'); if (empty($name)) { $this->adminMsg(lang('a-att-31')); } if ($this->checkFileName($name)) { $this->adminMsg(lang('m-con-20')); } $dir = ''; $data = $this->getfiles($this->dir, $name); } else { $data = file_list::get_file_list($this->dir . $dir); } if ($data) { foreach ($data as $t) { if ($t == 'index.html') { continue; } $path = $dir . $t . '/'; $ext = is_dir($this->dir . $path) ? 'dir' : strtolower(trim(substr(strrchr($t, '.'), 1, 10))); $ico = file_exists(basename(VIEW_DIR) . '/admin/images/ext/' . $ext . '.gif') ? $ext . '.gif' : $ext . '.png'; $fileinfo = array(); if (is_file($this->dir . $dir . $t)) { $file = $this->dir . $dir . $t; $fileinfo = array('path' => $file, 'time' => date(TIME_FORMAT, filemtime($file)), 'size' => formatFileSize(filesize($file)), 'ext' => $ext); } $list[] = array('name' => $t, 'dir' => base64_encode($path), 'path' => $this->dir . $path, 'ico' => $ico, 'isimg' => in_array($ext, array('gif', 'jpg', 'png', 'jpeg', 'bmp')) ? 1 : 0, 'isdir' => is_dir($this->dir . $path) ? 1 : 0, 'fileinfo' => $fileinfo, 'url' => is_dir($this->dir . $path) ? url('admin/attachment/index', array('dir' => base64_encode($path), 'iframe' => $iframe)) : ''); } } $this->view->assign(array('dir' => $this->dir . $dir, 'istop' => $dir ? 1 : 0, 'pdir' => url('admin/attachment/index', array('dir' => base64_encode(str_replace(basename($dir), '', $dir)), 'iframe' => $iframe)), 'list' => $list, 'iframe' => $iframe)); $this->view->display('admin/attachment_list'); }
public static function getFileListInDirEx($dir) { $fileList = array(); $d = dir($dir); if (is_object($d)) { //echo "Handle: " . $d->handle . "\n"; //echo "Path: " . $d->path . "\n"; while (false !== ($entry = $d->read())) { if ($entry != '..' && $entry != '.' && is_file($dir . $entry)) { $pathFileName = $dir . $entry; $arrTmp['fullpath'] = $pathFileName; $arrTmp['name'] = $entry; $arrTmp['size'] = formatFileSize(filesize($pathFileName)); $arrTmp['cdate'] = date('Y-m-d H:i:s', filemtime($pathFileName)); //$fileList[$dir.$entry] = $entry; $fileList[$pathFileName] = $arrTmp; } //echo $entry."\n"; } $d->close(); } return $fileList; }
function makefile($fileid, $statichtml = 0) { global $DMC, $DBPrefix, $strDownFile, $strDownFile1, $strDownFile2, $strPlayMusic, $strOnlinePlay, $strOnlineStop, $strDownload, $strRightBtnSave, $settingInfo; $kkstr = ""; $dataInfo = $DMC->fetchArray($DMC->query("select id,name,attTitle,downloads,fileSize,fileWidth,fileHeight from " . $DBPrefix . "attachments where id='{$fileid}' or name='{$fileid}'")); if (is_array($dataInfo)) { $fileType = strtolower(substr($dataInfo['name'], strrpos($dataInfo['name'], ".") + 1)); if (in_array($fileType, array('wma', 'mp3', 'rm', 'ra', 'qt', 'wmv', 'swf', 'flv', 'mpg', 'avi', 'divx', 'asf', 'rmvb'))) { $fid = "media" . validCode(4); if (strpos($dataInfo['name'], "://") < 1) { $dataInfo['name'] = "attachments/" . $dataInfo['name']; } if (strpos(";{$settingInfo['ajaxstatus']};", "M") < 1) { $intWidth = $dataInfo['fileWidth'] == 0 ? 400 : $dataInfo['fileWidth']; $intHeight = $dataInfo['fileHeight'] == 0 ? 300 : $dataInfo['fileHeight']; $kkstr .= "<div class=\"UBBPanel\">"; $kkstr .= "<div class=\"UBBTitle\"><img src=\"images/music.gif\" alt=\"\" style=\"margin:0px 2px -3px 0px\" border=\"0\"/>{$strPlayMusic} -- " . $dataInfo['attTitle']; $kkstr .= "</div>"; $kkstr .= "<div class=\"UBBContent\">"; $kkstr .= "<a id=\"" . $fid . "_href\" href=\"javascript:MediaShow('" . $fileType . "','{$fid}','" . $dataInfo['name'] . "','{$intWidth}','{$intHeight}','{$strOnlinePlay}','{$strOnlineStop}')\">"; $kkstr .= "<img name=\"" . $fid . "_img\" src=\"images/mm_snd.gif\" style=\"margin:0px 3px -2px 0px\" border=\"0\" alt=\"\"/>"; $kkstr .= "<span id=\"" . $fid . "_text\">{$strOnlinePlay}</span></a><div id=\"" . $fid . "\">"; $kkstr .= "</div></div></div>"; } else { $kkstr .= "<div class=\"UBBPanel\">"; $kkstr .= "<div class=\"UBBTitle\"><img src=\"images/music.gif\" alt=\"\" style=\"margin:0px 2px -3px 0px\" border=\"0\"/>{$strPlayMusic} -- " . $dataInfo['attTitle']; $kkstr .= "</div>"; $kkstr .= "<div class=\"UBBContent\">"; $kkstr .= "<a id=\"" . $fid . "_href\" href=\"javascript:void(0)\" onclick=\"javascript:f2_ajax_media('f2blog_ajax.php?ajax_display=media&media={$fid}&id={$dataInfo['id']}','{$fid}','{$strOnlinePlay}','{$strOnlineStop}')\">"; $kkstr .= "<img name=\"" . $fid . "_img\" src=\"images/mm_snd.gif\" style=\"margin:0px 3px -2px 0px\" border=\"0\" alt=\"\"/>"; $kkstr .= "<span id=\"" . $fid . "_text\">{$strOnlinePlay}</span></a><div id=\"" . $fid . "\" style=\"display:none;\">"; $kkstr .= "</div></div></div>"; } } else { if ($statichtml == 1) { //静态页面 $kkstr .= "<img src=\"images/download.gif\" alt=\"{$strDownFile}\" style=\"margin:0px 2px -4px 0px\"/><a href=\"download.php?id=" . $dataInfo['id'] . "\">" . $dataInfo['attTitle'] . "</a> (" . formatFileSize($dataInfo['fileSize']) . " ,{$strDownFile1}<?php echo !empty(\$cachedownload['" . $dataInfo['id'] . "'])?\$cachedownload['" . $dataInfo['id'] . "']:'0'?>{$strDownFile2})"; } else { $dataInfo['downloads'] = $dataInfo['downloads'] != "" ? $dataInfo['downloads'] : "0"; $kkstr .= "<img src=\"images/download.gif\" alt=\"{$strDownFile}\" style=\"margin:0px 2px -4px 0px\"/><a href=\"download.php?id=" . $dataInfo['id'] . "\">" . $dataInfo['attTitle'] . "</a> (" . formatFileSize($dataInfo['fileSize']) . " , {$strDownFile1}" . $dataInfo['downloads'] . "{$strDownFile2})"; } } } return $kkstr; }
/** * 文件信息查看 */ public function fileinfoAction() { $file = $this->post('file'); //文件 if ($file && is_file($file)) { echo lang('a-att-6') . ':' . $file . '<br>' . lang('a-att-7') . ':' . date(TIME_FORMAT, @filemtime($file)) . '<br>' . lang('a-att-8') . ':' . formatFileSize(filesize($file)) . ' <a href="' . $file . '" target=_blank>' . lang('a-att-10') . '</a>'; } else { echo '<a href="' . $file . '" target=_blank>' . $file . '</a>'; } }
/** * 附件管理 */ public function attachmentAction() { $dir = urldecode($this->get('dir')); $type = $this->get('type'); $mdir = 'uploadfiles/member/' . $this->memberinfo['id'] . '/'; //会员附件目录 $mdir = $type == 1 ? $mdir . 'file/' : $mdir . 'image/'; if ($this->checkFileName($dir)) { $this->memberMsg(lang('m-con-20'), url('member/content/attachment', array('type' => $type))); } $dir = substr($dir, 0, 1) == '/' ? substr($dir, 1) : $dir; $data = file_list::get_file_list($mdir . $dir . '/'); $list = array(); if ($data) { foreach ($data as $t) { $path = $mdir . $dir . '/' . $t; $ext = is_dir($path) ? 'dir' : strtolower(trim(substr(strrchr($t, '.'), 1, 10))); $ico = file_exists(basename(VIEW_DIR) . '/admin/images/ext/' . $ext . '.gif') ? $ext . '.gif' : $ext . '.png'; $info = array(); if (is_file($path)) { if (strpos($t, '.thumb.') !== false) { continue; } $info = array('ext' => $ext, 'path' => $path, 'time' => date('Y-m-d H:i:s', filemtime($path)), 'size' => formatFileSize(filesize($path), 2)); } $list[] = array('dir' => urlencode($dir . '/' . $t), 'ico' => $ico, 'url' => is_dir($path) ? url('member/content/attachment', array('dir' => urlencode($dir . '/' . $t), 'type' => $type)) : '', 'name' => $t, 'path' => $path, 'info' => $info, 'isimg' => in_array($ext, array('gif', 'jpg', 'png', 'jpeg', 'bmp')) ? 1 : 0, 'isdir' => is_dir($path) ? 1 : 0); } } $this->view->assign(array('dir' => $dir, 'type' => $type, 'list' => $list, 'pdir' => url('member/content/attachment', array('dir' => urlencode(str_replace(basename($dir), '', $dir)), 'type' => $type)), 'istop' => $dir ? 1 : 0, 'countsize' => formatFileSize(count_member_size($this->memberinfo['id'], $type == 1 ? 'file' : 'image'), 2), 'meta_title' => lang('m-con-5') . '-' . lang('member') . '-' . $this->site['SITE_NAME'])); $this->view->display('member/attachment'); }
/** * @return string HTML code for image form element. * @param int $id Image ID. * @param array $element_params * @desc Make image form element */ function makeFormElement($id=null, $element_params=null) { GLOBAL $parser; GLOBAL $db; $tpl = &$parser->tpl; $this->init($parser,$id); if ($this->isNew()) { // create thumbnails foreach ($this->image['images'] as $key=>$params) { if ($key!=0) { $tpl->setCurrentBlock('new_thumbnail'); $tpl->setVariable(array( 'NAME' => $this->field_name.'_'.$key, 'THUMBNAIL_NAME' => $params['name'], 'THUMBNAIL_WIDTH' => $params['width'], 'THUMBNAIL_HEIGHT' => $params['height'] )); $tpl->parseCurrentBlock(); } } // create original $tpl->setCurrentBlock('new'); $tpl->setVariable(array( 'NAME' => $this->field_name.'_0', 'IMG_NAME' => $this->field_name )); $tpl->parseCurrentBlock(); } else { // create thumbnails foreach ($this->image[images] as $key=>$params) { if ($key!=0) { $file_name = $this->path.$this->id.'_'.$key; $http_file_name = HTTP_ROOT.$this->root_path.$this->id.'_'.$key; if (file_exists($file_name)) { // if thumbnail exists $thumbnail_info = getimagesize($file_name); $tpl->setCurrentBlock('update_thumbnail'); $tpl->setVariable(array( 'THUMBNAIL_NAME' => $params[name], 'THUMBNAIL_W' => $thumbnail_info[0], 'THUMBNAIL_H' => $thumbnail_info[1], 'THUMBNAIL_FILE_NAME' => $http_file_name, 'EDITORS_PATH' => 'editors/', 'ID' => $this->id, 'KEY' => $key, 'IMAGE_NAME' => $this->image_name )); $tpl->parseCurrentBlock(); } else { // if thumbnail NOT exists } } } $thumbnail_file_name = $this->path.$this->id.'_t'; $thumbnail_http_file_name = HTTP_ROOT.$this->root_path.$this->id.'_t'; $original_thumbnail_info = getimagesize($thumbnail_file_name); $original_file_name = $this->path.$this->id.'_0'; $original_info = getimagesize($original_file_name); $file_size = filesize($original_file_name); $tpl->parseVariable(array( 'NAME' => $this->field_name.'_0', 'IMAGE_FILE_DELETE' => 'is_delete', 'APPLY_TO_THUMBNAILS' => 'apply_to_thumbnails', 'ORIGINAL_THUMBNAIL_SRC' => $thumbnail_http_file_name, 'ORIGINAL_THUMBNAIL_INFO' => $original_thumbnail_info[3], 'TIMESTAMP' => time(), 'IMAGE_SRC' => $this->path.$this->id, 'IMAGE_TYPE' => strtolower(imageGetTypeName($original_info[2])), 'IMAGE_W' => $original_info[0], 'IMAGE_H' => $original_info[1], 'IMAGE_FILE_SIZE' => formatFileSize($file_size), 'IMG_NAME' => $this->field_name, 'EDITORS_PATH' => 'editors/', 'ID' => $this->id, 'KEY' => '0', 'IMAGE_NAME' => $this->image_name // 'FILENAME' => str_replace(SYS_ROOT,'',$file_name) ),'update'); } return trim($tpl->get()); }
$sizes = array(); $bknums = array(); $shares = array(); $cssClasses = array(); $i = 0; $params = array(); foreach ($data as $entry) { $param = array('host' => $_GET['host'], 'backupnum' => $entry['backupnum'], 'sharename' => $entry['sharename'], 'dir' => $entry['filepath']); if ($entry['type'] == 'd') { $sizes[] = ''; $name = '<a href="#" onclick="BrowseDir(\'' . $entry['filepath'] . '\')">' . $entry['filename'] . "</a>"; $cssClasses[] = 'folder'; $params['isdir'] = '1'; //$viewVersionsActions[] = $emptyAction; } else { $sizes[] = formatFileSize($entry['filesize']); $param_str = "host=" . $_GET['host'] . "&backupnum=" . $entry['backupnum'] . "&sharename=" . urlencode($entry['sharename']); $param_str .= "&dir=" . urlencode($entry['filepath']); $name = '<a href="#" onclick="RestoreFile(\'' . $param_str . '\')">' . $entry['filename'] . "</a>"; $cssClasses[$i] = 'file'; //$viewVersionsActions[] = $viewVersionsAction; } $i++; $names[] = $name; $params[] = $param; } $count = count($data); $n = new OptimizedListInfos($names, _T('File', 'backuppc')); $n->disableFirstColumnActionLink(); $n->addExtraInfo($sizes, _T("Size", "backuppc")); $n->setMainActionClasses($cssClasses);
case 'jpg': case 'jpeg': case 'png': case 'gif': $className = 'image'; break; case 'mp3': $className = 'audio'; break; case 'fla': case 'swf': case 'flv': $className = 'flash'; break; case 'mpeg': case 'mp4': case '3gp': case 'mpg': case 'mov': case 'avi': $className = 'video'; break; case 'psd': $className = 'photoshop'; break; case 'pdf': $className = ' pdf'; break; case 'doc': case 'docx': $className = 'msword';
break; } } $ActionMessage = substr($str, 1) . " {$strCacheTitle}{$strUpdate}{$strSuccess}"; $action = ""; } $edit_url = "{$PHP_SELF}"; //查找连接 if ($action == "") { // 查找 $title = "{$strCacheTitle}"; $cachedb = array(); foreach ($cacheArr as $name => $desc) { $filepath = F2BLOG_ROOT . "cache/cache_" . $name . '.php'; if (is_file($filepath)) { $cachefile['name'] = $name; $cachefile['desc'] = $desc; $cachefile['size'] = formatFileSize(filesize($filepath)); $cachefile['mtime'] = format_time("L", filemtime($filepath)); $cachedb[] = $cachefile; } else { $cachefile['name'] = $name; $cachefile['desc'] = $desc; $cachefile['size'] = " "; $cachefile['mtime'] = " "; $cachedb[] = $cachefile; } } unset($cachefile); include "cache_list.inc.php"; }
<th>Filename</th> <th>File Size</th> <th>Date Modified</th> <th>Backup</th> </tr> </thead> <?php $banners = $concept[banners]; if (file_exists($base_url)) { foreach ($banners as $key => $banner) { // gets all the banner info $bannerName = formatDisplayName($banner[banner_name]); $bannerZipFile = $base_url . $banner[banner_base_name] . ".zip"; $bannerHtmlFile = getHtmlFile($base_url . $banner[banner_base_name]); $bannerFileSize = formatFileSize(filesize($bannerZipFile)); $bannerDateModified = formatDate(filemtime($bannerZipFile)); $bannerBackup = $base_url . $banner[banner_base_name] . ".jpg"; ?> <tr> <!-- thumbnail --> <td class="backup-thumbnail"><a href="<?php echo $bannerHtmlFile; ?> " target="_blank"><img src="<?php echo $bannerBackup; ?> " alt=""></a></td> <!-- filename --> <td><a href="<?php echo $bannerHtmlFile;
function renderCell($cell) { switch ($cell['realm']) { case 'user': echo "<table class='slbcell vscell'><tr><td rowspan=3 width='5%'>"; printImageHREF('USER'); echo '</td><td>' . mkA($cell['user_name'], 'user', $cell['user_id']) . '</td></tr>'; if (strlen($cell['user_realname'])) { echo "<tr><td><strong>" . niftyString($cell['user_realname']) . "</strong></td></tr>"; } else { echo "<tr><td class=sparenetwork>no name</td></tr>"; } echo '<td>'; if (!isset($cell['etags'])) { $cell['etags'] = getExplicitTagsOnly(loadEntityTags('user', $cell['user_id'])); } echo count($cell['etags']) ? "<small>" . serializeTags($cell['etags']) . "</small>" : ' '; echo "</td></tr></table>"; break; case 'file': echo "<table class='slbcell vscell'><tr><td rowspan=3 width='5%'>"; switch ($cell['type']) { case 'text/plain': printImageHREF('text file'); break; case 'image/jpeg': case 'image/png': case 'image/gif': printImageHREF('image file'); break; default: printImageHREF('empty file'); break; } echo "</td><td>"; echo mkA('<strong>' . niftyString($cell['name']) . '</strong>', 'file', $cell['id']); echo "</td><td rowspan=3 valign=top>"; if (isset($cell['links']) and count($cell['links'])) { printf("<small>%s</small>", serializeFileLinks($cell['links'])); } echo "</td></tr><tr><td>"; echo count($cell['etags']) ? "<small>" . serializeTags($cell['etags']) . "</small>" : ' '; echo '</td></tr><tr><td>'; if (isolatedPermission('file', 'download', $cell)) { // FIXME: reuse renderFileDownloader() echo "<a href='?module=download&file_id={$cell['id']}'>"; printImageHREF('download', 'Download file'); echo '</a> '; } echo formatFileSize($cell['size']); echo "</td></tr></table>"; break; case 'ipv4vs': case 'ipvs': case 'ipv4rspool': renderSLBEntityCell($cell); break; case 'ipv4net': case 'ipv6net': echo "<table class='slbcell vscell'><tr><td rowspan=3 width='5%'>"; printImageHREF('NET'); echo '</td><td>' . mkA("{$cell['ip']}/{$cell['mask']}", $cell['realm'], $cell['id']); echo getRenderedIPNetCapacity($cell); echo '</td></tr>'; echo "<tr><td>"; if (strlen($cell['name'])) { echo "<strong>" . niftyString($cell['name']) . "</strong>"; } else { echo "<span class=sparenetwork>no name</span>"; } // render VLAN renderNetVLAN($cell); echo "</td></tr>"; echo '<tr><td>'; echo count($cell['etags']) ? "<small>" . serializeTags($cell['etags']) . "</small>" : ' '; echo "</td></tr></table>"; break; case 'rack': echo "<table class='slbcell vscell'><tr><td rowspan=3 width='5%'>"; $thumbwidth = getRackImageWidth(); $thumbheight = getRackImageHeight($cell['height']); echo "<img border=0 width={$thumbwidth} height={$thumbheight} title='{$cell['height']} units' "; echo "src='?module=image&img=minirack&rack_id={$cell['id']}'>"; echo "</td><td>"; echo mkA('<strong>' . niftyString($cell['name']) . '</strong>', 'rack', $cell['id']); echo "</td></tr><tr><td>"; echo niftyString($cell['comment']); echo "</td></tr><tr><td>"; echo count($cell['etags']) ? "<small>" . serializeTags($cell['etags']) . "</small>" : ' '; echo "</td></tr></table>"; break; case 'location': echo "<table class='slbcell vscell'><tr><td rowspan=3 width='5%'>"; printImageHREF('LOCATION'); echo "</td><td>"; echo mkA('<strong>' . niftyString($cell['name']) . '</strong>', 'location', $cell['id']); echo "</td></tr><tr><td>"; echo niftyString($cell['comment']); echo "</td></tr><tr><td>"; echo count($cell['etags']) ? "<small>" . serializeTags($cell['etags']) . "</small>" : ' '; echo "</td></tr></table>"; break; case 'object': echo "<table class='slbcell vscell'><tr><td rowspan=2 width='5%'>"; printImageHREF('OBJECT'); echo '</td><td>'; echo mkA('<strong>' . niftyString($cell['dname']) . '</strong>', 'object', $cell['id']); echo '</td></tr><tr><td>'; echo count($cell['etags']) ? "<small>" . serializeTags($cell['etags']) . "</small>" : ' '; echo "</td></tr></table>"; break; default: throw new InvalidArgException('realm', $cell['realm']); } }
<tr> <td colspan="3" background="images/content/dotted_attach.gif"></td> </tr> <tr> <td height="31" align="center"> <img src="images/content/AlignFree.gif" onclick="insert_file('F')" alt="<?php echo $strSelFilFree; ?> "/> </td> <td align="center"> <img src="images/content/attachDown.gif" onClick="Javascript:onclick_download()" alt="<?php echo $strDownload; ?> "/> </td> <td align="center"> <img src="images/content/attachDel.gif" onClick="Javascript:onclick_delete(this.form)" alt="<?php echo $strDelete; ?> "/> </td> </tr> </table> </td> </tr> <tr> <td colspan="2"> <?php echo $strAttType . "<font color=red>" . $cfg_upload_file . "</font><br>" . $strAttachmentsError1 . "<font color=red>" . formatFileSize($cfg_upload_size) . "</font><br>"; ?> <input name="attfile" class="filebox" type="file" style="font-size: 9pt; height:24px" onchange="Javascript:onclick_update(this.form)" size="50"/> </td> </tr> </table> </form>
/** * 生成首页 */ public function indexcAction() { ob_start(); $this->view->assign(array('indexc' => 1, 'meta_title' => $this->site['SITE_TITLE'], 'meta_keywords' => $this->site['SITE_KEYWORDS'], 'meta_description' => $this->site['SITE_DESCRIPTION'])); $this->view->setTheme(true); $this->view->display('index'); $this->view->setTheme(false); $sites = App::get_site(); if (count($sites) > 1) { $size = file_put_contents(APP_ROOT . 'cache/index/' . $this->siteid . '.html', ob_get_clean(), LOCK_EX); @unlink(APP_ROOT . 'index.html'); } else { $size = file_put_contents(APP_ROOT . 'index.html', ob_get_clean(), LOCK_EX); } $this->adminMsg(lang('a-con-107') . '(' . formatFileSize($size) . ')', '', 3, 1, 1); }
$uploads = $SOUP->get('uploads'); $id = $SOUP->get('id', 'editUploads'); ?> <script type="text/javascript"> $(document).ready(function(){ $('#<?php echo $id; ?> input.delete').click(function(){ var li = $(this).parent(); var id = $(li).attr('id').slice(7); // file- var deleted = $('<input type="hidden" name="deleted['+id+']" value="'+id+'" />'); $(li).append(deleted); $(li).fadeOut(); }); }); </script> <div id="<?php echo $id; ?> "> <?php if (!empty($uploads)) { echo '<ul class="segmented-list uploads">'; foreach ($uploads as $u) { echo '<li id="delete-' . $u->getID() . '">'; echo '<input type="button" class="delete" value="Delete" />'; echo '<a href="' . $u->getDownloadURL() . '">' . $u->getOriginalName() . '</a> (' . formatFileSize($u->getSize()) . ')'; echo '</li>';
function formatEventDetails($event) { $details = ''; switch ($event->getEventTypeID()) { case 'edit_update_uploads': case 'edit_task_uploads': $addedIDs = explode(',', $event->getData2()); $added = ''; foreach ($addedIDs as $a) { if ($a == '') { continue; } // skip blanks $upload = Upload::load($a); $added .= $upload->getOriginalName() . ' (' . formatFileSize($upload->getSize()) . ')<br /><br />'; } if (!empty($added)) { $details .= '<ins>' . $added . '</ins>'; } $deletedIDs = explode(',', $event->getData1()); $deleted = ''; foreach ($deletedIDs as $d) { if ($d == '') { continue; } // skip blanks $upload = Upload::load($d); $deleted .= $upload->getOriginalName() . ' (' . formatFileSize($upload->getSize()) . ')<br /><br />'; } if (!empty($deleted)) { $details .= '<del>' . $deleted . '</del>'; } break; case 'edit_pitch': case 'edit_specs': case 'edit_rules': case 'edit_task_description': case 'edit_update_message': $from = $event->getData1(); $to = $event->getData2(); $from = str_replace(' ', '<br />', $from); $to = str_replace(' ', '<br />', $to); $diff = new FineDiff($from, $to); $htmlDiff = $diff->renderDiffToHTML(); $htmlDiff = html_entity_decode($htmlDiff, ENT_QUOTES, 'UTF-8'); $htmlDiff = html_entity_decode($htmlDiff, ENT_QUOTES, 'UTF-8'); $details .= $htmlDiff; break; case 'edit_task_title': case 'edit_update_title': $from = $event->getData1(); $to = $event->getData2(); $diff = new FineDiff($from, $to); $htmlDiff = $diff->renderDiffToHTML(); $htmlDiff = html_entity_decode($htmlDiff, ENT_QUOTES, 'UTF-8'); $htmlDiff = html_entity_decode($htmlDiff, ENT_QUOTES, 'UTF-8'); $details .= $htmlDiff; break; case 'edit_task_leader': $details .= 'Old Leader: <del>' . formatUserLink($event->getUser1ID(), $event->getProjectID()) . '</del><br /><br />'; $details .= 'New Leader: <ins>' . formatUserLink($event->getUser2ID(), $event->getProjectID()) . '</ins>'; break; case 'edit_task_num_needed': $old = $event->getData1() != null ? $event->getData1() : '∞'; $new = $event->getData2() != null ? $event->getData2() : '∞'; $details .= 'Old: <del>' . $old . '</del> people needed<br /><br />'; $details .= 'New: <ins>' . $new . '</ins> people needed'; break; case 'edit_task_deadline': case 'edit_project_deadline': $old = $event->getData1() != null ? formatTimeTag($event->getData1()) : '(none)'; $new = $event->getData2() != null ? formatTimeTag($event->getData2()) : '(none)'; $details .= 'Old Deadline: <del>' . $old . '</del><br /><br />'; $details .= 'New Deadline: <ins>' . $new . '</ins>'; break; case 'edit_project_status': $old = formatProjectStatus($event->getData1()); $new = formatProjectStatus($event->getData2()); $details .= 'Old Project Status: <del>' . $old . '</del><br /><br />'; $details .= 'New Project Status: <ins>' . $new . '</ins>'; break; case 'edit_accepted_status': $old = formatAcceptedStatus($event->getData1()); $new = formatAcceptedStatus($event->getData2()); $details .= 'Old Status: <del>' . $old . '</del><br /><br />'; $details .= 'New Status: <ins>' . $new . '</ins>'; break; case 'create_task_comment': case 'create_task_comment_reply': case 'create_update_comment': case 'create_update_comment_reply': $details .= formatComment($event->getData1()); break; case 'create_discussion': $details .= '<strong>' . $event->getData1() . '</strong><br /><br />'; $details .= formatDiscussionReply($event->getData2()); break; case 'create_discussion_reply': $details .= formatDiscussionReply($event->getData1()); break; case 'create_update': if ($event->getData1() != '') { $details .= '<strong>' . $event->getData1() . '</strong><br /><br />'; } if ($event->getData2() != '') { $details .= formatUpdate($event->getData2()); } break; case 'create_task': if ($event->getData1() != '') { $details .= '<strong>' . $event->getData1() . '</strong><br /><br />'; } if ($event->getData2() != '') { $details .= formatTaskDescription($event->getData2()); } break; } return $details; }
/** * 文件上传 * @param $fields 上传字段 'file' * @param $type 文件类型 array(jpg,gif) * @param $size 文件大小 MB * @param $img 图片配置参数 * @param $mark 图片水印 * @param $admin 是否来自后台 * @param $stype 上传方式 swf或者ke * @param $ofile 原文件 * @param $document 后台栏目归档目录 * @return Array 返回数组 */ private function upload($fields, $type, $size, $img = null, $mark = true, $admin = 0, $stype = null, $ofile = null, $document = null) { $path = 'uploadfiles/'; $upload = $this->instance('file_upload'); if (empty($admin) && $this->memberinfo) { $uid = $this->memberinfo['id']; //会员附件归类 if ($uid) { $path .= 'member/' . $uid . '/'; if (isset($this->membergroup[$this->memberinfo['groupid']]['filesize']) && $this->membergroup[$this->memberinfo['groupid']]['filesize']) { $c = count_member_size($this->memberinfo['id']); if ($c > $this->membergroup[$this->memberinfo['groupid']]['filesize'] * 1024 * 1024) { $this->attMsg(lang('att-7', array('1' => $this->membergroup[$this->memberinfo['groupid']]['filesize'], '2' => formatFileSize($c))), $stype); } } } $document = null; } elseif ($admin) { $uid = (int) get_cookie('member_id'); } else { //$this->attMsg(lang('att-0'), $stype); $uid = 0; $patp = 'uploadfiles/guest/'; } $upload->set($_FILES[$fields])->set_limit_size(1024 * 1024 * $size)->set_limit_type($type); //设置路径和名称 $ext = $upload->fileext(); if (stripos($ext, 'php') !== FALSE) { return array('result' => '文件格式被系统禁止'); } if (in_array($ext, array('jpg', 'jpeg', 'bmp', 'png', 'gif'))) { $dir = 'image'; $upload->set_image($img['w'], $img['h'], $img['t']); } else { $dir = 'file'; } $path .= $dir . '/' . (empty($document) || $document == 'undefined' || !preg_match('/^[a-zA-Z_0-9]+$/', $document) ? '' : $document . '/'); if ($ofile && is_file($ofile) && strpos($path, dirname(dirname($ofile))) === 0) { //判断原文件 $path = dirname($ofile) . '/'; $file = $fname = basename($ofile); } else { $path .= date('Ym') . '/'; $data = file_list::get_file_list($path); $name = count($data) + 1; $name = is_file($path . $name . '.' . $ext) ? $name . str_replace('0.', '_', (double) microtime()) : $name; $file = $upload->filename(); $fname = $name . '.' . $ext; } $result = $upload->upload($path, $fname); //上传成功处理图片 if (!$result && $dir == 'image') { $this->watermark($path . $fname); } return array('result' => $result, 'path' => $path . $fname, 'file' => $file, 'ext' => $dir == 'image' ? 1 : $ext); }
echo $index + 1 + count($folderlist); ?> </td> <td width="20%" nowrap class="subcontent-td"> <?php echo $filelist[$index]; ?> </td> <td width="20%" nowrap class="subcontent-td"> <?php echo strpos($fileTitle, ".") > 0 ? substr($fileTitle, 0, strrpos($fileTitle, ".")) : " "; ?> </td> <td width="16%" nowrap class="subcontent-td"> <?php echo formatFileSize(filesize($basedir . $filelist[$index])); ?> </td> <td width="16%" nowrap class="subcontent-td"> <?php echo format_time("L", filemtime($basedir . $filelist[$index])); ?> </td> <td width="5%" nowrap class="subcontent-td" align="center"> <?php if ($logId > 0) { ?> <a href="../index.php?load=read&id=<?php echo $logId; ?> " target="_blank" title="<?php
/** * Function to get the queued commands from the history */ public function getQueuedCommands() { $entrymaskMgr = new Entrymasks(); $jsQueue = new JSQueue(NULL); $tagMgr = new Tags(); $queuedCommands = array(); $currentQueueId = sGuiLH(); if (!$currentQueueId || $currentQueueId == 'false') { return; // if running first time (only) //$currentQueueId = $jsQueue->getLastQueueId(); } if ($currentQueueId) { $queuedCommandsRaw = $jsQueue->getQueue($currentQueueId, sGuiUS()); $templateMgr = new Templates(); $viewMgr = new Views(); foreach ($queuedCommandsRaw as $queuedCommandRaw) { // Check permissions $permissionsObj = NULL; $objectID = $queuedCommandRaw['OID']; $siteID = $queuedCommandRaw['SITEID']; $icons = new Icons(); $url = $imgurl = ''; switch ($queuedCommandRaw['TYPE']) { case HISTORYTYPE_MAILING: $mailingMgr = new MailingMgr(); $mailingObj = $mailingMgr->getMailing($objectID); $permissionsObj = $mailingObj->permissions; break; case HISTORYTYPE_PAGE: if ($siteID > 0 && $objectID > 0) { $pageMgr = new PageMgr($siteID); $pageObj = $pageMgr->getPage($objectID); if ($pageObj) { $url = $pageObj->getUrl(); $permissionsObj = $pageObj->permissions; } } break; case HISTORYTYPE_CO: if (!$objectID) { continue; } $cb = sCblockMgr()->getCblock($objectID); $permissionsObj = $cb->permissions; break; case HISTORYTYPE_ENTRYMASK: $permissionsObj = $entrymaskMgr->permissions; break; case HISTORYTYPE_FILE: $permissionsObj = sFileMgr()->permissions; if ($objectID) { $file = sFileMgr()->getFile($objectID); if ($file) { $info = $file->get(); $url = sApp()->webroot . "download/" . $info['PNAME'] . "/"; $hiddenviews = $file->views->getHiddenViews(); foreach ($hiddenviews as $hiddenview) { if ($hiddenview['IDENTIFIER'] == "YGSOURCE") { $tmpviewinfo = $file->views->getGeneratedViewInfo($hiddenview['ID']); if ($tmpviewinfo[0]['TYPE'] == FILE_TYPE_WEBIMAGE) { $imgurl = sApp()->webroot . "image/" . $info['PNAME'] . "/"; } } } } } break; case HISTORYTYPE_TEMPLATE: $permissionsObj = $templateMgr->permissions; break; case HISTORYTYPE_TAG: $permissionsObj = $tagMgr->permissions; break; case HISTORYTYPE_SITE: $pageMgr = new PageMgr($siteID); $sitePages = $pageMgr->tree->get(0, 1); $tmpPageID = $sitePages[0]["ID"]; if ($tmpPageID) { $pageObj = $pageMgr->getPage($tmpPageID); $permissionsObj = $pageObj->permissions; } break; case HISTORYTYPE_USER: $permissionsObj = sUsergroups()->usergroupPermissions; break; case HISTORYTYPE_USERGROUP: case HISTORYTYPE_EXTERNAL: case HISTORYTYPE_IMAGE: case HISTORYTYPE_FILETYPES: case HISTORYTYPE_FILEVIEWS: case HISTORYTYPE_JSQUEUE: case HISTORYTYPE_PERMISSION: default: break; } if ($queuedCommandRaw['TEXT'] == 'NOPERMISSIONCHECK' || strpos($queuedCommandRaw['OLDVALUE'], 'HIGHLIGHT') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'UNHIGHLIGHT') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'PAGE_MOVE') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'PAGE_HIDE') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'PAGE_UNHIDE') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'PAGE_ACTIVATE') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'RELOAD_WINDOW') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'CLEAR_USERINFOS') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'SET_USERINFOS') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'CLEAR_FILEINFOS') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'REFRESH_WINDOW') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'ADD_FILE') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'OBJECT_DELETE') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'OBJECT_ADD_TAG') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'OBJECT_CHANGE') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'OBJECT_CHANGECLASS') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'OBJECT_CHANGEPNAME') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'OBJECT_CHANGEBGIMAGE') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'OBJECT_CHANGE_LOCK_STATE') === 0) { $allowed = true; } else { if ($permissionsObj != NULL) { $allowed = $permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RREAD"); } } if ($permissionsObj != NULL || $allowed) { if ($allowed) { $itext = sItext(); switch ($queuedCommandRaw['OLDVALUE']) { case 'UNHIGHLIGHT': if ($queuedCommandRaw['TEXT']) { //$queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHilite(\''.$queuedCommandRaw['TEXT'].'\', \''.$objectID.'-template\', \''.$queuedCommandRaw['TEXT'].'\');'; $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHilite(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . $queuedCommandRaw['VALUE1'] . '\', \'' . $queuedCommandRaw['VALUE2'] . '\');'; } break; case 'OBJECT_CHANGE_LOCK_STATE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_changeWindowLockStateForObject(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . $queuedCommandRaw['VALUE1'] . '\', \'' . $queuedCommandRaw['VALUE2'] . '\');'; } break; case 'OBJECT_CHANGEBGIMAGE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_changeBGImage(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . $queuedCommandRaw['VALUE1'] . '\', \'' . $queuedCommandRaw['VALUE2'] . '\', \'' . $queuedCommandRaw['VALUE3'] . '\');'; } break; case 'OBJECT_CHANGECLASS': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_changeClass(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . $queuedCommandRaw['VALUE1'] . '\', \'' . $queuedCommandRaw['VALUE2'] . '\', \'' . $queuedCommandRaw['VALUE3'] . '\');'; } break; case 'OBJECT_CHANGEPNAME': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_changePName(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . $queuedCommandRaw['VALUE1'] . '\', \'' . $queuedCommandRaw['VALUE2'] . '\', \'' . $queuedCommandRaw['VALUE3'] . '\', \'' . $url . '\', \'' . $imgurl . '\');'; } break; case 'OBJECT_CHANGE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_change(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . addslashes($queuedCommandRaw['VALUE1']) . '\', \'' . addslashes($queuedCommandRaw['VALUE2']) . '\', \'' . addslashes($queuedCommandRaw['VALUE3']) . '\');'; } break; case 'OBJECT_ADD_TAG': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addTag(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . $queuedCommandRaw['VALUE1'] . '\', \'' . $queuedCommandRaw['VALUE2'] . '\', \'' . $queuedCommandRaw['VALUE3'] . '\', \'' . $queuedCommandRaw['VALUE4'] . '\', ' . stripslashes($queuedCommandRaw['VALUE5']) . ', \'' . $queuedCommandRaw['VALUE6'] . '\', \'' . $queuedCommandRaw['VALUE7'] . '\');'; } break; case 'OBJECT_DELETE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_del(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . $queuedCommandRaw['VALUE1'] . '\', \'' . $queuedCommandRaw['VALUE2'] . '\', \'' . $queuedCommandRaw['VALUE3'] . '\', \'' . $queuedCommandRaw['VALUE4'] . '\');'; } break; case 'ADD_FILE': $file = new File($objectID); $latestVersion = $file->getLatestApprovedVersion(); $file = new File($objectID, $latestVersion); $fileInfo = $file->get(); $reftracker = new Reftracker(); if ($fileInfo['CREATEDBY']) { $user = new User($fileInfo['CREATEDBY']); $userInfo = $user->get(); $userInfo['PROPS'] = $user->properties->getValues($fileInfo['CREATEDBY']); } $fileInfo['CUSTOM_DATE'] = date('d.m.Y', TStoLocalTS($fileInfo['CHANGEDTS'])); $fileInfo['CUSTOM_TIME'] = date('G:i', TStoLocalTS($fileInfo['CHANGEDTS'])); $fileInfo['REFS'] = $reftracker->getIncomingForFile($fileInfo['OBJECTID']); $tags = $file->tags->getAssigned(); for ($t = 0; $t < count($tags); $t++) { $tp = array(); $tp = $file->tags->tree->getParents($tags[$t]['ID']); $tp2 = array(); for ($p = 0; $p < count($tp); $p++) { $tinfo = $file->tags->get($tp[$p]); $tp2[$p]['ID'] = $tinfo['ID']; $tp2[$p]['NAME'] = $tinfo['NAME']; } $tp2[count($tp2) - 1]['NAME'] = $itext['TXT_TAGS'] != '' ? $itext['TXT_TAGS'] : '$TXT_TAGS'; $tags[$t]['PARENTS'] = $tp2; } $fileInfo['TAGS'] = $tags; $fileInfo['THUMB'] = 1; if ($queuedCommandRaw['TEXT'] == 'nothumb') { $fileInfo['THUMB'] = 0; } $views = $file->views->getAssigned(); foreach ($views as $view) { if ($view["IDENTIFIER"] == "YGSOURCE") { $viewinfo = $file->views->getGeneratedViewInfo($view["ID"]); $fileInfo["WIDTH"] = $viewinfo[0]["WIDTH"]; $fileInfo["HEIGHT"] = $viewinfo[0]["HEIGHT"]; } } $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addFile(\'file\', \'' . $fileInfo['PARENT'] . '-file\', \'' . $objectID . '\', \'' . $fileInfo['THUMB'] . '\', \'' . $fileInfo['COLOR'] . '\', \'' . $fileInfo['CODE'] . '\', \'' . $fileInfo['NAME'] . '\', \'' . $fileInfo['PNAME'] . '\', \'' . json_encode($fileInfo['TAGS']) . '\', \'' . $fileInfo['FILESIZE'] . '\', \'' . count($fileInfo['REFS']) . '\', \'' . TStoLocalTS($fileInfo['CHANGEDTS']) . '\', \'' . $fileInfo['CUSTOM_DATE'] . '\', \'' . $fileInfo['CUSTOM_TIME'] . '\', \'' . $fileInfo['UID'] . '\', \'' . $userInfo['PROPS']['FIRSTNAME'] . ' ' . $userInfo['PROPS']['LASTNAME'] . '\', \'' . $fileInfo['FILENAME'] . '\', \'' . $fileInfo["WIDTH"] . '\', \'' . $fileInfo['HEIGHT'] . '\');'; break; case 'REFRESH_TAGS': if ($queuedCommandRaw['TEXT']) { switch ($queuedCommandRaw['TYPE']) { case HISTORYTYPE_CO: $objType = 'cblock'; break; case HISTORYTYPE_FILE: $objType = 'file'; break; } } $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_refreshTags(\'' . $objType . '\', \'' . $objectID . '-' . $objType . '\', \'tags\', \'' . $queuedCommandRaw['TEXT'] . '\');'; break; case 'REFRESH_WINDOW': if ($queuedCommandRaw['TEXT']) { switch ($queuedCommandRaw['TYPE']) { case HISTORYTYPE_CO: $objType = 'cblock'; break; case HISTORYTYPE_PAGE: $objType = 'page'; break; case HISTORYTYPE_FILE: $objType = 'file'; break; case HISTORYTYPE_TAG: $objType = 'tag'; break; case HISTORYTYPE_TEMPLATE: $objType = 'template'; break; case HISTORYTYPE_ENTRYMASK: $objType = 'entrymask'; break; case HISTORYTYPE_SITE: $objType = 'site'; break; } // Special cases switch ($queuedCommandRaw['TYPE']) { case HISTORYTYPE_PAGE: $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_refreshWin(\'' . $objType . '\',\'' . $objectID . '-' . $siteID . '\',\'' . $queuedCommandRaw['TEXT'] . '\');'; break; case HISTORYTYPE_FILE: $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_refreshWin(\'' . $objType . '\',\'' . $objectID . '-' . $objType . '\',\'' . $queuedCommandRaw['TEXT'] . '\');'; $queuedCommands[$queuedCommandRaw['ID']] .= 'Koala.yg_refreshWin(\'' . $objType . 'folder\',\'' . $objectID . '-' . $objType . '\',\'' . $queuedCommandRaw['TEXT'] . '\');'; break; default: $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_refreshWin(\'' . $objType . '\',\'' . $objectID . '-' . $objType . '\',\'' . $queuedCommandRaw['TEXT'] . '\');'; break; } } break; case 'CLEAR_FILEINFOS': $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_fileInfos[' . $objectID . '] = null;'; break; case 'SET_FILEINFOS': $file = sFileMgr()->getFile($objectID); if ($file) { $latestFinalVersion = $file->getLatestApprovedVersion(); $file = new File($objectID, $latestFinalVersion); $fileInfo = $file->get(); $fileTypes = sFileMgr()->getFiletypes(); $user = new User(sUserMgr()->getCurrentUserID()); $fileInfo['DATE'] = date($itext['DATE_FORMAT'], TStoLocalTS($fileInfo['CHANGEDTS'])); $fileInfo['TIME'] = date($itext['TIME_FORMAT'], TStoLocalTS($fileInfo['CHANGEDTS'])); $fileInfo['FILESIZE'] = formatFileSize($fileInfo['FILESIZE']); $views = $file->views->getAssigned(true); $viewInfo = $file->views->getGeneratedViewInfo($views[0]["ID"]); $fileInfo['WIDTH'] = $viewInfo[0]["WIDTH"]; $fileInfo['HEIGHT'] = $viewInfo[0]["HEIGHT"]; $fileInfo['TAGS'] = $file->tags->getAssigned(); $tags = array(); foreach ($fileInfo['TAGS'] as $tag) { array_push($tags, $tag['NAME']); } $fileTags = implode(', ', $tags); if (strlen($fileTags) > 40) { $fileTags = substr($fileTags, 0, 40); $fileTags .= '...'; } $fileInfo['TAGS'] = $fileTags; if (strlen($fileInfo['NAME']) > 40) { $fileInfo['NAME'] = substr($fileInfo['NAME'], 0, 40); $fileInfo['NAME'] .= '...'; } if (strlen($fileInfo['FILENAME']) > 40) { $fileInfo['FILENAME'] = substr($fileInfo['FILENAME'], 0, 40); $fileInfo['FILENAME'] .= '...'; } if ($fileInfo['CREATEDBY']) { $user = new User($fileInfo['CREATEDBY']); $userInfo = $user->get(); $userInfo['PROPS'] = $user->properties->getValues($fileInfo['CREATEDBY']); $fileInfo['USERNAME'] = $userInfo['PROPS']['FIRSTNAME'] . ' ' . $userInfo['PROPS']['LASTNAME']; } foreach ($fileTypes as $fileTypes_item) { if ($fileTypes_item['ID'] == $fileInfo['FILETYPE']) { $fileInfo['FILETYPE_TXT'] = $fileTypes_item['NAME']; } } $fileInfo['THUMB'] = 0; $hiddenViews = $file->views->getHiddenViews(); foreach ($hiddenViews as $view) { if ($view['IDENTIFIER'] == 'yg-preview') { $tmpviewinfo = $file->views->getGeneratedViewInfo($view["ID"]); if ($tmpviewinfo[0]["TYPE"] == FILE_TYPE_WEBIMAGE) { $fileInfo['THUMB'] = 1; $fileInfo['PREVIEWWIDTH'] = $tmpviewinfo[0]["WIDTH"]; $fileInfo['PREVIEWHEIGHT'] = $tmpviewinfo[0]["HEIGHT"]; } } } $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_fileInfos[' . $objectID . '] = ' . json_encode($fileInfo) . ';Koala.yg_showFileHint(\'' . $objectID . '\');'; } break; case 'SET_USERINFOS': $user = new User($objectID); $userInfo = $user->get(); $userInfo['PROPS'] = $user->properties->getValues($objectID); $userInfo['USERGROUPS'] = $user->getUsergroups($objectID); $roles = array(); foreach ($userInfo['USERGROUPS'] as $role) { array_push($roles, $role['NAME']); } $user_roles = implode(', ', $roles); if (strlen($user_roles) > 30) { $user_roles = substr($user_roles, 0, 30); $user_roles .= '...'; } if (file_exists(sApp()->app_root . sApp()->userpicdir . $objectID . '-picture.jpg')) { $internPrefix = (string) sConfig()->getVar('CONFIG/REFTRACKER/INTERNALPREFIX'); $user_picture = $internPrefix . 'userimage/' . $objectID . '/48x48?rnd=' . rand(); } else { $user_picture = sApp()->imgpath . 'content/temp_userpic.png'; } $user_company = $userInfo['PROPS']['COMPANY']; $user_name = $userInfo['PROPS']['FIRSTNAME'] . ' ' . $userInfo['PROPS']['LASTNAME']; $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_userInfos[' . $objectID . '] = {name: \'' . $user_name . '\', groups: \'' . $user_roles . '\', pic: \'' . $user_picture . '\', company: \'' . $user_company . '\'}'; break; case 'CLEAR_USERINFOS': $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_userInfos[' . $objectID . '] = null;'; break; case 'CLEAR_REFRESH': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_clearRefresh(\'' . $objectID . '-' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'RELOAD_WINDOW': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_reloadWin(null, \'' . $objectID . '-' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'PAGE_DEACTIVATE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_deActivate(\'page\', \'' . $objectID . '-' . $siteID . '\', \'name\');'; } break; case 'PAGE_ACTIVATE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_activate(\'page\', \'' . $objectID . '-' . $siteID . '\', \'name\');'; } break; case 'PAGE_UNHIDE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHide(\'page\', \'' . $objectID . '-' . $siteID . '\', \'name\');'; } break; case 'PAGE_HIDE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_hide(\'page\', \'' . $objectID . '-' . $siteID . '\', \'name\');'; } break; case 'FILE_DELVIEW': if ($queuedCommandRaw['TEXT']) { $file = sFileMgr()->getFile($objectID); $fileInfo = $file->get(); if ($fileInfo['FOLDER'] == 1) { $isFolder = 'true'; } else { $isFolder = 'false'; } $queuedCommands[$queuedCommandRaw['ID']] = 'if (Koala.yg_delViewArr[' . $queuedCommandRaw['TEXT'] . ']) Koala.yg_delViewArr[' . $queuedCommandRaw['TEXT'] . '](' . $objectID . ', ' . $isFolder . ');'; } break; case 'FILE_CLEAR_DELVIEW': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'if (Koala.yg_delViewArr[' . $queuedCommandRaw['TEXT'] . ']) Koala.yg_delViewArr[' . $queuedCommandRaw['TEXT'] . ']=undefined;'; } break; case 'FILE_ADDVIEW': if ($queuedCommandRaw['TEXT']) { $file = sFileMgr()->getFile($objectID); $fileInfo = $file->get(); $viewInfo = $viewMgr->get($queuedCommandRaw['TEXT']); if ($fileInfo['FOLDER'] == 1) { $isFolder = 'true'; } else { $isFolder = 'false'; } $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addView(\'' . $objectID . '\', \'' . $viewInfo['ID'] . '\', \'' . $viewInfo['IDENTIFIER'] . '\', \'' . $viewInfo['NAME'] . '\', \'' . $viewInfo['WIDTH'] . '\', \'' . $viewInfo['HEIGHT'] . '\', \'' . $isFolder . '\');'; } break; case 'FILE_GENERATEDVIEW': if ($queuedCommandRaw['TEXT']) { $file = sFileMgr()->getFile($objectID); $viewInfo = $viewMgr->get($queuedCommandRaw['TEXT']); $generatedViewInfo = $file->views->getGeneratedViewInfo($viewInfo['ID']); if ($generatedViewInfo[0]['TYPE'] == FILE_TYPE_WEBIMAGE) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addGenerated(\'' . $objectID . '\',\'' . $viewInfo['IDENTIFIER'] . '\', \'' . $viewInfo['WIDTH'] . '\', \'' . $viewInfo['HEIGHT'] . '\');'; } else { if ($generatedViewInfo[0]) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addGenerated(\'' . $objectID . '\',\'NULL\');'; } } } break; case 'UNHIGHLIGHT_TEMPLATE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHilite(\'template\', \'' . $objectID . '-template\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'HIGHLIGHT_PAGE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_hilite(\'page\', \'' . $objectID . '-' . $siteID . '\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'UNHIGHLIGHT_PAGE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHilite(\'page\', \'' . $objectID . '-' . $siteID . '\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'HIGHLIGHT_CBLOCK': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_hilite(\'cblock\', \'' . $objectID . '-cblock\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'UNHIGHLIGHT_CBLOCK': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHilite(\'cblock\', \'' . $objectID . '-cblock\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'UNHIGHLIGHT_ENTRYMASK': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHilite(\'entrymask\', \'' . $objectID . '-entrymask\', \'' . $queuedCommandRaw['TEXT'] . '\');' . 'Koala.yg_unHilite(\'page\', \'' . $objectID . '-entrymask\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'UNHIGHLIGHT_SITE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHilite(\'page\', \'' . $objectID . '-site\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'HIGHLIGHT_SITE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_hilite(\'page\', \'' . $objectID . '-site\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'HIGHLIGHT_MAILING': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_hilite(\'mailing\', \'' . $objectID . '-mailing' . '\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'UNHIGHLIGHT_MAILING': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHilite(\'mailing\', \'' . $objectID . '-mailing' . '\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'PAGE_MOVE': if ($queuedCommandRaw['TEXT']) { if ($queuedCommandRaw['TARGETID'] == 1) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_moveTreeNode(\'page\', \'' . $objectID . '-' . $siteID . '\', \'' . $queuedCommandRaw['TEXT'] . '\', 2);'; } else { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_moveTreeNode(\'page\', \'' . $objectID . '-' . $siteID . '\', \'' . $queuedCommandRaw['TEXT'] . '\', 1);'; } } break; case 'PAGE_MOVEUP': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_moveUp(\'page\', \'' . $objectID . '-' . $siteID . '\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'PAGE_MOVEDOWN': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_moveDown(\'page\', \'' . $objectID . '-' . $siteID . '\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'CBLOCK_MOVE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_moveTreeNode(\'cblock\', \'' . $objectID . '-cblock\', \'' . $queuedCommandRaw['TEXT'] . '-cblock\', 1);'; } break; case 'FILE_MOVE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_moveTreeNode(\'file\', \'' . $objectID . '-file\', \'' . $queuedCommandRaw['TEXT'] . '-file\', 1);'; } break; case 'TAG_MOVE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_moveTreeNode(\'tag\', \'' . $objectID . '-tag\', \'' . $queuedCommandRaw['TEXT'] . '-tag\', 1);'; } break; case 'TAG_ADD': $objectInfo = $tagMgr->get($objectID); $icon = $icons->icon['tag_small']; $statusClass = ''; if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RWRITE")) { // Nur Leserecht (hellgrau) $statusClass .= " nowrite"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RDELETE")) { // Nur Leserecht (hellgrau) $statusClass .= " nodelete"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RSUB")) { $statusClass .= " nosub"; } $objectName = $objectInfo['NAME']; $objectParents = $tagMgr->getParents($objectID); $parentNodeId = $objectParents[0][0]["ID"]; if ($queuedCommandRaw['NEWVALUE'] == sGuiUS()) { $andSelect = 'true'; } else { $andSelect = 'false'; } $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addChild(\'tag\', \'' . $parentNodeId . '-tag\', \'name\', \'' . $objectName . '\', \'tag\', \'' . $objectID . '-tag\', \'name\', \'' . $icon . '\', \'' . $statusClass . '\', ' . $andSelect . ');'; break; case 'FILE_ADD': case 'FILEFOLDER_ADD': $file = sFileMgr()->getFile($objectID); if ($file) { $objectInfo = $file->get(); $icon = $icons->icon['folder']; $statusClass = ''; if ($objectInfo["VERSIONPUBLISHED"] + 2 != $objectInfo["VERSION"] && $objectInfo["VERSIONPUBLISHED"] != ALWAYS_LATEST_APPROVED_VERSION && $objectInfo["HASCHANGED"] == "1") { // Editiert (grün) $statusClass = "changed"; } elseif ($objectInfo["HASCHANGED"] == "1") { $statusClass = "changed"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RWRITE")) { // Nur Leserecht (hellgrau) $statusClass .= " nowrite"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RDELETE")) { // Nur Leserecht (hellgrau) $statusClass .= " nodelete"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RSUB")) { $statusClass .= " nosub"; } $objectName = $objectInfo['NAME']; $objectParents = sFileMgr()->getParents($objectID); $parentNodeId = $objectParents[0][0]["ID"]; if ($queuedCommandRaw['NEWVALUE'] == sGuiUS()) { $andSelect = 'true'; } else { $andSelect = 'false'; } $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addChild(\'file\', \'' . $parentNodeId . '-file\', \'name\', \'' . $objectName . '\', \'file\', \'' . $objectID . '-file\', \'name\', \'' . $icon . '\', \'' . $statusClass . '\', ' . $andSelect . ');'; } break; case 'CBLOCK_ADD': $cb = sCblockMgr()->getCblock($objectID); $objectInfo = $cb->get(); $icon = $icons->icon['cblock_small']; $statusClass = ''; if ($objectInfo['FOLDER'] != 1) { if ($objectInfo["VERSIONPUBLISHED"] + 2 != $objectInfo["VERSION"] && $objectInfo["VERSIONPUBLISHED"] != ALWAYS_LATEST_APPROVED_VERSION && $objectInfo["HASCHANGED"] == "1") { // Editiert (grün) $statusClass .= "changed changed1 nosub"; } elseif ($objectInfo["HASCHANGED"] == "1") { $statusClass .= "changed changed2 nosub"; } } else { if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RSUB")) { $statusClass .= " nosub"; } $icon = $icons->icon['folder']; $statusClass .= " folder"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RWRITE")) { // Nur Leserecht (hellgrau) $statusClass .= " nowrite"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RDELETE")) { // Nur Leserecht (hellgrau) $statusClass .= " nodelete"; } $objectName = $objectInfo['NAME']; $objectParents = sCblockMgr()->getParents($objectID); $parentNodeId = $objectParents[0][0]["ID"]; if ($queuedCommandRaw['NEWVALUE'] == sGuiUS() && $queuedCommandRaw['TEXT'] != 'list') { $andSelect = 'true'; } else { $andSelect = 'false'; } if ($queuedCommandRaw['NEWVALUE'] == sGuiUS()) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addListItem(\'' . $parentNodeId . '-cblock\', \'' . addslashes(json_encode($objectInfo)) . '\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } $queuedCommands[$queuedCommandRaw['ID']] .= 'Koala.yg_addChild(\'cblock\', \'' . $parentNodeId . '-cblock\', \'name\', \'' . $objectName . '\', \'cblock\', \'' . $objectID . '-cblock\', \'name\', \'' . $icon . '\', \'' . $statusClass . '\', ' . $andSelect . ');'; break; case 'PAGE_ADD': if ($pageObj) { $objectInfo = $pageObj->get(); $icon = $icons->icon['page_small']; $statusClass = ''; $inactive = false; if ($objectInfo["ACTIVE"] == "0") { $icon = $icons->icon['page_inactive_small']; $inactive = true; } $naviinfo = NULL; $navis = $templateMgr->getNavis($objectInfo["TEMPLATEID"]); for ($i = 0; $i < count($navis); $i++) { if ($navis[$i]["ID"] == $objectInfo["NAVIGATIONID"]) { $naviinfo = $navis[$i]; } } if ($objectInfo["HIDDEN"] == "1" || $objectInfo["TEMPLATEID"] == "0" || !$naviinfo['ID']) { $icon = $icons->icon['page_hidden_small']; if ($inactive == true) { $icon = $icons->icon['page_inactive_hidden_small']; } } if ($objectInfo["VERSIONPUBLISHED"] + 2 != $objectInfo["VERSION"] && $objectInfo["VERSIONPUBLISHED"] != ALWAYS_LATEST_APPROVED_VERSION && $objectInfo["HASCHANGED"] == "1") { // Editiert (grün) $statusClass = "changed"; } elseif ($objectInfo["HASCHANGED"] == "1") { $statusClass = "changed"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RWRITE")) { // Nur Leserecht (hellgrau) $statusClass .= " nowrite"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RDELETE")) { // Nur Leserecht (hellgrau) $statusClass .= " nodelete"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RSUB")) { $statusClass .= " nosub"; } $objectName = $objectInfo['NAME']; $objectParents = $pageMgr->getParents($objectID); $parentNodeId = $objectParents[0][0]["ID"]; if (!$parentNodeId) { $parentNodeId = 1; } $url = $pageObj->getUrl(); if ($queuedCommandRaw['NEWVALUE'] == sGuiUS()) { $andSelect = 'true'; } else { $andSelect = 'false'; } $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addChild(\'page\', \'' . $parentNodeId . '-' . $siteID . '\', \'name\', \'' . $objectName . '\', \'page\', \'' . $objectID . '-' . $siteID . '\', \'name\', \'' . $icon . '\', \'' . $statusClass . '\', ' . $andSelect . ', \'' . $url . '\');' . "\n"; } break; case 'MAILING_ADD': $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_refreshMailingsWindow();' . "\n"; break; case 'MAILING_DELETE': $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_refreshMailingsWindow(true);' . "\n"; break; default: $queuedCommands[$queuedCommandRaw['ID']] = stripslashes($queuedCommandRaw['OLDVALUE']) . "\n"; break; } } } } if (count($queuedCommandsRaw)) { $currentQueueId = $queuedCommandsRaw[count($queuedCommandsRaw) - 1]['ID']; } } $output = "\n<script>\n"; $output .= "parent.Koala.currentGuiSyncHistoryId = " . $currentQueueId . ";\n"; $output .= "parent.Koala.yg_executeGuiJSQueue( " . json_encode($queuedCommands) . " );\n"; $output .= "</script>\n"; print $output; }
new NotifyWidgetFailure(nl2br($response['errtext'])); return; } $files = $response['data']; $names = $files[0]; $paths = $files[1]; $types = $files[3]; $sizes = $files[5]; $cssClasses = array(); $emptyAction = new EmptyActionItem(); $viewVersionsAction = new ActionPopupItem(_T("View all versions"), "viewFileVersions", "display", "dir", "backuppc", "backuppc"); $viewVersionsActions = array(); $params = array(); for ($i = 0; $i < count($names); $i++) { $params[] = array('host' => $_GET['host'], 'backupnum' => $_GET['backupnum'], 'sharename' => $_GET['sharename'], 'dir' => $paths[$i]); $sizes[$i] = formatFileSize($sizes[$i]); if ($types[$i] == 'dir') { $names[$i] = '<a href="#" onclick="BrowseDir(\'' . $paths[$i] . '\')">' . $names[$i] . "</a>"; $cssClasses[$i] = 'folder'; $sizes[$i] = ''; $params[$i]['isdir'] = '1'; $viewVersionsActions[] = $emptyAction; } else { $param_str = "host=" . $_GET['host'] . "&backupnum=" . $_GET['backupnum'] . "&sharename=" . urlencode($_GET['sharename']); $param_str .= "&dir=" . urlencode($paths[$i]); $names[$i] = '<a href="#" onclick="RestoreFile(\'' . $param_str . '\')">' . $names[$i] . "</a>"; $cssClasses[$i] = 'file'; $viewVersionsActions[] = $viewVersionsAction; } $names[$i] = sprintf('<input type="checkbox" name="f%d" value="%s" /> ', $i, $paths[$i]) . $names[$i]; }
$a_path .= "/" . $Attm_Dirs[$dcc]['name']; } $Attm_Files = getFiles($a_path); $btsort = array(); foreach ($Attm_Files as $field) { $btsort[] = $field['name']; } @array_multisort($btsort, SORT_ASC, $Attm_Files, SORT_ASC); $ic = count($Attm_Files); for ($icc = 0; $icc < $ic; $icc++) { if ($Attm_Files[$icc]['name'] != ".htaccess" && $Attm_Files[$icc]['name'] != "index.php" && $Attm_Files[$icc]['name'] != "index.html") { $a_file = $Attm_Files[$icc]['name']; if (!empty($Attm_Dirs[$dcc]['name']) && $Attm_Dirs[$dcc]['name'] != ".") { $a_file = $Attm_Dirs[$dcc]['name'] . "/" . $Attm_Files[$icc]['name']; } $Form->add_InputOption($FormularName, $InputName_AttachExisting, $a_file, display($Attm_Files[$icc]['name']) . " (" . formatFileSize($Attm_Files[$icc]['size']) . ")", display($Attm_Dirs[$dcc]['name'])); } //if Attm name } //for lcc } //if attmdir name } //for dcc //Subject $Form->new_Input($FormularName, $InputName_Name, "text", display(${$InputName_Name})); $Form->set_InputJS($FormularName, $InputName_Name, " onChange=\"flash('submit','#ff0000');\" "); $Form->set_InputStyleClass($FormularName, $InputName_Name, "mFormText", "mFormTextFocus"); $Form->set_InputSize($FormularName, $InputName_Name, 48, 255); $Form->set_InputDesc($FormularName, $InputName_Name, ___("Erscheint als Betreff in der e-Mail")); $Form->set_InputReadonly($FormularName, $InputName_Name, false);
/> </td> <td class="subcontent-td"><?php echo $value; ?> </td> <td class="subcontent-td" align="center"><?php echo strpos($value, ".zip") > 0 ? $strBackupOption4 : $strBackupOption2; ?> </td> <td class="subcontent-td" align="center"><?php echo $file_count[$value]; ?> </td> <td class="subcontent-td"><?php echo formatFileSize($file_size[$value]); ?> </td> <td class="subcontent-td"><?php echo format_time("L", $file_time[$value]); ?> </td> <td class="subcontent-td" align="center"> <?php if ($file_count[$value] > 1) { echo "<a href=\"{$PHP_SELF}?action=downlist&filename={$value}&filecount={$file_count[$value]}\">{$strDownFile}</a>"; } else { echo "<a href=\"{$data_path}/{$value}\"><img src=\"../images/download.gif\" border=\"0\" alt=\"\"/></a>"; } ?> </td>
function displayAjaxFooter() { global $lang_btn_new_folder; global $lang_btn_new_file; global $lang_info_host; global $lang_info_user; global $lang_info_upload_limit; global $lang_info_drag_drop; ?> <div id="footerDiv"> <div id="hostInfoDiv"> <span><?php echo $lang_info_host; ?> :</span> <?php echo $_SESSION["ftp_host"]; ?> <span><?php echo $lang_info_user; ?> :</span> <?php echo $_SESSION["ftp_user"]; ?> <span><?php echo $lang_info_upload_limit; ?> :</span> <?php echo formatFileSize($_SESSION["upload_limit"]); ?> <!-- <span><?php echo $lang_info_drag_drop; ?> :</span> <div id="dropFilesCheckDiv"></div> --> <!-- Drag & Drop check commented out as considered redundant --> </div> <div class="floatLeft10"> <input type="button" value="<?php echo $lang_btn_new_folder; ?> " onClick="processForm('&ftpAction=newFolder')" class="<?php echo adjustButtonWidth($lang_btn_new_folder); ?> "> </div> <div class="floatLeft10"> <input type="button" value="<?php echo $lang_btn_new_file; ?> " onClick="processForm('&ftpAction=newFile')" class="<?php echo adjustButtonWidth($lang_btn_new_file); ?> "> </div> <div id="uploadButtonsDiv"><div> </div> <?php }
</tr> </table> </div> </td> <td valign="top" width="500"> <select size="5" name="fileList[]" id="fileList" multiple="multiple" style="width:500px;" onChange="selectAttachment();"> <?php while ($fa = $DMC->fetchArray($query_result)) { ?> <option value="<?php echo $fa['name'] . "|" . $fa['fileWidth'] . "|" . $fa['fileHeight'] . "|" . $fa['id']; ?> "> <?php $imgSize = $fa['fileWidth'] > 0 ? $fa['fileWidth'] . "X" . $fa['fileHeight'] . " / " : ""; echo $fa['attTitle'] . " (" . $imgSize . formatFileSize($fa['fileSize']) . ") [" . $fa['id'] . "]"; ?> </option> <?php } ?> </select> </td> <td width="492" valign="top" style="padding:3px"> <a href="remote_editor.php?<?php echo "mark_id={$mark_id}&editorcode={$editorcode}"; ?> &TB_iframe=true&height=110&width=500" title="<?php echo $strEditorInsertRemote; ?> " class="thickbox"><img src="themes/<?php
$dl['allowed'] = true; } else { $dl['allowed'] = false; } $dl['downloadthis'] = str_replace("%n", $dl['name'], $lang->get('downloadthis')); $path = 'media/download/' . $category['uniqid'] . '/' . $dl['file']; if (!file_exists($path)) { $path = $dl['file']; } if (!file_exists($path)) { $notify->add('Error', 'File not found'); } else { $h = (int) $config->get($mod, 'download-window-height'); $w = (int) $config->get($mod, 'download-window-width'); $dl['url'] = "javascript:window.open('" . $path . "', '_blank', 'width=" . $w . ", height=" . $h . ", resizable=yes');"; $dl['size'] = formatFileSize(filesize($path)); $days = floor((time() - $dl['timestamp']) / 86400); // 86400 equals 1 day in seconds @($dl['dls_per_day'] = number_format($dl['counter'] / $days, 1)); $dl['description'] = $bbcode->parse($dl['description']); $dl['release_notes'] = $bbcode->parse($dl['release_notes']); $smarty->assign('download', $dl); } } else { if ($rights->isAllowed($mod, 'manage')) { $breadcrumbs->addElement($lang->get('download_stat'), makeURL($mod, array('categoryid' => $categoryid, 'downloadid' => $downloadid, 'statistic' => ''))); $smarty->assign('first_download_year', getFirstDownloadCounterYear($downloadid)); @($selected_month = (int) $_POST['Date_Month']); @($selected_year = (int) $_POST['Date_Year']); if ($selected_month == 0) { $selected_month = date("n");
function makeElementView($value) { GLOBAL $parser; $this->init(&$parser,$value); $file_size = (file_exists($this->full_name))?formatFileSize(filesize($this->full_name)):''; $file_link = HTTP_ROOT.FILE_PATH.$this->file['path'].$this->id.'_'.$this->original_name; if ($file_size!='') { $tpl = new template(TPL_PATH); $tpl_name=$parser->getSystemTemplate('type/file'); $tpl->loadTemplatefile($tpl_name,true,true); $tpl->parseVariable(array( 'file_name' => $this->original_name, 'id' => $this->id, 'link' => $file_link, 'size' => $file_size, 'data_name' => $this->file_name ),'view'); $view = $tpl->get(); } if ($parser->buffer=='dynamic_view') { if (file_exists($this->full_name)) { return $view; } else { return ' '; } } $to_parse='FILE_'.strtoupper($this->file_name); $return[$to_parse] = $file_link; $return[$to_parse.'_NAME'] = $this->original_name; $return[$to_parse.'_SRC'] = $file_link; $return[$to_parse.'_SIZE'] = $file_size; $return[$this->field_name] = $view; return $return; }
<td class="subcontent-td"> <?php echo strpos($fa['attTitle'], ".") > 0 ? substr($fa['attTitle'], 0, strrpos($fa['attTitle'], ".")) : $fa['attTitle']; ?> </td> <?php if (empty($editorcode)) { ?> <td class="subcontent-td" nowrap> <?php echo empty($fa['fileType']) ? " " : $fa['fileType']; ?> </td> <td class="subcontent-td" nowrap> <?php echo formatFileSize($fa['fileSize']); ?> </td> <td width="13%" class="subcontent-td" nowrap> <?php echo format_time("L", $fa['postTime']); ?> </td> <?php } ?> <td class="subcontent-td"> <?php if (empty($fa['logTitle'])) { $fa['logTitle'] = $strAttachmentNoLogs; }