private void FillFileSystemsToList(bool isReload)
        {
            var builder = new StringBuilder();

            builder.Append(@"<table class=""table table-bordered table-hover""><tr class=""info thead""><td>名称</td><td width=""80"">大小</td><td width=""120"">类型</td><td width=""120"">修改日期</td></tr>");
            var directoryUrl = PageUtility.GetSiteUrlByPhysicalPath(SiteInfo, _directoryPath, true);

            var fileSystemInfoExtendCollection = FileManager.GetFileSystemInfoExtendCollection(_directoryPath, isReload);

            foreach (FileSystemInfoExtend subDirectoryInfo in fileSystemInfoExtendCollection.Folders)
            {
                string fileNameString =
                    $"<img src={SiteServerAssets.GetFileSystemIconUrl(EFileSystemType.Directory, false)} border=0 /> {subDirectoryInfo.Name}";
                var    fileSystemTypeString = "文件夹";
                var    fileModifyDateTime   = subDirectoryInfo.LastWriteTime;
                var    linkUrl = GetRedirectUrl(PageUtils.Combine(_currentRootPath, subDirectoryInfo.Name));
                string trHtml  =
                    $"<tr><td><nobr><a href=\"{linkUrl}\">{fileNameString}</a></nobr></td><td align=\"right\">&nbsp;</td><td align=\"center\">{fileSystemTypeString}</td><td align=\"center\">{DateUtils.GetDateString(fileModifyDateTime, EDateFormatType.Day)}</td></tr>";
                builder.Append(trHtml);
            }

            foreach (FileSystemInfoExtend fileInfo in fileSystemInfoExtendCollection.Files)
            {
                string fileNameString =
                    $"<img src={GetFileSystemIconUrl(SiteInfo, fileInfo, false)} border=0 /> {fileInfo.Name}";
                var fileSystemType       = EFileSystemTypeUtils.GetEnumType(fileInfo.Type);
                var fileSystemTypeString = (fileSystemType == EFileSystemType.Unknown) ?
                                           $"{fileInfo.Type.TrimStart('.').ToUpper()} 文件"
                    : EFileSystemTypeUtils.GetText(fileSystemType);
                var fileKbSize = fileInfo.Size / 1024;
                if (fileKbSize == 0)
                {
                    fileKbSize = 1;
                }
                var fileModifyDateTime = fileInfo.LastWriteTime;
                var linkUrl            = PageUtils.Combine(directoryUrl, fileInfo.Name);
                var attachmentUrl      = linkUrl.Replace(SiteInfo.Additional.WebUrl, "@");
                //string fileViewUrl = Modal.FileView.GetOpenWindowString(base.SiteId, attachmentUrl);
                var    fileViewUrl = ModalFileView.GetOpenWindowStringHidden(SiteId, attachmentUrl, _hiddenClientId);
                string trHtml      =
                    $"<tr><td><a href=\"javascript:;\" onClick=\"window.parent.SelectAttachment('{_hiddenClientId}', '{attachmentUrl.Replace("'", "\\'")}', '{fileViewUrl.Replace("'", "\\'")}');{LayerUtils.CloseScript}\" title=\"点击此项选择此附件\">{fileNameString}</a></td><td align=\"right\">{fileKbSize} KB</td><td align=\"center\">{fileSystemTypeString}</td><td align=\"center\">{DateUtils.GetDateString(fileModifyDateTime, EDateFormatType.Day)}</td></tr>";
                builder.Append(trHtml);
            }

            builder.Append("</table>");
            LtlFileSystems.Text = builder.ToString();
        }
Beispiel #2
0
        public static string GetInsertAudioScript(string attributeName, string playUrl, SiteInfo siteInfo)
        {
            if (string.IsNullOrEmpty(playUrl))
            {
                return(string.Empty);
            }

            var dict = new Dictionary <string, string>
            {
                { StlPlayer.PlayUrl, playUrl },
                { StlPlayer.IsAutoPlay, siteInfo.Additional.ConfigUEditorAudioIsAutoPlay.ToString() },
                { "style", "width: 400px; height: 40px;" }
            };

            return(GetInsertHtmlScript(attributeName,
                                       $@"<img class=""siteserver-stl-audio"" src=""{SiteServerAssets.GetUrl("ueditor/audio-clip.png")}"" {TranslateUtils.ToAttributesString(dict)} />"));
        }
Beispiel #3
0
        protected override void Render(HtmlTextWriter writer)
        {
            var code = string.Empty;

            if (!string.IsNullOrEmpty(Type))
            {
                if (Type.Trim().ToLower() == "jquery")
                {
                    code =
                        $@"<script language=""javascript"" src=""{SiteServerAssets.GetUrl(SiteServerAssets.JQuery.Js)}""></script>";
                }
                else if (Type.Trim().ToLower() == "ajaxupload")
                {
                    code =
                        $@"<script language=""javascript"" src=""{SiteServerAssets.GetUrl(SiteServerAssets.AjaxUpload.Js)}""></script>";
                }
                else if (Type.Trim().ToLower() == "bootstrap")
                {
                    var cssUrl = SiteServerAssets.GetUrl(SiteServerAssets.Bootstrap.Css);
                    var jsUrl  = SiteServerAssets.GetUrl(SiteServerAssets.Bootstrap.Js);

                    code = $@"
<link rel=""stylesheet"" type=""text/css"" href=""{cssUrl}"">
<script language=""javascript"" src=""{jsUrl}""></script>
";
                }
                else if (Type.Trim().ToLower() == "calendar")
                {
                    code =
                        $@"<script language=""javascript"" src=""{SiteServerAssets.GetUrl(SiteServerAssets.DatePicker.Js)}""></script>";
                }
                else if (Type.Trim().ToLower() == "toastr")
                {
                    code =
                        $@"<link rel=""stylesheet"" type=""text/css"" href=""{SiteServerAssets.GetUrl(SiteServerAssets.Toastr.Css)}""><script language=""javascript"" src=""{SiteServerAssets.GetUrl(SiteServerAssets.Toastr.Js)}""></script>";
                }
                else if (Type.Trim().ToLower() == "layer")
                {
                    code =
                        $@"<script language=""javascript"" src=""{SiteServerAssets.GetUrl(SiteServerAssets.Layer.Js)}""></script>";
                }
            }

            writer.Write(code);
        }
        private string GetDepartmentTreeHtml()
        {
            var htmlBuilder      = new StringBuilder();
            var departmentIdList = GovPublicManager.GetFirstDepartmentIdList(PublishmentSystemInfo);

            var treeDirectoryUrl = SiteServerAssets.GetIconUrl("tree");

            var theDepartmentIdList = DepartmentManager.GetDepartmentIdList();
            var isLastNodeArray     = new bool[theDepartmentIdList.Count];

            foreach (var theDepartmentId in theDepartmentIdList)
            {
                var departmentInfo = DepartmentManager.GetDepartmentInfo(theDepartmentId);
                htmlBuilder.Append(GetTitle(departmentInfo, treeDirectoryUrl, isLastNodeArray, departmentIdList));
                htmlBuilder.Append("<br/>");
            }
            return(htmlBuilder.ToString());
        }
        public static string GetFileSystemIconUrl(SiteInfo siteInfo, FileSystemInfoExtend fileInfo, bool isLargeIcon)
        {
            EFileSystemType fileSystemType;

            if (PathUtility.IsVideoExtenstionAllowed(siteInfo, fileInfo.Type))
            {
                fileSystemType = EFileSystemType.Video;
            }
            else if (PathUtility.IsImageExtenstionAllowed(siteInfo, fileInfo.Type))
            {
                fileSystemType = EFileSystemType.Image;
            }
            else
            {
                fileSystemType = EFileSystemTypeUtils.GetEnumType(fileInfo.Type);
            }
            return(SiteServerAssets.GetFileSystemIconUrl(fileSystemType, isLargeIcon));
        }
Beispiel #6
0
        private string GetChannelTreeHtml()
        {
            var htmlBuilder = new StringBuilder();

            var treeDirectoryUrl = SiteServerAssets.GetIconUrl("tree");

            htmlBuilder.Append("<span id='ChannelSelectControl'>");
            var channelIdList = DataProvider.ChannelDao.GetIdListBySiteId(SiteId);
            var isLastNodeArray = new bool[channelIdList.Count];
            foreach (var channelId in channelIdList)
            {
                var nodeInfo = ChannelManager.GetChannelInfo(SiteId, channelId);
                htmlBuilder.Append(GetTitle(nodeInfo, treeDirectoryUrl, isLastNodeArray));
                htmlBuilder.Append("<br/>");
            }
            htmlBuilder.Append("</span>");
            return htmlBuilder.ToString();
        }
