protected void CheckPermissions() { security_data = this.m_refContentApi.LoadPermissions(this.content_id, "content", 0); switch (base.m_sPageAction) { case "edit": if (security_data.CanEdit == true) { // we are good } else { throw (new Exception("You do not have permissions to edit.")); } break; default: // "view" if (security_data.IsReadOnly == true) { // we are good } else { throw (new Exception("You do not have permissions to view.")); } break; } }
public void ShouldGetScopesFromClaimsIfNoScopeFinderProvided(string[] userScopes, bool shouldSucceed) { var permissionData = new PermissionData() { Scopes = new List <PermissionScopeData>() { new PermissionScopeData() { Scope = "Calendar.Write" }, new PermissionScopeData() { Scope = "User.Write" } } }; var requirement = new ODataAuthorizationScopesRequirement(permissionData); var context = CreateAuthContext("Scope", new[] { requirement }, userScopes); var handler = new ODataAuthorizationHandler(); handler.HandleAsync(context).Wait(); Assert.Equal(shouldSucceed, context.HasSucceeded); }
private void ResetModels() { settings = SettingsMethods.ReadConfig(); RolePositionPair = settings.RolePositionsDictionary; for (int i = 0; i < blockACheckedListBox.Items.Count; i++) { blockACheckedListBox.SetItemChecked(i, false); } RolePermissionPair = new Dictionary <Guid, List <Guid> >(); dbRolePermissionPair = new Dictionary <Guid, List <Guid> >(); using (PermissionData data = new PermissionData(settings.ConnectionString)) { foreach (RoleModel role in Roles) { List <PermissionModel> rolePermissionRetrieved = data.GetPermissionListByRoleGuid(role.ID); foreach (PermissionModel perm in rolePermissionRetrieved) { dbRolePermissionPair.AddWithKey(role.ID, perm.ID); } } } foreach (KeyValuePair <Guid, List <Guid> > item in dbRolePermissionPair) { foreach (Guid value in item.Value) { RolePermissionPair.AddWithKey(item.Key, value); } } blockAListBox.SelectedIndex = -1; blockACheckedListBox.SelectedIndex = -1; }
/// <summary> /// 更新菜单权限 /// </summary> /// <param name="moduleId"></param> /// <param name="moduleData"></param> /// <returns></returns> public async Task <OutputDto> UpdatePermissionAsync(Guid permissionId, PermissionData permissionData) { var permission = ConvertToModel <PermissionData, PermissionType>(permissionData); permission.Id = permissionId; return(await _permissionRepository.UpdateAsync(permission)); }
public void Display_Edit() { ContentData content_data; m_reftask = m_reftask.GetTaskByID(m_iID); content_data = m_refContentApi.GetContentById(m_iPostID, 0); security_data = m_refContentApi.LoadPermissions(m_iPostID, "content", 0); if (this.m_iPostID != 0 && this.m_iPostID != -1) { ltr_post_data.Text = "(" + this.m_iPostID.ToString() + ") " + content_data.Title; } base.SetTitleBarToMessage("lbl edit comment"); base.AddBackButton((string)("../content.aspx?action=ViewContentByCategory&id=" + content_data.FolderId.ToString() + "&ContType=" + Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments + "&LangType=" + m_refContentApi.ContentLanguage + "&contentid=" + m_iPostID.ToString())); base.AddButtonwithMessages(m_refContentApi.AppPath + "images/UI/Icons/save.png", "#", "alt save comment", "btn save", "OnClick=\"javascript:SubmitForm();return false;\"", StyleHelper.SaveButtonCssClass, true); base.AddHelpButton("EditComment"); SetLabels(); if (m_reftask.State == EkEnumeration.TaskState.Pending.GetHashCode().ToString()) { rb_pending.Checked = true; } else if (m_reftask.State == EkEnumeration.TaskState.Completed.GetHashCode().ToString()) { rb_approved.Checked = true; } txt_displayname.Text = m_reftask.CommentDisplayName; txt_email.Text = m_reftask.CommentEmail; txt_url.Text = m_reftask.CommentURI; txt_comment.Text = m_reftask.Description; RenderJS(); }
public Permission(PermissionData data) : base(data.DateCreated, data.DateUpdated, data.DateEnabled, data.DateDeleted) { PermissionId = new PermissionId(data.Id); AppId = new AppId(data.AppId); Name = data.Name; Description = data.Description; }
public async Task <PermissionDto> CreateAsync(CreatePermissionDto data) { PermissionData permissionData = new PermissionData( GuidGenerator.Create(), data.Name, data.Permission, data.ParentId); var result = await _permissionRepository.InsertAsync(permissionData); return(ObjectMapper.Map <PermissionData, PermissionDto>(result)); }
private List <string> GetPermissionsFromRolePermissions(List <RelationRolePermissionData> rolePermissions) { List <string> permissions = new List <string>(); foreach (RelationRolePermissionData relation in rolePermissions) { PermissionData permission = PermissionRepository.GetDataById(relation.PermissionId); permissions.Add(permission.CodePermission); } return(permissions); }
public void SetDataAsync(string storageName, PermissionData permissionData) { using (var db = new SQLiteConnection(databasePath)) { db.InsertOrReplace(new Permissions { Username = storageName, Group = permissionData.Group, BanReason = permissionData.BanReason, BanTimeout = permissionData.BanTimeout.Ticks }); } }
public List <string> GetUserPermissions(string username) { List <string> userPermissionsCodes = new List <string>(); UserData user = UserRepository.GetUserByUsername(username); List <RelationUserPermissionData> relationUserPermissions = RelationUserPermissionRepository.GetRelationUserPermissionFor(user.Id); foreach (RelationUserPermissionData relationUserPermission in relationUserPermissions) { PermissionData permission = PermissionRepository.GetDataById(relationUserPermission.PermissionId); userPermissionsCodes.Add(permission.CodePermission); } return(userPermissionsCodes); }
/// <summary> /// 新增权限 /// </summary> /// <param name="moduleData"></param> /// <returns></returns> public async Task <OutputDto> AddPermissionAsync(PermissionData permissionData) { if (permissionData == null) { throw new OneZeroException("角色信息不能为空", ResponseCode.ExpectedException); } if (await _permissionRepository.CheckUniqueAsync(v => v.Name.Equals(permissionData.Name))) { throw new OneZeroException("已存在相同Code的权限,请修改后重试!", ResponseCode.ExpectedException); } return(await _permissionRepository.AddAsync(permissionData, null, v => ConvertToModel <PermissionData, PermissionType>(permissionData))); }
public PermissionViewModel Get(int?permissionId) { var viewModel = new PermissionViewModel(); if (permissionId.HasValue) { PermissionData domainModel = PermissionRepository.GetDataById(permissionId.Value); PermissionViewModelBuilder builder = BuilderResolverService.Get <PermissionViewModelBuilder, PermissionData>(domainModel); Constructor.ConstructViewModelData(builder); viewModel = builder.GetViewModel(); } return(viewModel); }
protected void InitializePermissionSelected() { _initializePermissionSelected = true; // 如果当前角色为空,则默认不选择 if (UnselectAll()) { foreach (var permissionTreeViewModel in PermissionTreeViewModels) { permissionTreeViewModel.IsSelected = false; } } // 如果是管理员角色,默认全选 else if (SelectAll()) { foreach (var permissionTreeViewModel in PermissionTreeViewModels) { permissionTreeViewModel.IsSelected = true; } } else // 根据当前角色拥有的权限进行处理 { // 获取当前角色的权限 // 将递归转换成非递归,来设置子节点的选中情况 var permissionViewModels = new List <PermissionTreeViewModel>(); permissionViewModels.AddRange(PermissionTreeViewModels.ToArray()); PermissionTreeViewModel current = null; PermissionData permissionDefinition = null; while (permissionViewModels.Count > 0) // 如果列表不为空,继续初始化 { current = permissionViewModels[0]; permissionViewModels.RemoveAt(0); permissionViewModels.AddRange(current.Children); // 如果当前节点对应于PermissionData,则设置选中状态 if (current.Tag != null && !(current.Tag is PermissionGroupData)) { permissionDefinition = current.Tag as PermissionData; // 选中状态由数据库是否存在当前权限为准 current.IsSelected = IsSelected(permissionDefinition); // 监听当前叶子节点的选择变更事件,并自动同步数据库 current.PropertyChanged -= PermissionTreeViewModelPropertyChanged; current.PropertyChanged += PermissionTreeViewModelPropertyChanged; } } } _initializePermissionSelected = false; }
public ActionResult Edit(int id) { try { PermissionDataRepository ml = new PermissionDataRepository(); PermissionData obj = ml.GetPermissionData(id); return(View(obj)); } catch (Exception ex) { return(Content(ContentIcon.Error + "|" + ErrorWirter(RouteData, ex.Message))); } }
protected override bool IsSelected(PermissionData permissionDefinition) { bool include = _includePermissions.Exists(p => p.BundleSymbolicName.Equals(permissionDefinition.Owner.SymbolicName) && p.Id.Equals(permissionDefinition.Id)); if (include) { return(true); } bool exclude = _excludePermissions.Exists(p => p.BundleSymbolicName.Equals(permissionDefinition.Owner.SymbolicName) && p.Id.Equals(permissionDefinition.Id)); if (exclude) { return(false); } return(_rolePermissions.Exists(p => p.BundleSymbolicName.Equals(permissionDefinition.Owner.SymbolicName) && p.Id.Equals(permissionDefinition.Id))); }
public static void ResetPermissionCache(List <Permission> permission = null, List <UserRole> userrole = null, List <RolePermission> rolepermission = null) { if (_permissionData == null) { _permissionData = new PermissionData(); } if (_permissionData.Permissions == null) { _permissionData.Permissions = permission.Where(a => a.IsDeleted != 1).ToList(); } if (_permissionData.UserRoles == null) { _permissionData.UserRoles = userrole; } if (_permissionData.RolePermissions == null) { _permissionData.RolePermissions = rolepermission; } }
public ActionResult Create([Bind(Include = "PermissionName" )] Permission Permission) { if (ModelState.IsValid) { bool bSucess = false; bSucess = PermissionData.Add(Permission); if (bSucess == true) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Can Not Insert"); } } return(View(Permission)); }
public ActionResult DeleteConfirmed( Int32?PermissionID ) { Permission Permission = new Permission(); Permission.PermissionID = System.Convert.ToInt32(PermissionID); Permission = PermissionData.Select_Record(Permission); bool bSucess = false; bSucess = PermissionData.Delete(Permission); if (bSucess == true) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Can Not Delete"); } return(null); }
private void Buid(int groupId) { using (var dbContext = new DatabaseModel.whitmanenterprisewarehouseEntities()) { var groupPermissions = dbContext.vincontrolgrouppermissions .Select(gp => new { gp.vincontrolgroup.groupid, gp.vincontrolpermissioncode.permissioncode, gp.vincontrolpermissionvalue.permissionvalue }) .Where(gp => gp.groupid == groupId); foreach (var g in groupPermissions) { if (!PermissionData.ContainsKey(g.permissioncode) && g.permissionvalue != NO_ACCESS) { PermissionData.Add(g.permissioncode, g.permissionvalue); } else if (PermissionData.ContainsKey(g.permissioncode) && PermissionData[g.permissioncode] != ALL_ACCESS) { PermissionData[g.permissioncode] = g.permissionvalue; } } } }
public ActionResult Create(FormCollection formCollection) { try { PermissionDataRepository ml = new PermissionDataRepository(); PermissionData obj = new PermissionData() { CreateDate = DateTime.Now, CreateUserID = ID, IsDeleted = false }; UpdateModel(obj); bool result = ml.Insert(obj) > 0 ? true : false; return(result ? Content(ContentIcon.Succeed + "|操作成功|/Admin/PermissionData/Index") : Content(ContentIcon.Error + "|操作失败")); } catch (Exception ex) { return(Content(ContentIcon.Error + "|" + ErrorWirter(RouteData, ex.Message))); } }
private void UpdateSource() { using RoleData roleData = new RoleData(settings.ConnectionString); using PositionData positionData = new PositionData(settings.ConnectionString); using PermissionData permissionData = new PermissionData(settings.ConnectionString); List <RoleModel> retrievedRoles = roleData.GetDataCollection(); retrievedRoles.ForEach(x => Roles.Add(x)); Roles.Remove(Roles.FirstOrDefault(r => r.Name.Equals("Administrator"))); Roles.Remove(Roles.FirstOrDefault(r => r.Name.Equals("nullRole"))); List <PositionModel> retrievedPositions = positionData.GetDataCollection(); retrievedPositions.ForEach(x => Positions.Add(x)); Positions.Remove(Positions.FirstOrDefault(r => r.Name.Equals("Директор"))); List <PermissionModel> retrievedPermissions = permissionData.GetDataCollection(); retrievedPermissions.ForEach(x => Permissions.Add(x)); FillListCollections(); }
public static PermissionData ToViewData(this Permission node, CategoryDictionary suffix = CategoryDictionary.None) { var model = new PermissionData() { Id = node.Id, ParentId = node.ParentId, Title = node.Title, Area = node.Area, Controller = node.Controller, Action = node.Action, Value = node.Value, HttpMethod = node.HttpMethod, Url = node.Url, IsNav = node.IsNav, Actived = node.Actived, Disabled = node.Disabled, Sort = node.Sort, Description = node.Description, CategoryID = node.CategoryID, CategoryTitle = node.CategoryTitle, Icon = node.Icon }; if ((suffix & CategoryDictionary.Children) == CategoryDictionary.Children && node.Children.Count > 0) { model.Children = node.Children.Select(x => x.ToViewData(suffix)).ToList(); } if ((suffix & CategoryDictionary.Parent) == CategoryDictionary.Parent && node.Parent != null) { model.Parent = node.Parent.ToViewData(CategoryDictionary.None); } if ((suffix & CategoryDictionary.ExtensionField) == CategoryDictionary.ExtensionField) { var ctx = new EmpContext(); model.ExtensionFields = ctx.ExtensionFields.Where(x => x.Table == "Permission" && x.JoinId == node.Id).ToViewList(); } return(model); }
// GET: /Permission/Delete/<id> public ActionResult Delete( Int32?PermissionID ) { if ( PermissionID == null ) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Permission Permission = new Permission(); Permission.PermissionID = System.Convert.ToInt32(PermissionID); Permission = PermissionData.Select_Record(Permission); if (Permission == null) { return(HttpNotFound()); } return(View(Permission)); }
public ActionResult Edit(int id, FormCollection formCollection) { try { PermissionDataRepository ml = new PermissionDataRepository(); PermissionData obj = ml.GetPermissionData(id); UpdateModel(obj); obj.LastUpdateDate = DateTime.Now; obj.LastUpdateUserID = ID; bool result = ml.Update(obj) > 0 ? true : false; return(result ? Content(ContentIcon.Succeed + "|操作成功") : Content(ContentIcon.Error + "|操作失败")); } catch (Exception ex) { return(Content(ContentIcon.Error + "|" + ErrorWirter(RouteData, ex.Message))); } }
public static Permission ToModel(this PermissionData node) { return(new Permission() { Id = node.Id, ParentId = node.ParentId, Title = node.Title, Area = node.Area, Controller = node.Controller, Action = node.Action, Value = node.Value, HttpMethod = node.HttpMethod, Url = node.Url, IsNav = node.IsNav, Actived = node.Actived, Disabled = node.Disabled, Sort = node.Sort, Description = node.Description, CategoryID = node.CategoryID, CategoryTitle = node.CategoryTitle, Icon = node.Icon }); }
public ActionResult Edit(Permission Permission) { Permission oPermission = new Permission(); oPermission.PermissionID = System.Convert.ToInt32(Permission.PermissionID); oPermission = PermissionData.Select_Record(Permission); if (ModelState.IsValid) { bool bSucess = false; bSucess = PermissionData.Update(oPermission, Permission); if (bSucess == true) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Can Not Update"); } } return(View(Permission)); }
/// <summary> /// Get GetPermissionData Array for modify permissions /// </summary> /// <returns>Return GetPermissionData array</returns> private PermissionData[] GetPermissionDataArray() { // Get PropertyValues TaggedPropertyValue taggedPropertyValue = new TaggedPropertyValue(); TaggedPropertyValue[] propertyValues = new TaggedPropertyValue[2]; // PidTagMemberId taggedPropertyValue.PropertyTag.PropertyId = this.propertyDictionary[PropertyNames.PidTagMemberId].PropertyId; taggedPropertyValue.PropertyTag.PropertyType = this.propertyDictionary[PropertyNames.PidTagMemberId].PropertyType; // Anonymous Client: The server MUST use the permissions specified in PidTagMemberRights for // any anonymous users that have not been authenticated with user credentials. taggedPropertyValue.Value = BitConverter.GetBytes(TestSuiteBase.TaggedPropertyValueForPidTagMemberId); propertyValues[0] = taggedPropertyValue; // PidTagMemberRights taggedPropertyValue = new TaggedPropertyValue { PropertyTag = { PropertyId = this.propertyDictionary[PropertyNames.PidTagMemberRights].PropertyId, PropertyType = this.propertyDictionary[PropertyNames.PidTagMemberRights].PropertyType }, Value = BitConverter.GetBytes(TestSuiteBase.TaggedPropertyValueForPidTagMemberRights) }; // CreateSubFolder propertyValues[1] = taggedPropertyValue; PermissionData[] permissionsDataArray = new PermissionData[1]; permissionsDataArray[0].PermissionDataFlags = (byte)PermissionDataFlags.ModifyRow; permissionsDataArray[0].PropertyValueCount = (ushort)propertyValues.Length; permissionsDataArray[0].PropertyValues = propertyValues; return(permissionsDataArray); }
public ActionResult Index(int?pageIndex, int?pageSize, PermissionData entity) { try { PermissionDataRepository ml = new PermissionDataRepository(); entity.IsDeleted = false; PagedList <PermissionData> page = ml.Search(entity).GetPagedList(pageIndex ?? PageIndex, pageSize ?? PageSize, Order, By); IList <PermissionData> objs = page; if (Request.IsAjaxRequest()) { return(PartialView("_Index", objs)); } return(View(objs)); } catch (Exception ex) { return(Content(ContentIcon.Error + "|" + ErrorWirter(RouteData, ex.Message))); } }
public void ShouldOnlySucceedIfUserHasAnAllowedScope(string[] userScopes, bool shouldSucceed) { var permissionData = new PermissionData() { Scopes = new List <PermissionScopeData>() { new PermissionScopeData() { Scope = "Calendar.Write" }, new PermissionScopeData() { Scope = "User.Write" } } }; var requirement = new ODataAuthorizationScopesRequirement(permissionData); var context = CreateAuthContext("Permission", new[] { requirement }, userScopes); var handler = new ODataAuthorizationHandler(FindScopes); handler.HandleAsync(context).Wait(); Assert.Equal(shouldSucceed, context.HasSucceeded); }
private void Display_ViewContent() { m_refMsg = m_refContentApi.EkMsgRef; bool bCanAlias = false; PermissionData security_task_data; StringBuilder sSummaryText; Ektron.Cms.UrlAliasing.UrlAliasManualApi m_aliasname = new Ektron.Cms.UrlAliasing.UrlAliasManualApi(); Ektron.Cms.UrlAliasing.UrlAliasAutoApi m_autoaliasApi = new Ektron.Cms.UrlAliasing.UrlAliasAutoApi(); Ektron.Cms.Common.UrlAliasManualData d_alias; System.Collections.Generic.List<Ektron.Cms.Common.UrlAliasAutoData> auto_aliaslist = new System.Collections.Generic.List<Ektron.Cms.Common.UrlAliasAutoData>(); Ektron.Cms.UrlAliasing.UrlAliasSettingsApi m_urlAliasSettings = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi(); int i; bool IsStagingServer; IsStagingServer = m_refContentApi.RequestInformationRef.IsStaging; security_task_data = m_refContentApi.LoadPermissions(m_intId, "tasks", ContentAPI.PermissionResultType.Task); security_data = m_refContentApi.LoadPermissions(m_intId, "content", ContentAPI.PermissionResultType.All); security_data.CanAddTask = security_task_data.CanAddTask; security_data.CanDestructTask = security_task_data.CanDestructTask; security_data.CanRedirectTask = security_task_data.CanRedirectTask; security_data.CanDeleteTask = security_task_data.CanDeleteTask; active_subscription_list = m_refContentApi.GetAllActiveSubscriptions(); if ("viewstaged" == m_strPageAction) { ContentStateData objContentState; objContentState = m_refContentApi.GetContentState(m_intId); if ("A" == objContentState.Status) { // Can't view staged m_strPageAction = "view"; } } try { if (m_strPageAction == "view") { content_data = m_refContentApi.GetContentById(m_intId, 0); } else if (m_strPageAction == "viewstaged") { content_data = m_refContentApi.GetContentById(m_intId, ContentAPI.ContentResultType.Staged); } } catch (Exception ex) { Response.Redirect("reterror.aspx?info=" + EkFunctions.UrlEncode(ex.Message), true); return; } if ((content_data != null) && (Ektron.Cms.Common.EkConstants.IsAssetContentType(Convert.ToInt64 (content_data.Type), Convert.ToBoolean (-1)))) { ContentPaneHeight = "700px"; } //ekrw = m_refContentApi.EkUrlRewriteRef() //ekrw.Load() if (((m_urlAliasSettings.IsManualAliasEnabled || m_urlAliasSettings.IsAutoAliasEnabled) && m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias)) && (content_data != null) && (content_data.AssetData != null) && !(Ektron.Cms.Common.EkFunctions.IsImage((string)("." + content_data.AssetData.FileExtension)))) { bCanAlias = true; } blog_post_data = new BlogPostData(); blog_post_data.Categories = (string[])Array.CreateInstance(typeof(string), 0); if (content_data.MetaData != null) { for (i = 0; i <= (content_data.MetaData.Length - 1); i++) { if ((string)(content_data.MetaData[i].TypeName.ToLower()) == "blog categories") { content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace("'", "\'"); content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace(""", "\""); content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace(">", ">"); content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace("<", "<"); blog_post_data.Categories = Strings.Split((string)(content_data.MetaData[i].Text), ";", -1, 0); } else if ((string)(content_data.MetaData[i].TypeName.ToLower()) == "blog pingback") { if (!(content_data.MetaData[i].Text.Trim().ToLower() == "no")) { m_bIsBlog = true; } blog_post_data.Pingback = Ektron.Cms.Common.EkFunctions.GetBoolFromYesNo((string)(content_data.MetaData[i].Text)); } else if ((string)(content_data.MetaData[i].TypeName.ToLower()) == "blog tags") { blog_post_data.Tags = (string)(content_data.MetaData[i].Text); } else if ((string)(content_data.MetaData[i].TypeName.ToLower()) == "blog trackback") { blog_post_data.TrackBackURL = (string)(content_data.MetaData[i].Text); } } } //THE FOLLOWING LINES ADDED DUE TO TASK //:BEGIN / PROPOSED BY PAT //TODO: Need to recheck this part of the code e.r. if (content_data == null) { if (ContentLanguage != 0) { if (ContentLanguage.ToString() != (string)(Ektron.Cms.CommonApi.GetEcmCookie()["DefaultLanguage"])) { Response.Redirect((string)(Request.ServerVariables["URL"] + "?" + Strings.Replace(Request.ServerVariables["Query_String"], (string)("LangType=" + ContentLanguage), (string)("LangType=" + m_refContentApi.DefaultContentLanguage), 1, -1, 0)), false); return; } } else { if (ContentLanguage.ToString() != (string)(Ektron.Cms.CommonApi.GetEcmCookie()["DefaultLanguage"])) { Response.Redirect((string)(Request.ServerVariables["URL"] + "?" + Request.ServerVariables["Query_String"] + "&LangType=" + m_refContentApi.DefaultContentLanguage), false); return; } } } //:END if (m_intFolderId == -1) { m_intFolderId = content_data.FolderId; } HoldMomentMsg.Text = m_refMsg.GetMessage("one moment msg"); if ((active_subscription_list == null) || (active_subscription_list.Length == 0)) { phWebAlerts.Visible = false; phWebAlerts2.Visible = false; } content_state_data = m_refContentApi.GetContentState(m_intId); jsFolderId.Text = m_intFolderId.ToString (); jsIsForm.Text = content_data.Type.ToString (); jsBackStr.Text = "back_file=content.aspx"; if (m_strPageAction.Length > 0) { jsBackStr.Text += "&back_action=" + m_strPageAction; } if (Convert.ToString(m_intFolderId).Length > 0) { jsBackStr.Text += "&back_folder_id=" + m_intFolderId; } if (Convert.ToString(m_intId).Length > 0) { jsBackStr.Text += "&back_id=" + m_intId; } if (Convert.ToString((short)ContentLanguage).Length > 0) { jsBackStr.Text += "&back_LangType=" + ContentLanguage; } jsToolId.Text = m_intId.ToString (); jsToolAction.Text = m_strPageAction; jsLangId.Text = m_refContentApi.ContentLanguage.ToString (); if (content_data.Type == 3333) { ViewCatalogToolBar(); } else { ViewToolBar(); } if (bCanAlias && content_data.SubType != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) //And folder_data.FolderType <> 1 Don't Show alias tab for Blogs. { string m_strAliasPageName = ""; d_alias = m_aliasname.GetDefaultAlias(content_data.Id); if (d_alias.QueryString != "") { m_strAliasPageName = d_alias.AliasName + d_alias.FileExtension + d_alias.QueryString; //content_data.ManualAlias } else { m_strAliasPageName = d_alias.AliasName + d_alias.FileExtension; //content_data.ManualAlias } if (m_strAliasPageName != "") { if (IsStagingServer && folder_data.DomainStaging != string.Empty) { m_strAliasPageName = (string)("http://" + folder_data.DomainStaging + "/" + m_strAliasPageName); } else if (folder_data.IsDomainFolder) { m_strAliasPageName = (string)("http://" + folder_data.DomainProduction + "/" + m_strAliasPageName); } else { m_strAliasPageName = SitePath + m_strAliasPageName; } m_strAliasPageName = "<a href=\"" + m_strAliasPageName + "\" target=\"_blank\" >" + m_strAliasPageName + "</a>"; } else { m_strAliasPageName = " [Not Defined]"; } tdAliasPageName.InnerHtml = m_strAliasPageName; } else { phAliases.Visible = false; phAliases2.Visible = false; } auto_aliaslist = m_autoaliasApi.GetListForContent(content_data.Id); autoAliasList.InnerHtml = "<div class=\"ektronHeader\">" + m_refMsg.GetMessage("lbl automatic") + "</div>"; autoAliasList.InnerHtml += "<div class=\"ektronBorder\">"; autoAliasList.InnerHtml += "<table width=\"100%\">"; autoAliasList.InnerHtml += "<tr class=\"title-header\">"; autoAliasList.InnerHtml += "<th>" + m_refMsg.GetMessage("generic type") + "</th>"; autoAliasList.InnerHtml += "<th>" + m_refMsg.GetMessage("lbl alias name") + "</th>"; autoAliasList.InnerHtml += "</tr>"; for (i = 0; i <= auto_aliaslist.Count() - 1; i++) { autoAliasList.InnerHtml += "<tr class=\"row\">"; if (auto_aliaslist[i].AutoAliasType == Ektron.Cms.Common.EkEnumeration.AutoAliasType.Folder) { autoAliasList.InnerHtml += "<td><img src =\"" + m_refContentApi.AppPath + "images/UI/Icons/folder.png\" alt=\"" + m_refContentApi.EkMsgRef.GetMessage("lbl folder") + "\" title=\"" + m_refContentApi.EkMsgRef.GetMessage("lbl folder") + "\"/ ></td>"; } else { autoAliasList.InnerHtml += "<td><img src =\"" + m_refContentApi.AppPath + "images/UI/Icons/taxonomy.png\" alt=\"" + m_refContentApi.EkMsgRef.GetMessage("generic taxonomy lbl") + "\" title=\"" + m_refContentApi.EkMsgRef.GetMessage("generic taxonomy lbl") + "\"/ ></td>"; } if (IsStagingServer && folder_data.DomainStaging != string.Empty) { autoAliasList.InnerHtml = autoAliasList.InnerHtml + "<td> <a href = \"http://" + folder_data.DomainStaging + "/" + auto_aliaslist[i].AliasName + "\" target=\"_blank\" >" + auto_aliaslist[i].AliasName + " </a></td></tr>"; } else if (folder_data.IsDomainFolder) { autoAliasList.InnerHtml += "<td> <a href = \"http://" + folder_data.DomainProduction + "/" + auto_aliaslist[i].AliasName + "\" target=\"_blank\" >" + auto_aliaslist[i].AliasName + " </a></td>"; } else { autoAliasList.InnerHtml += "<td> <a href = \"" + SitePath + auto_aliaslist[i].AliasName + "\" target=\"_blank\" >" + auto_aliaslist[i].AliasName + " </a></td>"; } autoAliasList.InnerHtml += "</tr>"; } autoAliasList.InnerHtml += "</table>"; autoAliasList.InnerHtml += "</div>"; if (content_data == null) { content_data = m_refContentApi.GetContentById(m_intId, 0); } if (content_data.Type == 3333) { m_refCatalog = new CatalogEntry(m_refContentApi.RequestInformationRef); m_refCurrency = new Currency(m_refContentApi.RequestInformationRef); //m_refMedia = MediaData() entry_edit_data = m_refCatalog.GetItemEdit(m_intId, ContentLanguage, false); Ektron.Cms.Commerce.ProductType m_refProductType = new Ektron.Cms.Commerce.ProductType(m_refContentApi.RequestInformationRef); prod_type_data = m_refProductType.GetItem(entry_edit_data.ProductType.Id, true); if (prod_type_data.Attributes.Count == 0) { phAttributes.Visible = false; phAttributes2.Visible = false; } Display_PropertiesTab(content_data); Display_PricingTab(); Display_ItemTab(); Display_MetadataTab(); Display_MediaTab(); } else { ViewContentProperties(content_data); phCommerce.Visible = false; phCommerce2.Visible = false; phItems.Visible = false; } bool bPackageDisplayXSLT = false; string CurrentXslt = ""; int XsltPntr; if ((!(content_data.XmlConfiguration == null)) && (content_data.Type == Ektron.Cms.Common.EkConstants.CMSContentType_CatalogEntry || content_data.Type == Ektron.Cms.Common.EkConstants.CMSContentType_Content || content_data.Type == Ektron.Cms.Common.EkConstants.CMSContentType_Forms)) { if (!(content_data.XmlConfiguration == null)) { if (content_data.XmlConfiguration.DefaultXslt.Length > 0) { if (content_data.XmlConfiguration.DefaultXslt == "0") { bPackageDisplayXSLT = true; } else { bPackageDisplayXSLT = false; } if (!bPackageDisplayXSLT) { XsltPntr = int.Parse(content_data.XmlConfiguration.DefaultXslt); if (XsltPntr > 0) { Collection tmpXsltColl = (Collection)content_data.XmlConfiguration.PhysPathComplete; if (tmpXsltColl["Xslt" + XsltPntr] != null) { CurrentXslt = (string)(tmpXsltColl["Xslt" + XsltPntr]); } else { tmpXsltColl = (Collection)content_data.XmlConfiguration.LogicalPathComplete; CurrentXslt = (string)(tmpXsltColl["Xslt" + XsltPntr]); } } } } else { bPackageDisplayXSLT = true; } //End If Ektron.Cms.Xslt.ArgumentList objXsltArgs = new Ektron.Cms.Xslt.ArgumentList(); objXsltArgs.AddParam("mode", string.Empty, "preview"); if (bPackageDisplayXSLT) { divContentHtml.InnerHtml = m_refContentApi.XSLTransform(content_data.Html, content_data.XmlConfiguration.PackageDisplayXslt, false, false, objXsltArgs, true, true); } else { // CurrentXslt is always obtained from the object in the database. divContentHtml.InnerHtml = m_refContentApi.XSLTransform(content_data.Html, CurrentXslt, true, false, objXsltArgs, true, true); } } else { divContentHtml.InnerHtml = content_data.Html; } } else { if (content_data.Type == 104) { media_html.Value = content_data.MediaText; //Get Url from content string tPath = m_refContentApi.RequestInformationRef.AssetPath + m_refContentApi.EkContentRef.GetFolderParentFolderIdRecursive(content_data.FolderId).Replace(",", "/") + "/" + content_data.AssetData.Id + "." + content_data.AssetData.FileExtension; string mediaHTML = FixPath(content_data.Html, tPath); int scriptStartPtr = 0; int scriptEndPtr = 0; int len = 0; //Registering the javascript & CSS this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "linkReg", "<link href=\"" + m_refContentApi.ApplicationPath + "csslib/EktTabs.css\" rel=\"stylesheet\" type=\"text/css\" />", false); mediaHTML = mediaHTML.Replace("<link href=\"" + m_refContentApi.ApplicationPath + "csslib/EktTabs.css\" rel=\"stylesheet\" type=\"text/css\" />", ""); while (1 == 1) { scriptStartPtr = mediaHTML.IndexOf("<script", scriptStartPtr); scriptEndPtr = mediaHTML.IndexOf("</script>", scriptEndPtr); if (scriptStartPtr == -1 || scriptEndPtr == -1) { break; } len = scriptEndPtr - scriptStartPtr + 9; this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), (string)("scriptreg" + scriptEndPtr), mediaHTML.Substring(scriptStartPtr, len), false); mediaHTML = mediaHTML.Replace(mediaHTML.Substring(scriptStartPtr, len), ""); scriptStartPtr = 0; scriptEndPtr = 0; } media_display_html.Value = mediaHTML; divContentHtml.InnerHtml = "<a href=\"#\" onclick=\"document.getElementById(\'" + divContentHtml.ClientID + "\').innerHTML = document.getElementById(\'" + media_display_html.ClientID + "\').value;return false;\" alt=\"" + m_refMsg.GetMessage("alt show media content") + "\" title=\"" + m_refMsg.GetMessage("alt show media content") + "\">" + m_refMsg.GetMessage("lbl show media content") + "<br/><img align=\"middle\" src=\"" + m_refContentApi.AppPath + "images/filmstrip_ph.jpg\" /></a>"; } else { if (Ektron.Cms.Common.EkConstants.IsAssetContentType(content_data.Type, Convert .ToBoolean (-1))) { string ver = ""; ver = (string)("&version=" + content_data.AssetData.Version); if (IsImage(content_data.AssetData.Version)) { divContentHtml.InnerHtml = "<img src=\"" + m_refContentApi.SitePath + "assetmanagement/DownloadAsset.aspx?ID=" + content_data.AssetData.Id + ver + "\" />"; } else { divContentHtml.InnerHtml = "<div align=\"center\" style=\"padding:15px;\"><a style=\"text-decoration:none;\" href=\"#\" onclick=\"javascript:window.open(\'" + m_refContentApi.SitePath + "assetmanagement/DownloadAsset.aspx?ID=" + content_data.AssetData.Id + ver + "\',\'DownloadAsset\',\'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=1000,height=800\');return false;\"><img align=\"middle\" src=\"" + m_refContentApi.AppPath + "images/application/download.gif\" />" + m_refMsg.GetMessage("btn download") + " "" + content_data.Title + ""</a></div>"; } } else if (content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) { Ektron.Cms.API.UrlAliasing.UrlAliasCommon u = new Ektron.Cms.API.UrlAliasing.UrlAliasCommon(); FolderData fd = this.m_refContentApi.GetFolderById(content_data.FolderId); string stralias = u.GetAliasForContent(content_data.Id); if (stralias == string.Empty || fd.IsDomainFolder) { stralias = content_data.Quicklink; } string link = ""; if (content_data.ContType == (int)EkEnumeration.CMSContentType.Content || (content_data.ContType == (int)EkEnumeration.CMSContentType.Archive_Content && content_data.EndDateAction != 1)) { string url = this.m_refContent.RequestInformation.SitePath + stralias; if (url.Contains("?")) { url += "&"; } else { url += "?"; } if ("viewstaged" == m_strPageAction) { url += "view=staged"; } else { url += "view=published"; } url += (string)("&LangType=" + content_data.LanguageId.ToString()); link = "<a href=\"" + url + "\" onclick=\"window.open(this.href);return false;\">Click here to view the page</a><br/><br/>"; } divContentHtml.InnerHtml = link + Ektron.Cms.PageBuilder.PageData.RendertoString(content_data.Html); } else { if ((int)Ektron.Cms.Common.EkEnumeration.CMSContentType.Forms == content_data.Type || (int)Ektron.Cms.Common.EkEnumeration.CMSContentType.Archive_Forms == content_data.Type) { divContentHtml.InnerHtml = content_data.Html.Replace("[srcpath]", m_refContentApi.ApplicationPath + m_refContentApi.AppeWebPath); divContentHtml.InnerHtml = divContentHtml.InnerHtml.Replace("[skinpath]", m_refContentApi.ApplicationPath + "csslib/ContentDesigner/"); } else { divContentHtml.InnerHtml = content_data.Html; } if (m_bIsBlog) { Collection blogData = m_refContentApi.EkContentRef.GetBlogData(content_data.FolderId); if (blogData != null) { if (blogData["enablecomments"].ToString() != string.Empty) { litBlogComment.Text = "<div class=\"ektronTopSpace\"></div><a class=\"button buttonInline greenHover buttonNoIcon\" href=\"" + m_refContentApi.AppPath + "content.aspx?id=" + content_data.FolderId + "&action=ViewContentByCategory&LangType=" + content_data.LanguageId + "&ContType=" + Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments + "&contentid=" + content_data.Id + "&viewin=" + content_data.LanguageId + "\" title=\"" + m_refMsg.GetMessage("alt view comments label") + "\">" + m_refMsg.GetMessage("view comments") + "</a>"; litBlogComment.Visible = true; } } } } } } sSummaryText = new StringBuilder(); if ((int)Ektron.Cms.Common.EkEnumeration.CMSContentType.Forms == content_data.Type || (int)Ektron.Cms.Common.EkEnumeration.CMSContentType.Archive_Forms == content_data.Type) { if (content_data.Teaser != null) { if (content_data.Teaser.IndexOf("<ektdesignpackage_design") > -1) { string strDesign; strDesign = m_refContentApi.XSLTransform(null, null, true, false, null, true); tdsummarytext.InnerHtml = strDesign; } else { tdsummarytext.InnerHtml = content_data.Teaser; } } else { tdsummarytext.InnerHtml = ""; } } else { if (m_bIsBlog) { sSummaryText.AppendLine("<table class=\"ektronGrid\">"); sSummaryText.AppendLine(" <tr>"); sSummaryText.AppendLine(" <td valign=\"top\" class=\"label\">"); sSummaryText.AppendLine(" " + m_refMsg.GetMessage("generic description") + ""); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" <td valign=\"top\">"); } sSummaryText.AppendLine(content_data.Teaser); if (m_bIsBlog) { sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" </tr>"); sSummaryText.AppendLine(" <tr>"); sSummaryText.AppendLine(" <td valign=\"top\" class=\"label\">"); sSummaryText.AppendLine(" " + m_refMsg.GetMessage("lbl blog cat") + ""); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" <td>"); if (!(blog_post_data.Categories == null)) { arrBlogPostCategories = blog_post_data.Categories; if (arrBlogPostCategories.Length > 0) { Array.Sort(arrBlogPostCategories); } } else { arrBlogPostCategories = null; } if (blog_post_data.Categories.Length > 0) { for (i = 0; i <= (blog_post_data.Categories.Length - 1); i++) { if (blog_post_data.Categories[i].ToString() != "") { sSummaryText.AppendLine(" <input type=\"checkbox\" name=\"blogcategories" + i.ToString() + "\" value=\"" + blog_post_data.Categories[i].ToString() + "\" checked=\"true\" disabled> " + Strings.Replace((string)(blog_post_data.Categories[i].ToString()), "~@~@~", ";", 1, -1, 0) + "<br />"); } } } else { sSummaryText.AppendLine("No categories defined."); } sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" </tr>"); sSummaryText.AppendLine(" <tr>"); sSummaryText.AppendLine(" <td class=\"label\" valign=\"top\">"); sSummaryText.AppendLine(" " + m_refMsg.GetMessage("lbl personal tags") + ""); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" <td>"); if (!(blog_post_data == null)) { sSummaryText.AppendLine(blog_post_data.Tags); } sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" </tr>"); sSummaryText.AppendLine(" <tr>"); sSummaryText.AppendLine(" <td class=\"label\">"); if (!(blog_post_data == null)) { sSummaryText.AppendLine(" <input type=\"hidden\" name=\"blogposttrackbackid\" id=\"blogposttrackbackid\" value=\"" + blog_post_data.TrackBackURLID.ToString() + "\" />"); sSummaryText.AppendLine(" <input type=\"hidden\" id=\"isblogpost\" name=\"isblogpost\" value=\"true\"/>" + m_refMsg.GetMessage("lbl trackback url") + ""); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" <td>"); sSummaryText.AppendLine("<input type=\"text\" size=\"75\" id=\"trackback\" name=\"trackback\" value=\"" + EkFunctions.HtmlEncode(blog_post_data.TrackBackURL) + "\" disabled/>"); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" </tr>"); sSummaryText.AppendLine(" <tr>"); sSummaryText.AppendLine(" <td class=\"label\">"); if (blog_post_data.Pingback == true) { sSummaryText.AppendLine("" + m_refMsg.GetMessage("lbl blog ae ping") + ""); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" <td>"); sSummaryText.AppendLine(" <input type=\"checkbox\" name=\"pingback\" id=\"pingback\" checked disabled/>"); } else { sSummaryText.AppendLine("" + m_refMsg.GetMessage("lbl blog ae ping") + ""); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" <td>"); sSummaryText.AppendLine(" <input type=\"checkbox\" name=\"pingback\" id=\"pingback\" disabled/>"); } } else { sSummaryText.AppendLine(" <input type=\"hidden\" name=\"blogposttrackbackid\" id=\"blogposttrackbackid\" value=\"\" />"); sSummaryText.AppendLine(" <input type=\"hidden\" id=\"isblogpost\" name=\"isblogpost\" value=\"true\"/>" + m_refMsg.GetMessage("lbl trackback url") + ""); sSummaryText.AppendLine("<input type=\"text\" size=\"75\" id=\"trackback\" name=\"trackback\" value=\"\" disabled/>"); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" </tr>"); sSummaryText.AppendLine(" <tr>"); sSummaryText.AppendLine(" <td class=\"label\">" + m_refMsg.GetMessage("lbl blog ae ping") + ""); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" <td>"); sSummaryText.AppendLine(" <input type=\"checkbox\" name=\"pingback\" id=\"pingback\" disabled/>"); } sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" </tr>"); sSummaryText.AppendLine("</table>"); } tdsummarytext.InnerHtml = sSummaryText.ToString(); } ViewMetaData(content_data); tdcommenttext.InnerHtml = content_data.Comment; AddTaskTypeDropDown(); ViewTasks(); ViewSubscriptions(); Ektron.Cms.Content.EkContent cref; cref = m_refContentApi.EkContentRef; TaxonomyBaseData[] dat; dat = cref.GetAllFolderTaxonomy(folder_data.Id); if (dat == null || dat.Length == 0) { phCategories.Visible = false; phCategories2.Visible = false; } ViewAssignedTaxonomy(); if ((content_data != null) && ((content_data.Type >= EkConstants.ManagedAsset_Min && content_data.Type <= EkConstants.ManagedAsset_Max && content_data.Type != 104) || (content_data.Type >= EkConstants.Archive_ManagedAsset_Min && content_data.Type <= EkConstants.Archive_ManagedAsset_Max && content_data.Type != 1104) || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData)) { showAlert = false; } if ( (Request.QueryString["menuItemType"] != null && Request.QueryString["menuItemType"].ToLower() == "viewproperties") || (Request.QueryString["tab"] != null && Request.QueryString["tab"].ToLower() == "properties") ) { DefaultTab.Value = "dvProperties"; Util_ReloadTree(content_data.Path, content_data.FolderId); } }
private void Display_EditApprovals() { _PermissionData = _ContentApi.LoadPermissions(_Id, _ItemType, 0); int m_intApprovalMethoad = 0; if (_ItemType == "folder") { _FolderData = _ContentApi.GetFolderById(_Id); m_intApprovalMethoad = _FolderData.ApprovalMethod; } else { _ContentData = _ContentApi.GetContentById(_Id, 0); m_intApprovalMethoad = _ContentData.ApprovalMethod; } EditApprovalsToolBar(); rblApprovalMethod.Items.Add(new ListItem(_MessageHelper.GetMessage("force all approvers with description"), "1")); rblApprovalMethod.Items.Add(new ListItem(_MessageHelper.GetMessage("do not force all approvers with description"), "0")); if (m_intApprovalMethoad == 1) { rblApprovalMethod.Items[0].Selected = true; } else { rblApprovalMethod.Items[1].Selected = true; } }
private void Page_Load(System.Object sender, System.EventArgs e) { //Make sure the user is logged in. If not forward user to login page. if ((m_refContentApi.EkContentRef).IsAllowed(0, 0, "users", "IsLoggedIn", m_refContentApi.UserId) == false) { string strUrl; Session["RedirectLnk"] = Request.Url.AbsoluteUri; strUrl = "login.aspx?fromLnkPg=1"; this.Response.ContentType = ""; this.Response.Redirect(strUrl, true); } //Put user code to initialize the page here int ContentLanguage = m_refContentApi.ContentLanguage; if (!(Request.QueryString["LangType"] == null)) { if (Request.QueryString["LangType"] != "") { ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); } else { if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "") { ContentLanguage = Convert.ToInt32(m_refContentApi.GetCookieValue("LastValidLanguageID")); } } } else { if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "") { ContentLanguage = Convert.ToInt32(m_refContentApi.GetCookieValue("LastValidLanguageID")); } } if (ContentLanguage == (int)Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED) { m_refContentApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES; } else { m_refContentApi.ContentLanguage = ContentLanguage; } if (!(Request.QueryString["fieldname"] == null)) { FieldName = Request.QueryString["fieldname"]; } QueryLang = ContentLanguage.ToString(); if (!(Request.QueryString["qlang"] == null)) { QueryLang = Request.QueryString["qlang"]; } if (!String.IsNullOrEmpty(Request["form_id"])) { FormId = Convert.ToInt64(Request["form_id"]); } StartDate = Request["start_date"]; EndDate = Request["end_date"]; Flag = Request["flag"]; DataType = Request["data_type"]; ResultType = Request["result_type"]; CurrentUserId = m_refContentApi.UserId; DisplayType = Request["display_type"]; FormTitle = Request["form_title"]; m_refMsg = m_refContentApi.EkMsgRef; Security_info = m_refContentApi.LoadPermissions(FormId, "content", 0); Response.AddHeader("content-disposition", "attachment; filename=Form_Data_Export.xls"); objForm = m_refContentApi.EkModuleRef; gtForms = objForm.GetAllFormInfo(); Collection objFormData = new Collection(); Collection cDatas; objFormData.Add(FormId, "FORM_ID", null, null); objFormData.Add(CurrentUserId, "USER_ID", null, null); objFormData.Add(StartDate, "START_DATE", null, null); objFormData.Add(EndDate, "END_DATE", null, null); objFormData.Add(QueryLang, "Query_Language", null, null); objFormData.Add(FieldName, "Field_Name", null, null); cDatas = objForm.GetAllFormData(objFormData); if (cDatas.Count == 0) { FormResult.Text = "<table><tr><td>" + m_refMsg.GetMessage("msg no data report") + "</td></tr></table>"; return; } if (Information.IsNumeric(DisplayType)) { //The following lines of code are extracted from dotnetjohn.com on "Export DataSets to Excel" //http://www.dotnetjohn.com/articles.aspx?articleid=36 //first let's clean up the response.object Response.Clear(); Response.Charset = ""; //set the response mime type for excel Response.ContentType = "application/vnd.ms-excel"; //create a string writer System.IO.StringWriter stringWrite = new System.IO.StringWriter(); //create an htmltextwriter which uses the stringwriter System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite); //instantiate a datagrid DataGrid dg = new DataGrid(); //set the datagrid datasource to the dataset passed in dg.DataSource = objForm.GetAllFormRawData(objFormData).Tables[0]; //bind the datagrid dg.DataBind(); //tell the datagrid to render itself to our htmltextwriter dg.RenderControl(htmlWrite); //all that's left is to output the html Response.Write(stringWrite.ToString()); Response.End(); } else { FormResult.Text = LoadResult(objFormData, cDatas); } }
private void Page_Load(System.Object sender, System.EventArgs e) { //Dim FormFieldStats As Collection Collection FormStats = new Collection(); //Dim item As Collection string Target; Response.CacheControl = "no-cache"; Response.AddHeader("Pragma", "no-cache"); Response.Expires = -1; StyleSheetJS.Text = m_refStyle.GetClientScript(); //Put user code to initialize the page here ContentLanguage = m_refContentApi.ContentLanguage; AppImgPath = m_refContentApi.AppImgPath; FormId = Convert.ToInt64(Request.QueryString["id"]); DisplayType = Request.QueryString["display_type"]; Target = Request.QueryString["display_target"]; if (Request.QueryString["LangType"] != "") { ContentLanguage = Convert.ToInt32( Request.QueryString["LangType"]); m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); } else { if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "") { ContentLanguage = int.Parse(m_refContentApi.GetCookieValue("LastValidLanguageID")); } } EnableMultilingual = m_refContentApi.EnableMultilingual; m_refContentApi.ContentLanguage = ContentLanguage; Security_info = m_refContentApi.LoadPermissions(FormId, "content", 0); objForm = m_refContentApi.EkModuleRef; if ((Convert.ToString(FormId) != "") && (FormId > 0)) { DefaultFormTitle = objForm.GetFormTitleById(FormId); } else { DefaultFormTitle = Request.QueryString["FormTitle"]; } int i; string strFieldNames = ""; string strFieldOptionNames = ""; string strFieldOptionValues = ""; ArrayList cResult = new ArrayList(); ArrayList cItem; Hashtable hshQuestions; long llResponses; cResult = m_refContentApi.GetFormDataHistogramById((int) FormId); //llResponses = CInt(cResult.Item(0)(0).ToString.Substring(cResult.Item(0)(0).ToString.IndexOf("responses") + 9)) llResponses = m_refContentApi.EkModuleRef.GetFormSubmissionsByFormId(FormId); hshQuestions = m_refContentApi.GetFormFieldQuestionsById((int) FormId); if (DisplayType == "1") { FormReportGrid.Visible = true; BoundColumn colBound; colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Names"; colBound.HeaderText = ""; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.Wrap = false; FormReportGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Percent"; colBound.HeaderText = ""; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left; FormReportGrid.Columns.Add(colBound); FormReportGrid.BorderColor = System.Drawing.Color.White; DataTable dt = new DataTable(); //Dim dr As DataRow dt.Columns.Add(new DataColumn("Names", typeof(string))); dt.Columns.Add(new DataColumn("Percent", typeof(string))); int j; // loop through the names and value pairs to populate the dr and add the dr to dt lblTbl.Visible = true; lblTbl.Text = ""; lblTbl.Text = lblTbl.Text + "<Table>"; lblTbl.Text = lblTbl.Text + "<tr><td align=center><B><U>Responses - " + llResponses.ToString() + "</U></B></td></tr>"; lblTbl.Text = lblTbl.Text + "</table>"; for (i = 0; i <= cResult.Count - 1; i++) { //cItem = cResult[i]; cItem =(ArrayList) cResult[i]; lblTbl.Text = lblTbl.Text + "<Table>"; lblTbl.Text = lblTbl.Text + "<tr><td align=center><B><U>" + hshQuestions[cItem[0]] + "</U></B></td></tr>"; lblTbl.Text = lblTbl.Text + "</table>"; lblTbl.Text = lblTbl.Text + "<table>"; for (j = 1; j <= cItem.Count - 1; j++) { lblTbl.Text = lblTbl.Text + "<tr><td>"; lblTbl.Text = lblTbl.Text + "<b>" + (Convert.ToInt64((cItem[j].ToString().Substring(cItem[j].ToString().LastIndexOf(",") + 1))) * 100) / llResponses + "%" + "</b> " + cItem[j].ToString().Substring(0, System.Convert.ToInt32(cItem[j].ToString().LastIndexOf(",") - 5)); lblTbl.Text = lblTbl.Text + "</td></tr>"; } lblTbl.Text = lblTbl.Text + "</Table>"; } //dt.Rows.Add(dr) //Dim dv As New DataView(dt) //FormReportGrid.DataSource = dv //FormReportGrid.DataBind() } else { chart.Visible = true; // Now we have the data get the values //For Each item In FormStats //strNames = "18-21,22-25,26-30,31-40,41-50,51-60,61-over:10k-20k,21k-30k,31k-40k:High School,Some College,Degree(Associates),Master,Doctoral,Professional" //'strNames = "18-21,22-25,26-30,31-40,41-50,51-60,61-over:10k-20k,21k-30k,31k-40k" //strStale = "10,30,25,10,5,5,15:10,50,40:10,10,10,10,10,10" //strFieldNames = "Age range:Annual Income:Education level" strFieldNames = ""; strFieldOptionNames = ""; strFieldOptionValues = ""; //EktComma is used to retain the commas in the fields and field option names int idx; int j; //Dim scaleFactor As Double for (idx = 0; idx <= cResult.Count - 1; idx++) { cItem =(ArrayList) cResult[idx]; if (cItem.Count > 0) { strFieldNames = strFieldNames + ":" + hshQuestions[cItem[0].ToString().Replace(",", "EktComma")]; } } strFieldNames = EkFunctions.UrlEncode(strFieldNames.Substring(1, strFieldNames.Length - 1)); cItem = null; //For Each cItem In cResult for (idx = 0; idx <= cResult.Count - 1; idx++) { cItem = (ArrayList)cResult[idx]; for (j = 1; j <= cItem.Count - 1; j++) { strFieldOptionNames = strFieldOptionNames + cItem[j].ToString().Substring(0, System.Convert.ToInt32(cItem[j].ToString().LastIndexOf(",") - 5)).Replace(",", "EktComma") + ","; strFieldOptionValues = strFieldOptionValues + (Convert.ToInt64((cItem[j].ToString().Substring(cItem[j].ToString().LastIndexOf(",") + 1))) * 100) / llResponses + ","; } strFieldOptionNames = (string) (strFieldOptionNames.Substring(0, strFieldOptionNames.Length - 1) + ":"); strFieldOptionValues = (string) (strFieldOptionValues.Substring(0, strFieldOptionValues.Length - 1) + ":"); } strFieldOptionNames = EkFunctions.UrlEncode(strFieldOptionNames.Substring(0, strFieldOptionNames.Length - 1)); strFieldOptionValues = strFieldOptionValues.Substring(0, strFieldOptionValues.Length - 1); if (DisplayType == "2") { DisplayType = "0"; //Horizontal bar chart in chart.aspx } bool showAxis = false; chart.ImageUrl = "chart.aspx?fieldOptionNames=" + strFieldOptionNames + "&FieldNames=" + strFieldNames + "&FormValues=" + strFieldOptionValues + "&form_page=form_page&grpdisplay=" + DisplayType + "&responses=" + llResponses + "&showAxis=" + showAxis; //& Request.QueryString("report_display") //Next } }
protected override void Page_Load(object sender, System.EventArgs e) { try { base.Page_Load(sender, e); if (!usesModal) { ShowDropUploader(false); } if (Request.QueryString["catid"] != "") { _CategoryId = Convert.ToInt64(Request.QueryString["catid"]); } if (Request.QueryString["groupId"] != "") { _GroupID = Convert.ToInt64(Request.QueryString["groupId"]); } if (!(Page.IsPostBack)) { ltr_adb_ra.Text = m_refMsg.GetMessage("lbl require authentication"); ltr_adb_mc.Text = m_refMsg.GetMessage("lbl moderate comments"); if (m_sPageAction == "editprop") { _editMode = true; if (_EkContentRef.RequestInformation.IsMembershipUser == 1 && _EkContentRef.IsAllowed(m_iID, 0, "folder", "EditFolders", 0) == false) { throw (new Exception(base.GetMessage("com: user does not have permission"))); } base.SetTitleBarToMessage("edit board prop title"); if (!usesModal) { base.AddBackButton((string)("addeditboard.aspx?action=View&id=" + m_iID.ToString())); } base.AddButtonwithMessages(m_refContentApi.AppPath + "images/UI/Icons/save.png", "#", "lbl alt edit board", "lbl save board", " onclick=\"javascript:return CheckDiscussionBoardParameters();\" ", StyleHelper.SaveButtonCssClass, true); if (usesModal) { base.AddButtonwithMessages(AppImgPath + "../UI/Icons/cancel.png", "#", "generic cancel", "generic cancel", " onclick=\"self.parent.ektb_remove();\" ", StyleHelper.RemoveButtonCssClass); } base.AddHelpButton("EditBoard"); _DiscussionBoard = _EkContentRef.GetBoardbyID(m_iID.ToString()); _Categories = _DiscussionBoard.Categories; txt_adb_boardname.Text = _DiscussionBoard.Name; hdn_adb_boardname.Value = _DiscussionBoard.Name; ltr_boardid_data.Text = _DiscussionBoard.Id.ToString(); txt_adb_title.Text = _DiscussionBoard.Description; ltr_acceptedhtml.Text = base.GetMessage("lbl acceptedhtml"); txt_acceptedhtml.Text = _DiscussionBoard.AcceptedHTML; ltr_acceptedextensions.Text = base.GetMessage("lbl acceptedextensions"); txt_acceptedextensions.Text = _DiscussionBoard.AcceptedExtensions; chk_adb_mc.Checked = _DiscussionBoard.ModerateComments; chk_adb_ra.Checked = _DiscussionBoard.RequireAuthentication; chk_lock_board.Checked = _DiscussionBoard.LockBoard; txt_adb_stylesheet.Text = _DiscussionBoard.StyleSheet; ltr_sitepath.Text = m_refContentApi.SitePath; ltr_maxfilesize.Text = base.GetMessage("lbl max file size"); txt_maxfilesize.Text = _DiscussionBoard.MaxFileSize.ToString(); ltr_bytes.Text = base.GetMessage("lbl bytes"); ltr_comma_ext.Text = base.GetMessage("lbl comma sep"); ltr_comma_html.Text = base.GetMessage("lbl comma sep"); drp_theme.Attributes.Add("onchange", "javascript:updatetheme();"); _PermissionData = m_refContentApi.LoadPermissions(m_iID, "folder", 0); _Editor.ID = "content_html"; _Editor.FolderId = m_iID; _Editor.SetPermissions(_PermissionData); _Editor.AllowFonts = true; _Editor.Content = _DiscussionBoard.TermsAndConditions; _Editor.Visible = true; pnlTerms.Controls.Add(_Editor); hdn_adf_folderid.Value = m_iID.ToString(); hdn_adb_action.Value = "prop"; SetLabels("prop"); ShowCategories(); SetCSSdropdown(_DiscussionBoard.StyleSheet); Display_DiscussionBoardJS(""); lit_ef_templatedata.Text = "<input type=\"hidden\" id=\"language\" value=\"" + this.ContentLanguage + "\" /><input type=\"hidden\" maxlength=\"255\" size=\"" + (75 - m_refContentApi.SitePath.Length) + "\" value=\"\" name=\"templatefilename\" id=\"templatefilename\">"; DrawContentTemplatesTable("edit"); DrawFolderTaxonomyTable(); DisplaySitemapPath(); } else if (m_sPageAction == "viewcat") { _DiscussionBoard = _EkContentRef.GetBoardbyID(m_iID.ToString()); _Categories = _DiscussionBoard.Categories; base.SetTitleBarToMessage("view board subject title"); if (usesModal) { base.AddBackButton("addeditboard.aspx?action=editprop&id=" + m_iID.ToString() + "&thickbox=true"); } else { base.AddBackButton("addeditboard.aspx?action=View&id=" + m_iID.ToString()); } base.AddButtonwithMessages(m_refContentApi.AppPath + "images/UI/Icons/contentEdit.png", (string)("addeditboard.aspx?LangType=" + this.ContentLanguage.ToString() + "&action=editcat&id=" + m_iID.ToString() + "&catid=" + _CategoryId.ToString()), "lbl alt edit board subject", "edit board subject title", "", StyleHelper.EditButtonCssClass, true); if (_Categories.Length > 1) // do not allow delete if this is the only category in the board { base.AddButtonwithMessages(m_refContentApi.AppPath + "images/UI/Icons/delete.png", (string)("addeditboard.aspx?LangType=" + this.ContentLanguage.ToString() + "&action=delcat&id=" + m_iID.ToString() + "&catid=" + _CategoryId.ToString()), "lbl alt delete board subject", "delete board subject title", "", StyleHelper.DeleteButtonCssClass); } base.AddHelpButton("ViewBoardCategories"); for (int i = 0; i <= (_Categories.Length - 1); i++) { if (_Categories[i].CategoryID == _CategoryId) { txt_catname.Text = _Categories[i].Name; lbl_catid.Text = _Categories[i].CategoryID.ToString(); txt_catsort.Text = _Categories[i].SortOrder.ToString(); } } txt_catname.Enabled = false; txt_catsort.Enabled = false; hdn_adf_folderid.Value = m_iID.ToString(); hdn_adb_action.Value = "cat"; SetLabels("cat"); ShowCategories(); Display_EditCatJS(); } else if (m_sPageAction == "editcat") { base.SetTitleBarToMessage("edit board subject title"); if (usesModal) { base.AddBackButton("addeditboard.aspx?LangType=" + this.ContentLanguage.ToString() + "&action=editprop&id=" + m_iID.ToString() + "&thickbox=true"); } else { base.AddBackButton("addeditboard.aspx?LangType=" + this.ContentLanguage.ToString() + "&action=Viewcat&id=" + m_iID.ToString() + "&catid=" + _CategoryId.ToString()); } base.AddButtonwithMessages(m_refContentApi.AppPath + "images/UI/Icons/save.png", "#", "lbl alt save board subject", "lbl save board subject", " onclick=\"javascript:return CheckBoardCatParameters();\" ", StyleHelper.SaveButtonCssClass, true); base.AddHelpButton("EditBoardCategories"); _DiscussionBoard = _EkContentRef.GetBoardbyID(m_iID.ToString()); _Categories = _DiscussionBoard.Categories; for (int i = 0; i <= (_Categories.Length - 1); i++) { if (_Categories[i].CategoryID == _CategoryId) { txt_catname.Text = _Categories[i].Name; ltr_catid.Text = _Categories[i].CategoryID.ToString(); txt_catsort.Text = _Categories[i].SortOrder.ToString(); } } txt_adb_boardname.Text = _DiscussionBoard.Name; txt_adb_title.Text = _DiscussionBoard.Description; chk_adb_mc.Checked = _DiscussionBoard.ModerateComments; chk_adb_ra.Checked = _DiscussionBoard.RequireAuthentication; chk_lock_board.Checked = _DiscussionBoard.LockBoard; txt_adb_stylesheet.Text = _DiscussionBoard.StyleSheet; ltr_sitepath.Text = m_refContentApi.SitePath; hdn_adf_folderid.Value = m_iID.ToString(); hdn_adb_action.Value = "cat"; SetLabels("cat"); ShowCategories(); Display_EditCatJS(); } else if (m_sPageAction == "delcat") { int removeid = 0; base.SetTitleBarToMessage("delete board subject title"); base.AddBackButton((string)("addeditboard.aspx?LangType=" + this.ContentLanguage.ToString() + "&action=viewcat&id=" + m_iID.ToString() + "&catid=" + _CategoryId.ToString())); base.AddButtonwithMessages(m_refContentApi.AppPath + "images/UI/Icons/delete.png", "#", "lbl alt delete board", "delete board subject title", " onclick=\"javascript:return CheckDelete();\" ", StyleHelper.DeleteButtonCssClass, true); base.AddHelpButton("DeleteBoardCategories"); _DiscussionBoard = _EkContentRef.GetBoardbyID(m_iID.ToString()); _Categories = _DiscussionBoard.Categories; for (int i = 0; i <= (_Categories.Length - 1); i++) { if (_Categories[i].CategoryID == _CategoryId) { ltr_delcatnamedata.Text = _Categories[i].Name; removeid = i; break; } } drp_movecat.DataSource = _Categories; drp_movecat.DataTextField = "Name"; drp_movecat.DataValueField = "CategoryID"; drp_movecat.DataBind(); drp_movecat.Items.RemoveAt(removeid); drp_movecat.SelectedIndex = 0; hdn_adf_folderid.Value = m_iID.ToString(); hdn_adb_action.Value = "delcat"; SetLabels("delcat"); //ShowCategories() Display_DeleteCatJS(); } else if (m_sPageAction == "addcat") { base.SetTitleBarToMessage("add board subject title"); base.AddBackButton((string)("../content.aspx?action=ViewContentByCategory&id=" + m_iID.ToString())); base.AddButtonwithMessages(m_refContentApi.AppPath + "images/UI/Icons/save.png", "#", "lbl alt save board subject", "lbl save board subject", " onclick=\"javascript:return CheckBoardCatParameters();\" ", StyleHelper.SaveButtonCssClass, true); base.AddHelpButton("AddBoardCategories"); _DiscussionBoard = _EkContentRef.GetBoardbyID(m_iID.ToString()); _Categories = _DiscussionBoard.Categories; txt_catname.Text = ""; txt_catsort.Text = "1"; tr_catid.Visible = false; hdn_adf_folderid.Value = m_iID.ToString(); hdn_adb_action.Value = "addcat"; SetLabels("cat"); ShowCategories(); Display_EditCatJS(); } else //view { base.Version8TabsImplemented = true; base.SetTitleBarToMessage("view board prop title"); //MyBase.AddButtonwithMessages(m_refContentApi.AppImgPath & "btn_EventTypes-nm.gif", "addeditboard.aspx?LangType=" & m_refContentApi.ContentLanguage & "&action=editcat&id=" & m_iID.ToString(), "alt editboard cat", "lbl editboard cat", "") if (usesModal) { base.AddButtonwithMessages(m_refContentApi.AppPath + "images/UI/Icons/contentEdit.png", (string)("addeditboard.aspx?LangType=" + m_refContentApi.ContentLanguage + "&action=editprop&id=" + m_iID.ToString() + "&thickbox=true"), "alt editboard prop", "lbl editboard prop", "", StyleHelper.EditButtonCssClass, true); base.AddButtonwithMessages(AppImgPath + "../UI/Icons/cancel.png", "#", "generic cancel", "generic cancel", " onclick=\"self.parent.ektb_remove();\" ", StyleHelper.RemoveButtonCssClass); } else { base.AddBackButton("../content.aspx?action=ViewContentByCategory&id=" + m_iID.ToString()); base.AddButtonwithMessages(m_refContentApi.AppPath + "images/UI/Icons/contentEdit.png", (string)("addeditboard.aspx?LangType=" + m_refContentApi.ContentLanguage + "&action=editprop&id=" + m_iID.ToString()), "alt editboard prop", "lbl editboard prop", "", StyleHelper.EditButtonCssClass, true); } base.AddHelpButton("ViewBoardProp"); _DiscussionBoard = _EkContentRef.GetBoardbyID(m_iID.ToString()); _Categories = _DiscussionBoard.Categories; txt_adb_boardname.Text = _DiscussionBoard.Name; txt_adb_title.Text = _DiscussionBoard.Description; ltr_acceptedhtml.Text = base.GetMessage("lbl acceptedhtml"); txt_acceptedhtml.Text = _DiscussionBoard.AcceptedHTML; ltr_acceptedextensions.Text = base.GetMessage("lbl acceptedextensions"); txt_acceptedextensions.Text = _DiscussionBoard.AcceptedExtensions; ltr_boardid_data.Text = _DiscussionBoard.Id.ToString(); chk_adb_mc.Checked = _DiscussionBoard.ModerateComments; chk_adb_ra.Checked = _DiscussionBoard.RequireAuthentication; chk_lock_board.Checked = _DiscussionBoard.LockBoard; txt_adb_stylesheet.Text = _DiscussionBoard.StyleSheet; ltr_sitepath.Text = m_refContentApi.SitePath; chkInheritSitemapPath.Checked = Convert.ToBoolean(_DiscussionBoard.SitemapInherited); Literal termsText = new Literal(); termsText.Text = _DiscussionBoard.TermsAndConditions; pnlTerms.Controls.Add(termsText); ltr_maxfilesize.Text = base.GetMessage("lbl max file size"); txt_maxfilesize.Text = _DiscussionBoard.MaxFileSize.ToString(); ltr_bytes.Text = base.GetMessage("lbl bytes"); ltr_comma_ext.Text = base.GetMessage("lbl comma sep"); ltr_comma_html.Text = base.GetMessage("lbl comma sep"); Display_DiscussionBoardJS("view"); hdn_adf_folderid.Value = m_iID.ToString(); SetLabels(""); ShowCategories(); SetCSSdropdown(_DiscussionBoard.StyleSheet); SetDisabled(); lit_ef_templatedata.Text = "<input type=\"hidden\" maxlength=\"255\" size=\"" + (75 - m_refContentApi.SitePath.Length) + "\" value=\"\" name=\"templatefilename\" id=\"templatefilename\">"; DrawContentTemplatesTable("view"); DrawFolderTaxonomyTable(); ViewSitemapPath(); } } else { Process_DoUpdate(); } } catch (Exception ex) { Utilities.ShowError(ex.Message); } }
private void Display_EditFolder() { TemplateData[] template_data; XmlConfigData[] xmlconfig_data; bool isBlog = System.Convert.ToBoolean(_FolderType == 1); int i = 0; ltInheritSitemapPath.Text = _MessageHelper.GetMessage("lbl inherit from parent"); _PermissionData = _ContentApi.LoadPermissions(_Id, "folder", 0); ltrTypes.Text = _MessageHelper.GetMessage("Smart Forms txt"); if (isBlog) { _BlogData = _ContentApi.BlogObject(_FolderData); _IsUserBlog = _ContentApi.IsUserBlog(_BlogData.Id); _FolderData.PublishPdfEnabled = false; EditFolderToolBar(); phSubjects.Visible = true; phBlogRoll.Visible = true; phDescription.Visible = false; } else { EditFolderToolBar(); } template_data = _ContentApi.GetAllTemplates("TemplateFileName"); xmlconfig_data = _ContentApi.GetAllXmlConfigurations("title"); oldfolderdescription.Value = Server.HtmlDecode(_FolderData.Description); folderdescription.Value = Server.HtmlDecode(_FolderData.Description); folder_id.Value = _FolderData.Id.ToString(); if (_Id == 0) { phFolderProperties1.Visible = true; lit_ef_folder.Text = _FolderData.Name + "<input type=\"hidden\" value=\"" + _FolderData.Name + "\" name=\"foldername\"/>"; lit_ef_folder.Text += "<input type=\"hidden\" value=\"" + _FolderData.Name + "\" name=\"oldfoldername\"/>"; } else { if (isBlog) { phBlogProperties1.Visible = true; phBlogProperties2.Visible = true; td_vf_nametxt.InnerHtml = "<input type=\"text\" maxlength=\"75\" size=\"30\" value=\"" + _FolderData.Name + "\" name=\"foldername\" />"; td_vf_nametxt.InnerHtml += "<input type=\"hidden\" value=\"" + EkFunctions.HtmlEncode(_FolderData.Name) + "\" name=\"oldfoldername\" id=\"oldfoldername\" />"; td_vf_nametxt.InnerHtml += "<input type=\"hidden\" name=\"isblog\" id=\"isblog\" value=\"true\"/>"; td_vf_titletxt.InnerHtml = "<input type=\"text\" maxlength=\"75\" size=\"30\" value=\"" + _BlogData.Title + "\" name=\"blogtitle\" id=\"blogtitle\" />"; td_vf_visibilitytxt.InnerHtml = "<select name=\"blog_visibility\" id=\"blog_visibility\">"; if (_BlogData.Visibility == Ektron.Cms.Common.EkEnumeration.BlogVisibility.Public) { td_vf_visibilitytxt.InnerHtml += "<option value=\"0\" selected>" + _MessageHelper.GetMessage("lbl public") + "</option>"; td_vf_visibilitytxt.InnerHtml += "<option value=\"1\">" + _MessageHelper.GetMessage("lbl private") + "</option>"; } else { td_vf_visibilitytxt.InnerHtml += "<option value=\"0\">" + _MessageHelper.GetMessage("lbl public") + "</option>"; td_vf_visibilitytxt.InnerHtml += "<option value=\"1\" selected>" + _MessageHelper.GetMessage("lbl private") + "</option>"; } td_vf_visibilitytxt.InnerHtml += "</select>"; tagline.Value = Server.HtmlDecode(_BlogData.Tagline); if (_BlogData.PostsVisible < 0) { td_vf_postsvisibletxt.InnerHtml = "<input type=\"text\" name=\"postsvisible\" id=\"postsvisible\" value=\"\" size=\"1\" maxlength=\"3\"/>"; } else { td_vf_postsvisibletxt.InnerHtml = "<input type=\"text\" name=\"postsvisible\" id=\"postsvisible\" value=\"" + _BlogData.PostsVisible.ToString() + "\" size=\"1\" maxlength=\"3\"/>"; } td_vf_postsvisibletxt.InnerHtml += "<div class=\"ektronCaption\">"+ _MessageHelper.GetMessage("Post Visible warning")+"</div>"; if (_BlogData.EnableComments == true) { td_vf_commentstxt.InnerHtml += "<input type=\"checkbox\" name=\"enable_comments\" id=\"enable_comments\" checked=\"checked\" onclick=\"UpdateBlogCheckBoxes();\" />" + _MessageHelper.GetMessage("lbl enable comments"); td_vf_commentstxt.InnerHtml += "<br />"; if (_BlogData.ModerateComments) { td_vf_commentstxt.InnerHtml += "<input type=\"checkbox\" name=\"moderate_comments\" id=\"moderate_comments\" checked=\"checked\" />" + _MessageHelper.GetMessage("lbl moderate comments"); } else { td_vf_commentstxt.InnerHtml += "<input type=\"checkbox\" name=\"moderate_comments\" id=\"moderate_comments\" />"+ _MessageHelper.GetMessage("lbl moderate comments"); } td_vf_commentstxt.InnerHtml += "<br />"; if (_BlogData.RequiresAuthentication) { td_vf_commentstxt.InnerHtml += "<input type=\"checkbox\" name=\"require_authentication\" id=\"require_authentication\" checked=\"checked\" />" + _MessageHelper.GetMessage("lbl require authentication"); } else { td_vf_commentstxt.InnerHtml += "<input type=\"checkbox\" name=\"require_authentication\" id=\"require_authentication\" />" + _MessageHelper.GetMessage("lbl require authentication"); } } else { td_vf_commentstxt.InnerHtml += "<input type=\"checkbox\" name=\"enable_comments\" id=\"enable_comments\" onclick=\"UpdateBlogCheckBoxes();\" />"+_MessageHelper.GetMessage("lbl enable comments")+"<br />"; td_vf_commentstxt.InnerHtml += "<input type=\"checkbox\" name=\"moderate_comments\" id=\"moderate_comments\" disabled=\"disabled\"/>"+ _MessageHelper.GetMessage("lbl moderate comments")+"<br />"; td_vf_commentstxt.InnerHtml += "<input type=\"checkbox\" name=\"require_authentication\" id=\"require_authentication\" disabled=\"disabled\"/>" + _MessageHelper.GetMessage("lbl require authentication")+"<br />"; } if (_BlogData.NotifyURL != "") { td_vf_updateservicestxt.InnerHtml += "<input type=\"checkbox\" name=\"chknotify_url\" id=\"chknotify_url\" checked=\"checked\" />"+ _MessageHelper.GetMessage("lbl Notify blog"); td_vf_updateservicestxt.InnerHtml += "<br />"; td_vf_updateservicestxt.InnerHtml += "<input type=\"text\" maxlength=\"75\" size=\"40\" value=\"" + EkFunctions.HtmlEncode(_BlogData.NotifyURL) + "\" name=\"notify_url\" id=\"notify_url\"/>"; } else { td_vf_updateservicestxt.InnerHtml += "<input type=\"checkbox\" name=\"chknotify_url\" id=\"chknotify_url\" />" + _MessageHelper.GetMessage("lbl Notify blog"); td_vf_updateservicestxt.InnerHtml += "<br />"; td_vf_updateservicestxt.InnerHtml += "<input type=\"text\" maxlength=\"75\" size=\"40\" value=\"\" name=\"notify_url\" id=\"notify_url\"/>"; } } else { phFolderProperties1.Visible = true; lit_ef_folder.Text = "<input type=\"text\" maxlength=\"100\" size=\"75\" value=\"" + _FolderData.Name + "\" name=\"foldername\"><input type=\"hidden\" value=\"\" name=\"oldfoldername\" id=\"oldfoldername\" />"; } } if ((_FolderData.StyleSheetInherited) && (_FolderData.StyleSheet != "")) { lit_ef_ss.Text = _ContentApi.SitePath + "<input type=\"text\" maxlength=\"255\" size=\"" + (75 - _ContentApi.SitePath.Length) + "\" value=\"\" name=\"stylesheet\" />"; lit_ef_ss.Text += "<br/>"; lit_ef_ss.Text += "<span class=\"ektronCaption\">"; lit_ef_ss.Text += _MessageHelper.GetMessage("inherited style sheet msg") + _ContentApi.SitePath + _FolderData.StyleSheet; lit_ef_ss.Text += "</span>"; } else { lit_ef_ss.Text = _ContentApi.SitePath + "<input type=\"text\" maxlength=\"255\" size=\"" + (75 - _ContentApi.SitePath.Length) + "\" value=\"" + _FolderData.StyleSheet + "\" name=\"stylesheet\" />"; } lit_ef_templatedata.Text = "<input type=\"hidden\" maxlength=\"255\" size=\"" + (75 - _ContentApi.SitePath.Length) + "\" value=\"\" name=\"templatefilename\" id=\"templatefilename\" />"; DrawContentTemplatesTable(); DrawFlaggingOptions(); long iTmpCaller = _ContentApi.RequestInformationRef.CallerId; try { _ContentApi.RequestInformationRef.CallerId = Ektron.Cms.Common.EkConstants.InternalAdmin; _ContentApi.RequestInformationRef.UserId = Ektron.Cms.Common.EkConstants.InternalAdmin; AssetConfigInfo[] asset_config = _ContentApi.GetAssetMgtConfigInfo(); if (asset_config[10].Value.IndexOf("ektron.com") > -1) { ltrCheckPdfServiceProvider.Text = _MessageHelper.GetMessage("pdf service provider"); } else { ltrCheckPdfServiceProvider.Text = ""; } } catch (Exception ex) { string _error = ex.Message; } finally { _ContentApi.RequestInformationRef.CallerId = iTmpCaller; _ContentApi.RequestInformationRef.UserId = iTmpCaller; } if (_FolderData.PublishPdfEnabled && _FolderType != (int)Ektron.Cms.Common.EkEnumeration.FolderType.Calendar) { phPDF.Visible = true; _IsPublishedAsPdf = (string)(_FolderData.PublishPdfActive ? "checked=\"checked\" " : string.Empty); this.lblPublishAsPdf.InnerText = _MessageHelper.GetMessage("publish as pdf"); } else { _IsPublishedAsPdf = string.Empty; phPDF.Visible = false; } // only top level folders can be domain folders and only if not a blog folder already CommonApi m_refCommonAPI = new CommonApi(); Ektron.Cms.Common.EkRequestInformation request_info = m_refCommonAPI.RequestInformationRef; if ((_FolderType != 1) && (_FolderData.ParentId == 0) && (_Id != 0)) { SettingsData settings_list; SiteAPI m_refSiteAPI = new SiteAPI(); settings_list = m_refSiteAPI.GetSiteVariables(-1); //string schk = ""; string disdomain = ""; //if (_FolderData.IsDomainFolder) //{ // schk = " checked "; //} //else //{ // disdomain = " disabled "; //} if (!_FolderData.IsDomainFolder) { disdomain = " disabled "; } if (_FolderType == 2 && LicenseManager.IsFeatureEnable(request_info, Feature.MultiSite)) { // Domain folder checkbox replaced to hidden field. //DomainFolder.Text += "<tr><td colspan=""2""> </td></tr><tr><td colspan=""2"" class=""input-box-text"">Multi-Site Domain Configuration:</td></tr>" //DomainFolder.Text += "<tr><td colspan=""2""><input type=""checkbox"" disabled= ""true"" name=""IsDomainFolder"" id=""IsDomainFolder""" & schk & " onClick=""" //If (settings_list.AsynchronousStaging) Then // DomainFolder.Text += "document.forms[0].DomainStaging.disabled = !document.forms[0].IsDomainFolder.checked; " //End If //DomainFolder.Text += "document.forms[0].DomainProduction.disabled = !document.forms[0].IsDomainFolder.checked;" //If (Not request_info.LinkManagement) Then // DomainFolder.Text += " if (document.forms[0].IsDomainFolder.checked) alert('Please set ek_LinkManagement to True in your web.config');" //End If //DomainFolder.Text += """/><label for=""IsDomainFolder"">" & m_refMsg.GetMessage("alt Domain for this folder") & "</label></td></tr>" DomainFolder.Text += "<input type=\"hidden\" name=\"IsDomainFolder\" id=\"IsDomainFolder\" value=\"on\"/>"; // staging field should only show up on staging servers; production server can see production field DomainFolder.Text += "<tr>"; DomainFolder.Text += "<td class=\"label\"><label for=\"DomainStaging\">" + _MessageHelper.GetMessage("lbl Staging Domain") + ":</label></td>"; DomainFolder.Text += "<td class=\"value\">http:// <input type=\"text\" name=\"DomainStaging\" id=\"DomainStaging\" size=\"50\" value=\"" + _FolderData.DomainStaging + ("\"" + disdomain) + "/></td>"; DomainFolder.Text += "</tr>"; DomainFolder.Text += "<tr>"; DomainFolder.Text += "<td class=\"label\"><label for=\"DomainProduction\">" + _MessageHelper.GetMessage("lbl Production Domain") + ":</label></td>"; DomainFolder.Text += "<td class=\"value\">http:// <input type=\"text\" name=\"DomainProduction\" id=\"DomainProduction\" size=\"50\" value=\"" + _FolderData.DomainProduction + ("\"" + disdomain) + "/></td>"; DomainFolder.Text += "</tr>"; if (_FolderData.IsDomainFolder && _FolderData.ParentId == 0) { StringBuilder categorydata = new StringBuilder(); if ((_FolderData.FolderTaxonomy != null) && _FolderData.FolderTaxonomy.Length > 0) { for (int d = 0; d <= _FolderData.FolderTaxonomy.Length - 1; d++) { if (_SelectedTaxonomyList.Length > 0) { _SelectedTaxonomyList = _SelectedTaxonomyList + "," + _FolderData.FolderTaxonomy[d].TaxonomyId; } else { _SelectedTaxonomyList = _FolderData.FolderTaxonomy[d].TaxonomyId.ToString(); } } } _CurrentCategoryChecked = Convert.ToInt32(_FolderData.CategoryRequired); current_category_required.Value = _CurrentCategoryChecked.ToString(); inherit_taxonomy_from.Value = _FolderData.TaxonomyInheritedFrom.ToString(); } } } // handle dynamic replication settings if (request_info.EnableReplication && !(_FolderType == (int)Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionForum || _FolderType == (int)Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionBoard)) { bool bShowReplicationMethod = true; if (_FolderData.ParentId != 0 && (_FolderType == (int)Ektron.Cms.Common.EkEnumeration.FolderType.Blog)) { // don't show for blogs under community folder FolderData tmp_folder_data = null; tmp_folder_data = this._ContentApi.EkContentRef.GetFolderById(_FolderData.ParentId); if (tmp_folder_data.FolderType == (int)Ektron.Cms.Common.EkEnumeration.FolderType.Community) { bShowReplicationMethod = false; } } if (bShowReplicationMethod) { string schk = ""; if (_FolderData.ReplicationMethod == 1) { schk = " checked"; } if (!_FolderData.IsCommunityFolder) { ReplicationMethod.Text = _MessageHelper.GetMessage("lbl folderdynreplication"); ReplicationMethod.Text += "<input type=\"checkbox\" name=\"EnableReplication\" id=\"EnableReplication\" value=\"1\"" + schk + " ><label for=\"EnableReplication\"/>" + _MessageHelper.GetMessage("replicate folder contents") + "</label>"; } } else { // if we're not showing it, it means replication is enabled because we're under a parent community folder ReplicationMethod.Text = "<input type=\"hidden\" name=\"EnableReplication\" value=\"1\" />"; } } // show categories if its a blog if (isBlog) { ltr_vf_categories.Text += "<div id=\"parah\">"; if (!(_BlogData.Categories == null) && _BlogData.Categories.Length > 0 && _BlogData.Categories[0].Length > 0) { for (i = 0; i <= _BlogData.Categories.Length - 1; i++) { ltr_vf_categories.Text += "<input type=\'text\' id=\'category" + i.ToString() + "\' name=\'category" + i.ToString() + "\' onChange=\'saveValue(" + i.ToString() + ",this.value)\' value=\'" + Strings.Replace((string)(_BlogData.Categories[i].ToString()), "~@~@~", ";", 1, -1, 0).Replace("\'", "'") + "\' maxlength=\'75\' size=\'75\'/> "; ltr_vf_categories.Text += "<a href=\"#Remove\" onclick=\"removeInput(" + i.ToString() + ");return false;\" class=\"button buttonInlineBlock redHover buttonRemove\">" + _MessageHelper.GetMessage("btn remove") + "</a>"; ltr_vf_categories.Text += "<div class=\'ektronTopSpace\'></div>"; ltr_vf_categories.Text += "<script type=\"text/javascript\">addInputInit(\'" + Strings.Replace((string)(_BlogData.Categories[i].ToString()), "~@~@~", ";", 1, -1, 0).Replace("\'", "\\\'") + "\');</script>"; //<p>" & blog_data.Categories(i).ToString() & "</p>" } ltr_vf_categories.Text += "</div>"; ltr_vf_categories.Text += "<input type=\"hidden\" id=\"categorylength\" name=\"categorylength\" value=\"" + _BlogData.Categories.Length.ToString() + "\" />"; } else { ltr_vf_categories.Text += "</div>"; ltr_vf_categories.Text += "<input type=\"hidden\" id=\"categorylength\" name=\"categorylength\" value=\"0\" />"; } ltr_vf_categories.Text += "<a href=\"#Add\" onclick=\"addInput();return false;\" class=\"button buttonInlineBlock greenHover buttonAdd\">" + this._MessageHelper.GetMessage("lnk add new subject") + "</a>"; ltr_vf_categories.Text += "<a href=\"#Remove\" onclick=\"deleteInput();return false;\" class=\"button buttonInlineBlock redHover buttonRemove\">" + this._MessageHelper.GetMessage("lnk remove last subject") + "</a>"; Literal ltrT = new Literal(); ltrT.Text += "<div id=\"proll\" name=\"proll\">"; if (!(_BlogData.BlogRoll == null) && _BlogData.BlogRoll.Length() > 0) { for (i = 0; i <= _BlogData.BlogRoll.Length() - 1; i++) { ltrT.Text += "<a href=\"#\" class=\"button buttonInlineBlock redHover buttonRemove\" onClick=\"removeRoll(" + i.ToString() + ")\">Remove Roll Link</a>"; ltrT.Text += "<div class=\"ektronTopSpace\"></div>"; ltrT.Text += "<table class=\"ektronGrid\">"; ltrT.Text += " <tr>"; ltrT.Text += " <td class=\"label\">Link Name:</td>"; ltrT.Text += " <td class=\"value\"><input name=\"editfolder_linkname" + i.ToString() + "\" type=\"text\" value=\"" + EkFunctions.HtmlEncode(_BlogData.BlogRoll.RollItem(i).LinkName) + "\" size=\"55\" id=\"editfolder_linkname" + i.ToString() + "\" onChange=\"saveRoll(" + i.ToString() + ",this.value,\'linkname\')\" /></td>"; ltrT.Text += " </tr>"; ltrT.Text += " <tr>"; ltrT.Text += " <td class=\"label\">URL:</td>"; ltrT.Text += " <td class=\"value\"><input name=\"editfolder_url" + i.ToString() + "\" type=\"text\" value=\"" + EkFunctions.HtmlEncode(_BlogData.BlogRoll.RollItem(i).URL) + "\" size=\"55\" id=\"editfolder_url" + i.ToString() + "\" onChange=\"saveRoll(" + i.ToString() + ",this.value,\'url\')\" /></td>"; ltrT.Text += " </tr>"; ltrT.Text += " <tr>"; ltrT.Text += " <td class=\"label\">Short Description:</td>"; ltrT.Text += " <td class=\"value\"><input name=\"editfolder_short" + i.ToString() + "\" type=\"text\" value=\"" + EkFunctions.HtmlEncode(_BlogData.BlogRoll.RollItem(i).ShortDescription) + "\" size=\"55\" id=\"editfolder_short" + i.ToString() + "\" onChange=\"saveRoll(" + i.ToString() + ",this.value,\'short\')\" /></td>"; ltrT.Text += " </tr>"; ltrT.Text += " <tr>"; ltrT.Text += " <td class=\"label\">Relationship:</td>"; ltrT.Text += " <td class=\"value\">"; ltrT.Text += " <input name=\"editfolder_rel" + i.ToString() + "\" type=\"text\" value=\"" + EkFunctions.HtmlEncode(_BlogData.BlogRoll.RollItem(i).Relationship) + "\" size=\"45\" id=\"editfolder_rel" + i.ToString() + "\" onChange=\"saveRoll(" + i.ToString() + ",this.value,\'rel\')\" /> \""; ltrT.Text += " <a style=\"padding-top: .25em; padding-bottom: .25em;\" class=\"button buttonInline blueHover buttonEdit\" href=\"#\" onClick=\"window.open(\'blogs/xfnbuilder.aspx?field=editfolder_rel" + i.ToString() + "&id=" + i.ToString() + "\',\'XFNBuilder\',\'location=0,status=0,scrollbars=0,width=500,height=300\');\">Edit</a>"; ltrT.Text += " </td>"; ltrT.Text += " </tr>"; ltrT.Text += "</table>"; ltrT.Text += "<div class=\"ektronTopSpace\"></div>"; ltrT.Text += "<script type=\"text/javascript\">addRollInit(\'" + Strings.Replace(_BlogData.BlogRoll.RollItem(i).LinkName, "\'", "\\\'", 1, -1, 0) + "\',\'" + Strings.Replace(_BlogData.BlogRoll.RollItem(i).URL, "\'", "\\\'", 1, -1, 0) + "\',\'" + Strings.Replace(_BlogData.BlogRoll.RollItem(i).ShortDescription, "\'", "\\\'", 1, -1, 0) + "\',\'" + Strings.Replace(_BlogData.BlogRoll.RollItem(i).Relationship, "\'", "\\\'", 1, -1, 0) + "\');</script>"; } } ltrT.Text += "</div>"; ltrT.Text += "<input type=\"hidden\" id=\"rolllength\" name=\"rolllength\" value=\"" + _BlogData.BlogRoll.Length().ToString() + "\" />"; ltrT.Text += "<div class=\"ektronTopSpace\"></div>"; ltrT.Text += "<a href=\"javascript:addRoll()\" class=\"button buttonInlineBlock greenHover buttonAdd\">" + _MessageHelper.GetMessage("lnk add new roll link") + "</a>"; ltrT.Text += "<a href=\"javascript:deleteRoll()\" class=\"button buttonInlineBlock redHover buttonRemove\">" + _MessageHelper.GetMessage("lnk remove last roll link") + "</a>"; lbl_vf_roll.Controls.Add(ltrT); } if (_Id == 0) { js_ef_focus.Text = "Ektron.ready(function(){document.forms.frmContent.stylesheet.focus();});"; } else { if (!(Request.QueryString["showpane"] != "")) { js_ef_focus.Text = "Ektron.ready(function() { document.forms.frmContent.foldername.focus();" + Environment.NewLine; js_ef_focus.Text += " if( $ektron(\'#web_alert_inherit_checkbox\').length > 0 ){" + Environment.NewLine; js_ef_focus.Text += " if( $ektron(\'#web_alert_inherit_checkbox\')[0].checked ){" + Environment.NewLine; js_ef_focus.Text += " $ektron(\'.selectContent\').css(\'display\', \'none\');" + Environment.NewLine; js_ef_focus.Text += " $ektron(\'.useCurrent\').css(\'display\', \'none\');" + Environment.NewLine; js_ef_focus.Text += " } " + Environment.NewLine; js_ef_focus.Text += " } " + Environment.NewLine; js_ef_focus.Text += "});" + Environment.NewLine; } js_ef_focus.Text += "function UpdateBlogCheckBoxes() {" + Environment.NewLine; js_ef_focus.Text += " if (document.forms[0].enable_comments.checked == true) {" + Environment.NewLine; js_ef_focus.Text += " document.forms[0].moderate_comments.disabled = false;" + Environment.NewLine; js_ef_focus.Text += " document.forms[0].require_authentication.disabled = false;" + Environment.NewLine; js_ef_focus.Text += " } else {" + Environment.NewLine; js_ef_focus.Text += " document.forms[0].moderate_comments.disabled = true;" + Environment.NewLine; js_ef_focus.Text += " document.forms[0].require_authentication.disabled = true;" + Environment.NewLine; js_ef_focus.Text += " }" + Environment.NewLine; js_ef_focus.Text += "}" + Environment.NewLine; } DrawFolderTaxonomyTable(); DisplaySitemapPath(); DisplayMetadataInfo(); DisplaySubscriptionInfo(); DrawContentTypesTable(); DrawContentAliasesTable(); IsContentSearchableSection(); IsDisplaySettings(); if (_FolderType == 2) //OrElse folder_data.Id = 0 Avoiding sitealias for root. { phSiteAlias.Visible = true; phSiteAlias2.Visible = true; DisplaySiteAlias(); } Showpane(); if (_FolderData.IsCommunityFolder) { Display_AddCommunityFolder(); } }
private void Display_ViewFolder() { Collection cPreApproval; bool isBlog; isBlog = System.Convert.ToBoolean(_FolderType == 1 ? true : false); if (isBlog) { _BlogData = _ContentApi.BlogObject(_FolderData); _FolderData.PublishPdfEnabled = false; phSubjects.Visible = true; phBlogRoll.Visible = true; phDescription.Visible = false; } _PermissionData = _ContentApi.LoadPermissions(_Id, "folder", 0); ltrTypes.Text = _MessageHelper.GetMessage("Smart Forms txt"); //Sitemap Path ltInheritSitemapPath.Text = _MessageHelper.GetMessage("lbl Inherit Parent Configuration"); ViewFolderToolBar(); if (isBlog) { phBlogProperties1.Visible = true; if (_BlogData.Visibility == Ektron.Cms.Common.EkEnumeration.BlogVisibility.Public) { td_vf_visibilitytxt.InnerHtml = _MessageHelper.GetMessage("lbl public"); } else { td_vf_visibilitytxt.InnerHtml = _MessageHelper.GetMessage("lbl private"); } td_vf_nametxt.InnerHtml = _BlogData.Name; td_vf_titletxt.InnerHtml = _BlogData.Title; } else { phFolderProperties1.Visible = true; td_vf_foldertxt.InnerHtml = _FolderData.Name; } td_vf_idtxt.InnerHtml = _Id.ToString(); if (isBlog) { phBlogProperties2.Visible = true; string sEnabled = ""; string sModerate = ""; string sRequire = ""; string sNotify = ""; if (_BlogData.EnableComments) { sEnabled = "checked=\"checked\" "; } if (_BlogData.ModerateComments) { sModerate = "checked=\"checked\" "; } if (_BlogData.RequiresAuthentication) { sRequire = "checked=\"checked\" "; } if (_BlogData.NotifyURL != "") { sNotify = "checked=\"checked\" "; } td_vf_taglinetxt.InnerHtml = _BlogData.Tagline; if (_BlogData.PostsVisible < 0) { td_vf_postsvisibletxt.InnerHtml = "(selected day)"; } else { td_vf_postsvisibletxt.InnerHtml += _BlogData.PostsVisible.ToString(); } td_vf_commentstxt.InnerHtml += "<input disabled=\"disabled\" type=\"checkbox\" name=\"enable_comments\" id=\"enable_comments\" " + sEnabled + " />" + _MessageHelper.GetMessage("lbl enable comments"); td_vf_commentstxt.InnerHtml += "<br />"; td_vf_commentstxt.InnerHtml += "<input disabled=\"disabled\" type=\"checkbox\" name=\"moderate_comments\" id=\"moderate_comments\" " + sModerate + " />" + _MessageHelper.GetMessage("lbl moderate comments"); td_vf_commentstxt.InnerHtml += "<br />"; td_vf_commentstxt.InnerHtml += "<input disabled=\"disabled\" type=\"checkbox\" name=\"require_authentication\" id=\"require_authentication\" " + sRequire + " />" + _MessageHelper.GetMessage("lbl require authentication"); td_vf_updateservicestxt.InnerHtml += "<input type=\"checkbox\" name=\"notify_url\" id=\"notify_url\" " + sNotify + " disabled=\"disabled\" />" + _MessageHelper.GetMessage("lbl Notify blog"); td_vf_updateservicestxt.InnerHtml += "<br />"; td_vf_updateservicestxt.InnerHtml += _BlogData.NotifyURL; } else { td_vf_folderdesctxt.InnerHtml = _FolderData.Description; } if (_FolderData.StyleSheet == "") { td_vf_stylesheettxt.InnerHtml += _MessageHelper.GetMessage("none specified msg"); } else { td_vf_stylesheettxt.InnerHtml += _SitePath + _FolderData.StyleSheet; } if (_FolderData.StyleSheetInherited) { td_vf_stylesheettxt.InnerHtml += "<div class=\"ektronCaption\">" + _MessageHelper.GetMessage("inherited style sheet msg") + "</div>"; } DrawContentAliasesTable(); IsContentSearchableSection(); IsDisplaySettings(); DrawContentTemplatesTable(); DrawFolderTaxonomyTable(); //Assigned taxonomy long iTmpCaller = _ContentApi.RequestInformationRef.CallerId; try { _ContentApi.RequestInformationRef.CallerId = Ektron.Cms.Common.EkConstants.InternalAdmin; _ContentApi.RequestInformationRef.UserId = Ektron.Cms.Common.EkConstants.InternalAdmin; AssetConfigInfo[] asset_config = _ContentApi.GetAssetMgtConfigInfo(); if (asset_config[10].Value.IndexOf("ektron.com") > -1) { ltrCheckPdfServiceProvider.Text = _MessageHelper.GetMessage("pdf service provider"); } else { ltrCheckPdfServiceProvider.Text = ""; } } catch (Exception ex) { string _error = ex.Message; } finally { _ContentApi.RequestInformationRef.CallerId = iTmpCaller; _ContentApi.RequestInformationRef.UserId = iTmpCaller; } if (_FolderData.PublishPdfEnabled && (Ektron.Cms.Common.EkEnumeration.FolderType)_FolderType != Ektron.Cms.Common.EkEnumeration.FolderType.Calendar) { if (_FolderData.PublishPdfActive) { td_vf_pdfactivetxt.InnerHtml += _MessageHelper.GetMessage("publish as pdf"); ltrCheckPdfServiceProvider.Visible = true; } else { td_vf_pdfactivetxt.InnerHtml += _MessageHelper.GetMessage("lbl Publish native format"); ltrCheckPdfServiceProvider.Visible = false; } } else { phPublishAsPdf.Visible = false; } // show domain info if (_FolderData.IsDomainFolder) { phProductionDomain.Visible = true; SettingsData settings_list; SiteAPI m_refSiteAPI = new SiteAPI(); CommonApi m_refCommonAPI = new CommonApi(); Ektron.Cms.Common.EkRequestInformation request_info; settings_list = m_refSiteAPI.GetSiteVariables(-1); request_info = m_refCommonAPI.RequestInformationRef; DomainFolder.Text += "<tr>"; DomainFolder.Text += "<td class=\"label\">" + _MessageHelper.GetMessage("lbl Staging Domain") + ":</td>"; DomainFolder.Text += "<td class=\"value\">http://" + _FolderData.DomainStaging + "</td>"; DomainFolder.Text += "</tr>"; DomainFolder.Text += "<tr>"; DomainFolder.Text += "<td class=\"label\">" + _MessageHelper.GetMessage("lbl Production Domain") + ":</td>"; DomainFolder.Text += "<td class=\"value\">http://" + _FolderData.DomainProduction + "</td>"; DomainFolder.Text += "</tr>"; } if (_FolderData.IsDomainFolder && _FolderData.ParentId == 0) { DrawFolderLocaleTaxonomyTable(); } else { LocaleTaxonomy.Visible = false; } // show categories if its a blog if (isBlog) { if (!(_BlogData.Categories == null) && _BlogData.Categories.Length > 0) { for (this._i = 0; this._i <= _BlogData.Categories.Length - 1; this._i++) { ltr_vf_categories.Text += _BlogData.Categories[this._i]; ltr_vf_categories.Text += "<br/>"; } } else { ltr_vf_categories_lbl.Text = "No subjects"; } if (!(_BlogData.BlogRoll == null) && _BlogData.BlogRoll.Length() > 0) { for (this._i = 0; this._i <= _BlogData.BlogRoll.Length() - 1; this._i++) { Table tRoll = new Table(); tRoll.CssClass = "ektronGrid"; TableRow tRollRow = new TableRow(); TableCell tRollCell = new TableCell(); //Link Name tRollCell = new TableCell(); tRollRow = new TableRow(); tRollCell.Text = "Link Name:"; tRollCell.CssClass = "label"; tRollRow.Controls.Add(tRollCell); tRollCell = new TableCell(); tRollCell.Text = _BlogData.BlogRoll.RollItem(this._i).LinkName; tRollCell.CssClass = "readOnlyValue"; tRollRow.Controls.Add(tRollCell); tRoll.Controls.Add(tRollRow); //URL tRollCell = new TableCell(); tRollRow = new TableRow(); tRollCell.Text = "URL:"; tRollCell.CssClass = "label"; tRollRow.Controls.Add(tRollCell); tRollCell = new TableCell(); tRollCell.Text = _BlogData.BlogRoll.RollItem(this._i).URL; tRollCell.CssClass = "readOnlyValue"; tRollRow.Controls.Add(tRollCell); tRoll.Controls.Add(tRollRow); //Short Description tRollCell = new TableCell(); tRollRow = new TableRow(); tRollCell.Text = "Short Description:"; tRollCell.CssClass = "label"; tRollRow.Controls.Add(tRollCell); tRollCell = new TableCell(); tRollCell.Text = _BlogData.BlogRoll.RollItem(this._i).ShortDescription; tRollCell.CssClass = "readOnlyValue"; tRollRow.Controls.Add(tRollCell); tRoll.Controls.Add(tRollRow); //Relationship tRollCell = new TableCell(); tRollRow = new TableRow(); tRollCell.Text = "Relationship:"; tRollCell.CssClass = "label"; tRollRow.Controls.Add(tRollCell); tRollCell = new TableCell(); tRollCell.Text = _BlogData.BlogRoll.RollItem(this._i).Relationship; tRollCell.CssClass = "readOnlyValue"; tRollRow.Controls.Add(tRollCell); tRoll.Controls.Add(tRollRow); lbl_vf_roll.Controls.Add(tRoll); Literal spacer = new Literal(); spacer.Text = "<div class=\'ektronTopSpace\'></div>"; lbl_vf_roll.Controls.Add(spacer); } } } if (_SettingsData.EnablePreApproval) { phPreapprovalGroup.Visible = true; cPreApproval = _ContentApi.EkContentRef.GetFolderPreapprovalGroup(_Id); if (-1 == Convert.ToInt32(cPreApproval["PreApprovalGroupID"])) { td_vf_preapprovaltxt.InnerHtml += cPreApproval["UserGroupName"] + " (Inherited)"; } else if (0 == Convert.ToInt32(cPreApproval["PreApprovalGroupID"])) { td_vf_preapprovaltxt.InnerHtml += "(None)"; } else { td_vf_preapprovaltxt.InnerHtml += cPreApproval["PreApprovalGroup"]; } } // display replication settings for folder if (_ContentApi.RequestInformationRef.EnableReplication) { bool bShowReplicationMethod = true; if (_FolderData.ParentId != 0 && ((Ektron.Cms.Common.EkEnumeration.FolderType)_FolderType == Ektron.Cms.Common.EkEnumeration.FolderType.Blog || (Ektron.Cms.Common.EkEnumeration.FolderType)_FolderType == Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionForum)) { FolderData tmp_folder_data = null; tmp_folder_data = this._ContentApi.EkContentRef.GetFolderById(_FolderData.ParentId); if ((Ektron.Cms.Common.EkEnumeration.FolderType)tmp_folder_data.FolderType == Ektron.Cms.Common.EkEnumeration.FolderType.Community) { bShowReplicationMethod = false; } } if (bShowReplicationMethod) { ReplicationMethod.Text = "<tr><td> </td></tr><tr><td class=\"label\">" + _MessageHelper.GetMessage("lbl folderdynreplication") + "</td></tr><tr><td>"; if (_FolderData.ReplicationMethod == 1) { ReplicationMethod.Text += _MessageHelper.GetMessage("replicate folder contents"); } else { ReplicationMethod.Text += _MessageHelper.GetMessage("generic No"); } ReplicationMethod.Text += " </td></tr>"; } } // Show Custom-Field folder assignments: CustomFieldsApi customFieldsApi = new CustomFieldsApi(); if (_ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED) { customFieldsApi.ContentLanguage = _ContentApi.DefaultContentLanguage; } else { customFieldsApi.ContentLanguage = _ContentLanguage; } litMetadata.Text = customFieldsApi.GetEditableCustomFieldAssignments(_Id, false); customFieldsApi = null; DisplaySitemapPath(); DisplaySubscriptionInfo(); DrawContentTypesTable(); if (_FolderType == 2) //OrElse m_intFolderId = 0 Avoiding root to be site aliased { phSiteAlias.Visible = true; DisplaySiteAlias(); } Showpane(); }
private void Display_EditContentProperties() { XmlConfigData[] xmlconfig_data; string xmlseltagvalue = "0"; bool OptionSelected = false; MultiConfigData xmlconfig_content; int i = 0; string configResource = "xml configuration label"; content_data = m_refContentApi.GetContentById(m_intId, 0); if (content_data.Type == EkConstants.CMSContentType_CatalogEntry) { ProductTypeApi m_refProductTypeAPI = new ProductTypeApi(); Criteria<ProductTypeProperty> criteria = new Criteria<ProductTypeProperty>(); xmlconfig_data = m_refProductTypeAPI.GetList(criteria).ToArray(); configResource = "lbl product type xml config"; } else { xmlconfig_data = m_refContentApi.GetAllXmlConfigurations("title"); } folder_data = m_refContentApi.GetFolderById(content_data.FolderId); security_data = m_refContentApi.LoadPermissions(m_intId, "content", 0); content_id.Value = m_intId.ToString(); xmlconfig_content = m_refContentApi.EkContentRef.GetXmlConfig(content_data.Id, content_data.LanguageId); if (content_data.Type == EkConstants.CMSContentType_CatalogEntry) { EditEntryPropertiesToolBar(); } else { EditContentPropertiesToolBar(); } if (xmlconfig_content.XmlID == 0) { if (content_data.XmlConfiguration == null) { content_data.XmlConfiguration = new XmlConfigData(); } } if (content_data.XmlConfiguration.Id != 0) { td_ecp_xmlconfiglbl.InnerHtml = m_refMsg.GetMessage(configResource); if (content_data.Type == EkConstants.CMSContentType_CatalogEntry) { td_ecp_xmlconfig.InnerHtml = "<input type=\"hidden\" name=\"xmlconfig\" id=\"xmlconfig\" value=\"" + content_data.XmlConfiguration.Id + "\"/>"; td_ecp_xmlconfig.InnerHtml += "<select name=\"xmlconfig_disabled\" "; } else { td_ecp_xmlconfig.InnerHtml = "<select name=\"xmlconfig\" "; } if (xmlconfig_content.XmlID == 0 || content_data.Type == EkConstants.CMSContentType_CatalogEntry) { td_ecp_xmlconfig.InnerHtml += " disabled "; } td_ecp_xmlconfig.InnerHtml += ">"; if (!(xmlconfig_data == null)) { for (i = 0; i <= xmlconfig_data.Length - 1; i++) { if (content_data.IsXmlInherited == false || xmlconfig_content.XmlID != 0) { if (!(content_data.XmlConfiguration == null)) { if (content_data.XmlConfiguration.Id == xmlconfig_data[i].Id || xmlconfig_content.XmlID == xmlconfig_data[i].Id) { OptionSelected = true; xmlseltagvalue = xmlconfig_data[i].Id.ToString(); } else { OptionSelected = false; } } } td_ecp_xmlconfig.InnerHtml += "<option value=\"" + xmlconfig_data[i].Id + "\""; if (OptionSelected) { td_ecp_xmlconfig.InnerHtml += " selected "; } td_ecp_xmlconfig.InnerHtml += ">" + xmlconfig_data[i].Title; } } td_ecp_xmlconfig.InnerHtml += "</select>"; td_ecp_xmlconfig.InnerHtml += "<input type=\"hidden\" name=\"init_xmlconfig\" value=\"" + xmlseltagvalue + "\">"; if (!(content_data.Type == EkConstants.CMSContentType_CatalogEntry)) { td_ecp_xmlconfig_lnk.InnerHtml = "<a href=\"#\" Onclick=\"javascript:PreviewXmlConfig();\"><img src=\"" + m_refContentApi.AppPath + "images/UI/Icons/preview.png" + "\" border=\"0\" alt=\"" + m_refMsg.GetMessage("alt preview button text (xml config)") + "\" title=\"" + m_refMsg.GetMessage("alt preview button text (xml config)") + "\"></a>"; } } if (content_data.SubType != EkEnumeration.CMSContentSubtype.WebEvent) { xmlConfigPanel.Visible = true; } else { xmlConfigPanel.Visible = false; } searchable.InnerHtml = m_refMsg.GetMessage("lbl content searchable"); searchable.InnerHtml += " <input type=\"checkbox\" name=\"IsSearchable\""; if (content_data.SubType == EkEnumeration.CMSContentSubtype.PageBuilderMasterData) searchable.InnerHtml += " disabled=\"disabled\""; else { if (content_data.IsSearchable == true) { searchable.InnerHtml += " checked "; } } searchable.InnerHtml += ">"; // Display content flagging options: flagging.InnerHtml = m_refMsg.GetMessage("wa tree flag def"); long contentFlagId = content_data.FlagDefId; if (contentFlagId > 0) { FlagDefData fd = m_refContentApi.EkContentRef.GetFlaggingDefinitionbyID(contentFlagId, false); if (fd != null) { if (string.IsNullOrEmpty(fd.Name)) { lblflag.Text = "None"; } else { lblflag.Text = fd.Name; // & " (Id:" & fd.ID & ")" } } else { lblflag.Text = "None"; } } else { lblflag.Text = "None"; } }
private void Page_Load(System.Object sender, System.EventArgs e) { isMac = Utilities.IsMac(); m_refMsg = _SiteApi.EkMsgRef; AppImgPath = _SiteApi.AppImgPath; AppPath = _SiteApi.AppPath; if (m_refContentApi.RequestInformationRef.IsMembershipUser == 1 || m_refContentApi.RequestInformationRef.UserId == 0) { Response.Redirect((string)("reterror.aspx?info=" + Server.UrlEncode(m_refMsg.GetMessage("msg login cms user"))), false); return; } RegisterResources(); if (!(Request.QueryString["LangType"] == null)) { if (Request.QueryString["LangType"] != "") { ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); _SiteApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); } else { if (_SiteApi.GetCookieValue("LastValidLanguageID") != "") { ContentLanguage = Convert.ToInt32(_SiteApi.GetCookieValue("LastValidLanguageID")); } } } else { if (_SiteApi.GetCookieValue("LastValidLanguageID") != "") { ContentLanguage = Convert.ToInt32(_SiteApi.GetCookieValue("LastValidLanguageID")); } } _SiteApi.ContentLanguage = ContentLanguage; ektRW = _SiteApi.EkUrlRewriteRef; //intQString = Request.QueryString //folderID = Request.QueryString("FolderID") long.TryParse(Request.QueryString["FolderID"].ToString(), out folderID); sFormName = Request.QueryString["formName"]; sTFormElement = Request.QueryString["titleFormElem"]; iQLInkCheck = Request.QueryString["useQLinkCheck"]; SetBrowserState = Request.QueryString["SetBrowserState"]; intQStringNoFID = (string)("formName=" + sFormName); if (sTFormElement != "") { intQStringNoFID = intQStringNoFID + "&titleFormElem=" + sTFormElement; } if (!string.IsNullOrEmpty(Convert.ToString(iQLInkCheck))) { intQStringNoFID = intQStringNoFID + "&useQLinkCheck=" + iQLInkCheck; } if (SetBrowserState != "") { intQStringNoFID = intQStringNoFID + "&SetBrowserState=" + SetBrowserState; } forceTemplate = Request.QueryString["forcetemplate"]; gtNavs = m_refContentApi.EkContentRef.GetFolderInfoWithPath(folderID); FolderName = gtNavs["FolderName"].ToString(); FolderType = (EkEnumeration.FolderType)gtNavs["FolderType"]; parentfolderid = gtNavs["ParentID"].ToString(); fpath = gtNavs["Path"].ToString(); gtNavs = null; cTmp = new Collection(); cTmp.Add("name", "OrderBy", null, null); cTmp.Add(folderID, "FolderID", null, null); cTmp.Add(folderID, "ParentID", null, null); cTmp.Add(folderID, "FilterContentAssetType", null, null); cfolders = m_refContentApi.EkContentRef.GetAllViewableChildFoldersv2_0(cTmp); cPerms = m_refContentApi.LoadPermissions(folderID, "folder", 0); CanCreateContent = cPerms.CanAdd; if (Request.QueryString["disAllowAddContent"] == "1") { CanCreateContent = false; } else if (FolderType == EkEnumeration.FolderType.Catalog) { CanCreateContent = false; } else if (CanCreateContent == true && isMac == true) { XmlConfigData[] active_xml_list = m_refContentApi.GetEnabledXmlConfigsByFolder(folderID); if ((Utilities.IsNonFormattedContentAllowed(active_xml_list)) == false) { CanCreateContent = false; } } if (!Page.IsPostBack) { PopulateQLinkList(); } QuickLinkSelectToolBar(); }
protected override void Page_Load(object sender, System.EventArgs e) { base.Page_Load(sender, e); Utilities.ValidateUserLogin(); m_SelectedEditControl = Utilities.GetEditorPreference(Request); objCookieObject = Ektron.Cms.CommonApi.GetEcmCookie(); if (objCookieObject != null && !(objCookieObject.Values["editoroptions"] == null)) { m_SelectedEditControl = objCookieObject.Values["editoroptions"].ToLower(); } if (m_SelectedEditControl.ToLower() == "jseditor") { cdContent_teaser.Visible = false; } bool bPermissions = true; m_refContentApi = new Ektron.Cms.ContentAPI(); iNewLang = m_refContentApi.ContentLanguage; if (!String.IsNullOrEmpty(Request.QueryString["dynamicbox"])) { bDynamicBox = Convert.ToBoolean(Request.QueryString["dynamicbox"]); } if (!String.IsNullOrEmpty(Request.QueryString["forum"])) { try { IsForum = Convert.ToBoolean(Convert.ToInt32(Request.QueryString["forum"])); } catch (Exception) { IsForum = false; } } setlabels(); if (!IsForum && m_SelectedEditControl.ToLower() == "jseditor") { AddEkDoPostBack(); } this.dialog_publish.Attributes.Add("onclick", "return publish_handler();"); this.dialog_publish_top.Attributes.Add("onclick", "return publish_handler();"); this.dialog_publish_asset.Attributes.Add("onclick", "return publish_handler();"); if (!String.IsNullOrEmpty(Request.QueryString["mode"])) { if (Request.QueryString["mode"].Trim().ToLower() == "edit") { Mode = CurrentMode.Edit; } else if (Request.QueryString["mode"].Trim().ToLower() == "addlang") { Mode = CurrentMode.Edit; bWithLang = true; if (!String.IsNullOrEmpty(Request.QueryString["Lang"])) iOrigLang = Convert.ToInt32(Request.QueryString["Lang"]); } else { Mode = CurrentMode.Add; } } SetCSS(); if (!String.IsNullOrEmpty(Request.QueryString["mode_id"])) { try { ModeID = Convert.ToInt64(Request.QueryString["mode_id"]); } catch (Exception) { ModeID = 0; } } if (!String.IsNullOrEmpty(Request.QueryString["lang_id"])) { try { LangID = Convert.ToInt32(Request.QueryString["lang_id"]); } catch (Exception) { LangID = m_refContentApi.RequestInformationRef.DefaultContentLanguage; } } if (!String.IsNullOrEmpty(Request.QueryString["langtype"])) { try { LangID = Convert.ToInt32(Request.QueryString["langtype"]); } catch (Exception) { LangID = m_refContentApi.RequestInformationRef.DefaultContentLanguage; } } if (LangID == -1 || LangID == 0) { LangID = m_refContentApi.RequestInformationRef.DefaultContentLanguage; } m_refContentApi.RequestInformationRef.ContentLanguage = LangID; m_refContentApi.ContentLanguage = LangID; if (!Page.IsPostBack) { if (m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.TaxonomyAdministrator, m_refContentApi.RequestInformationRef.UserId, false)) { TaxonomyRoleExists = true; } switch (Mode) { case CurrentMode.Add: auto_generate_summary.Visible = false; content_id.Value = "0"; security_data = m_refContentApi.LoadPermissions(ModeID, "folder", 0); if (!security_data.CanAdd) { title_label.Text = "You do not have rights to add content in FolderID=" + ModeID; bPermissions = false; } else { Ektron.Cms.API.Folder folderApi = new Ektron.Cms.API.Folder(); folder_data = folderApi.GetFolder(ModeID); if (folder_data != null) { if (cssFilesPath == "") //apply stylesheet from folderdata { cssFilesPath = this.m_refContentApi.RequestInformationRef.SitePath + folder_data.StyleSheet; } if (cssFilesPath.Length > 0) { cdContent_teaser.Stylesheet = cssFilesPath; } } cdContent_teaser.FolderId = ModeID; if (!IsForum && m_SelectedEditControl.ToLower() == "jseditor") { InnerEditor.ToolbarLayout = SetToolbar(); ftb_control.Text = InnerEditor.ToString(); ftb_control.Visible = true; cdContent_teaser.Visible = false; } else if (!IsForum) { ftb_control.Visible = false; cdContent_teaser.Visible = true; } SetTaxonomy(0, ModeID); } break; case CurrentMode.Edit: auto_generate_summary.Visible = true; content_id.Value = ModeID.ToString(); if (!String.IsNullOrEmpty(Request.QueryString["mode"]) && Request.QueryString["mode"].Trim().ToLower() == "addlang") { long folderid = 0; if (!String.IsNullOrEmpty(Request.QueryString["folder"])) { long.TryParse(Request.QueryString["folder"], out folderid); } security_data = m_refContentApi.LoadPermissions(folderid, "folder", 0); if (!security_data.CanAdd) { title_label.Text = "You do not have rights to add language content block ID=" + ModeID; bPermissions = false; } } else { security_data = m_refContentApi.LoadPermissions(ModeID, "content", 0); if (!security_data.CanEdit && !IsForum) { title_label.Text = "You do not have rights to edit content block ID=" + ModeID; bPermissions = false; } else { Ektron.Cms.API.Folder folderApi = new Ektron.Cms.API.Folder(); folder_data = folderApi.GetFolder(ModeID); if (folder_data != null) { if (cssFilesPath == "") //apply stylesheet from folderdata { cssFilesPath = this.m_refContentApi.RequestInformationRef.SitePath + folder_data.StyleSheet; } if (cssFilesPath.Length > 0) { cdContent_teaser.Stylesheet = cssFilesPath; } } } } if (bPermissions) { if (Request.QueryString["ctlupdateid"] != "") { commparams = (string)("&ctlupdateid=" + Request.QueryString["ctlupdateid"] + "&ctlmarkup=" + Request.QueryString["ctlmarkup"] + "&cltid=" + Request.QueryString["cltid"] + "&ctltype=" + Request.QueryString["ctltype"]); updateFieldId = Request.QueryString["ctlupdateid"]; Page.ClientScript.RegisterHiddenField("ctlupdateid", updateFieldId); } if (Request.QueryString["ctlmarkup"] != "") { Page.ClientScript.RegisterHiddenField("ctlmarkup", Request.QueryString["ctlmarkup"]); } if (Request.QueryString["ctltype"] != "") { Page.ClientScript.RegisterHiddenField("ctltype", Request.QueryString["ctltype"]); } if (Request.QueryString["cltid"] != "") { Page.ClientScript.RegisterHiddenField("cltid", Request.QueryString["cltid"]); } SetContentBlock(); } break; } if (!bPermissions) { ftb_control.Visible = false; title_value.Visible = false; dialog_publish.Visible = false; dialog_publish_top.Visible = false; dialog_publish_asset.Visible = false; cdContent_teaser.Visible = false; return; } ltr_js.Text = this.EditorJS(); if (m_SelectedEditControl.ToLower() != "jseditor") { ftb_control.Visible = false; //set the equavalent SetToolbar() to contentdesigner if (cdContent_teaser != null) { string ToolsOption = ""; if (security_data.CanAdd) { ToolsOption = "Wiki=1"; } bool bLibraryAllowed = false; if (security_data.IsReadOnlyLib) { bLibraryAllowed = true; } ToolsOption = ToolsOption + ("&LibraryAllowed=" + bLibraryAllowed.ToString()); bool bCanModifyImg = false; if (security_data.CanAddToImageLib) { bCanModifyImg = true; } ToolsOption = ToolsOption + ("&CanModifyImg=" + bCanModifyImg.ToString()); if (ToolsOption.Length > 0) { ToolsOption = (string)("?" + ToolsOption); } cdContent_teaser.SetPermissions(security_data); cdContent_teaser.ToolsFile = this.m_refContentApi.RequestInformationRef.ApplicationPath + "ContentDesigner/configurations/InterfaceBlog.aspx" + ToolsOption; if (!(Request.QueryString["editorVisible"] == null)) { //To avoid the editor's onbeforeunload checks being called cdContent_teaser.Visible = System.Convert.ToBoolean(Request.QueryString["editorVisible"]); } } } } if (dialog_publish.Visible == true) { tr_pub.Visible = true; tr_asset.Visible = false; } else { tr_pub.Visible = false; tr_asset.Visible = true; } string _helpUrl = string.Empty; if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["ek_helpDomainPrefix"])) { string helpDomain = ConfigurationManager.AppSettings["ek_helpDomainPrefix"]; Uri _uri = new Uri(helpDomain); if (_uri != null && !_uri.IsFile) { if ((helpDomain.IndexOf("[ek_cmsversion]") > 1)) { //defect # 64951 - This help file (It had been its own help project in previous releases as well). _helpUrl = " http://documentation.ektron.com/current/memberhelp/wwhelp/wwhimpl/js/html/wwhelp.htm"; } } else { _helpUrl = this.m_refContentApi.RequestInformationRef.ApplicationPath + "/helpmessage.aspx?error=isfile"; } } else { _helpUrl = this.m_refContentApi.RequestInformationRef.ApplicationPath + "/help/memberhelp/index.html"; } help_button.Text = "<a href=\"#\"><img id=\"DeskTopHelp\" title=\"" + this.m_refMsg.GetMessage("alt help button text") + "\" border=\"0\" src=\"" + this.m_refContentApi.RequestInformationRef.ApplicationPath + "/images/application/menu/help.gif\" onclick=\"javascript:PopUpWindow(\'" + _helpUrl + "\', \'SitePreview\', 600, 500, 1, 1);return false;\"></a>"; if (IsForum) { SetForumMode(); } }
private void SetContentBlock() { long ifolderid = 0; //cb.EnableMembershipEditing = True if (this.bWithLang == true) { cb.LanguageID = this.iOrigLang; } cb.DefaultContentID = ModeID; cb.LanguageID = m_refContentApi.ContentLanguage; cb.Page = this; cb.Fill(); ifolderid = cb.EkItem.FolderId; if (m_SelectedEditControl == "jseditor") { InnerEditor.Text = cb.EkItem.Html; } else { cdContent_teaser.Content = cb.EkItem.Html; cdContent_teaser.FolderId = ifolderid; } if (this.bWithLang == true) { m_refContentApi.ContentLanguage = this.iOrigLang; } security_data = m_refContentApi.LoadPermissions(cb.EkItem.FolderId, "folder", 0); if (m_SelectedEditControl.ToLower() == "jseditor") { InnerEditor.ToolbarLayout = SetToolbar(); ftb_control.Text = InnerEditor.ToString(); } title_value.Text = Server.HtmlDecode(cb.EkItem.Title); // content_data = m_refContentApi.GetContentById(ModeID) if (IsForum) { ifolderid = m_refContentApi.GetParentIdByFolderId(cb.EkItem.FolderId); } if (m_refContentApi.UserId > 0) { folder_data = m_refContentApi.GetFolderById(ifolderid); } else { folder_data = new FolderData(); } if (cb.EkItem.Teaser.Trim() == "") { auto_generate_summary.Visible = false; } if (cb.EkItem.AssetInfo != null && cb.EkItem.AssetInfo.Id.Length > 0) { Ektron.Cms.UI.CommonUI.ApplicationAPI AppUI = new Ektron.Cms.UI.CommonUI.ApplicationAPI(); ltr_js.Visible = false; title_label.Visible = false; title_value.Visible = false; change_notification.Visible = false; ftb_control.Visible = false; dialog_publish.Visible = false; dialog_publish_top.Visible = false; content_block_view.Visible = true; content_block_overwrite.Visible = true; ContentBase _ekItem = cb.EkItem; content_block_view.Text = AppUI.ecmNextGenContentBlock(ref _ekItem, "", 0); content_block_overwrite.DefaultAssetID = ModeID; cdContent_teaser.Visible = false; } SetTaxonomy(ModeID, ifolderid); }
public bool HasWriteAccess(string permissionCode) { return(PermissionData.ContainsKey(permissionCode) && PermissionData[permissionCode] == ALL_ACCESS); }
private void Display_AddApproval() { security_data = m_refContentApi.LoadPermissions(m_intId, ItemType, 0); if (ItemType == "folder") { folder_data = m_refContentApi.GetFolderById(m_intId); } else { content_data = m_refContentApi.GetContentById(m_intId, 0); } ApprovalData[] approval_data; approval_data = m_refContentApi.GetAllUnassignedItemApprovals(m_intId, ItemType); AddApprovalToolBar(); Populate_AddApprovals(approval_data); }
public bool HasReadAccess(string permissionCode) { return(PermissionData.ContainsKey(permissionCode)); }
private void DrawData() { perm_data = m_refContentApi.LoadPermissions(FolderId, "folder", 0); CanCreateContent = perm_data.CanAdd; GenerateToolBar(); PopulateGridData(); }
private void Display_ViewForm() { bool CanIAddLang = true; bool TaskExists = false; PermissionData security_task_data; m_refContent = m_refContentApi.EkContentRef; //Check to see if it's passing it by content-id if (Request.QueryString["form_content_id"] != null && Request.QueryString["form_content_id"] != "") { m_intFormId = Convert.ToInt64(Request.QueryString["form_content_id"]); form_data = m_refContentApi.GetFormById(m_intFormId); } else { form_data = m_refContentApi.GetFormById(m_intFormId); } if (form_data == null) { throw (new Exception("Unable to view form. ID=" + m_intFormId)); } if (Request.QueryString["staged"] != null && Request.QueryString["staged"] != "") { content_data = m_refContentApi.GetContentById(form_data.Id, ContentAPI.ContentResultType.Staged); } else { content_data = m_refContentApi.GetContentById(form_data.Id, 0); } TaskExists = m_refContent.DoesTaskExistForContent(form_data.Id); security_task_data = m_refContentApi.LoadPermissions(form_data.Id, "tasks", ContentAPI.PermissionResultType.Task); security_data = m_refContentApi.LoadPermissions(form_data.Id, "content", ContentAPI.PermissionResultType.All); security_data.CanAddTask = security_task_data.CanAddTask; security_data.CanDestructTask = security_task_data.CanDestructTask; security_data.CanRedirectTask = security_task_data.CanRedirectTask; security_data.CanDeleteTask = security_task_data.CanDeleteTask; CanIAddLang = security_data.CanAdd; // Replace [srcpath] with actual path. [srcpath] is used in calendar field. if (content_data.Html != null&& content_data.Html.Length > 0) { td_vf_content.InnerHtml = content_data.Html.Replace("[srcpath]", m_refContentApi.ApplicationPath + m_refContentApi.AppeWebPath); td_vf_content.InnerHtml = td_vf_content.InnerHtml.Replace("[skinpath]", m_refContentApi.ApplicationPath + "csslib/ContentDesigner/"); } else { td_vf_content.InnerHtml = content_data.Html; } if (content_data.Teaser.Length > 0) { td_vf_summary.InnerHtml = DisplayFormDesign(content_data.Teaser); } else { td_vf_summary.InnerHtml = "<p>" + m_refMsg.GetMessage("lbl place post back message here") + "</p>"; } ViewToolBar(); Populate_ViewForm(form_data); }
public ActionResult Create(int[] kids, FormCollection formCollection) { try { RoleRepository ml = new RoleRepository(); Role obj = new Role() { CreateDate = DateTime.Now, CreateUserID = ID, IsDeleted = false }; UpdateModel(obj); ml.Insert(obj); int rid = ml.Search(obj).First().ID; #region 更新引角色权限 if (rid > 1) { var pdl = new PermissionDataRepository(); pdl.DeleteByMIDOrRID(rid, 0); var pmlts = new PermissionMapRepository().GetList(1, 1000); if (pmlts != null) { string pData = formCollection["pData"]; foreach (var item in pmlts) { var pdt = new PermissionData() { PID = item.ID, RID = rid, HasPermission = false, CreateUserID = CurrentMember.ID, LastUpdateUserID = CurrentMember.ID, CreateDate = DateTime.Now, LastUpdateDate = DateTime.Now, IsDeleted = false }; if (!string.IsNullOrEmpty(pData)) { try { var pDataArr = pData.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (pDataArr.Contains(item.ID.ToString())) { pdt.HasPermission = true; } } catch { } } pdl.Insert(pdt); } } } PermissionHelper permission = new PermissionHelper(); permission.Write(); #endregion return(Content(ContentIcon.Succeed + "|保存成功|/admin/Role/Index")); } catch (Exception ex) { return(Content(ContentIcon.Error + "|" + ErrorWirter(RouteData, ex.Message))); } }
private void Display_EditCatalog() { ltInheritSitemapPath.Text = _MessageHelper.GetMessage("lbl Inherit Parent Configuration"); ltrTypes.Text = _MessageHelper.GetMessage("lbl product types"); _PermissionData = _ContentApi.LoadPermissions(_Id, "folder", 0); _FolderData = _ContentApi.GetFolderById(_Id, true, true); _FolderType = _FolderData.FolderType; EditCatalogToolBar(); oldfolderdescription.Value = Server.HtmlDecode(_FolderData.Description); folderdescription.Value = Server.HtmlDecode(_FolderData.Description); folder_id.Value = _FolderData.Id.ToString(); phFolderProperties1.Visible = true; lit_ef_folder.Text = "<input type=\"text\" maxlength=\"100\" size=\"75\" value=\"" + _FolderData.Name + "\" name=\"foldername\"/><input type=\"hidden\" value=\"\" name=\"oldfoldername\" id=\"oldfoldername\" />"; if ((_FolderData.StyleSheetInherited) && (_FolderData.StyleSheet != "")) { lit_ef_ss.Text = "" + _ContentApi.SitePath + "<input type=\"text\" maxlength=\"255\" size=\"" + (75 - _ContentApi.SitePath.Length) + "\" value=\"\" name=\"stylesheet\"/>"; lit_ef_ss.Text += "<br />" + _MessageHelper.GetMessage("inherited style sheet msg") + _ContentApi.SitePath + _FolderData.StyleSheet; } else { lit_ef_ss.Text = _ContentApi.SitePath + "<input type=\"text\" maxlength=\"255\" size=\"" + (75 - _ContentApi.SitePath.Length) + "\" value=\"" + _FolderData.StyleSheet + "\" name=\"stylesheet\"/>"; } lit_ef_templatedata.Text = "<input type=\"hidden\" maxlength=\"255\" size=\"" + (75 - _ContentApi.SitePath.Length) + "\" value=\"\" name=\"templatefilename\" id=\"templatefilename\"/>"; DrawContentTemplatesTable(); DrawFlaggingOptions(); Ektron.Cms.Common.EkRequestInformation request_info = _ContentApi.RequestInformationRef; // handle dynamic replication settings if (request_info.EnableReplication) { bool bShowReplicationMethod = true; if (bShowReplicationMethod) { string schk = ""; if (_FolderData.ReplicationMethod == 1) { schk = " checked"; } ReplicationMethod.Text = _MessageHelper.GetMessage("lbl folderdynreplication"); ReplicationMethod.Text += "<input type=\"checkbox\" name=\"EnableReplication\" id=\"EnableReplication\" value=\"1\"" + schk + " ><label for=\"EnableReplication\"/>" + _MessageHelper.GetMessage("replicate folder contents") + "</label>"; } else { // if we're not showing it, it means replication is enabled because we're under a parent community folder ReplicationMethod.Text = "<input type=\"hidden\" name=\"EnableReplication\" value=\"1\" />"; } } js_ef_focus.Text = "Ektron.ready(function() { document.forms.frmContent.foldername.focus();" + Environment.NewLine; js_ef_focus.Text += " if( $ektron(\'#web_alert_inherit_checkbox\').length > 0 ){" + Environment.NewLine; js_ef_focus.Text += " if( $ektron(\'#web_alert_inherit_checkbox\')[0].checked ){" + Environment.NewLine; js_ef_focus.Text += " $ektron(\'.selectContent\').css(\'display\', \'none\');" + Environment.NewLine; js_ef_focus.Text += " $ektron(\'.useCurrent\').css(\'display\', \'none\');" + Environment.NewLine; js_ef_focus.Text += " } " + Environment.NewLine; js_ef_focus.Text += " } " + Environment.NewLine; js_ef_focus.Text += "});" + Environment.NewLine; DrawFolderTaxonomyTable(); DisplaySitemapPath(); DisplayCatalogMetadataInfo(); DisplaySubscriptionInfo(); DrawProductTypesTable(); DrawContentAliasesTable(); IsContentSearchableSection(); IsDisplaySettings(); }
protected override void Page_Load(object sender, System.EventArgs e) { try { base.Page_Load(sender, e); if (!Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.eCommerce)) { throw (new Exception(GetMessage("feature locked error"))); } Util_ObtainValues(); Util_CheckAccess(); m_refCatalog = new Ektron.Cms.Commerce.CatalogEntry(m_refContentApi.RequestInformationRef); m_refCurrency = new Currency(m_refContentApi.RequestInformationRef); m_refContent = m_refContentApi.EkContentRef; hdn_defaultCurrency.Value = m_refContentApi.RequestInformationRef.CommerceSettings.DefaultCurrencyId.ToString(); switch (this.m_sEditAction) { case "add": case "addlang": m_iFolder = this.m_iID; if (!Page.IsPostBack) { UserRights = m_refContentApi.LoadPermissions(m_iFolder, "folder", ContentAPI.PermissionResultType.Folder); ContentMetaData[] defaultMeta; Util_CheckFolderType(); if (m_sEditAction == "addlang") { entry_edit_data = m_refCatalog.GetItem(otherLangId, backLangType); if (entry_edit_data.ProductType.Id > 0) { m_refProductType = new ProductType(m_refContentApi.RequestInformationRef); prod_type_data = m_refProductType.GetItem(entry_edit_data.ProductType.Id, true); editorPackage = prod_type_data.PackageXslt; xid = prod_type_data.Id; Util_SetXmlId(xid); hdn_entrytype.Value = entry_edit_data.EntryType.ToString(); } } if (entry_edit_data == null) { Util_GetEntryType(); } defaultMeta = m_refContentApi.GetMetaDataTypes("id"); if ((defaultMeta != null) && defaultMeta.Length > 0) { meta_data.AddRange(defaultMeta); } Display_ContentTab(); Display_SummaryTab(); Display_EntryTab(); Display_PricingTab(); Display_MediaTab(); Display_ItemTab(); Display_MetadataTab(); Display_ScheduleTab(); Display_TaxonomyTab(); Display_CommentTab(); Display_TemplateTab(); if ((_urlAliasSettingApi.IsManualAliasEnabled || _urlAliasSettingApi.IsAutoAliasEnabled) && m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias)) { Display_AliasTab(); } Util_SetLabels(); } else { Process_Add(); } break; case "update": if (!Page.IsPostBack) { UserRights = m_refContentApi.LoadPermissions(m_iID, "content", ContentAPI.PermissionResultType.Content); if (PullApproval) this.m_refContent.TakeOwnership(m_iID); entry_edit_data = m_refCatalog.GetItemEdit(m_iID, m_refContentApi.RequestInformationRef.ContentLanguage, true); if (entry_edit_data.ProductType.Id > 0) { m_refProductType = new ProductType(m_refContentApi.RequestInformationRef); prod_type_data = m_refProductType.GetItem(entry_edit_data.ProductType.Id, true); editorPackage = prod_type_data.PackageXslt; xid = prod_type_data.Id; Util_SetXmlId(xid); hdn_entrytype.Value = entry_edit_data.EntryType.ToString(); } meta_data = entry_edit_data.Metadata; m_iFolder = entry_edit_data.FolderId; Util_CheckFolderType(); Display_ContentTab(); Display_SummaryTab(); Display_EntryTab(); Display_PricingTab(); Display_MediaTab(); Display_ItemTab(); Display_MetadataTab(); Display_ScheduleTab(); Display_TaxonomyTab(); Display_CommentTab(); Display_TemplateTab(); if ((_urlAliasSettingApi.IsManualAliasEnabled || _urlAliasSettingApi.IsAutoAliasEnabled) && m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias)) { Display_AliasTab(); } Util_SetLabels(); } else { Process_Edit(); } break; } Util_SetJS(); if (prod_type_data != null) { hdn_productType.Value = prod_type_data.EntryClass.ToString(); } this.RegisterJs(); this.RegisterCss(); if (catalog_data != null) { chk_searchable.Checked = catalog_data.IscontentSearchable; } //-------------------DisplayTabs Based on selected options from Folder properties---------------------------------- if (((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.AllTabs) == (int)EkEnumeration.FolderTabDisplaySettings.AllTabs) && catalog_data.DisplaySettings != 0) { if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Summary) == (int)EkEnumeration.FolderTabDisplaySettings.Summary) { divSummary.Visible = true; } else { divSummary.Visible = false; liSummary.Visible = false; } if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.MetaData) == (int)EkEnumeration.FolderTabDisplaySettings.MetaData) { divMetadata.Visible = true; } else { if (!metadataRequired) { divMetadata.Visible = false; liMetadata.Visible = false; } } if ((_urlAliasSettingApi.IsManualAliasEnabled || _urlAliasSettingApi.IsAutoAliasEnabled) && m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias)) { if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Aliasing) == (int)EkEnumeration.FolderTabDisplaySettings.Aliasing) { divAlias.Visible = true; } else { if (!catalog_data.AliasRequired) { divAlias.Visible = false; liAlias.Visible = false; } } } if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Schedule) == (int)EkEnumeration.FolderTabDisplaySettings.Schedule) { divSchedule.Visible = true; } else { divSchedule.Visible = false; liSchedule.Visible = false; } if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Comment) == (int)EkEnumeration.FolderTabDisplaySettings.Comment) { divComment.Visible = true; } else { divComment.Visible = false; } if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Templates) == (int)EkEnumeration.FolderTabDisplaySettings.Templates) { divTemplates.Visible = true; } else { divTemplates.Visible = false; } if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy) == (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy) { divCategories.Visible = true; } else { if (!catalog_data.IsCategoryRequired) { divCategories.Visible = false; liCategory.Visible = false; } } } //-------------------DisplayTabs Based on selected options from Folder properties End------------------------------ } catch (Exception ex) { Utilities.ShowError(ex.Message); } }
protected bool Util_CheckAccess() { security_data = m_refContentApi.LoadPermissions(this.m_iID, "folder", 0); return security_data.IsReadOnly; }
protected void Util_ObtainValues() { if (Request.QueryString["back_LangType"] != "") { backLangType = Convert.ToInt64(Request.QueryString["back_LangType"]); } if (Request.QueryString["content_id"] != "") { otherLangId = Convert.ToInt64(Request.QueryString["content_id"]); } if (Request.QueryString["type"] != "") { m_sEditAction = Request.QueryString["type"]; } if (!(Request.QueryString["folder_id"] == null)) // add { m_iFolder = Convert.ToInt64(Request.QueryString["folder_id"]); } if (!(Request.QueryString["back_folder_id"] == null)) // edit { m_iFolder = Convert.ToInt64(Request.QueryString["back_folder_id"]); } if (Request.QueryString["xid"] != "") { xid = Convert.ToInt64(Request.QueryString["xid"]); if (xid > 0) { m_refProductType = new ProductType(m_refContentApi.RequestInformationRef); prod_type_data = m_refProductType.GetItem(xid, true); this.editorPackage = prod_type_data.PackageXslt; hdn_entrytype.Value = prod_type_data.EntryClass.ToString(); } } Util_SetXmlId(xid); m_cPerms = m_refContentApi.LoadPermissions(m_iFolder, "folder", 0); if (Request.QueryString["incontext"] != "") { _inContextEditing = Convert.ToBoolean(Request.QueryString["incontext"]); } //m_mMeasures = New Measurements(m_refContentApi.RequestInformationRef).GetMeasurements() }
private void Display_EditApprovalOrder() { bool bFolderUserAdmin = false; //FormAction = "content.aspx?LangType=" & m_intContentLanguage & "&action=DoUpdateApprovalOrder&id=" & m_intId & "&type=" & ItemType //SetPostBackPage() if (ItemType == "folder") { folder_data = m_refContentApi.GetFolderById(m_intId); } else { content_data = m_refContentApi.GetContentById(m_intId, 0); } ApprovalItemData[] approval_data; approval_data = m_refContentApi.GetItemApprovals(m_intId, ItemType); security_data = m_refContentApi.LoadPermissions(m_intId, ItemType, 0); if (!(folder_data == null)) { bFolderUserAdmin = security_data.IsAdmin || m_refContentApi.IsARoleMemberForFolder_FolderUserAdmin(folder_data.Id, 0, false); } else { if (!(content_data == null)) { bFolderUserAdmin = security_data.IsAdmin || m_refContentApi.IsARoleMemberForFolder_FolderUserAdmin(content_data.FolderId, 0, false); } else { bFolderUserAdmin = security_data.IsAdmin; } } if (!(security_data.IsAdmin || bFolderUserAdmin)) { throw (new Exception(m_refMsg.GetMessage("error: user not permitted"))); } EditApprovalOrderToolbar(); string strMsg = ""; int i = 0; if (!(approval_data == null)) { if (approval_data.Length < 20) { ApprovalList.Rows = approval_data.Length; } for (i = 0; i <= approval_data.Length - 1; i++) { if (approval_data[i].UserId > 0) { ApprovalList.Items.Add(new ListItem(approval_data[i].DisplayUserName, "user." + approval_data[i].UserId)); if (strMsg.Length == 0) { strMsg = "user." + approval_data[i].UserId; } else { strMsg += ",user." + approval_data[i].UserId; } } else { ApprovalList.Items.Add(new ListItem(approval_data[i].DisplayUserGroupName, "group." + approval_data[i].GroupId)); if (strMsg.Length == 0) { strMsg = "group." + approval_data[i].GroupId; } else { strMsg += ",group." + approval_data[i].GroupId; } } } } td_eao_link.InnerHtml = "<a href=\"javascript:Move(\'up\', document.forms[0]." + UniqueID + "_ApprovalList, document.forms[0]." + UniqueID + "_ApprovalOrder)\">"; td_eao_link.InnerHtml += "<img src=\"" + m_refContentApi.AppPath + "Images/ui/icons/arrowHeadUp.png\" valign=middle border=0 width=16 height=16 alt=\"" + m_refMsg.GetMessage("move selection up msg") + "\" title=\"" + m_refMsg.GetMessage("move selection up msg") + "\"></a><br />"; td_eao_link.InnerHtml += "<a href=\"javascript:Move(\'dn\', document.forms[0]." + UniqueID + "_ApprovalList, document.forms[0]." + UniqueID + "_ApprovalOrder)\">"; td_eao_link.InnerHtml += "<img src=\"" + m_refContentApi.AppPath + "Images/ui/icons/arrowHeadDown.png\" valign=middle border=0 width=16 height=16 alt=\"" + m_refMsg.GetMessage("move selection down msg") + "\" title=\"" + m_refMsg.GetMessage("move selection down msg") + "\"></a>"; td_eao_title.InnerHtml = m_refMsg.GetMessage("move within approvals msg"); td_eao_msg.InnerHtml = "<label class=\"label\">" + m_refMsg.GetMessage("first approver msg") + "</label>"; td_eao_ordertitle.InnerHtml = "<h2>" + m_refMsg.GetMessage("approval order title") + "</h2>"; ApprovalOrder.Value = strMsg; }
protected void Util_CheckAccess() { if (!Utilities.ValidateUserLogin()) { return; } if (m_refContentApi.RequestInformationRef.IsMembershipUser == 1) { Response.Redirect(m_refContentApi.ApplicationPath + "reterror.aspx?info=" + m_refMsg.GetMessage("msg login cms user"), false); } security_data = m_refContentApi.LoadPermissions(m_iID, "content", 0); }
private void Display_EditUser() { Ektron.Cms.Content.EkContent m_refContent; FromUsers = Request.QueryString["FromUsers"]; uId = long.Parse(Request.QueryString["id"]); user_data = m_refUserApi.GetUserById(uId, true, false); template_list = m_refContentApi.GetAllTemplates("TemplateFileName"); m_refContent = m_refSiteApi.EkContentRef; security_data = m_refContentApi.LoadPermissions(0, "content", 0); language.Text = GetAllLanguageDropDownMarkup("language", m_refMsg.GetMessage("app default msg")); if (m_intGroupType == 0) { defaultPreferences = m_refUserApi.GetUserPreferenceById(m_refSiteApi.UserId); if (defaultPreferences.FolderPath == null) { jsPreferenceFolderId.Text = ""; } else { jsPreferenceFolderId.Text = Convert.ToString(defaultPreferences.FolderPath).Replace("\\", "\\\\"); } jsPreferenceWidth.Text = defaultPreferences.Width.ToString(); jsPreferenceHeight.Text = defaultPreferences.Height.ToString(); jsPreferenceTemplate.Text = defaultPreferences.Template; jsPreferenceDispTitleTxt.Text = defaultPreferences.DisplayTitleText; TD_msg.Text += m_refMsg.GetMessage("disable email notifications msg"); if (security_data.IsAdmin && setting_data.EnableMessaging == false) { enablemsg.Text = "<div class=\"ektronTopSpace\"></div><label class=\"ektronCaption\">" + m_refMsg.GetMessage("application emails disabled msg") + "</label>"; } if (user_data.IsDisableMessage) { ltr_checkBox.Text = "<input type=\"checkbox\" maxlength=\"50\" size=\"25\" name=\"disable_msg\" id=\"disable_msg\" value=\"disable_msg\" CHECKED=\"True\">"; } else { ltr_checkBox.Text = "<input type=\"checkbox\" name=\"disable_msg\" id=\"disable_msg\" value=\"disable_msg\">"; } if (user_data.UserPreference.ForceSetting != true) { if (!(defaultPreferences == null)) { preference.Text = "<tr><td/><td><div class=\'ektronTopSpace\'><a class=\"button buttonInlineBlock blueHover buttonDefault\" href=\"Javascript://\" onclick=\"RestoreDefault();return false;\">" + m_refMsg.GetMessage("lnk restore default") + "</a></div><div class=\'ektronTopSpace\'></div></td></tr>"; } } folder.Text += "<td class=\"wrapText\"><label class=\"label wrapText\">" + m_refMsg.GetMessage("lbl set smart desktop") + "</label></td><td><input type=\"checkbox\""; if (user_data.UserPreference.ForceSetting) { folder.Text += " disabled "; } if (user_data.UserPreference.FolderId == "") { folder.Text += " checked "; } folder.Text += " id=\"chkSmartDesktop\" name=\"chkSmartDesktop\"/>"; folder.Text += "<input type=\"hidden\" name=\"OldfolderId\" id=\"OldfolderId\" value=\"" + user_data.UserPreference.FolderId + "\"/>"; folder.Text += "<input type=\"hidden\" name=\"folderId\" id=\"folderId\" value=\"" + user_data.UserPreference.FolderId + "\"/>"; folder.Text += "</td>"; if (user_data.UserPreference.ForceSetting) { lockedmsg.Text = "<tr><td class=\"important\" colspan=\"2\">" + m_refMsg.GetMessage("preferences locked msg") + "</td></tr>"; } forcemsg.Text = "<td>"; forcemsg.Text += m_refSiteApi.SitePath + "<input type=\"text\""; if (user_data.UserPreference.ForceSetting == true) { forcemsg.Text += " disabled "; } forcemsg.Text += " ID=\"templatefilename\" value=\"" + user_data.UserPreference.Template + "\" size=\"35\" class=\"minWidth\" name=\"templatefilename\" />"; if (user_data.UserPreference.ForceSetting == false) { forcemsg.Text += "<a class=\"button buttonInline greenHover selectContent\" href=\"#\" onclick=\"LoadChildPage();return true;\">" + m_refMsg.GetMessage("generic select") + "</a>"; } forcemsg.Text += "</td>"; width.Text = "<td class=\"label\">" + m_refMsg.GetMessage("lbl imagetool resize width") + "</td><td><input class=\"minWidth\" type=\"text\" size=\"4\" id=\"txtWidth\""; if (user_data.UserPreference.ForceSetting) { width.Text += " disabled "; } width.Text += " value=\"" + user_data.UserPreference.Width + "\" name=\"txtWidth\">px</td>"; height.Text = "<td class=\"label\">" + m_refMsg.GetMessage("lbl imagetool resize height") + "</td><td><input class=\"minWidth\" type=\"text\" size=\"4\" id=\"txtHeight\""; if (user_data.UserPreference.ForceSetting) { height.Text += " disabled "; } height.Text += " value=\"" + user_data.UserPreference.Height + "\" name=\"txtHeight\">px</td>"; //disptext.Text = "<td class=\"label wrapText\">" + m_refMsg.GetMessage("lbl display button caption") + "</td><td><input type=\"checkbox\" id=\"chkDispTitleText\""; //if (user_data.UserPreference.DisplayTitleText == "1") //{ // disptext.Text += " checked "; //} //if (user_data.UserPreference.ForceSetting) //{ // disptext.Text += " disabled "; //} //disptext.Text += " name=\"chkDispTitleText\"/></td>"; //disptext.Text += " <input type=\"hidden\" id=\"hdn_pagesize\" name=\"hdn_pagesize\" value=\"" + user_data.UserPreference.PageSize.ToString() + "\" />"; } if (security_data.IsAdmin) { jsIsAdmin.Text = "true"; } else { jsIsAdmin.Text = "false"; } if (security_data.IsAdmin && !( ThirdPartyAuthenticationEnabled(user_data.IsMemberShip) )) { username.Text = "<input type=\"Text\" maxlength=\"255\" size=\"25\" name=\"username\" id=\"username\" value=\"" + user_data.Username + "\" onkeypress=\"return CheckKeyValue(event,\'34\');\">"; } else { username.Text = "<input type=\"hidden\" maxlength=\"255\" size=\"25\" name=\"username\" id=\"username\" value=\"" + user_data.Username + "\" onkeypress=\"return CheckKeyValue(event,\'34\');\">" + user_data.Username; } if (ThirdPartyAuthenticationEnabled(user_data.IsMemberShip)) { TR_domain.Visible = true; TR_organization.Visible = false; TR_orgunit.Visible = false; TR_ldapdomain.Visible = false; TD_path.InnerHtml = "<input type=\"hidden\" name=\"userpath\" value=\"" + user_data.Path + "\">"; TD_path.InnerHtml += "<input type=\"hidden\" name=\"domain\" value=\"" + user_data.Domain + "\">" + user_data.Domain; } else if (setting_data.ADAuthentication == 2) { TR_domain.Visible = false; TR_organization.Visible = false; TR_orgunit.Visible = false; TR_ldapdomain.Visible = true; //Dim arrOrg As Array //Dim arrCount As Long //Dim arrItem As Array //Dim strOrgUnit As String = "" //Dim strOrg As String = "" string strDC = user_data.Domain; //arrOrg = Split(user_data.Domain, ",") //For arrCount = LBound(arrOrg) To UBound(arrOrg) // If (Not (arrOrg(arrCount) = "")) Then // arrItem = Split(arrOrg(arrCount), "=") // If (arrItem(0) = "o" Or arrItem(0) = " o") Then // strOrg = arrItem(1) // ElseIf (arrItem(0) = "ou" Or arrItem(0) = "ou") Then // If (Not (strOrgUnit = "")) Then // strOrgUnit &= "," // End If // strOrgUnit &= arrItem(1) // ElseIf (arrItem(0) = "dc" Or arrItem(0) = " dc") Then // If (Not (strDC = "")) Then // strDC &= "." // End If // strDC &= arrItem(1) // End If // End If //Next //org.Text = "<input type=""Text"" maxlength=""255"" size=""25"" name=""organization_text"" id=""organization_text"" value=""" & strOrg & """ onkeypress=""return CheckKeyValue(event,'34,32');"">" //orgunit.Text = "<input type=""Text"" maxlength=""255"" size=""25"" name=""orgunit_text"" id=""orgunit_text"" value=""" & strOrgUnit & """ onkeypress=""return CheckKeyValue(event,'34,32');"">" ldapdomain.Text = "<input type=\"Text\" maxlength=\"255\" size=\"25\" name=\"ldapdomain_text\" id=\"ldapdomain_text\" value=\"" + strDC + "\" onkeypress=\"return CheckKeyValue(event,\'34,32\');\">"; } else { TR_domain.Visible = false; TR_organization.Visible = false; TR_orgunit.Visible = false; TR_ldapdomain.Visible = false; } ltr_uid.Text = user_data.Id.ToString(); if (security_data.IsAdmin && !( ThirdPartyAuthenticationEnabled(user_data.IsMemberShip) )) { firstname.Text = "<input type=\"Text\" maxlength=\"50\" size=\"25\" name=\"firstname\" id=\"firstname\" value=\"" + (user_data.FirstName) + "\" onkeypress=\"return CheckKeyValue(event,\'34\');\">"; lastname.Text = "<input type=\"Text\" maxlength=\"50\" size=\"25\" name=\"lastname\" id=\"lastname\" value=\"" + (user_data.LastName) + "\" onkeypress=\"return CheckKeyValue(event,\'34\');\">"; } else { firstname.Text = "<input type=\"hidden\" name=\"specialCaseOverride\" id=\"specialCaseOverride\" value=\"1\" />"; firstname.Text += "<input type=\"hidden\" maxlength=\"50\" size=\"25\" name=\"firstname\" id=\"firstname\" value=\"" + (user_data.FirstName) + "\" onkeypress=\"return CheckKeyValue(event,\'34\');\">" + user_data.FirstName; lastname.Text = "<input type=\"hidden\" maxlength=\"50\" size=\"25\" name=\"lastname\" id=\"lastname\" value=\"" + (user_data.LastName) + "\" onkeypress=\"return CheckKeyValue(event,\'34\');\">" + user_data.LastName; } displayname.Text = "<input type=\"Text\" maxlength=\"50\" size=\"25\" name=\"displayname\" id=\"displayname\" value=\"" + (user_data.DisplayName) + "\" onkeypress=\"return CheckKeyValue(event,\'34\');\">"; if (ThirdPartyAuthenticationEnabled(user_data.IsMemberShip)) { hppwd.Text = "<td colspan=\"2\"><input type=\"hidden\" maxlength=\"255\" size=\"25\" name=\"pwd\" id=\"pwd\" value=\"" + user_data.Password + "\" onkeypress=\"return CheckKeyValue(event,\'34\');\">"; hppwd.Text += "<input type=\"hidden\" name=\"hpwd\" id=\"hpwd\" value=\"" + user_data.Password + "\"</td>"; } else { hppwd.Text = "<td class=\"label\"><span style=\"color:red;\">*</span>" + m_refMsg.GetMessage("password label") + "</td>"; hppwd.Text += "<td class=\"value\"><input type=\"password\" maxlength=\"255\" size=\"25\" name=\"pwd\" id=\"pwd\" value=\"" + user_data.Password + "\" onkeypress=\"return CheckKeyValue(event,\'34\');\">"; hppwd.Text += "<input type=\"hidden\" name=\"hpwd\" id=\"hpwd\" value=\"" + user_data.Password + "\">"; hppwd.Text += "</td>"; } if (ThirdPartyAuthenticationEnabled(user_data.IsMemberShip)) { confirmpwd.Text = "<td colspan=\"2\"><input type=\"hidden\" maxlength=\"255\" size=\"25\" name=\"confirmpwd\" id=\"confirmpwd\" value=\"" + user_data.Password + "\" onkeypress=\"return CheckKeyValue(event,\'34\');\"></td>"; } else { confirmpwd.Text = "<td class=\"label\"><span style=\"color:red;\">*</span>" + m_refMsg.GetMessage("confirm pwd label") + "</td>"; confirmpwd.Text += "<td class=\"value\"><input type=\"password\" maxlength=\"255\" size=\"25\" name=\"confirmpwd\" id=\"confirmpwd\" value=\"" + user_data.Password + "\" onkeypress=\"return CheckKeyValue(event,\'34\');\"></td>"; } if (ADIntegrationEnabledForUserType(user_data.IsMemberShip)) { email.Text = "<td class=\"label\">" + m_refMsg.GetMessage("email address label") + "</td>"; email.Text += "<td><input type=\"Hidden\" maxlength=\"255\" size=\"25\" name=\"email_addr1\" id=\"email_addr1\" value=\"" + user_data.Email + "\" onkeypress=\"return CheckKeyValue(event,\'34,32\');\">" + user_data.Email + "</td>"; } else { email.Text = "<td class=\"label\">" + m_refMsg.GetMessage("email address label") + "</td>"; email.Text += "<td class=\"value\"><input type=\"Text\" maxlength=\"255\" size=\"25\" name=\"email_addr1\" id=\"email_addr1\" value=\"" + user_data.Email + "\" onkeypress=\"return CheckKeyValue(event,\'34,32\');\"></td>"; } if (m_intGroupType == 1) { email.Text += "<input type=hidden id=email_addr1Org name=email_addr1Org value=\"" + user_data.Email + "\">"; } if ((this.m_refContentApi.RequestInformationRef.LoginAttempts != -1) && ((security_data.IsAdmin) || (m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminUsers)))) { accountLocked.Text = "<input type=\"checkbox\" id=\"chkAccountLocked\" name=\"chkAccountLocked\" "; if (user_data.IsAccountLocked(this.m_refContentApi.RequestInformationRef)) { accountLocked.Text += " checked "; } accountLocked.Text += " />"; } else { accountLocked.Text = "<input type=\"hidden\" id=\"chkAccountLocked\" name=\"chkAccountLocked\" "; if (user_data.IsAccountLocked(this.m_refContentApi.RequestInformationRef)) { accountLocked.Text += " value=\"on\" />"; } else { accountLocked.Text += " value=\"\" />"; } } ltr_avatar.Text = "<input type=\"Text\" maxlength=\"255\" size=\"19\" name=\"avatar\" id=\"avatar\" value=\"" + EkFunctions.HtmlEncode(user_data.Avatar) + "\" onkeypress=\"return CheckKeyValue(event,\'34\');\">"; ltrmapaddress.Text = "<input type=\"Text\" maxlength=\"100\" size=\"19\" name=\"mapaddress\" id=\"mapaddress\" value=\"" + user_data.Address + "\" onkeypress=\"return CheckKeyValue(event,\'34\');\">"; ltrmaplatitude.Text = "<input type=\"Text\" maxlength=\"100\" size=\"19\" name=\"maplatitude\" id=\"maplatitude\" value=\"" + user_data.Latitude + "\" onkeypress=\"return CheckKeyValue(event,\'34\');\" disabled>"; ltrmaplongitude.Text = "<input type=\"Text\" maxlength=\"100\" size=\"19\" name=\"maplongitude\" id=\"maplongitude\" value=\"" + user_data.Longitude + "\" onkeypress=\"return CheckKeyValue(event,\'34\');\" disabled>"; ltr_upload.Text = "</asp:Literal> <a href=\"Upload.aspx?action=edituser&addedit=true&returntarget=avatar&EkTB_iframe=true&height=300&width=400&modal=true\" title=\"" + m_refMsg.GetMessage("upload txt") + "\" class=\"ek_thickbox button buttonInline greenHover buttonUpload btnUpload\" title=\"" + m_refMsg.GetMessage("upload txt") + "\">" + m_refMsg.GetMessage("upload txt") + "</a>"; HttpBrowserCapabilities browser = Request.Browser; Ektron.Cms.Framework.Context.CmsContextService context = new Ektron.Cms.Framework.Context.CmsContextService(); if (browser.Type.Contains("IE") && browser.MajorVersion >= 9) { // work around to prevent errors in IE9 when it destroys native JS objects // see http://msdn.microsoft.com/en-us/library/gg622929%28v=VS.85%29.aspx uxAvatarUploadIframe.Attributes.Add("src", "about:blank"); } else { uxAvatarUploadIframe.Attributes.Add("src", context.WorkareaPath + "/Upload.aspx?action=edituser&addedit=true&returntarget=avatar&height=300&width=400&modal=true"); } jsUxDialogSelectorTxt.Text = uxDialog.Selector.ToString(); string uploadTxt = m_refMsg.GetMessage("upload txt"); uxDialog.Title = uploadTxt; ltr_upload.Text = "</asp:Literal> <a href=\"#\" onclick=\"$ektron('" + uxDialog.Selector + "').dialog('open'); AvatarDialogInit();\" title=\"" + uploadTxt + "\" class=\"button buttonInline greenHover buttonUpload btnUpload\" title=\"" + uploadTxt + "\">" + uploadTxt + "</a>"; //drp_editor.SelectedIndex = 0 //drp_editor.Items.Add(New ListItem("eWebWP", "ewebwp")) drp_editor.Items.Add(new ListItem(m_refMsg.GetMessage("lbl content designer"), "contentdesigner")); //drp_editor.Items.Add(New ListItem(m_refMsg.GetMessage("lbl jseditor"), "jseditor")) drp_editor.Items.Add(new ListItem("eWebEditPro", "ewebeditpro")); if ((string) (user_data.EditorOption.ToLower().Trim()) == "contentdesigner") { drp_editor.SelectedIndex = 0; //Case "jseditor" // drp_editor.SelectedIndex = 1 } else if ((string) (user_data.EditorOption.ToLower().Trim()) == "ewebeditpro") { drp_editor.SelectedIndex = 1; //Case "ewebwp" // drp_editor.SelectedIndex = 0 } // "ewebwp" else { drp_editor.SelectedIndex = 0; // default to contentdesigner } ctlEditor.Content = user_data.Signature; TD_personalTags.InnerHtml = GetPersonalTags(); CreateColumns(); if (_activityApi.IsActivityPublishingEnabled && (agentList != null)&& agentList.Count > 0 && Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.SocialNetworking, false)) { LoadGrid("colleagues"); LoadGrid("groups"); EditPublishPreferencesGrid(); } else { EkMembershipActivityTable.Visible = false; activitiesTab.Visible = false; } //Community alias Tab LoadCommunityAliasTab(); }
protected void setButtons() { PermissionData myPermissionData = new PermissionData(); lbPreview.Text = m_refMsg.GetMessage("lbl pagebuilder preview layout"); lbPreview.ToolTip = lbPreview.Text; lbNew.OnClientClick = "return false;"; lbCopy.OnClientClick = "return false;"; enableButton(lbNew, false); enableButton(lbCopy, false); enableButton(lbCancel, false); enableButton(lbPreview, false); enableButton(lbSave, false); enableButton(lbWorkarea, false); enableButton(lbAnalytics, false); enableButton(lbViewPublishedCheckedIn, false); dontAutoCloseMenu.Visible = true; tray.Visible = false; pnlSearchWidget.Visible = false; EktronPersonalizationWrapper.Visible = true; layoutVersion version = (Page as PageBuilder).viewType; if ((Page as PageBuilder).Status != Mode.AnonViewing) { if (!Capi.EkContentRef.IsAllowed(0, 0, "users", "IsLoggedIn", 0) || Capi.RequestInformationRef.UserId == EkConstants.BuiltIn) { EktronPersonalizationWrapper.Visible = false; return; } //fix for when another user forces checkin and starts editing. it kicks us out here. if ((isActionAllowed(dmsMenuItemMenuItemType.DmsMenuForceCheckIn) || isActionAllowed(dmsMenuItemMenuItemType.DmsMenuRequestCheckIn)) && (Page as PageBuilder).Status == Mode.Editing) { SwitchMode(Mode.AuthorViewing, (Page as PageBuilder).viewType); return; } myPermissionData = Capi.LoadPermissions(PageID, "content", ContentAPI.PermissionResultType.All); if (!myPermissionData.CanPublish) { if (myPermissionData.CanApprove) { lbPublish.Text = m_refMsg.GetMessage("generic approve title"); lbPublish.ToolTip = lbPublish.Text; } else { lbPublish.Text = m_refMsg.GetMessage("generic submit"); lbPublish.ToolTip = lbPublish.Text; } } lbPublish.ToolTip = lbPublish.Text; RegisterFiles(); string force = getActionString(dmsMenuItemMenuItemType.DmsMenuForceCheckIn); if (force != "") { lbCheckin.Text = force; lbCheckin.ToolTip = force; } string noforce = getActionString(dmsMenuItemMenuItemType.DmsMenuCheckIn); if (noforce != "") { lbCheckin.Text = noforce; lbCheckin.ToolTip = noforce; } enableButton(lbEdit, UserCanEditPage()); if (isActionAllowed(dmsMenuItemMenuItemType.DmsMenuViewProperties)) { enableButton(lbProperties, true); lbProperties.NavigateUrl = Capi.AppPath + "workarea.aspx?page=content.aspx&folder_id=" + FolderID.ToString(); lbProperties.NavigateUrl += "&ContentNav=" + PagePath; lbProperties.NavigateUrl += "&TreeVisible=Content&action=view&id=" + PageID.ToString(); lbProperties.NavigateUrl += "&LangType=" + LangID.ToString(); lbProperties.NavigateUrl += "&menuItemType=viewproperties"; string onclick = "window.open(this.href, 'Admin400', 'location=0,status=1,scrollbars=1, width:900, height:580');return false;"; lbProperties.Attributes.Add("onclick", onclick); } else { enableButton(lbProperties, false); } enableButton(lbCheckin, isActionAllowed(dmsMenuItemMenuItemType.DmsMenuCheckIn) || isActionAllowed(dmsMenuItemMenuItemType.DmsMenuForceCheckIn)); enableButton(lbPublish, (isActionAllowed(dmsMenuItemMenuItemType.DmsMenuPublish) || isActionAllowed(dmsMenuItemMenuItemType.DmsMenuCheckIn) || isActionAllowed(dmsMenuItemMenuItemType.DmsMenuSubmit) || isActionAllowed(dmsMenuItemMenuItemType.DmsMenuApprove)) && version == layoutVersion.Staged); } switch ((Page as PageBuilder).Status) { case Mode.AnonViewing: EktronPersonalizationWrapper.Visible = false; break; case Mode.AuthorViewing: bool showSwitchView = false; if (PageID > -1) { ContentHistoryData[] history = null; //get permissions for history if (myPermissionData.CanHistory) { history = Capi.GetHistoryList(PageID); } bool foundcheckedin = false; bool foundpublished = false; if (history != null) { for (int i = 0; i < history.Length; i++) { if (history[i].Status == "I") { foundcheckedin = true; } if (history[i].Status == "A") { foundpublished = true; break; } } } showSwitchView = foundcheckedin && foundpublished; if (!showSwitchView) { ContentStateData state = Capi.GetContentState(PageID); DateTime golive = new DateTime(); if(state.CurrentGoLive == "" || !DateTime.TryParse(state.CurrentGoLive, out golive)){ golive = DateTime.MinValue; } if (golive > DateTime.Now) showSwitchView = true; } } dontAutoCloseMenu.Visible = false; enableButton(lbWorkarea, true); enableButton(lbAnalytics, true); enableButton(lbViewPublishedCheckedIn, showSwitchView); break; case Mode.Preview: enableButton(lbEdit, false); enableButton(lbCancel, true); enableButton(lbPreview, true); enableButton(lbWorkarea, true); enableButton(lbAnalytics, true); lbPreview.Text = m_refMsg.GetMessage("lbl pagebuilder return to edit"); lbPreview.ToolTip = lbPreview.Text; dontAutoCloseMenu.Visible = false; break; case Mode.Editing: if (!isActionAllowed(dmsMenuItemMenuItemType.DmsMenuForceCheckIn)) { (Page as PageBuilder).viewType = layoutVersion.Staged; enableButton(lbEdit, false); enableButton(lbCancel, true); enableButton(lbPreview, true); enableButton(lbSave, true); enableButton(lbWorkarea, true); enableButton(lbAnalytics, true); tray.Visible = true; pnlSearchWidget.Visible = true; sessionKeepalive.Visible = true; //register CSS JS.RegisterJS(this, JS.ManagedScript.EktronJsonJS); JS.RegisterJS(this, JS.ManagedScript.EktronUICoreJS); JS.RegisterJS(this, JS.ManagedScript.EktronUIWidgetJS); JS.RegisterJS(this, JS.ManagedScript.EktronUISortableJS); JS.RegisterJS(this, JS.ManagedScript.EktronUIEffectsJS); JS.RegisterJS(this, JS.ManagedScript.EktronUIEffectsHighlightJS); JS.RegisterJS(this, JS.ManagedScript.EktronBlockUiJS); JS.RegisterJS(this, JS.ManagedScript.EktronUIResizableJS); JS.RegisterJS(this, JS.ManagedScript.EktronUIDraggableJS); JS.RegisterJS(this, JS.ManagedScript.EktronModalJS); } break; } }
private void Display_MapCMSUserGroupToAD() { AppImgPath = m_refSiteApi.AppImgPath; rp = Request.QueryString["rp"]; e1 = Request.QueryString["e1"]; e2 = Request.QueryString["e2"]; f = Request.QueryString["f"]; if (rp == "") { rp = Request.Form["rp"]; } if (e1 == "") { e1 = Request.Form["e1"]; } if (e2 == "") { e2 = Request.Form["e2"]; } if (f == "") { f = Request.Form["f"]; } language_data = m_refSiteApi.GetAllActiveLanguages(); user_data = m_refUserApi.GetUserGroupById(m_intGroupId); if ((m_intGroupId == 1) && (Convert.ToInt32(rp) == 3)) { domain_data = m_refUserApi.GetDomains(1, 0); } else { domain_data = m_refUserApi.GetDomains(0, 0); } security_data = m_refContentApi.LoadPermissions(0, "content", 0); setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId); if ((search == "1") || (search == "2")) { if (search == "1") { strFilter = Request.Form["groupname"]; Domain = Request.Form["domainname"]; } else { strFilter = Request.QueryString["groupname"]; Domain = Request.QueryString["domainname"]; } if (Domain == "All Domains") { Domain = ""; } GroupData[] adgroup_data; adgroup_data = m_refUserApi.GetAvailableADGroups(strFilter, Domain); //TOOLBAR System.Text.StringBuilder result = new System.Text.StringBuilder(); txtTitleBar.InnerHtml = m_refStyle.GetTitleBar((string)(m_refMsg.GetMessage("search ad for cms group") + " \"" + user_data.GroupDisplayName + "\"")); result.Append("<table><tr>"); //if (Request.ServerVariables["HTTP_USER_AGENT"].ToString().IndexOf("MSIE") > -1) //defect 16045 //{ // result.Append(m_refStyle.GetButtonEventsWCaption(AppImgPath + "../UI/Icons/back.png", "javascript:window.location.reload(false);", m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true)); //} //else //{ //} result.Append(m_refStyle.GetButtonEventsWCaption(AppImgPath + "../UI/Icons/back.png", "javascript:history.back(1);", m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true)); if (rp != "1") { result.Append(m_refStyle.GetButtonEventsWCaption(AppImgPath + "../UI/Icons/cancel.png", "#", m_refMsg.GetMessage("generic Cancel"), m_refMsg.GetMessage("close title"), "onclick=\"top.close();\"", StyleHelper.SaveButtonCssClass, true)); } if (!(adgroup_data == null)) { if (rp == "1") { result.Append(m_refStyle.GetButtonEventsWCaption(AppImgPath + "../UI/Icons/save.png", "#", m_refMsg.GetMessage("alt update button text (associate group)"), m_refMsg.GetMessage("btn update"), "onclick=\"return SubmitForm(\'aduserinfo\', \'CheckRadio(1);\');\"", StyleHelper.SaveButtonCssClass, true)); } else { result.Append(m_refStyle.GetButtonEventsWCaption(AppImgPath + "../UI/Icons/save.png", "#", m_refMsg.GetMessage("alt update button text (associate group)"), m_refMsg.GetMessage("btn update"), "onclick=\"return SubmitForm(\'aduserinfo\', \'CheckReturn(1);\');\"", StyleHelper.SaveButtonCssClass, true)); } } result.Append(StyleHelper.ActionBarDivider); result.Append("<td>"); result.Append(m_refStyle.GetHelpButton("Display_MapCMSUserGroupToAD", "")); result.Append("</td>"); result.Append("</tr></table>"); htmToolBar.InnerHtml = result.ToString(); //Dim i As Integer = 0 //If (Not (IsNothing(domain_data))) Then // domainname.Items.Add(New ListItem(m_refMsg.GetMessage("all domain select caption"), "")) // domainname.Items(0).Selected = True // For i = 0 To domain_data.Length - 1 // domainname.Items.Add(New ListItem(domain_data(i).Name, domain_data(i).Name)) // Next //End If Populate_MapCMSGroupToADGrid(adgroup_data); } else { PostBackPage.Text = Utilities.SetPostBackPage((string)("users.aspx?Action=MapCMSUserGroupToAD&Search=1&LangType=" + ContentLanguage + "&rp=" + rp + "&e1=" + e1 + "&e2=" + e2 + "&f=" + f + "&grouptype=" + m_intGroupType + "&groupid=" + m_intGroupId)); txtTitleBar.InnerHtml = m_refStyle.GetTitleBar((string)(m_refMsg.GetMessage("search ad for cms group") + " \"" + user_data.DisplayUserName + "\"")); System.Text.StringBuilder result = new System.Text.StringBuilder(); result.Append("<table><tr>"); if (rp != "1") { result.Append(m_refStyle.GetButtonEventsWCaption(AppImgPath + "../UI/Icons/cancel.png", "#", m_refMsg.GetMessage("generic Cancel"), m_refMsg.GetMessage("btn cancel"), "onclick=\"top.close();\"")); } else { result.Append(m_refStyle.GetButtonEventsWCaption(AppImgPath + "images/UI/Icons/back.png", "javascript:history.back(1);", m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true)); } result.Append("<td>"); result.Append(m_refStyle.GetHelpButton("Display_MapCMSUserGroupToAD", "")); result.Append("</td>"); result.Append("</tr></table>"); htmToolBar.InnerHtml = result.ToString(); Populate_MapCMSUserGroupToADGrid_Search(domain_data); } }
private void PopulateCategory(string Action) { LibraryData library_data; FolderData fold_data; m_intTaxFolderId = _FolderId; _EkContent = _ContentApi.EkContentRef; _CurrentUserID = _ContentApi.UserId; _PermissionData = _ContentApi.LoadPermissions(_FolderId, "content", 0); library_data = _ContentApi.GetLibraryItemByID(_Id, _FolderId); fold_data = _ContentApi.GetFolderById(_FolderId); if (_Type == "images" || _Type == "files") { if (fold_data.CategoryRequired == true && _EkContent.GetAllFolderTaxonomy(_FolderId).Length > 0) { jsCategoryrequired.Text = "true"; } } if (_PermissionData.IsAdmin || _EkContent.IsARoleMember(Convert.ToInt64( Ektron.Cms.Common.EkEnumeration.CmsRoleIds.TaxonomyAdministrator),_CurrentUserID,false)) { TaxonomyRoleExists = true; } TaxonomyBaseData[] taxonomy_cat_arr = null; if (Action != "add") { taxonomy_cat_arr = _EkContent.ReadAllAssignedCategory(library_data.ContentId); if ((taxonomy_cat_arr != null) && taxonomy_cat_arr.Length > 0) { foreach (TaxonomyBaseData taxonomy_cat in taxonomy_cat_arr) { if (taxonomyselectedtree.Value == "") { taxonomyselectedtree.Value = Convert.ToString(taxonomy_cat.TaxonomyId); } else { taxonomyselectedtree.Value = taxonomyselectedtree.Value + "," + Convert.ToString(taxonomy_cat.TaxonomyId); } } } TaxonomyTreeIdList = (string)taxonomyselectedtree.Value; if (TaxonomyTreeIdList.Trim().Length > 0) { TaxonomyTreeParentIdList = _EkContent.ReadDisableNodeList(library_data.ContentId); } } else { if (TaxonomySelectId > 0) { taxonomyselectedtree.Value = Convert.ToString( TaxonomySelectId); TaxonomyTreeIdList = (string)taxonomyselectedtree.Value; taxonomy_cat_arr = _EkContent.GetTaxonomyRecursiveToParent(TaxonomySelectId, _EkContent.RequestInformation.ContentLanguage, 0); if ((taxonomy_cat_arr != null) && taxonomy_cat_arr.Length > 0) { foreach (TaxonomyBaseData taxonomy_cat in taxonomy_cat_arr) { if (TaxonomyTreeParentIdList == "") { TaxonomyTreeParentIdList = Convert.ToString(taxonomy_cat.TaxonomyId); } else { TaxonomyTreeParentIdList = TaxonomyTreeParentIdList + "," + Convert.ToString(taxonomy_cat.TaxonomyId); } } } } } TaxonomyRequest taxonomy_request = new TaxonomyRequest(); TaxonomyBaseData[] taxonomy_data_arr = null; Utilities.SetLanguage(_ContentApi); taxonomy_request.TaxonomyId = _FolderId; taxonomy_request.TaxonomyLanguage = _ContentApi.ContentLanguage; taxonomy_data_arr = _EkContent.GetAllFolderTaxonomy(_FolderId); foreach (TaxonomyBaseData tax_node in taxonomy_data_arr) { _SelectedTaxonomyList = _SelectedTaxonomyList + tax_node.TaxonomyId; _SelectedTaxonomyList += ","; } //Hiding the Category tab if no taxonomy is applied for the folder or if user requires the category tab to be hidden bool HideCategoryTab = false; if (!string.IsNullOrEmpty(Request.QueryString["HideCategoryTab"] )) { HideCategoryTab = Convert.ToBoolean(Request.QueryString["HideCategoryTab"]); } if (HideCategoryTab || (taxonomy_data_arr == null || taxonomy_data_arr.Length == 0) && (TaxonomyOverrideId == 0)) { //TODO: Ross - Not sure why, but the tab was set to non-visible in either case...odd!! //if (Action == "add" || _Operation == "overwrite") //{ //TODO: Ross - Don't have "add" tabs yet phAddCategoryTab.Visible = false; phCategory.Visible = false; phCategory2.Visible = false; //} } }
private void Page_Load(System.Object sender, System.EventArgs e) { try { if (!(Request.QueryString["LangType"] == null)) { if (Request.QueryString["LangType"] != "") { ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); } else { if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "") { ContentLanguage = Convert.ToInt32(m_refContentApi.GetCookieValue("LastValidLanguageID")); } } } else { if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "") { ContentLanguage = Convert.ToInt32(m_refContentApi.GetCookieValue("LastValidLanguageID")); } } if (ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED) { m_refContentApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES; } else { m_refContentApi.ContentLanguage = ContentLanguage; } m_refMsg = m_refContentApi.EkMsgRef; if (Request.QueryString["id"] != "") { ContentId = Convert.ToInt64(Request.QueryString["id"]); } if (Request.QueryString["hist_id"] != "") { HistoryId = Convert.ToInt64(Request.QueryString["hist_id"]); } if (!(Page.IsPostBack)) { AppImgPath = m_refContentApi.AppImgPath; AppName = m_refContentApi.AppName; ContentLanguage = m_refContentApi.ContentLanguage; imagePath = m_refContentApi.AppPath + "images/ui/icons/"; content_data = new ContentData(); if (ContentId > 0 && HistoryId > 0) { if (Request.QueryString["xslt"] == "remove") { bApplyXslt = false; } else { bApplyXslt = true; } security_data = m_refContentApi.LoadPermissions(ContentId, "content", ContentAPI.PermissionResultType.Content); m_contentType = m_refContentApi.EkContentRef.GetContentType(ContentId); switch (m_contentType) { case EkConstants.CMSContentType_CatalogEntry: Ektron.Cms.Commerce.CatalogEntryApi m_refCatalogAPI = new Ektron.Cms.Commerce.CatalogEntryApi(); entry_data = m_refCatalogAPI.GetItem(ContentId); entry_version_data = m_refCatalogAPI.GetItemVersion(ContentId, m_refContentApi.ContentLanguage, HistoryId); PopulateCatalogPageData(entry_version_data, entry_data); Display_EntryHistoryToolBar(entry_data); break; default: content_data = m_refContentApi.GetContentById(ContentId, 0); hist_content_data = m_refContentApi.GetContentByHistoryId(HistoryId); FolderData folder_data; blog_post_data = new BlogPostData(); blog_post_data.Categories = new string[0]; if (!(content_data == null)) { bIsBlog = System.Convert.ToBoolean(m_refContentApi.EkContentRef.GetFolderType(content_data.FolderId) == Ektron.Cms.Common.EkEnumeration.FolderType.Blog); if (bIsBlog) { folder_data = m_refContentApi.GetFolderById(content_data.FolderId); if (hist_content_data.MetaData != null) { for (int i = 0; i <= (hist_content_data.MetaData.Length - 1); i++) { Ektron.Cms.Common.EkEnumeration.BlogPostDataType MetaType = (Ektron.Cms.Common.EkEnumeration.BlogPostDataType)Enum.Parse(typeof(Ektron.Cms.Common.EkEnumeration.BlogPostDataType), hist_content_data.MetaData[i].TypeId.ToString()); if (MetaType == Ektron.Cms.Common.EkEnumeration.BlogPostDataType.Categories || hist_content_data.MetaData[i].TypeName.ToLower().IndexOf("blog categories") > -1) { hist_content_data.MetaData[i].Text = hist_content_data.MetaData[i].Text.Replace("'", "\'"); hist_content_data.MetaData[i].Text = hist_content_data.MetaData[i].Text.Replace(""", "\""); hist_content_data.MetaData[i].Text = hist_content_data.MetaData[i].Text.Replace(">", ">"); hist_content_data.MetaData[i].Text = hist_content_data.MetaData[i].Text.Replace("<", "<"); blog_post_data.Categories = Strings.Split((string)(hist_content_data.MetaData[i].Text), ";", -1, 0); } else if (MetaType == Ektron.Cms.Common.EkEnumeration.BlogPostDataType.Ping || hist_content_data.MetaData[i].TypeName.ToLower().IndexOf("blog pingback") > -1) { blog_post_data.Pingback = Ektron.Cms.Common.EkFunctions.GetBoolFromYesNo((string)(hist_content_data.MetaData[i].Text)); } else if (MetaType == Ektron.Cms.Common.EkEnumeration.BlogPostDataType.Tags || hist_content_data.MetaData[i].TypeName.ToLower().IndexOf("blog tags") > -1) { blog_post_data.Tags = (string)(hist_content_data.MetaData[i].Text); } else if (MetaType == Ektron.Cms.Common.EkEnumeration.BlogPostDataType.Trackback || hist_content_data.MetaData[i].TypeName.ToLower().IndexOf("blog trackback") > -1) { blog_post_data.TrackBackURL = (string)(hist_content_data.MetaData[i].Text); } } } if (!(folder_data.XmlConfiguration == null)) { bXmlContent = true; } } hist_content_data.Type = content_data.Type; PopulatePageData(hist_content_data, content_data); } Display_ContentHistoryToolBar(); break; } } else if (ContentId > 0) { m_contentType = m_refContentApi.EkContentRef.GetContentType(ContentId); switch (m_contentType) { case EkConstants.CMSContentType_CatalogEntry: Ektron.Cms.Commerce.CatalogEntryApi m_refCatalogAPI = new Ektron.Cms.Commerce.CatalogEntryApi(); entry_data = m_refCatalogAPI.GetItem(ContentId); entry_version_data = m_refCatalogAPI.GetItemVersion(ContentId, m_refContentApi.ContentLanguage, HistoryId); PopulateCatalogPageData(entry_version_data, entry_data); Display_EntryHistoryToolBar(entry_data); break; default: content_data = m_refContentApi.GetContentById(ContentId, 0); PopulatePageData(hist_content_data, content_data); Display_ContentHistoryToolBar(); break; } } } else { m_contentType = m_refContentApi.EkContentRef.GetContentType(ContentId); content_data = m_refContentApi.GetContentById(ContentId, 0); switch (m_contentType) { case EkConstants.CMSContentType_CatalogEntry: Ektron.Cms.Commerce.CatalogEntryApi m_refCatalogAPI = new Ektron.Cms.Commerce.CatalogEntryApi(); HistoryId = Convert.ToInt64(Request.QueryString["hist_id"]); m_refCatalogAPI.Restore(ContentId, HistoryId); break; default: HistoryId = Convert.ToInt64(Request.QueryString["hist_id"]); m_refContentApi.RestoreHistoryContent(HistoryId); break; } CloseOnRestore.Text = "<script type=\"text/javascript\">try { location.href = \'content.aspx?LangType=" + ContentLanguage + "&action=ViewStaged&id=" + ContentId + "&fldid=" + content_data.FolderId + "\'; } catch(e) {}</script>"; } } catch (Exception ex) { ShowError(ex.Message); } }
private void Display_ViewCatalog() { Collection cPreApproval; _PermissionData = _ContentApi.LoadPermissions(_Id, "folder", 0); ltrTypes.Text = _MessageHelper.GetMessage("lbl product types"); //Sitemap Path ltInheritSitemapPath.Text = _MessageHelper.GetMessage("lbl Inherit Parent Configuration"); ViewCatalogToolBar(); td_vf_foldertxt.InnerHtml = _FolderData.Name; td_vf_idtxt.InnerHtml = _Id.ToString(); td_vf_folderdesctxt.InnerHtml = _FolderData.Description; if (_FolderData.StyleSheet == "") { td_vf_stylesheettxt.InnerHtml += _MessageHelper.GetMessage("none specified msg"); } else { td_vf_stylesheettxt.InnerHtml += _SitePath + _FolderData.StyleSheet; } if (_FolderData.StyleSheetInherited) { td_vf_stylesheettxt.InnerHtml += " " + _MessageHelper.GetMessage("style sheet inherited"); } DrawContentTemplatesTable(); DrawFolderTaxonomyTable(); //Assigned taxonomy DrawContentAliasesTable(); IsContentSearchableSection(); IsDisplaySettings(); if (_SettingsData.EnablePreApproval) { phPreapprovalGroup.Visible = true; cPreApproval = _ContentApi.EkContentRef.GetFolderPreapprovalGroup(_Id); if (-1 == Convert.ToInt32(cPreApproval["PreApprovalGroupID"])) { td_vf_preapprovaltxt.InnerHtml += cPreApproval["UserGroupName"] + " (Inherited)"; } else if (0 == Convert.ToInt32(cPreApproval["PreApprovalGroupID"])) { td_vf_preapprovaltxt.InnerHtml += "(None)"; } else { td_vf_preapprovaltxt.InnerHtml += cPreApproval["PreApprovalGroup"]; } } // display replication settings for folder if (_ContentApi.RequestInformationRef.EnableReplication) { bool bShowReplicationMethod = true; if (_FolderData.ParentId != 0 && (Ektron.Cms.Common.EkEnumeration.FolderType)_FolderType == Ektron.Cms.Common.EkEnumeration.FolderType.Blog || (Ektron.Cms.Common.EkEnumeration.FolderType)_FolderType == Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionForum) { FolderData tmp_folder_data = null; tmp_folder_data = this._ContentApi.EkContentRef.GetFolderById(_FolderData.ParentId); if ((Ektron.Cms.Common.EkEnumeration.FolderType)tmp_folder_data.FolderType == Ektron.Cms.Common.EkEnumeration.FolderType.Community) { bShowReplicationMethod = false; } } if (bShowReplicationMethod) { ReplicationMethod.Text = "<tr><td> </td></tr><tr><td class=\"label\">" + _MessageHelper.GetMessage("lbl folderdynreplication") + "</td></tr><tr><td>"; if (_FolderData.ReplicationMethod == 1) { ReplicationMethod.Text += _MessageHelper.GetMessage("replicate folder contents"); } else { ReplicationMethod.Text += _MessageHelper.GetMessage("generic No"); } ReplicationMethod.Text += " </td></tr>"; } } // Show Custom-Field folder assignments: CustomFieldsApi customFieldsApi = new CustomFieldsApi(); if (_ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED) { customFieldsApi.ContentLanguage = _ContentApi.DefaultContentLanguage; } else { customFieldsApi.ContentLanguage = _ContentLanguage; } litMetadata.Text = customFieldsApi.GetEditableCustomFieldAssignments(_Id, false, Ektron.Cms.Common.EkEnumeration.FolderType.Catalog); LocaleTaxonomy.Visible = false; officedocumentspanel.Visible = false; customFieldsApi = null; DisplaySitemapPath(); DisplaySubscriptionInfo(); DrawProductTypesTable(); }
private void Display_AddUserGroup() { language_data = m_refSiteApi.GetAllActiveLanguages(); security_data = m_refContentApi.LoadPermissions(0, "content", 0); AddUserGroupToolBar(); }
private void Display_Delete() { _FolderData = _ContentApi.GetFolderById(_Id); _PermissionData = _ContentApi.LoadPermissions(_Id, "folder", 0); switch (_FolderData.FolderType) { case (int)Ektron.Cms.Common.EkEnumeration.FolderType.Catalog: Display_DeleteEntries(); break; default: Display_DeleteContentByCategory(); break; } }