Beispiel #7
0
        private string GetChannelTreeHtml()
        {
            var htmlBuilder = new StringBuilder();

            var treeDirectoryUrl = SiteServerAssets.GetIconUrl("tree");

            htmlBuilder.Append("<span id='ChannelSelectControl'>");
            var nodeIdList      = DataProvider.NodeDao.GetNodeIdListByPublishmentSystemId(PublishmentSystemId);
            var isLastNodeArray = new bool[nodeIdList.Count];

            foreach (var nodeId in nodeIdList)
            {
                var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, nodeId);
                htmlBuilder.Append(GetChannelTreeTitle(nodeInfo, treeDirectoryUrl, isLastNodeArray));
                htmlBuilder.Append("<br/>");
            }
            htmlBuilder.Append("</span>");
            return(htmlBuilder.ToString());
        }
Beispiel #8
0
        void dgContents_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var modelInfo = e.Item.DataItem as ContentModelInfo;

                var ltlItemIcon    = (Literal)e.Item.FindControl("ltlItemIcon");
                var ltlModelID     = (Literal)e.Item.FindControl("ltlModelID");
                var ltlModelName   = (Literal)e.Item.FindControl("ltlModelName");
                var ltlDescription = (Literal)e.Item.FindControl("ltlDescription");
                var ltlTableName   = (Literal)e.Item.FindControl("ltlTableName");
                var ltlEditUrl     = (Literal)e.Item.FindControl("ltlEditUrl");
                var ltlDeleteUrl   = (Literal)e.Item.FindControl("ltlDeleteUrl");

                if (!string.IsNullOrEmpty(modelInfo.IconUrl))
                {
                    ltlItemIcon.Text = $"<img src='{SiteServerAssets.GetIconUrl($"tree/{modelInfo.IconUrl}")}' />";
                }
                ltlModelID.Text     = modelInfo.ModelId;
                ltlModelName.Text   = modelInfo.ModelName;
                ltlTableName.Text   = modelInfo.TableName;
                ltlDescription.Text = modelInfo.Description;

                if (!modelInfo.IsSystem)
                {
                    ltlEditUrl.Text =
                        $@"<a href=""javascript:;"" onclick=""{ModalContentModelAdd.GetOpenWindowStringToEdit(
                            PublishmentSystemId, modelInfo.ModelId)}"">编辑</a>";

                    var urlDelete = PageUtils.GetCmsUrl(nameof(PageContentModel), new NameValueCollection
                    {
                        { "PublishmentSystemID", PublishmentSystemId.ToString() },
                        { "ModelID", modelInfo.ModelId },
                        { "Delete", true.ToString() }
                    });
                    ltlDeleteUrl.Text =
                        $@"<a href=""{urlDelete}"" onClick=""javascript:return confirm('此操作将删除内容模型“{modelInfo.ModelName}”,确认吗?');"">删除</a>";
                }
            }
        }
Beispiel #9
0
        public string GetPreviewImageSrc(string adType)
        {
            var imageUrl = ChildMenuIcon.Text;

            if (!string.IsNullOrEmpty(imageUrl))
            {
                var extension = PathUtils.GetExtension(imageUrl);
                if (EFileSystemTypeUtils.IsImage(extension))
                {
                    return(PageUtility.ParseNavigationUrl(PublishmentSystemInfo, imageUrl));
                }
                else if (EFileSystemTypeUtils.IsFlash(extension))
                {
                    return(SiteServerAssets.GetIconUrl("flash.jpg"));
                }
                else if (EFileSystemTypeUtils.IsPlayer(extension))
                {
                    return(SiteServerAssets.GetIconUrl("player.gif"));
                }
            }
            return(SiteServerAssets.GetIconUrl("empty.gif"));
        }
Beispiel #10
0
        public static string GetNodeTreeLastImageHtml(SiteInfo siteInfo, ChannelInfo nodeInfo)
        {
            var imageHtml = string.Empty;

            if (nodeInfo.ParentId == 0)
            {
                var treeDirectoryUrl = SiteServerAssets.GetIconUrl("tree");
                if (siteInfo.IsRoot == false)
                {
                    imageHtml =
                        $@"<img align=""absmiddle"" title=""站点"" border=""0"" src=""{PageUtils.Combine(treeDirectoryUrl,
                            "site.gif")}"" />&nbsp;";
                }
                else
                {
                    imageHtml =
                        $@"<img align=""absmiddle"" title=""站点"" border=""0"" src=""{PageUtils.Combine(treeDirectoryUrl,
                            "siteHQ.gif")}"" />&nbsp;";
                }
            }
            if (!string.IsNullOrEmpty(nodeInfo.ContentRelatedPluginIds))
            {
                foreach (var service in PluginContentManager.GetContentPlugins(nodeInfo, false))
                {
                    var iconClass = PluginMenuManager.GetPluginIconClass(service.PluginId);
                    if (!string.IsNullOrEmpty(iconClass))
                    {
                        imageHtml +=
                            $@"<i class=""{iconClass}"" title=""{service.Metadata.Title}"" style=""color: #00b19d;display: inline-block;font-size: 18px;vertical-align: middle;width: 16px;""></i>";
                    }
                    else
                    {
                        imageHtml +=
                            $@"<img align=""absmiddle"" title=""{service.Metadata.Title}"" border=""0"" src=""{PluginManager.GetPluginIconUrl(service)}"" width=""18"" height=""18"" />";
                    }
                }
            }
            return(imageHtml);
        }
Beispiel #11
0
        public static string GetNodeTreeLastImageHtml(PublishmentSystemInfo publishmentSystemInfo, NodeInfo nodeInfo)
        {
            var treeDirectoryUrl = SiteServerAssets.GetIconUrl("tree");

            var imageHtml = string.Empty;

            if (nodeInfo.NodeType == ENodeType.BackgroundPublishNode)
            {
                if (publishmentSystemInfo.IsHeadquarters == false)
                {
                    imageHtml =
                        $@"<img align=""absmiddle"" alt=""站点"" border=""0"" src=""{PageUtils.Combine(treeDirectoryUrl,
                            "site.gif")}"" /></a>";
                }
                else
                {
                    imageHtml =
                        $@"<img align=""absmiddle"" alt=""站点"" border=""0"" src=""{PageUtils.Combine(treeDirectoryUrl,
                            "siteHQ.gif")}"" />";
                }
            }
            else
            {
                if (string.IsNullOrEmpty(nodeInfo.ContentModelId))
                {
                    return(imageHtml);
                }

                var modelInfo = ContentModelManager.GetContentModelInfo(publishmentSystemInfo, nodeInfo.ContentModelId);
                if (!string.IsNullOrEmpty(modelInfo.IconUrl))
                {
                    imageHtml +=
                        $@"&nbsp;<img align=""absmiddle"" alt=""{modelInfo.ModelName}"" border=""0"" src=""{PageUtils
                            .Combine(treeDirectoryUrl, modelInfo.IconUrl)}"" /></a>";
                }
            }
            return(imageHtml);
        }
Beispiel #12
0
        private NodeTreeItem(SiteInfo siteInfo, ChannelInfo nodeInfo, bool enabled, string administratorName)
        {
            _siteInfo          = siteInfo;
            _nodeInfo          = nodeInfo;
            _enabled           = enabled;
            _administratorName = administratorName;

            var treeDirectoryUrl = SiteServerAssets.GetIconUrl("tree");

            _iconFolderUrl = PageUtils.Combine(treeDirectoryUrl, "folder.gif");
            if (!string.IsNullOrEmpty(nodeInfo.ContentModelPluginId))
            {
                var iconUrl = PluginManager.GetPluginIconUrl(nodeInfo.ContentModelPluginId);
                if (!string.IsNullOrEmpty(iconUrl))
                {
                    _iconFolderUrl = iconUrl;
                }
            }

            _iconEmptyUrl = PageUtils.Combine(treeDirectoryUrl, "empty.gif");
            _iconMinusUrl = PageUtils.Combine(treeDirectoryUrl, "minus.png");
            _iconPlusUrl  = PageUtils.Combine(treeDirectoryUrl, "plus.png");
        }
Beispiel #13
0
        public static NavigationTreeItem CreateNavigationBarItem(bool isDisplay, bool selected, int parentsCount, bool hasChildren, bool openWindow, string text, string linkUrl, string target, bool enabled, string iconUrl)
        {
            var item = new NavigationTreeItem
            {
                _isDisplay     = isDisplay,
                _selected      = selected,
                _parentsCount  = parentsCount,
                _hasChildren   = hasChildren,
                _openWindow    = openWindow,
                _text          = text,
                _linkUrl       = linkUrl,
                _target        = target,
                _enabled       = enabled,
                _isClickChange = true,
                _iconFolderUrl =
                    !string.IsNullOrEmpty(iconUrl)
                                ? SiteServerAssets.GetIconUrl(iconUrl)
                                : SiteServerAssets.GetIconUrl(hasChildren ? "menu/itemContainer.png" : "menu/item.png")
            };

            item._iconOpenedFolderUrl = item._iconFolderUrl;
            return(item);
        }
Beispiel #14
0
        private string GetPublishmentSystemName(PublishmentSystemInfo publishmentSystemInfo)
        {
            var retval  = string.Empty;
            var padding = string.Empty;

            var level  = PublishmentSystemManager.GetPublishmentSystemLevel(publishmentSystemInfo.PublishmentSystemId);
            var psLogo = string.Empty;

            if (publishmentSystemInfo.IsHeadquarters)
            {
                psLogo = "siteHQ.gif";
            }
            else
            {
                psLogo = "site.gif";
                if (level > 0 && level < 10)
                {
                    psLogo = $"subsite{level + 1}.gif";
                }
            }
            psLogo = SiteServerAssets.GetIconUrl("tree/" + psLogo);

            for (var i = 0; i < level; i++)
            {
                padding += " ";
            }
            if (level > 0)
            {
                padding += "└ ";
            }

            retval =
                $"<img align='absbottom' border='0' src='{psLogo}'/>&nbsp;<a href='{publishmentSystemInfo.PublishmentSystemUrl}' target='_blank'>{publishmentSystemInfo.PublishmentSystemName}</a>";

            return
                ($"{padding}{retval}&nbsp;{EPublishmentSystemTypeUtils.GetIconHtml(publishmentSystemInfo.PublishmentSystemType)}");
        }
Beispiel #15
0
        void rptChannels_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var nodeId  = (int)e.Item.DataItem;
            var enabled = IsOwningNodeId(nodeId);

            if (!enabled)
            {
                if (!IsHasChildOwningNodeId(nodeId))
                {
                    e.Item.Visible = false;
                }
            }
            var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, nodeId);

            var ltlEditLink      = (Literal)e.Item.FindControl("ltlEditLink");
            var ltlNodeTitle     = (Literal)e.Item.FindControl("ltlNodeTitle");
            var ltlNodeIndexName = (Literal)e.Item.FindControl("ltlNodeIndexName");
            var ltlUpLink        = (Literal)e.Item.FindControl("ltlUpLink");
            var ltlDownLink      = (Literal)e.Item.FindControl("ltlDownLink");
            var ltlCheckBoxHtml  = (Literal)e.Item.FindControl("ltlCheckBoxHtml");

            if (enabled && HasChannelPermissions(nodeId, AppManager.Cms.Permission.Channel.ChannelEdit))
            {
                ltlEditLink.Text = $"<a href=\"{PageChannelEdit.GetRedirectUrl(PublishmentSystemId, nodeId, PageUrl)}\">编辑</a>";

                ltlUpLink.Text =
                    $@"<a href=""{PageUrl}&TheNodeID={nodeInfo.NodeId}&Subtract=True""><img src=""../Pic/icon/up.gif"" border=""0"" alt=""上升"" /></a>";
                ltlDownLink.Text =
                    $@"<a href=""{PageUrl}&TheNodeID={nodeInfo.NodeId}&Add=True""><img src=""../Pic/icon/down.gif"" border=""0"" alt=""下降"" /></a>";
            }

            var url = PageUtils.GetCmsUrl(nameof(PageContentChannel), new NameValueCollection
            {
                { "PublishmentSystemID", PublishmentSystemId.ToString() },
                { "NodeID", nodeId.ToString() }
            });

            ltlNodeTitle.Text =
                $@"<a href=""{PageActions.GetRedirectUrl(PublishmentSystemId, nodeId)}"" title=""浏览页面"" target=""_blank""><img src=""{SiteServerAssets.GetIconUrl("tree/folder.gif")}"" border=""0"" align=""absMiddle"" /></a>&nbsp;<A title=""进入栏目"" href=""{url}"">{nodeInfo
                    .NodeName}</A>&nbsp;{NodeManager.GetNodeTreeLastImageHtml(PublishmentSystemInfo, nodeInfo)}&nbsp;<SPAN class=""gray"" style=""FONT-SIZE: 8pt; FONT-FAMILY: arial"">({nodeInfo
                    .ContentNum})</SPAN>";

            ltlNodeIndexName.Text = nodeInfo.NodeIndexName;

            if (enabled)
            {
                ltlCheckBoxHtml.Text = $"<input type='checkbox' name='ChannelIDCollection' value='{nodeInfo.NodeId}' />";
            }
        }
Beispiel #16
0
        public static string GetInsertVideoScript(string attributeName, string playUrl, string imageUrl, SiteInfo siteInfo)
        {
            if (string.IsNullOrEmpty(playUrl))
            {
                return(string.Empty);
            }

            var dict = new Dictionary <string, string>
            {
                { StlPlayer.PlayUrl, playUrl },
                { StlPlayer.IsAutoPlay, siteInfo.Additional.ConfigUEditorVideoIsAutoPlay.ToString() },
                { StlPlayer.PlayBy, siteInfo.Additional.ConfigUEditorVideoPlayBy },
                { "style", "width: 333px; height: 333px;" }
            };

            if (siteInfo.Additional.ConfigUEditorVideoIsImageUrl && !string.IsNullOrEmpty(imageUrl))
            {
                dict.Add(StlPlayer.ImageUrl, imageUrl);
            }
            if (siteInfo.Additional.ConfigUEditorVideoIsWidth)
            {
                dict.Add(StlPlayer.Width, siteInfo.Additional.ConfigUEditorVideoWidth.ToString());
            }
            if (siteInfo.Additional.ConfigUEditorVideoIsHeight)
            {
                dict.Add(StlPlayer.Height, siteInfo.Additional.ConfigUEditorVideoHeight.ToString());
            }

            return(GetInsertHtmlScript(attributeName,
                                       $@"<img class=""siteserver-stl-player"" src=""{SiteServerAssets.GetUrl("ueditor/video-clip.png")}"" {TranslateUtils.ToAttributesString(dict)} />"));
        }
        private void FillFileSystemsToImage(bool isReload)
        {
            var builder = new StringBuilder();

            builder.Append(@"<table class=""table table-noborder table-hover"">");

            var directoryUrl       = PageUtility.GetSiteUrlByPhysicalPath(SiteInfo, _directoryPath, true);
            var backgroundImageUrl = SiteServerAssets.GetIconUrl("filesystem/management/background.gif");
            var directoryImageUrl  = SiteServerAssets.GetFileSystemIconUrl(EFileSystemType.Directory, true);

            var fileSystemInfoExtendCollection = FileManager.GetFileSystemInfoExtendCollection(_directoryPath, isReload);

            var mod = 0;

            foreach (FileSystemInfoExtend subDirectoryInfo in fileSystemInfoExtendCollection.Folders)
            {
                if (mod % 4 == 0)
                {
                    builder.Append("<tr>");
                }
                var linkUrl = GetRedirectUrl(PageUtils.Combine(_currentRootPath, subDirectoryInfo.Name));

                builder.Append($@"
<td>
		<table cellspacing=""0"" cellpadding=""0"" border=""0"" align=""center"">
			<tr>
				<td style=""height:100px; width:100px; text-align:center; vertical-align:middle;"">
					<table cellspacing=""0"" cellpadding=""0"" border=""0"" align=""center"">
						<tr>
							<td background=""{backgroundImageUrl}"" style=""background-repeat:no-repeat; background-position:center;height:96px; width:96px; text-align:center; vertical-align:middle;"" align=""center""><a href=""{linkUrl}""><img src=""{directoryImageUrl}"" border=0 /></a></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td style=""height:20px; width:100%; text-align:center; vertical-align:middle;""><a href=""{linkUrl}"">{StringUtils
				    .MaxLengthText(subDirectoryInfo.Name, 8)}</a></td>
			</tr>
		</table>
	</td>
");

                if (mod % 4 == 3)
                {
                    builder.Append("</tr>");
                }
                mod++;
            }

            foreach (FileSystemInfoExtend fileInfo in fileSystemInfoExtendCollection.Files)
            {
                if (mod % 4 == 0)
                {
                    builder.Append("<tr>");
                }
                var    fileSystemType = EFileSystemTypeUtils.GetEnumType(fileInfo.Type);
                var    linkUrl        = PageUtils.Combine(directoryUrl, fileInfo.Name);
                string fileImageUrl;
                var    imageStyleAttributes = string.Empty;
                if (EFileSystemTypeUtils.IsImage(fileInfo.Type))
                {
                    var imagePath = PathUtils.Combine(_directoryPath, fileInfo.Name);
                    try
                    {
                        var image = ImageUtils.GetImage(imagePath);
                        if (image.Height > image.Width)
                        {
                            if (image.Height > 94)
                            {
                                imageStyleAttributes = @"style=""height:94px;""";
                            }
                        }
                        else
                        {
                            if (image.Width > 94)
                            {
                                imageStyleAttributes = @"style=""width:94px;""";
                            }
                        }
                        fileImageUrl = PageUtils.Combine(directoryUrl, fileInfo.Name);
                        image.Dispose();
                    }
                    catch
                    {
                        fileImageUrl = SiteServerAssets.GetFileSystemIconUrl(fileSystemType, true);
                    }
                }
                else
                {
                    fileImageUrl = GetFileSystemIconUrl(SiteInfo, fileInfo, true);
                }

                var attachmentUrl = PageUtility.GetVirtualUrl(SiteInfo, linkUrl);
                //string fileViewUrl = Modal.FileView.GetOpenWindowString(base.SiteId, attachmentUrl);
                var fileViewUrl = ModalFileView.GetOpenWindowStringHidden(SiteId, attachmentUrl, _hiddenClientId);

                builder.Append($@"
<td>
		<table cellspacing=""0"" cellpadding=""0"" border=""0"" align=""center"">
			<tr>
				<td style=""height:100px; width:100px; text-align:center; vertical-align:middle;"">
					<table cellspacing=""0"" cellpadding=""0"" border=""0"" align=""center"">
						<tr>
							<td background=""{backgroundImageUrl}"" style=""background-repeat:no-repeat; background-position:center;height:96px; width:96px; text-align:center; vertical-align:middle;"" align=""center""><a href=""javascript:;"" onClick=""window.parent.SelectAttachment('{_hiddenClientId}', '{attachmentUrl
				    .Replace("'", "\\'")}', '{fileViewUrl.Replace("'", "\\'")}');{LayerUtils.CloseScript}"" title=""{fileInfo.Name}""><img src=""{fileImageUrl}"" {imageStyleAttributes} border=0 /></a></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td style=""height:20px; width:100%; text-align:center; vertical-align:middle;""><a href=""{linkUrl}"" title=""点击此项浏览此附件"" target=""_blank"">{StringUtils
				    .MaxLengthText(fileInfo.Name, 8)}</a></td>
			</tr>
		</table>
	</td>
");

                if (mod % 4 == 3)
                {
                    builder.Append("</tr>");
                }
                mod++;
            }

            builder.Append("</table>");
            LtlFileSystems.Text = builder.ToString();
        }
Beispiel #18
0
        public static string GetScript(EDepartmentLoadingType loadingType, NameValueCollection additional)
        {
            var script = @"
<script language=""JavaScript"">
function getTreeLevel(e) {
	var length = 0;
	if (!isNull(e)){
		if (e.tagName == 'TR') {
			length = parseInt(e.getAttribute('treeItemLevel'));
		}
	}
	return length;
}

function getTrElement(element){
	if (isNull(element)) return;
	for (element = element.parentNode;;){
		if (element != null && element.tagName == 'TR'){
			break;
		}else{
			element = element.parentNode;
		} 
	}
	return element;
}

function getImgClickableElementByTr(element){
	if (isNull(element) || element.tagName != 'TR') return;
	var img = null;
	if (!isNull(element.childNodes)){
		var imgCol = element.getElementsByTagName('IMG');
		if (!isNull(imgCol)){
			for (x=0;x<imgCol.length;x++){
				if (!isNull(imgCol.item(x).getAttribute('isOpen'))){
					img = imgCol.item(x);
					break;
				}
			}
		}
	}
	return img;
}

var weightedLink = null;

function fontWeightLink(element){
    if (weightedLink != null)
    {
        weightedLink.style.fontWeight = 'normal';
    }
    element.style.fontWeight = 'bold';
    weightedLink = element;
}

var completedChannelId = null;
function displayChildren(img){
	if (isNull(img)) return;

	var tr = getTrElement(img);

    var isToOpen = img.getAttribute('isOpen') == 'false';
    var isByAjax = img.getAttribute('isAjax') == 'true';
    var channelId = img.getAttribute('id');

	if (!isNull(img) && img.getAttribute('isOpen') != null){
		if (img.getAttribute('isOpen') == 'false'){
			img.setAttribute('isOpen', 'true');
            img.setAttribute('src', '{iconMinusUrl}');
		}else{
            img.setAttribute('isOpen', 'false');
            img.setAttribute('src', '{iconPlusUrl}');
		}
	}

    if (isToOpen && isByAjax)
    {
        var div = document.createElement('div');
        div.innerHTML = ""<img align='absmiddle' border='0' src='{iconLoadingUrl}' /> 加载中,请稍候..."";
        img.parentNode.appendChild(div);
        $(div).addClass('loading');
        loadingChannels(tr, img, div, channelId);
    }
    else
    {
        var level = getTreeLevel(tr);
        
	    var collection = new Array();
	    var index = 0;

	    for ( var e = tr.nextSibling; !isNull(e) ; e = e.nextSibling) {
		    if (!isNull(e) && !isNull(e.tagName) && e.tagName == 'TR'){
		        var currentLevel = getTreeLevel(e);
		        if (currentLevel <= level) break;
		        if(e.style.display == '') {
			        e.style.display = 'none';
		        }else{
			        if (currentLevel != level + 1) continue;
			        e.style.display = '';
			        var imgClickable = getImgClickableElementByTr(e);
			        if (!isNull(imgClickable)){
				        if (!isNull(imgClickable.getAttribute('isOpen')) && imgClickable.getAttribute('isOpen') =='true'){
					        imgClickable.setAttribute('isOpen', 'false');
                            imgClickable.setAttribute('src', '{iconPlusUrl}');
					        collection[index] = imgClickable;
					        index++;
				        }
			        }
		        }
            }
	    }
        
	    if (index > 0){
		    for (i=0;i<=index;i++){
			    displayChildren(collection[i]);
		    }
	    }
    }
}
";

            script += $@"
function loadingChannels(tr, img, div, channelId){{
    var url = '{AjaxSystemService.GetLoadingDepartmentsUrl()}';
    var pars = '{AjaxSystemService.GetLoadingDepartmentsParameters(loadingType, additional)}&parentID=' + channelId;

    jQuery.post(url, pars, function(data, textStatus)
    {{
        $($.parseHTML(data)).insertAfter($(tr));
        img.setAttribute('isAjax', 'false');
        img.parentNode.removeChild(div);
    }});
    completedChannelId = channelId;
}}

function loadingChannelsOnLoad(paths){{
    if (paths && paths.length > 0){{
        var channelIds = paths.split(',');
        var channelId = channelIds[0];
        var img = $('#' + channelId);
        if (img.attr('isOpen') == 'false'){{
            displayChildren(img[0]);
//            if (completedChannelId && completedChannelId == channelId){{
//                if (paths.indexOf(',') != -1){{
//                    setTimeout(""loadingChannelsOnLoad("" + paths + "")"", 3000);
//                }}
//            }} 
        }}
    }}
}}
</script>
";

            var item = new DepartmentTreeItem();

            script = script.Replace("{iconEmptyUrl}", item._iconEmptyUrl);
            script = script.Replace("{iconFolderUrl}", item._iconFolderUrl);
            script = script.Replace("{iconMinusUrl}", item._iconMinusUrl);
            script = script.Replace("{iconPlusUrl}", item._iconPlusUrl);

            script = script.Replace("{iconLoadingUrl}", SiteServerAssets.GetIconUrl("loading.gif"));

            script = script.Replace("loadingChannels", "loadingChannels_Department");
            script = script.Replace("displayChildren", "displayChildren_Department");

            return(script);
        }
 protected override void OnLoad(EventArgs e)
 {
     if (Page != null)
     {
         if (!Page.ClientScript.IsStartupScriptRegistered("DateTimeTextBox_Calendar"))
         {
             Page.ClientScript.RegisterStartupScript(GetType(), "DateTimeTextBox_Calendar",
                                                     $@"<script language=""javascript"" src=""{SiteServerAssets.GetUrl(SiteServerAssets.DatePicker.Js)}""></script>");
         }
     }
     base.OnLoad(e);
 }
Beispiel #20
0
        public static string GetScript(SiteInfo siteInfo, ELoadingType loadingType, string contentModelPluginId, NameValueCollection additional)
        {
            var script = @"
<script language=""JavaScript"">
function getTreeLevel(e) {
	var length = 0;
	if (e){
		if (e.tagName == 'TR') {
			length = parseInt(e.getAttribute('treeItemLevel'));
		}
	}
	return length;
}

function getTrElement(element){
	if (!element) return;
	for (element = element.parentNode;;){
		if (element != null && element.tagName == 'TR'){
			break;
		}else{
			element = element.parentNode;
		} 
	}
	return element;
}

function getImgClickableElementByTr(element){
	if (!element || element.tagName != 'TR') return;
	var img = null;
	if (element.childNodes){
		var imgCol = element.getElementsByTagName('IMG');
		if (imgCol){
			for (x=0;x<imgCol.length;x++){
				if (imgCol.item(x).getAttribute('isOpen')){
					img = imgCol.item(x);
					break;
				}
			}
		}
	}
	return img;
}

var activeTrElement = null;
function fontWeightLink(element){
    if (activeTrElement)
    {
        activeTrElement.setAttribute('class', '');
    }
    activeTrElement = getTrElement(element);
    if (activeTrElement) {
        activeTrElement.setAttribute('class', 'table-active');
    }
}

function unSelectRow(tr) {
    tr = $(tr);
    var cb = tr.find('input:checkbox:first');
    if (cb.length  === 0) return;
    var checked = cb.is(':checked');
    cb[0].checked = false;
    tr.removeClass('table-active');
}

var completedChannelId = null;
function displayChildren(img){
	if (!img) return;

	var tr = getTrElement(img);

    var isToOpen = img.getAttribute('isOpen') == 'false';
    var isByAjax = img.getAttribute('isAjax') == 'true';
    var channelId = img.getAttribute('id');

	if (img && img.getAttribute('isOpen') != null){
		if (img.getAttribute('isOpen') == 'false'){
			img.setAttribute('isOpen', 'true');
            img.setAttribute('src', '{iconMinusUrl}');
		}else{
            img.setAttribute('isOpen', 'false');
            img.setAttribute('src', '{iconPlusUrl}');
		}
	}

    if (isToOpen && isByAjax)
    {
        var div = document.createElement('div');
        div.innerHTML = ""<img align='absmiddle' width='30' height='12' border='0' src='{iconLoadingUrl}' />"";
        img.parentNode.appendChild(div);
        $(div).addClass('loading');
        loadingChannels(tr, img, div, channelId);
    }
    else
    {
        var level = getTreeLevel(tr);
        
	    var collection = new Array();
	    var index = 0;

	    for ( var e = tr.nextSibling; e != null ; e = e.nextSibling) {
		    if (e && e.tagName && e.tagName == 'TR'){
		        var currentLevel = getTreeLevel(e);
		        if (currentLevel <= level) break;
		        if(e.style.display == '') {
			        e.style.display = 'none';
                    unSelectRow(e);
		        }else{
			        if (currentLevel != level + 1) continue;
			        e.style.display = '';
			        var imgClickable = getImgClickableElementByTr(e);
			        if (imgClickable){
				        if (imgClickable.getAttribute('isOpen') && imgClickable.getAttribute('isOpen') =='true'){
					        imgClickable.setAttribute('isOpen', 'false');
                            imgClickable.setAttribute('src', '{iconPlusUrl}');
					        collection[index] = imgClickable;
					        index++;
				        }
			        }
		        }
            }
	    }
        
	    if (index > 0){
		    for (i=0;i<=index;i++){
			    displayChildren(collection[i]);
		    }
	    }
    }
}
";

            script += $@"
function loadingChannels(tr, img, div, channelId){{
    var url = '{AjaxOtherService.GetGetLoadingChannelsUrl()}';
    var pars = '{AjaxOtherService.GetGetLoadingChannelsParameters(siteInfo.Id, contentModelPluginId, loadingType, additional)}&parentID=' + channelId;

    jQuery.post(url, pars, function(data, textStatus)
    {{
        $($.parseHTML(data)).insertAfter($(tr));
        img.setAttribute('isAjax', 'false');
        img.parentNode.removeChild(div);
    }});
    completedChannelId = channelId;
}}

function loadingChannelsOnLoad(paths){{
    if (paths && paths.length > 0){{
        var channelIds = paths.split(',');
        var channelId = channelIds[0];
        var img = $('#' + channelId);
        if (img.attr('isOpen') == 'false'){{
            displayChildren(img[0]);
            if (completedChannelId && completedChannelId == channelId){{
                if (paths.indexOf(',') != -1){{
paths = paths.substring(paths.indexOf(',') + 1);
                    setTimeout(""loadingChannelsOnLoad('"" + paths + ""')"", 1000);
                }}
            }} 
        }}
    }}
}}
</script>
";

            var treeDirectoryUrl = SiteServerAssets.GetIconUrl("tree");

            script = script.Replace("{iconEmptyUrl}", PageUtils.Combine(treeDirectoryUrl, "empty.gif"));
            script = script.Replace("{iconMinusUrl}", PageUtils.Combine(treeDirectoryUrl, "minus.png"));
            script = script.Replace("{iconPlusUrl}", PageUtils.Combine(treeDirectoryUrl, "plus.png"));
            script = script.Replace("{iconLoadingUrl}", SiteServerAssets.GetUrl("layer/skin/default/xubox_loading0.gif"));
            return(script);
        }
Beispiel #21
0
        public static string GetContentCommands(string administratorName, PublishmentSystemInfo publishmentSystemInfo, NodeInfo nodeInfo, string pageUrl, string currentFileName, bool isCheckPage)
        {
            var iconUrl   = SiteServerAssets.GetIconUrl(string.Empty);
            var modelType = EContentModelTypeUtils.GetEnumType(nodeInfo.ContentModelId);

            var builder = new StringBuilder();

            //添加内容
            if (!isCheckPage && AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentAdd) && nodeInfo.Additional.IsContentAddable)
            {
                var redirectUrl = GetContentAddAddUrl(publishmentSystemInfo.PublishmentSystemId, nodeInfo, pageUrl);
                var title       = "添加内容";
                if (modelType == EContentModelType.GovPublic)
                {
                    title = "采集信息";
                }
                else if (modelType == EContentModelType.GovInteract)
                {
                    title = "新增办件";
                }
                else if (modelType == EContentModelType.Photo)
                {
                    title = "添加图片";
                }
                else if (modelType == EContentModelType.Vote)
                {
                    title = "发起投票";
                }

                builder.Append(
                    $@"<a href=""{redirectUrl}""><img style=""margin-right: 3px"" src=""{iconUrl}/add.gif"" align=""absMiddle"" />{title}</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");

                builder.Append($@"<a href=""javascript:;"" onclick=""{ModalContentImport.GetOpenWindowString(publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId)}"">导入内容</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");

                if (modelType != EContentModelType.UserDefined && modelType != EContentModelType.Vote && modelType != EContentModelType.Job && modelType != EContentModelType.GovInteract)
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalUploadWord.GetOpenWindowString(
                            publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, StringUtils.ValueToUrl(pageUrl))}"">导入Word</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
            }
            //删 除
            if (nodeInfo.ContentNum > 0 && AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentDelete))
            {
                builder.Append(
                    $@"<a href=""javascript:;"" onclick=""{PageContentDelete.GetRedirectClickStringForSingleChannel(
                        publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, false, pageUrl)}"">删 除</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
            }

            if (nodeInfo.ContentNum > 0)
            {
                builder.Append(
                    $@"<a href=""javascript:;"" onclick=""{ModalContentExport.GetOpenWindowString(
                        publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId)}"">导 出</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                //设置
                if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentEdit))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalContentAttributes.GetOpenWindowString(
                            publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId)}"">设置属性</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalAddToGroup.GetOpenWindowStringToContent(
                            publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId)}"">设置内容组</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
                //转 移
                if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentTranslate))
                {
                    var redirectUrl = PageContentTranslate.GetRedirectUrl(publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, pageUrl);

                    var clickString = PageUtils.GetRedirectStringWithCheckBoxValue(redirectUrl, "ContentIDCollection", "ContentIDCollection", "请选择需要转移的内容!");

                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{clickString}"">转 移</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
                //排 序
                if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentEdit))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalContentTaxis.GetOpenWindowString(
                            publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, pageUrl)}"">排 序</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
                //整理
                if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentOrder))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalContentTidyUp.GetOpenWindowString(
                            publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, pageUrl)}"">整 理</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
                //审 核
                if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentCheck))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalContentCheck.GetOpenWindowString(
                            publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, pageUrl)}"">审 核</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
                //归 档
                if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentArchive))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalContentArchive.GetOpenWindowString(
                            publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, pageUrl)}"">归 档</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
                //跨站转发
                if (CrossSiteTransUtility.IsTranslatable(publishmentSystemInfo, nodeInfo))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalContentCrossSiteTrans.GetOpenWindowString(
                            publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId)}"">跨站转发</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
                //生 成
                if (!isCheckPage && (AdminUtility.HasWebsitePermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, AppManager.Cms.Permission.WebSite.Create) || AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.CreatePage)))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{Cms.ModalProgressBar
                            .GetOpenWindowStringWithCreateContentsOneByOne(publishmentSystemInfo.PublishmentSystemId,
                                nodeInfo.NodeId)}"">生 成</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
            }

            //选择显示项
            //if (nodeInfo.NodeType != ENodeType.BackgroundImageNode)
            //{
            if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ChannelEdit))
            {
                builder.Append(
                    $@"<a href=""javascript:;"" onclick=""{ModalSelectColumns.GetOpenWindowStringToContent(
                        publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, true)}"">显示项</a> &nbsp; &nbsp; ");
            }
            //}

            if (!isCheckPage && nodeInfo.ContentNum > 0)
            {
                if (builder.Length > 0)
                {
                    builder.Length = builder.Length - 15;
                }

                //builder.Append(GetContentLinks(publishmentSystemInfo, nodeInfo, contentType, currentFileName));

                builder.Append(
                    $@"&nbsp; <a href=""javascript:;;"" onClick=""$('#contentSearch').toggle(); return false""><img src=""{iconUrl}/search.gif"" align=""absMiddle"" alt=""快速查找"" /></a>");
            }


            //if (builder.Length > 0)
            //{
            //    builder.Length = builder.Length - 16;
            //}
            return(builder.ToString());
        }
Beispiel #22
0
        public string GetItemHtml()
        {
            var htmlBuilder = new StringBuilder();

            for (var i = 0; i < _parentsCount; i++)
            {
                htmlBuilder.Append($"<img align=\"absmiddle\" src=\"{_iconEmptyUrl}\"/>");
            }

            if (_isDisplay)
            {
                if (_hasChildren)
                {
                    htmlBuilder.Append(
                        _selected
                            ? $"<img align=\"absmiddle\" style=\"cursor:pointer;\" onClick=\"displayChildren(this);\" isOpen=\"true\" src=\"{_iconMinusUrl}\"/>"
                            : $"<img align=\"absmiddle\" style=\"cursor:pointer;\" onClick=\"displayChildren(this);\" isOpen=\"false\" src=\"{_iconPlusUrl}\"/>");
                }
                else
                {
                    htmlBuilder.Append($"<img align=\"absmiddle\" src=\"{_iconEmptyUrl}\"/>");
                }
            }
            else
            {
                htmlBuilder.Append(
                    _hasChildren
                        ? $"<img align=\"absmiddle\" style=\"cursor:pointer;\" onClick=\"displayChildren(this);\" isOpen=\"false\" src=\"{_iconPlusUrl}\"/>"
                        : $"<img align=\"absmiddle\" src=\"{_iconEmptyUrl}\"/>");
            }

            if (!string.IsNullOrEmpty(_iconFolderUrl))
            {
                htmlBuilder.Append($"<img width=\"16\" height=\"16\" align=\"absmiddle\" src=\"{_iconFolderUrl}\"/>");
            }

            htmlBuilder.Append("&nbsp;");

            if (_enabled)
            {
                if (!string.IsNullOrEmpty(_linkUrl))
                {
                    var targetHtml      = string.IsNullOrEmpty(_target) ? string.Empty : $"target='{_target}'";
                    var clickChangeHtml = _isClickChange ? "onclick='openFolderByA(this);'" : string.Empty;

                    htmlBuilder.Append($"<a href='{_linkUrl}' {targetHtml} {clickChangeHtml} isTreeLink='true'>{_text}");

                    htmlBuilder.Append("</a>");

                    if (_openWindow)
                    {
                        htmlBuilder.Append(
                            $@"&nbsp;<a href='{_linkUrl}' target='_blank' title='新窗口打开'><img src=""{SiteServerAssets
                                .GetIconUrl("tree/open.png")}"" /></a>");
                    }
                }
                else if (!string.IsNullOrEmpty(_onClickUrl))
                {
                    htmlBuilder.Append(
                        $@"<a href=""javascript:;"" onClick=""{_onClickUrl}"" title='快速编辑栏目' isTreeLink='true'>{_text}</a>");
                }
                else
                {
                    htmlBuilder.Append(_text);
                }
            }
            else
            {
                htmlBuilder.Append(_text);
            }

            return(htmlBuilder.ToString());
        }
Beispiel #23
0
        public NameValueCollection Backup(int siteId, string backupType, string userKeyPrefix)
        {
            //返回“运行结果”和“错误信息”的字符串数组
            NameValueCollection retval;
            var request = new RequestImpl(Request);

            try
            {
                var eBackupType = EBackupTypeUtils.GetEnumType(backupType);

                var siteInfo = SiteManager.GetSiteInfo(siteId);
                var filePath = PathUtility.GetBackupFilePath(siteInfo, eBackupType);
                DirectoryUtils.CreateDirectoryIfNotExists(filePath);
                FileUtils.DeleteFileIfExists(filePath);

                if (eBackupType == EBackupType.Templates)
                {
                    BackupUtility.BackupTemplates(siteId, filePath, request.AdminName);
                }
                else if (eBackupType == EBackupType.ChannelsAndContents)
                {
                    BackupUtility.BackupChannelsAndContents(siteId, filePath, request.AdminName);
                }
                else if (eBackupType == EBackupType.Files)
                {
                    BackupUtility.BackupFiles(siteId, filePath, request.AdminName);
                }
                else if (eBackupType == EBackupType.Site)
                {
                    BackupUtility.BackupSite(siteId, filePath, request.AdminName);
                }

                string resultString =
                    $"任务完成,备份地址:<br /><strong> {filePath} </strong>&nbsp;<a href='{ApiRouteActionsDownload.GetUrl(ApiManager.InnerApiUrl, filePath)}'><img src='{SiteServerAssets.GetIconUrl("download.gif")}' />下载</a>。";

                retval = AjaxManager.GetWaitingTaskNameValueCollection(resultString, string.Empty, string.Empty);
            }
            catch (Exception ex)
            {
                retval = AjaxManager.GetWaitingTaskNameValueCollection(string.Empty, ex.Message, string.Empty);
                LogUtils.AddErrorLog(ex);
            }

            return(retval);
        }
Beispiel #24
0
        public static string GetChannelCommands(string administratorName, SiteInfo siteInfo, ChannelInfo nodeInfo, string pageUrl, string currentFileName)
        {
            var iconUrl = SiteServerAssets.GetIconUrl(string.Empty);
            var builder = new StringBuilder();

            //添加栏目
            if (AdminUtility.HasChannelPermissions(administratorName, siteInfo.Id, nodeInfo.Id, ConfigManager.Permissions.Channel.ChannelAdd) && nodeInfo.Additional.IsChannelAddable)
            {
                builder.Append(
                    $@"<a href=""{PageChannelAdd.GetRedirectUrl(siteInfo.Id,
                        nodeInfo.Id, pageUrl)}""><img style=""MARGIN-RIGHT: 3px"" src=""{iconUrl}/add.gif"" align=""absMiddle"" />添加栏目</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                builder.Append(
                    $@"<a href=""javascript:;"" onclick=""{ModalChannelsAdd.GetOpenWindowString(
                        siteInfo.Id, nodeInfo.Id, pageUrl)}"">快速添加</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
            }
            if (nodeInfo.ChildrenCount > 0)
            {
                //删除栏目
                if (AdminUtility.HasChannelPermissions(administratorName, siteInfo.Id, nodeInfo.Id, ConfigManager.Permissions.Channel.ChannelDelete))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{PageUtils.GetRedirectStringWithCheckBoxValue(
                            PageChannelDelete.GetRedirectUrl(siteInfo.Id, pageUrl),
                            "ChannelIDCollection", "ChannelIDCollection", "请选择需要删除的栏目!")}"">删除栏目</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
                //清空内容
                if (AdminUtility.HasChannelPermissions(administratorName, siteInfo.Id, nodeInfo.Id, ConfigManager.Permissions.Channel.ContentDelete))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{PageUtils.GetRedirectStringWithCheckBoxValue(
                            PageChannelDelete.GetRedirectUrl(siteInfo.Id, pageUrl),
                            "ChannelIDCollection", "ChannelIDCollection", "请选择需要删除内容的栏目!")}"">清空内容</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }

                if (AdminUtility.HasChannelPermissions(administratorName, siteInfo.Id, nodeInfo.Id, ConfigManager.Permissions.Channel.ChannelAdd))
                {
                    //导 入
                    if (nodeInfo.Additional.IsChannelAddable)
                    {
                        builder.Append(
                            $@"<a href=""javascript:;"" onclick=""{ModalChannelImport.GetOpenWindowString(
                               siteInfo.Id, nodeInfo.Id)}"">导 入</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                    }
                    //导 出
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{Cms.ModalExportMessage.GetOpenWindowStringToChannel(
                            siteInfo.Id, "ChannelIDCollection", "请选择需要导出的栏目!")}"">导 出</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }

                //设置栏目组
                if (AdminUtility.HasChannelPermissions(administratorName, siteInfo.Id, nodeInfo.Id, ConfigManager.Permissions.Channel.ChannelEdit))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalAddToGroup.GetOpenWindowStringToChannel(
                            siteInfo.Id)}"">设置栏目组</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
                //转 移
                if (AdminUtility.HasChannelPermissions(administratorName, siteInfo.Id, nodeInfo.Id, ConfigManager.Permissions.Channel.ChannelTranslate))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{PageUtils.GetRedirectStringWithCheckBoxValue(
                            PageChannelTranslate.GetRedirectUrl(siteInfo.Id,
                                nodeInfo.Id, pageUrl), "ChannelIDCollection", "ChannelIDCollection", "请选择需要转移的栏目!")}"">转 移</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }

                //生 成
                if (AdminUtility.HasSitePermissions(administratorName, siteInfo.Id, ConfigManager.Permissions.WebSite.Create) || AdminUtility.HasChannelPermissions(administratorName, siteInfo.Id, nodeInfo.Id, ConfigManager.Permissions.Channel.CreatePage))
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalCreateChannels.GetOpenWindowString(
                            siteInfo.Id)}"">生 成</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
            }
            else
            {
                //导 入
                if (AdminUtility.HasChannelPermissions(administratorName, siteInfo.Id, nodeInfo.Id, ConfigManager.Permissions.Channel.ChannelAdd) && nodeInfo.Additional.IsChannelAddable)
                {
                    builder.Append(
                        $@"<a href=""javascript:;"" onclick=""{ModalChannelImport.GetOpenWindowString(
                            siteInfo.Id, nodeInfo.Id)}"">导 入</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
                }
            }
            if (siteInfo.Id != nodeInfo.Id)
            {
                builder.Append(
                    $@"<a href=""{$"{currentFileName}?siteId={siteInfo.Id}&channelId={nodeInfo.ParentId}"}""><img style=""MARGIN-RIGHT: 3px"" src=""{iconUrl}/upfolder.gif"" align=""absMiddle"" />向 上</a> <span class=""gray"">&nbsp;|&nbsp;</span> ");
            }
            if (builder.Length > 0)
            {
                builder.Length = builder.Length - 15;
            }
            return(builder.ToString());
        }
Beispiel #25
0
        private void FillFileSystemsToImage(bool isReload)
        {
            var builder = new StringBuilder();

            builder.Append(@"<table class=""table table-noborder table-hover"">");

            var directoryUrl       = PageUtility.GetSiteUrlByPhysicalPath(SiteInfo, _directoryPath, true);
            var backgroundImageUrl = SiteServerAssets.GetIconUrl("filesystem/management/background.gif");
            var directoryImageUrl  = SiteServerAssets.GetFileSystemIconUrl(EFileSystemType.Directory, true);

            var fileSystemInfoExtendCollection = FileManager.GetFileSystemInfoExtendCollection(_directoryPath, isReload);

            var mod = 0;

            foreach (FileSystemInfoExtend subDirectoryInfo in fileSystemInfoExtendCollection.Folders)
            {
                if (mod % 4 == 0)
                {
                    builder.Append("<tr>");
                }
                var linkUrl = GetRedirectUrl(PageUtils.Combine(_currentRootPath, subDirectoryInfo.Name));

                builder.Append($@"
<td>
		<table cellspacing=""0"" cellpadding=""0"" border=""0"" align=""center"">
			<tr>
				<td style=""height:100px; width:100px; text-align:center; vertical-align:middle;"">
					<table cellspacing=""0"" cellpadding=""0"" border=""0"" align=""center"">
						<tr>
							<td background=""{backgroundImageUrl}"" style=""background-repeat:no-repeat; background-position:center;height:96px; width:96px; text-align:center; vertical-align:middle;"" align=""center""><a href=""{linkUrl}""><img src=""{directoryImageUrl}"" border=0 /></a></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td style=""height:20px; width:100%; text-align:center; vertical-align:middle;""><a href=""{linkUrl}"">{StringUtils
				    .MaxLengthText(subDirectoryInfo.Name, 7)}</a></td>
			</tr>
		</table>
	</td>
");

                if (mod % 4 == 3)
                {
                    builder.Append("</tr>");
                }
                mod++;
            }

            foreach (FileSystemInfoExtend fileInfo in fileSystemInfoExtendCollection.Files)
            {
                if (!PathUtility.IsVideoExtenstionAllowed(SiteInfo, fileInfo.Type))
                {
                    continue;
                }
                if (mod % 4 == 0)
                {
                    builder.Append("<tr>");
                }

                var linkUrl         = PageUtils.Combine(directoryUrl, fileInfo.Name);
                var imageAttributes = string.Empty;

                var fileImageUrl = SiteServerAssets.GetFileSystemIconUrl(EFileSystemType.Video, true);

                var textBoxUrl = PageUtility.GetVirtualUrl(SiteInfo, linkUrl);

                builder.Append($@"
<td onmouseover=""this.className='tdbg-dark';"" onmouseout=""this.className='';"">
		<table cellspacing=""0"" cellpadding=""0"" border=""0"" align=""center"">
			<tr>
				<td style=""height:100px; width:100px; text-align:center; vertical-align:middle;"">
					<table cellspacing=""0"" cellpadding=""0"" border=""0"" align=""center"">
						<tr>
							<td background=""{backgroundImageUrl}"" style=""background-repeat:no-repeat; background-position:center;height:96px; width:96px; text-align:center; vertical-align:middle;"" align=""center""><a href=""javascript:;"" onClick=""selectVideo('{textBoxUrl}', '{linkUrl}');"" title=""点击选择视频""><img src=""{fileImageUrl}"" {imageAttributes} border=0 /></a></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td style=""height:20px; width:100%; text-align:center; vertical-align:middle;""><a href=""{linkUrl}"" title=""点击浏览视频"" target=""_blank"">{StringUtils
				    .MaxLengthText(fileInfo.Name, 7)}</a></td>
			</tr>
		</table>
	</td>
");

                if (mod % 4 == 3)
                {
                    builder.Append("</tr>");
                }
                mod++;
            }

            builder.Append("</table>");
            LtlFileSystems.Text = builder.ToString();
        }
Beispiel #26
0
        /// <summary>
        /// Generates the HTML markup for the Next/Prev navigation bar
        /// </summary>
        /// <param name="cell"></param>
        private void BuildNextPrevUi(TableCell cell)
        {
            var isValidPage    = (CurrentPageIndex >= 0 && CurrentPageIndex <= TotalPages - 1);
            var canMoveBack    = (CurrentPageIndex > 0);
            var canMoveForward = (CurrentPageIndex < TotalPages - 1);

            // 首页
            var enabled    = isValidPage && canMoveBack;
            var firstImage = new Image {
                ToolTip = FirstText
            };
            var firstText = new Label {
                Text = FirstText
            };

            if (enabled)
            {
                firstImage.ImageUrl = SiteServerAssets.GetUrl(SiteServerAssets.Arrow.First);

                var link = new HyperLink();
                link.Style.Add("text-decoration", "none");
                link.NavigateUrl = GetNavigationUrl(1);
                if (!string.IsNullOrEmpty(EnabledCssClass))
                {
                    link.CssClass = EnabledCssClass;
                }
                link.Controls.Add(firstImage);
                link.Controls.Add(new LiteralControl("&nbsp;"));
                link.Controls.Add(firstText);
                cell.Controls.Add(link);
            }
            else
            {
                firstImage.ImageUrl = SiteServerAssets.GetUrl(SiteServerAssets.Arrow.FirstDisabled);
                cell.Controls.Add(firstImage);
                cell.Controls.Add(new LiteralControl("&nbsp;"));
                if (!string.IsNullOrEmpty(DisabledCssClass))
                {
                    firstText.CssClass = DisabledCssClass;
                }
                else
                {
                    firstText.Style.Add("color", "gray");
                }
                cell.Controls.Add(firstText);
            }

            cell.Controls.Add(new LiteralControl("&nbsp;&nbsp;"));

            // 上一页
            var prevImage = new Image {
                ToolTip = PrevText
            };
            var prevText = new Label {
                Text = PrevText
            };

            if (enabled)
            {
                prevImage.ImageUrl = SiteServerAssets.GetUrl(SiteServerAssets.Arrow.Previous);

                var link = new HyperLink();
                link.Style.Add("text-decoration", "none");
                link.NavigateUrl = GetNavigationUrl(CurrentPageIndex);
                if (!string.IsNullOrEmpty(EnabledCssClass))
                {
                    link.CssClass = EnabledCssClass;
                }
                link.Controls.Add(prevImage);
                link.Controls.Add(new LiteralControl("&nbsp;"));
                link.Controls.Add(prevText);
                cell.Controls.Add(link);
            }
            else
            {
                prevImage.ImageUrl = SiteServerAssets.GetUrl(SiteServerAssets.Arrow.PreviousDisabled);
                cell.Controls.Add(prevImage);
                cell.Controls.Add(new LiteralControl("&nbsp;"));
                if (!string.IsNullOrEmpty(DisabledCssClass))
                {
                    prevText.CssClass = DisabledCssClass;
                }
                else
                {
                    prevText.Style.Add("color", "gray");
                }
                cell.Controls.Add(prevText);
            }

            cell.Controls.Add(new LiteralControl("&nbsp;&nbsp;"));

            // 下一页
            enabled = isValidPage && canMoveForward;
            var nextImage = new Image {
                ToolTip = NextText
            };
            var nextText = new Label {
                Text = NextText
            };

            if (enabled)
            {
                nextImage.ImageUrl = SiteServerAssets.GetUrl(SiteServerAssets.Arrow.Next);

                var link = new HyperLink();
                link.Style.Add("text-decoration", "none");
                link.NavigateUrl = GetNavigationUrl(CurrentPageIndex + 2);
                if (!string.IsNullOrEmpty(EnabledCssClass))
                {
                    link.CssClass = EnabledCssClass;
                }
                link.Controls.Add(nextImage);
                link.Controls.Add(new LiteralControl("&nbsp;"));
                link.Controls.Add(nextText);
                cell.Controls.Add(link);
            }
            else
            {
                nextImage.ImageUrl = SiteServerAssets.GetUrl(SiteServerAssets.Arrow.NextDisabled);

                cell.Controls.Add(nextImage);
                cell.Controls.Add(new LiteralControl("&nbsp;"));
                if (!string.IsNullOrEmpty(DisabledCssClass))
                {
                    nextText.CssClass = DisabledCssClass;
                }
                else
                {
                    nextText.Style.Add("color", "gray");
                }
                cell.Controls.Add(nextText);
            }

            cell.Controls.Add(new LiteralControl("&nbsp;&nbsp;"));

            // 末页
            var lastImage = new Image {
                ToolTip = LastText
            };
            var lastText = new Label {
                Text = LastText
            };

            if (enabled)
            {
                lastImage.ImageUrl = SiteServerAssets.GetUrl(SiteServerAssets.Arrow.Last);

                var link = new HyperLink();
                link.Style.Add("text-decoration", "none");
                link.NavigateUrl = GetNavigationUrl(TotalPages);
                if (!string.IsNullOrEmpty(EnabledCssClass))
                {
                    link.CssClass = EnabledCssClass;
                }
                link.Controls.Add(lastImage);
                link.Controls.Add(new LiteralControl("&nbsp;"));
                link.Controls.Add(lastText);
                cell.Controls.Add(link);
            }
            else
            {
                lastImage.ImageUrl = SiteServerAssets.GetUrl(SiteServerAssets.Arrow.LastDisabled);

                cell.Controls.Add(lastImage);
                cell.Controls.Add(new LiteralControl("&nbsp;"));
                if (!string.IsNullOrEmpty(DisabledCssClass))
                {
                    lastText.CssClass = DisabledCssClass;
                }
                else
                {
                    lastText.Style.Add("color", "gray");
                }
                cell.Controls.Add(lastText);
            }

            //显示总记录数
            if (TotalPages > 0)
            {
                cell.Controls.Add(new LiteralControl("&nbsp;&nbsp;"));
                var totalPagesText = new Label();
                lastText.Text = $@" ( 共{TotalCount}条 )";
                cell.Controls.Add(totalPagesText);
            }
        }
Beispiel #27
0
        private void FillFileSystemsToImage(bool isReload)
        {
            var builder = new StringBuilder();

            builder.Append("<table class=\"table table-noborder table-hover\">");

            var directoryUrl = PageUtility.GetPublishmentSystemUrl(PublishmentSystemInfo, _relatedPath);

            var backgroundImageUrl = SiteServerAssets.GetIconUrl("filesystem/management/background.gif");
            var directoryImageUrl  = SiteServerAssets.GetFileSystemIconUrl(EFileSystemType.Directory, true);

            var fileSystemInfoExtendCollection = FileManager.GetFileSystemInfoExtendCollection(_directoryPath, isReload);

            var mod = 0;

            foreach (FileSystemInfoExtend subDirectoryInfo in fileSystemInfoExtendCollection.Folders)
            {
                if (string.IsNullOrEmpty(_relatedPath))
                {
                    if (StringUtils.EqualsIgnoreCase(subDirectoryInfo.Name, "api"))
                    {
                        continue;
                    }
                }
                if (mod % 5 == 0)
                {
                    builder.Append("<tr>");
                }
                var linkUrl = GetRedirectUrl(PublishmentSystemId, PageUtils.Combine(_relatedPath, subDirectoryInfo.Name));

                builder.Append($@"
<td>
		<table cellspacing=""0"" cellpadding=""0"" border=""0"" align=""center"">
			<tr>
				<td style=""height:100px; width:100px; text-align:center; vertical-align:middle;"">
					<table cellspacing=""0"" cellpadding=""0"" border=""0"" align=""center"">
						<tr>
							<td background=""{backgroundImageUrl}"" style=""background-repeat:no-repeat; background-position:center;height:96px; width:96px; text-align:center; vertical-align:middle;"" align=""center""><a href=""{linkUrl}""><img src=""{directoryImageUrl}"" border=0 /></a></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td style=""height:20px; width:100%; text-align:center; vertical-align:middle;""><a href=""{linkUrl}"">{StringUtils
				    .MaxLengthText(subDirectoryInfo.Name, 7)}</a> <input type=""checkbox"" name=""DirectoryNameCollection"" value=""{subDirectoryInfo
				    .Name}"" /></td>
			</tr>
		</table>
	</td>
");

                if (mod % 5 == 4)
                {
                    builder.Append("</tr>");
                }
                mod++;
            }

            foreach (FileSystemInfoExtend fileInfo in fileSystemInfoExtendCollection.Files)
            {
                if (mod % 5 == 0)
                {
                    builder.Append("<tr>");
                }
                var fileSystemType       = EFileSystemTypeUtils.GetEnumType(fileInfo.Type);
                var showPopWinString     = ModalFileView.GetOpenWindowString(PublishmentSystemId, _relatedPath, fileInfo.Name);
                var linkUrl              = PageUtils.Combine(directoryUrl, fileInfo.Name);
                var fileImageUrl         = string.Empty;
                var imageStyleAttributes = string.Empty;
                if (EFileSystemTypeUtils.IsImage(fileInfo.Type))
                {
                    var imagePath = PathUtils.Combine(_directoryPath, fileInfo.Name);
                    try
                    {
                        var image = ImageUtils.GetImage(imagePath);
                        if (image.Height > image.Width)
                        {
                            if (image.Height > 94)
                            {
                                imageStyleAttributes = @"style=""height:94px;""";
                            }
                        }
                        else
                        {
                            if (image.Width > 94)
                            {
                                imageStyleAttributes = @"style=""width:94px;""";
                            }
                        }
                        fileImageUrl = PageUtils.Combine(directoryUrl, fileInfo.Name);
                        image.Dispose();
                    }
                    catch
                    {
                        fileImageUrl = SiteServerAssets.GetFileSystemIconUrl(fileSystemType, true);
                    }
                }
                else
                {
                    fileImageUrl = SiteServerAssets.GetFileSystemIconUrl(fileSystemType, true);
                }

                builder.Append($@"
<td>
		<table cellspacing=""0"" cellpadding=""0"" border=""0"" align=""center"">
			<tr>
				<td style=""height:100px; width:100px; text-align:center; vertical-align:middle;"">
					<table cellspacing=""0"" cellpadding=""0"" border=""0"" align=""center"">
						<tr>
							<td background=""{backgroundImageUrl}"" style=""background-repeat:no-repeat; background-position:center;height:96px; width:96px; text-align:center; vertical-align:middle;"" align=""center""><a href=""javascript:;"" onclick=""{showPopWinString}"" target=""_blank""><img src=""{fileImageUrl}"" {imageStyleAttributes} border=0 /></a></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td style=""height:20px; width:100%; text-align:center; vertical-align:middle;""><a href=""{linkUrl}"" target=""_blank"">{StringUtils
                    .MaxLengthText(fileInfo.Name, 7)}</a> <input type=""checkbox"" name=""FileNameCollection"" value=""{fileInfo
                    .Name}"" /></td>
			</tr>
		</table>
	</td>
");

                if (mod % 5 == 4)
                {
                    builder.Append("</tr>");
                }
                mod++;
            }

            builder.Append("</table>");
            ltlFileSystems.Text = builder.ToString();
        }