/// <summary>
 /// This method is used to dislay Need Help
 /// </summary>
 /// <param name="cData"></param>
 private void NeedHelp(ContentData cData)
 {
     try
     {
         long genericContentMetaId = ConfigHelper.GetValueLong("MetaNeedHelpId");
         var genericContentMeta = cData.MetaData.Where(x => x.Id == genericContentMetaId).FirstOrDefault();
         if (genericContentMeta != null && genericContentMeta.Text != string.Empty)
         {
             var genericContentId = EktUtility.ParseLong(genericContentMeta.Text);
             if (genericContentId > 0)
             {
                 var contentData = SiteDataManager.GetRightColumnContentById(genericContentId);
                 if (contentData != null && contentData.SmartForm != null)
                 {
                     pnlNeedHelp.Visible = true;
                     lblNeedHelpTitle.Text = contentData.SmartForm.Title;
                     ltrNeedHelpTxtBody.Text = EktUtility.GetHTMLNodesFromEktRich(contentData.SmartForm.Body);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Log.WriteError(ex.Message + " : " + ex.StackTrace);
     }
 }
Example #2
0
 private static IEnumerable<string> GetPropertyTags(ContentData content, PropertyDefinition propertyDefinition)
 {
     var tagNames = content[propertyDefinition.Name] as string;
     return tagNames == null
         ? Enumerable.Empty<string>()
         : tagNames.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries);
 }
        internal static ContentData AddContent(ContentData content)
        {
            string token = AuthenticateAdmin();
            IContentManager cm = ObjectFactory.GetContent();
            cm.RequestInformation.AuthenticationToken = token;

            content.FolderId = GetFolderData(TestFolderPath).Id;
            return cm.Add(content);
        }
Example #4
0
            public void MapsString()
            {
                var sut = new ContentData
                {
                    Html             = @"<Sample>
                                <Value>123</Value>
                            </Sample>",
                    XmlConfiguration = new XmlConfigData()
                    {
                        Id = 1,
                    }
                };

                var result = sut.AsContentType <StringResult>();

                Assert.AreEqual(result.Value, "123");
            }
Example #5
0
            public void MapsEnum()
            {
                var sut = new ContentData
                {
                    Html             = @"<Sample>
                                <Value>1</Value>
                            </Sample>",
                    XmlConfiguration = new XmlConfigData()
                    {
                        Id = 1,
                    }
                };

                var result = sut.AsContentType <EnumResult>();

                Assert.AreEqual(result.Value, EnumOptions.Second);
            }
Example #6
0
        public async Task <HandleResult> GetEdit([FromBody] JObject form)
        {
            var itemNum   = form["itemNum"].ToStr();
            var columnNum = form["columnNum"].ToStr();

            if (columnNum.IsEmpty())
            {
                return(HandleResult.Error("无效数据"));
            }

            var column = await _columnService.GetByNum(columnNum);

            if (column == null)
            {
                return(HandleResult.Error("无效数据"));
            }

            var model = await _modelTableService.GetByNum(column.ModelNum);

            if (model == null)
            {
                return(HandleResult.Error("栏目未绑定模型"));
            }

            ContentData editValue = null;

            if (column.IsSingle)
            {
                editValue = await _service.GetFirstByColumnNum(model.SqlTableName, column.Num);
            }
            else
            {
                if (itemNum.IsEmpty())
                {
                    return(HandleResult.Error("无效数据"));
                }
                editValue = await _service.GetByItem(model.SqlTableName, itemNum);
            }

            return(new HandleResult
            {
                IsSuccess = true,
                Data = editValue.ToDictionary()
            });
        }
        public static T ToGenericContent <T>(this ContentData SourceContent) where T : GenericContent, new()
        {
            // Check if SourceContent.MetaData is null before referencing ...
            var gc = new T()
            {
                Name            = SourceContent.Title,
                ExpireDate      = SourceContent.ExpireDate,
                MainBody        = SourceContent.Html,
                IsPublished     = SourceContent.IsPublished,
                LanguageId      = SourceContent.LanguageId,
                PrimaryUrl      = SourceContent.Quicklink,
                MetaDescription = SourceContent.MetaData == null
                    ? string.Empty
                    : (from m in SourceContent.MetaData
                       where m.Name.ToLower() == "description"
                       select m.Text).DefaultIfEmpty(null).FirstOrDefault(),
                MetaKeywords = SourceContent.MetaData == null
                    ? new string[] { }
                    : SplitKeywordString((from m in SourceContent.MetaData
                                          where m.Name.ToLower() == "keywords"
                                          select m.Text).DefaultIfEmpty(null).FirstOrDefault()),
                MetaTitle = SourceContent.MetaData == null
                    ? string.Empty
                    : (from m in SourceContent.MetaData
                       where m.Name.ToLower() == "title"
                       select m.Text).DefaultIfEmpty(SourceContent.Title).FirstOrDefault(),
                ParentContentReference = null, // Coming from Ektron, there is no parent reference.
                SourceFolderId         = SourceContent.FolderId,
                SourceId          = SourceContent.Id,
                SourceStructureId = SourceContent.XmlConfiguration.Id,
                StartDate         = SourceContent.GoLiveDate.HasValue ? SourceContent.GoLiveDate.Value : DateTime.MinValue,
                TeaserText        = SourceContent.Teaser,
                IsPageLayout      = SourceContent.SubType == EkEnumeration.CMSContentSubtype.PageBuilderData || SourceContent.SubType == EkEnumeration.CMSContentSubtype.PageBuilderMasterData
            };

            long XmlConfigId = Common.PropertyRequest.GetEktronDefinition(typeof(T));

            if (XmlConfigId > 0)
            {
                var mapper = new XmlMapper.MapUtility();
                gc = mapper.RunMap <T>((T)gc, gc.MainBody);
            }

            return(gc);
        }
Example #8
0
        public bool Update(ContentTypeKey key, string value)
        {
            ResultManager.IsCorrect = false;

            //initial validations
            //-sys validations
            if (value == null)
            {
                ResultManager.Add(ErrorDefault, Trace + "ContenDataEdit.111 Value del contenido a editar no puede ser nulo");
                return(false);
            }

            //update item
            try
            {
                string lookupKey = Keys.ContainsKey(key)
                                ? Keys[key]
                                : string.Empty;

                ContentData item            = Repository.ContentData.GetAll().Where(x => string.Equals(x.Key, lookupKey)).FirstOrDefault();
                bool        isNewContentKey = false;
                if (item == null)
                {
                    isNewContentKey = true;
                    item            = new ContentData();
                }

                item.Key   = Keys[key];
                item.Value = value;

                if (isNewContentKey)
                {
                    Repository.ContentData.Add(item);
                }

                Repository.Complete();
                ResultManager.IsCorrect = true;
                return(true);
            }
            catch (Exception ex)
            {
                ResultManager.Add(ErrorDefault, Trace + "ContenDataEdit.511 Excepción al editar el contenido con key '" + key + "': " + ex.Message);
            }
            return(false);
        }
Example #9
0
        // This handles the logic of whether or not you should return a template or the local value
        public ContentArea GetTemplate(ContentArea propertyValue, ContentData contentData)
        {
            if (propertyValue != null && propertyValue.Count > 0)
            {
                // This has a local value
                return(propertyValue);
            }

            var template = GetTemplate(contentData);

            if (template != null)
            {
                // We have a template
                return(template);
            }

            return(null);
        }
    /// <summary>
    ///     Creates a ContentNodeKit
    /// </summary>
    /// <param name="contentTypeId"></param>
    /// <param name="id"></param>
    /// <param name="path"></param>
    /// <param name="sortOrder"></param>
    /// <param name="level">
    ///     Optional. Will get calculated based on the path value if not specified.
    /// </param>
    /// <param name="parentContentId">
    ///     Optional. Will get calculated based on the path value if not specified.
    /// </param>
    /// <param name="creatorId"></param>
    /// <param name="uid"></param>
    /// <param name="createDate"></param>
    /// <param name="draftData"></param>
    /// <param name="publishedData"></param>
    /// <returns></returns>
    public static ContentNodeKit CreateWithContent(
        int contentTypeId,
        int id,
        string path,
        int?sortOrder             = null,
        int?level                 = null,
        int?parentContentId       = null,
        int creatorId             = -1,
        Guid?uid                  = null,
        DateTime?createDate       = null,
        ContentData draftData     = null,
        ContentData publishedData = null)
    {
        var pathParts = path.Split(',');

        if (pathParts.Length >= 2)
        {
            parentContentId ??= int.Parse(pathParts[^ 2]);
        public async Task Should_add_error_if_validating_data_with_invalid_localizable_field()
        {
            schema = schema.AddOrUpdateField(new NumberField(1, "my-field", Partitioning.Language, new NumberFieldProperties {
                IsRequired = true
            }));

            var data =
                new ContentData();

            await data.ValidateAsync(schema, languagesConfig.ToResolver(), errors);

            errors.ShouldBeEquivalentTo(
                new List <ValidationError>
            {
                new ValidationError("my-field (de) is required", "my-field"),
                new ValidationError("my-field (en) is required", "my-field")
            });
        }
            public void LoadTest()
            {
                Mapper.RegisterType <DateResult>();
                var sut = new ContentData()
                {
                    DateCreated = DateTime.Now
                };

                var start = DateTime.Now;

                for (var i = 0; i < 30000; i++)
                {
                    var result = sut.AsContentType <DateResult>();
                }
                var end = DateTime.Now;

                Console.WriteLine(end - start);
            }
Example #13
0
        public IDictionary <string, string> Resolve(ContentData content)
        {
            var metadata   = _metadataProvider.GetMetadataForType(() => content, typeof(ContentData));
            var storeModel = _modelCreator.Create(metadata);
            var properties = new Dictionary <string, string>();

            foreach (var metadataStoreModel in storeModel.Properties)
            {
                var props = storeModel.MappedProperties.Where(x => x.To == metadataStoreModel.Name).ToList();
                foreach (var propertyMapping in props)
                {
                    properties.Add(propertyMapping.From, metadataStoreModel.DisplayName);
                }
                properties.Add(metadataStoreModel.Name, metadataStoreModel.DisplayName);
            }

            return(properties);
        }
            public void MapsString()
            {
                var sut = new ContentData()
                {
                    MetaData = new ContentMetaData[]
                    {
                        new ContentMetaData()
                        {
                            Name = "Value",
                            Text = "123"
                        }
                    }
                };

                var result = sut.AsContentType<StringResult>();

                Assert.AreEqual(result.Value, "123");
            }
Example #15
0
 public ActionResult Create(Content model)
 {
     if (ModelState.IsValid)
     {
         var data = new ContentData();
         var id   = data.InsertContent(model);
         if (id > 0)
         {
             return(RedirectToAction("Index", "Content"));
         }
         else
         {
             ModelState.AddModelError("", "Cannot add content");
         }
     }
     SetviewBag();
     return(View());
 }
    void Start()
    {
        if (Managers.Instance.IsPhone)
        {
            _contentData = phoneContent;
            prefabs      = phonePrefabs;
            tabletContent.area.SetActive(false);
        }
        else
        {
            _contentData = tabletContent;
            prefabs      = tabletPrefabs;
            phoneContent.area.SetActive(false);
        }

        UnityEngine.Events.UnityAction HideCorridors = () => { _contentData.corridors.GetComponent <Animator>().SetTrigger("Hide"); };
        GameObject.Find("HideCorridor").GetComponent <Button>().onClick.AddListener(HideCorridors);
    }
        public void Should_update_data_when_setting_field_value_with_number()
        {
            var original =
                new ContentData()
                .AddField("number",
                          new ContentFieldData()
                          .AddValue("iv", 1.0));

            var expected =
                new ContentData()
                .AddField("number",
                          new ContentFieldData()
                          .AddValue("iv", 3.0));

            var result = ExecuteScript(original, @"data.number.iv = data.number.iv + 2");

            Assert.Equal(expected, result);
        }
        public static async Task ValidateAsync(this ContentData data, PartitionResolver partitionResolver, IList <ValidationError> errors,
                                               Schema?schema              = null,
                                               ValidationMode mode        = ValidationMode.Default,
                                               ValidationUpdater?updater  = null,
                                               IValidatorsFactory?factory = null,
                                               ValidationAction action    = ValidationAction.Upsert)
        {
            var context = CreateContext(schema, mode, updater, action);

            var validator = new ContentValidator(partitionResolver, context, Factories(factory), Log);

            await validator.ValidateInputAsync(data);

            foreach (var error in validator.Errors)
            {
                errors.Add(error);
            }
        }
        public static string ToFullText <T>(this ContentData <T> data, int maxTotalLength = 1024 * 1024, int maxFieldLength = 1000, string separator = " ")
        {
            var stringBuilder = new StringBuilder();

            foreach (var value in data.Values.SelectMany(x => x.Values))
            {
                AppendText(value, stringBuilder, maxFieldLength, separator, false);
            }

            var result = stringBuilder.ToString();

            if (result.Length > maxTotalLength)
            {
                result = result.Substring(0, maxTotalLength);
            }

            return(result);
        }
Example #20
0
        public void Should_update_data_if_deleting_field()
        {
            var original =
                new ContentData()
                .AddField("number",
                          new ContentFieldData()
                          .AddInvariant(1.0));

            var expected = new ContentData();

            const string script = @"
                delete data.number
            ";

            var result = ExecuteScript(original, script);

            Assert.Equal(expected, result);
        }
Example #21
0
        // two-phase ctor, phase 2
        public void SetContentTypeAndData(PublishedContentType contentType, ContentData draftData, ContentData publishedData, IPublishedSnapshotAccessor publishedSnapshotAccessor, IVariationContextAccessor variationContextAccessor)
        {
            ContentType = contentType;

            if (draftData == null && publishedData == null)
            {
                throw new ArgumentException("Both draftData and publishedData cannot be null at the same time.");
            }

            if (draftData != null)
            {
                Draft = new PublishedContent(this, draftData, publishedSnapshotAccessor, variationContextAccessor).CreateModel();
            }
            if (publishedData != null)
            {
                Published = new PublishedContent(this, publishedData, publishedSnapshotAccessor, variationContextAccessor).CreateModel();
            }
        }
        public void Should_update_data_when_setting_field_value_with_object()
        {
            var original =
                new ContentData()
                .AddField("number",
                          new ContentFieldData()
                          .AddJsonValue(JsonValue.Object().Add("lat", 1.0)));

            var expected =
                new ContentData()
                .AddField("number",
                          new ContentFieldData()
                          .AddJsonValue(JsonValue.Object().Add("lat", 1.0).Add("lon", 4.0)));

            var result = ExecuteScript(original, @"data.number.iv = { lat: data.number.iv.lat, lon: data.number.iv.lat + 3 }");

            Assert.Equal(expected, result);
        }
        public void Should_update_data_when_setting_field_value_with_boolean()
        {
            var original =
                new ContentData()
                .AddField("boolean",
                          new ContentFieldData()
                          .AddValue("iv", false));

            var expected =
                new ContentData()
                .AddField("boolean",
                          new ContentFieldData()
                          .AddValue("iv", true));

            var result = ExecuteScript(original, @"data.boolean.iv = !data.boolean.iv");

            Assert.Equal(expected, result);
        }
        public void Should_update_data_when_setting_field_value_with_array()
        {
            var original =
                new ContentData()
                .AddField("number",
                          new ContentFieldData()
                          .AddJsonValue(JsonValue.Array(1.0, 2.0)));

            var expected =
                new ContentData()
                .AddField("number",
                          new ContentFieldData()
                          .AddJsonValue(JsonValue.Array(1.0, 4.0, 5.0)));

            var result = ExecuteScript(original, @"data.number.iv = [data.number.iv[0], data.number.iv[1] + 2, 5]");

            Assert.Equal(expected, result);
        }
Example #25
0
        public async Task Should_add_error_if_required_data_string_field_is_not_in_bag()
        {
            schema = schema.AddString(1, "my-field", Partitioning.Invariant,
                                      new StringFieldProperties {
                IsRequired = true
            });

            var data =
                new ContentData();

            await data.ValidateAsync(languagesConfig.ToResolver(), errors, schema);

            errors.Should().BeEquivalentTo(
                new List <ValidationError>
            {
                new ValidationError("Field is required.", "my-field.iv")
            });
        }
Example #26
0
        public void Should_copy_field_values_from_other_data_if_they_are_equal()
        {
            var oldData =
                new ContentData()
                .AddField("field1",
                          new ContentFieldData()
                          .AddLocalized("en", 1)
                          .AddLocalized("de", 2));
            var newData =
                new ContentData()
                .AddField("field1",
                          new ContentFieldData()
                          .AddLocalized("en", 1)
                          .AddLocalized("de", 3));

            newData.UseSameFields(oldData);

            Assert.Same(newData["field1"] !["en"], oldData["field1"] !["en"]);
Example #27
0
        public void Should_update_data_defining_property_for_content()
        {
            var original = new ContentData();

            var expected =
                new ContentData()
                .AddField("number",
                          new ContentFieldData()
                          .AddInvariant(1.0));

            const string script = @"
                Object.defineProperty(data, 'number', { value: { iv: 1 } })
            ";

            var result = ExecuteScript(original, script);

            Assert.Equal(expected, result);
        }
        public void Should_update_data_when_setting_field_value_with_string()
        {
            var original =
                new ContentData()
                .AddField("string",
                          new ContentFieldData()
                          .AddValue("iv", "1"));

            var expected =
                new ContentData()
                .AddField("string",
                          new ContentFieldData()
                          .AddValue("iv", "1new"));

            var result = ExecuteScript(original, @"data.string.iv = data.string.iv + 'new'");

            Assert.Equal(expected, result);
        }
        public async Task ValidatePartialAsync(ContentData data)
        {
            Guard.NotNull(data, nameof(data));

            foreach (var fieldData in data)
            {
                var fieldName = fieldData.Key;

                if (!schema.FieldsByName.TryGetValue(fieldData.Key, out Field field))
                {
                    errors.AddError("<FIELD> is not a known field", fieldName);
                }
                else
                {
                    await ValidateFieldPartialAsync(field, fieldData.Value);
                }
            }
        }
Example #30
0
        public async Task Should_resolve_references()
        {
            var referenceId1 = DomainId.NewGuid();
            var reference1 = CreateReference(referenceId1, 1);
            var referenceId2 = DomainId.NewGuid();
            var reference2 = CreateReference(referenceId1, 2);

            var user = new ClaimsPrincipal();

            var data =
                new ContentData()
                    .AddField("references",
                        new ContentFieldData()
                            .AddInvariant(JsonValue.Array(referenceId1, referenceId2)));

            A.CallTo(() => contentQuery.QueryAsync(
                    A<Context>.That.Matches(x => x.App.Id == appId.Id && x.User == user), A<Q>.That.HasIds(referenceId1, referenceId2), A<CancellationToken>._))
                .Returns(ResultList.CreateFrom(2, reference1, reference2));

            var vars = new ScriptVars
            {
                ["appId"] = appId.Id,
                ["data"] = data,
                ["dataOld"] = null,
                ["user"] = user
            };

            var expected = @"
                Text: Hello 1 World 1
                Text: Hello 2 World 2
            ";

            var script = @"
                getReferences(data.references.iv, function (references) {
                    var result1 = `Text: ${references[0].data.field1.iv} ${references[0].data.field2.iv}`;
                    var result2 = `Text: ${references[1].data.field1.iv} ${references[1].data.field2.iv}`;

                    complete(`${result1}\n${result2}`);
                })";

            var result = (await sut.ExecuteAsync(vars, script)).ToString();

            Assert.Equal(Cleanup(expected), Cleanup(result));
        }
Example #31
0
    public void SetContent(ContentData data)
    {
        ClearContent();
        cData = data;
        float heightSummary = 0;

        titleText.text = "<b>" + StringUtil.ParseUnicodeEscapes(data.title) + "</b>";
        titleText.ForceMeshUpdate();
        heightSummary -= (titleText.bounds.size.y + 0.5f - titleText.transform.localPosition.y);

        //max content
        int maxObj = (data.detail.Length > data.img.Length) ? data.detail.Length : data.img.Length;

        for (int i = 0; i < maxObj; i++)
        {
            GameObject cObj = (GameObject)GameObject.Instantiate(ContentObjectPrefabs);
            cObj.SetActive(true);
            cObj.name             = "Paragraph" + (i + 1);
            cObj.transform.parent = this.transform;
            ContentObject cComp = cObj.GetComponent <ContentObject>();
            //setup component
            if (i < data.img.Length)
            {
                cComp.setupImg(data.img[i]);
            }
            if (i < data.detail.Length)
            {
                cComp.setupDetailText(data.detail[i]);
            }
            Debug.Log("Hight Summary : " + heightSummary);
            cObj.transform.localPosition = new Vector3(0, heightSummary, 0);
            if (data.detail[i] == "")
            {
                detailHeight = 0.5f;
            }
            else
            {
                detailHeight = 0.0f;
            }
            heightSummary -= (cComp.height - detailHeight + 0.5f);
            ContentList.Add(cComp);
        }
        height = -heightSummary;
    }
Example #32
0
 public MonsterData(string name, Dictionary <string, string> content, string path) : base(name, content, path, type)
 {
     // Get usage info
     if (content.ContainsKey("info"))
     {
         info = new StringKey(content["info"]);
     }
     if (content.ContainsKey("imageplace"))
     {
         if (content["imageplace"].IndexOf("{import}") == 0)
         {
             imagePlace = ContentData.ImportPath() + content["imageplace"].Substring(8);
         }
         else
         {
             imagePlace = path + "/" + content["imageplace"];
         }
     }
     else // No image is a valid condition
     {
         imagePlace = image;
     }
     activations = new string[0];
     if (content.ContainsKey("activation"))
     {
         activations = content["activation"].Split(' ');
     }
     if (content.ContainsKey("health"))
     {
         float.TryParse(content["health"], out healthBase);
     }
     if (content.ContainsKey("healthperhero"))
     {
         float.TryParse(content["healthperhero"], out healthPerHero);
     }
     if (content.ContainsKey("horror"))
     {
         int.TryParse(content["horror"], out horror);
     }
     if (content.ContainsKey("awareness"))
     {
         int.TryParse(content["awareness"], out awareness);
     }
 }
Example #33
0
            private void Update(ContentEvent @event, ContentData data)
            {
                var uniqueId = DomainId.Combine(@event.AppId, @event.ContentId);

                if (states.TryGetValue(uniqueId, out var state))
                {
                    if (state.DocIdNew != null)
                    {
                        Index(@event,
                              new UpsertIndexEntry
                        {
                            ContentId      = @event.ContentId,
                            DocId          = state.DocIdNew,
                            GeoObjects     = data.ToGeo(jsonSerializer),
                            ServeAll       = true,
                            ServePublished = false,
                            Texts          = data.ToTexts()
                        });

                        Index(@event,
                              new UpdateIndexEntry
                        {
                            DocId          = state.DocIdCurrent,
                            ServeAll       = false,
                            ServePublished = true
                        });
                    }
                    else
                    {
                        var isPublished = state.DocIdCurrent == state.DocIdForPublished;

                        Index(@event,
                              new UpsertIndexEntry
                        {
                            ContentId      = @event.ContentId,
                            DocId          = state.DocIdCurrent,
                            GeoObjects     = data.ToGeo(jsonSerializer),
                            ServeAll       = true,
                            ServePublished = isPublished,
                            Texts          = data.ToTexts()
                        });
                    }
                }
            }
Example #34
0
 public string FixContentHistory(ContentData myContentData, string curSnippet)
 {
     Regex regExp;
         regExp = new Regex(" ");
         foreach (string strLineVal in regExp.Split(curSnippet))
         {
             regExp = new Regex("=");
             string[] strKeyValues;
             strKeyValues = regExp.Split(strLineVal);
             if ((string) (strKeyValues[0].Trim()) == "src")
             {
                 string curStringVal = strKeyValues[1];
                 if (curStringVal.ToLower().IndexOf("/assets") >= 0)
                 {
                     curStringVal = (string) (curStringVal.ToLower().Replace("/assets/" + myContentData.AssetData.Id.ToLower() + myContentData.AssetData.Version.Substring(myContentData.AssetData.Version.IndexOf(".")).ToLower(), "/assetmanagement/DownloadAsset.aspx?history=true&ID=" + myContentData.AssetData.Id + "&version=" + myContentData.AssetData.Version));
                     curSnippet = Regex.Replace(curSnippet, strKeyValues[1], curStringVal);
                 }
             }
         }
         return curSnippet;
 }
Example #35
0
    /// <summary>
    /// Page Init
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Init(object sender, EventArgs e)
    {
        RightSideContent.ccontentID = mainForm.EkItem.Id.ToString();
        RightSideContent.cfolderID = mainForm.EkItem.FolderId.ToString();
        uxPageTitle.pgTitle = mainForm.EkItem.Title.ToString();
        uxBreadcrumb.contentID = mainForm.EkItem.Id.ToString();
        uxPageTitle.pageId = mainForm.EkItem.Id.ToString();
        uxPageTitle.ResourceTypeId = "2";

          formID = long.Parse(Request.QueryString["ekfrm"].ToString());

        contactForm.formID = formID.ToString();

        TopDescription = "";

        switch (formID)
        {

            case 112:
                uploadFile.Visible = true;
                break;

        }

        ContentManager contentManager = new ContentManager();
        ContentData cData = new ContentData();
        Boolean returnMetadata = true;
        string result = string.Empty;
        cData = contentManager.GetItem(formID, returnMetadata);
        foreach (ContentMetaData cmd in cData.MetaData)
        {

            if (cmd.Name == "Forms Description")
            {
                getUpperText(cmd.Text);

            }
        }
    }
Example #36
0
    protected override void OnInitComplete(EventArgs e)
    {
        id = GeneralExtensions.GetQueryStringId();
        if (id > 0)
        {
            contentData = id.GetContentById();
            homeProperties = homeUtils.GetHomeElements(contentData.Html);
            //To bind the What's New Module
            this.blogModelSource.ContentFilters.Add(new Ektron.Cms.Framework.UI.Controls.ContentFilter()
            {
                Field = Ektron.Cms.Common.ContentProperty.Id,
                Operator = Ektron.Cms.Common.CriteriaFilterOperator.InSubClause,
                Value = homeProperties.blogIds
            });

            this.clientModelSource.ContentFilters.Add(new Ektron.Cms.Framework.UI.Controls.ContentFilter()
            {
                Field = Ektron.Cms.Common.ContentProperty.Id,
                Operator = Ektron.Cms.Common.CriteriaFilterOperator.EqualTo,
                Value = homeProperties.ourClientsId.ToString()
            });
        }
        base.OnInitComplete(e);
    }
Example #37
0
 private string GetPathHref(ContentData contentData)
 {
     return _ContentApi.AppPath + "reports.aspx?action=ViewNewContent&interval=" + Request.QueryString["interval"] + "&filtertype=PATH&filterId=" + contentData.FolderId + "&orderby=" + Request.QueryString["orderby"];
 }
Example #38
0
        private string GetImagePath(ContentData contentData)
        {
            string path = String.Empty;
            switch (contentData.ContType)
            {
                case 1:
                    if (contentData.SubType == EkEnumeration.CMSContentSubtype.WebEvent)
                    {
                        path = _ContentApi.AppPath + "images/UI/Icons/calendarViewDay.png";
                    }
                    else
                    {
                        path = _ContentApi.AppPath + "images/ui/icons/contentHtml.png";
                    }
                    break;
                case 2:
                    path = _ContentApi.AppPath + "images/ui/icons/contentForm.png";
                    break;
                case 3:
                    path = _ContentApi.AppPath + "images/ui/icons/icon_document.png";
                    break;
                case 1111:
                    path = _ContentApi.AppPath + "images/ui/icons/asteriskOrange.png";
                    break;
                case 3333:
                    path = _ContentApi.AppPath + "images/ui/icons/brick.png";
                    break;
                default:
                    path = contentData.AssetData.Icon;
                    break;
            }

            return path;
        }
Example #39
0
 private string GetSubmittedByHref(ContentData contentData)
 {
     return _ContentApi.AppPath + "reports.aspx?action=ViewCheckedOut&interval=" + Request.QueryString["interval"] + "&filtertype=USER&filterId=" + contentData.UserId + "&orderby=" + Request.QueryString["orderby"];
 }
        private void UpdateItemMetadata(ContentData item, DataRow row)
        {
            foreach (DataColumn column in MetadataColumns)
            {
                ContentMetaData metaData = item.MetaData.SingleOrDefault(cmd => cmd.Name == column.ColumnName);
                if (metaData == null)
                {
                    row.LogContentWarn(
                        "metadata named '{0}' not found",
                        column.ColumnName);
                    continue;
                }

                row.LogContentInfo("setting metadata field '{0}' to '{1}'", metaData.Name, row[column]);
                metaData.Text = row[column].ToString();
            }

            DoContentUpdate(row, item);
        }
Example #41
0
 private void SetContentID()
 {
     if (Request.QueryString["id"] != "")
     {
         try
         {
             contentid = Convert.ToInt64(Request.QueryString["id"]);
         }
         catch (Exception)
         {
             contentid = 0;
         }
     }
     else
     {
         contentid = 0;
     }
     try
     {
         content_data = _ContentAPI.GetContentById(contentid, 0);
     }
     catch (Exception ex)
     {
         Response.Redirect((string)("reterror.aspx?info=" + ex.Message.ToString()), true);
     }
 }
Example #42
0
    //End: Task Type
    private void ViewContentProperties(ContentData data)
    {
        //GET PROPERTY: status
        string dataStatus = "";
        switch (data.Status.ToLower())
        {
            case "a":
                dataStatus = m_refMsg.GetMessage("status:Approved (Published)");
                break;
            case "o":
                dataStatus = m_refMsg.GetMessage("status:Checked Out");
                break;
            case "i":
                dataStatus = m_refMsg.GetMessage("status:Checked In");
                break;
            case "p":
                dataStatus = m_refMsg.GetMessage("status:Approved (PGLD)");
                break;
            case "m":
                dataStatus = "<font color=\"Red\">" + m_refMsg.GetMessage("status:Submitted for Deletion") + "</font>";
                break;
            case "s":
                dataStatus = "<font color=\"Red\">" + m_refMsg.GetMessage("status:Submitted for Approval") + "</font>";
                break;
            case "t":
                dataStatus = m_refMsg.GetMessage("status:Waiting Approval");
                break;
            case "d":
                dataStatus = "Deleted (Pending Start Date)";
                break;
        }

        //GET PROPERTY: start date
        string goLive;
        if (data.DisplayGoLive.Length == 0)
        {
            goLive = m_refMsg.GetMessage("none specified msg");
        }
        else
        {
            goLive = Ektron.Cms.Common.EkFunctions.FormatDisplayDate(data.DisplayGoLive, data.LanguageId);
        }

        //GET PROPERTY: end date
        string endDate;
        if (data.DisplayEndDate == "")
        {
            endDate = m_refMsg.GetMessage("none specified msg");
        }
        else
        {
            endDate = Ektron.Cms.Common.EkFunctions.FormatDisplayDate(data.DisplayEndDate, data.LanguageId);
        }

        //GET PROPERTY: action on end date
        string endDateActionTitle;
        if (data.DisplayEndDate.Length > 0)
        {
            if (data.EndDateAction == Ektron.Cms.Common.EkConstants.EndDateActionType_archive_display)
            {
                endDateActionTitle = m_refMsg.GetMessage("Archive display descrp");
            }
            else if (data.EndDateAction == Ektron.Cms.Common.EkConstants.EndDateActionType_refresh)
            {
                endDateActionTitle = m_refMsg.GetMessage("Refresh descrp");
            }
            else
            {
                endDateActionTitle = m_refMsg.GetMessage("Archive expire descrp");
            }
        }
        else
        {
            endDateActionTitle = m_refMsg.GetMessage("none specified msg");
        }

        //GET PROPERTY: approval method
        string apporvalMethod;
        if (data.ApprovalMethod == 1)
        {
            apporvalMethod = m_refMsg.GetMessage("display for force all approvers");
        }
        else
        {
            apporvalMethod = m_refMsg.GetMessage("display for do not force all approvers");
        }

        //GET PROPERTY: approvals
        System.Text.StringBuilder approvallist = new System.Text.StringBuilder();
        int i;
        if (approvaldata == null)
        {
            approvaldata = m_refContentApi.GetCurrentApprovalInfoByID(m_intId);
        }
        approvallist.Append(m_refMsg.GetMessage("none specified msg"));
        if (!(approvaldata == null))
        {
            if (approvaldata.Length > 0)
            {
                approvallist.Length = 0;
                for (i = 0; i <= approvaldata.Length - 1; i++)
                {
                    if (approvaldata[i].Type.ToLower() == "user")
                    {
                        approvallist.Append("<img src=\"" + m_refContentApi.AppPath + "images/UI/Icons/user.png\" alt=\"" + m_refMsg.GetMessage("approver is user") + "\" title=\"" + m_refMsg.GetMessage("approver is user") + "\">");
                    }
                    else
                    {
                        approvallist.Append("<img src=\"" + m_refContentApi.AppPath + "images/UI/Icons/users.png\" alt=\"" + m_refMsg.GetMessage("approver is user group") + "\" title=\"" + m_refMsg.GetMessage("approver is user group") + "\">");
                    }

                    approvallist.Append("<span");
                    if (approvaldata[i].IsCurrentApprover)
                    {
                        approvallist.Append(" class=\"important\"");
                    }
                    approvallist.Append(">");

                    if (approvaldata[i].Type.ToLower() == "user")
                    {
                        approvallist.Append(approvaldata[i].DisplayUserName);
                    }
                    else
                    {
                        approvallist.Append(approvaldata[i].DisplayUserName);
                    }

                    approvallist.Append("</span>");
                }
            }
        }

        //GET PROPERTY: smart form configuration
        string type;
        if (data.Type == 3333)
        {
            type = m_refMsg.GetMessage("lbl product type xml config");
        }
        else
        {
            type = m_refMsg.GetMessage("xml configuration label");
        }

        //GET PROPERTY: smart form title
        string typeValue;
        if (!(data.XmlConfiguration == null))
        {
            typeValue = (string)("&nbsp;" + data.XmlConfiguration.Title);
            xml_id = data.XmlConfiguration.Id;
        }
        else
        {
            typeValue = (string)(m_refMsg.GetMessage("none specified msg") + " " + m_refMsg.GetMessage("html content assumed"));
        }

        if (folder_data == null)
        {
            folder_data = m_refContentApi.EkContentRef.GetFolderById(content_data.FolderId);
        }

        //GET PROPERTY: template name
        string fileName;
        if (m_refContent.MultiConfigExists(content_data.Id, m_refContentApi.RequestInformationRef.ContentLanguage))
        {
            TemplateData t_templateData = m_refContent.GetMultiTemplateASPX(content_data.Id);
            if (t_templateData != null)
            {
                fileName = t_templateData.FileName;
            }
            else
            {
                fileName = folder_data.TemplateFileName;
            }
        }
        else
        {
            fileName = folder_data.TemplateFileName;
        }

        //GET PROPERTY: rating
        string rating;
        Collection dataCol = m_refContentApi.GetContentRatingStatistics(data.Id, 0, null);
        int total = 0;
        int sum = 0;
        int hits = 0;
        if (dataCol.Count > 0)
        {
            total = Convert.ToInt32 (dataCol["total"]);
            sum = Convert.ToInt32 (dataCol["sum"]);
            hits = Convert.ToInt32 (dataCol["hits"]);
        }
        if (total == 0)
        {
            rating = m_refMsg.GetMessage("content not rated");
        }
        else
        {
            rating = System.Convert.ToString(Math.Round(System.Convert.ToDouble(Convert.ToDouble((short)sum) / total), 2));
        }

        NameValueCollection contentPropertyValues = new NameValueCollection();
        contentPropertyValues.Add(m_refMsg.GetMessage("content title label"), data.Title);
        contentPropertyValues.Add(m_refMsg.GetMessage("content id label"), data.Id.ToString ());
        contentPropertyValues.Add(m_refMsg.GetMessage("content language label"), LanguageName);
        contentPropertyValues.Add(m_refMsg.GetMessage("content status label"), dataStatus);
        contentPropertyValues.Add(m_refMsg.GetMessage("content LUE label"), data.EditorFirstName + " " + data.EditorLastName);
        contentPropertyValues.Add(m_refMsg.GetMessage("content LED label"), Ektron.Cms.Common.EkFunctions.FormatDisplayDate(data.DisplayLastEditDate, data.LanguageId));
        contentPropertyValues.Add(m_refMsg.GetMessage("generic start date label"),(goLive == Ektron.Cms.Common.EkFunctions.FormatDisplayDate(DateTime.MinValue.ToString(), data.LanguageId) ? m_refMsg.GetMessage("none specified msg") : goLive ));
        contentPropertyValues.Add(m_refMsg.GetMessage("generic end date label"), (endDate == Ektron.Cms.Common.EkFunctions.FormatDisplayDate(DateTime.MinValue.ToString(),  data.LanguageId) ? m_refMsg.GetMessage("none specified msg") : endDate));
        contentPropertyValues.Add(m_refMsg.GetMessage("End Date Action Title"), endDateActionTitle);
        contentPropertyValues.Add(m_refMsg.GetMessage("content DC label"), Ektron.Cms.Common.EkFunctions.FormatDisplayDate(data.DateCreated.ToString(), data.LanguageId));
        contentPropertyValues.Add(m_refMsg.GetMessage("lbl approval method"), apporvalMethod);
        contentPropertyValues.Add(m_refMsg.GetMessage("content approvals label"), approvallist.ToString());
        if (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)
        {
            contentPropertyValues.Add(type, typeValue);
        }
        if (content_data.Type == Ektron.Cms.Common.EkConstants.CMSContentType_CatalogEntry || content_data.Type == 1 || content_data.Type == 2 || content_data.Type == 104)
        {
            contentPropertyValues.Add(m_refMsg.GetMessage("template label"), fileName);
        }
        contentPropertyValues.Add(m_refMsg.GetMessage("generic Path"), data.Path);
        contentPropertyValues.Add(m_refMsg.GetMessage("rating label"), rating);
        contentPropertyValues.Add(m_refMsg.GetMessage("lbl content searchable"), data.IsSearchable.ToString());

        //string[] endColon = new string[] { ":" };
        string endColon = ":";
        string propertyName;
        StringBuilder propertyRows = new StringBuilder();
        for (i = 0; i <= contentPropertyValues.Count - 1; i++)
        {
            propertyName = (string)(contentPropertyValues.GetKey(i).TrimEnd(endColon.ToString().ToCharArray()));
            propertyRows.Append("<tr><td class=\"label\">");
            propertyRows.Append(propertyName + ":");
            propertyRows.Append("</td><td>");
            propertyRows.Append(contentPropertyValues[contentPropertyValues.GetKey(i)]);
            propertyRows.Append("</td></tr>");
        }

        litPropertyRows.Text = propertyRows.ToString();
    }
Example #43
0
    private void ViewMetaData(ContentData data)
    {
        // Note: History for metadata-to-folder-assignment is not stored, and the
            // metadata array supplied to this function does not include anything useful
            // except for the TypeName property (string). We must compare this name to
            // all the names of the metadata currently assigned to the content-items
            // folder, showing only the matches and filtering out all of the rest:
            System.Text.StringBuilder result = new System.Text.StringBuilder();
            int idx;
            Hashtable htValidMetadata;
            Collection cCustFieldCol;
            Collection cCustFieldItem;
            CustomFieldsApi custFlds;
            string sName;

            // folder
            try
            {
                // build a table of valid names:
                custFlds = new CustomFieldsApi();
                cCustFieldCol = custFlds.GetFieldsByFolder(data.FolderId, data.LanguageId);
                htValidMetadata = new Hashtable();
                foreach (Collection tempLoopVar_cCustFieldItem in cCustFieldCol)
                {
                    cCustFieldItem = tempLoopVar_cCustFieldItem;
                    htValidMetadata.Add(cCustFieldItem["CustomFieldName"], true);
                }

                // now display only those items that belong to the containing folder:
                result.Append("<table class=\"ektronForm\"><tbody>");

                if (!(data.MetaData == null))
                {
                    for (idx = 0; idx <= data.MetaData.Length - 1; idx++)
                    {
                        sName = (string) (data.MetaData[idx].TypeName);
                        if (htValidMetadata.ContainsKey(sName))
                        {
                            result.Append("<tr><td class=\"label\">" + sName + ":</td><td>&nbsp;&nbsp;");
                            result.Append(data.MetaData[idx].Text + "</td></tr>");
                        }
                    }
                }
                else
                {
                    result.Append("<tr><td>There is no metadata defined.</td><tr>");
                }
                result.Append("</tbody></table>");
                MetaDataValue.Text = result.ToString();

            }
            catch (Exception ex)
            {
                MetaDataValue.Text = ex.Message;

            }
            finally
            {
                result = null;
                custFlds = null;
                htValidMetadata = null;
                cCustFieldCol = null;
                cCustFieldItem = null;
            }
    }
Example #44
0
    private void Display_EditPermissions()
    {
        long nFolderId;

        if (_ItemType == "folder")
        {
            _FolderData = _ContentApi.GetFolderById(_Id);
            nFolderId = _Id;
            if (_FolderData.FolderType == Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionBoard) || _FolderData.FolderType == Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionForum))
            {
                _IsBoard = true;
            }
            else if (_FolderData.FolderType == Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.FolderType.Blog))
            {
                _IsBlog = true;
            }
        }
        else
        {
            _ContentData = _ContentApi.GetContentById(_Id, 0);
            _FolderData = _ContentApi.GetFolderById(_ContentData.FolderId);
            nFolderId = _ContentData.FolderId;
        }
        EditPermissionsToolBar();
        _PageData = new Collection();
        UserPermissionData[] userpermission_data;
        UserGroupData usergroup_data;
        UserData user_data;
        UserAPI m_refUserAPI = new UserAPI();
        if (Request.QueryString["base"] == "group")
        {
            userpermission_data = _ContentApi.GetUserPermissions(_Id, _ItemType, 0, Request.QueryString["PermID"], ContentAPI.PermissionUserType.All, ContentAPI.PermissionRequestType.All); //cTmp = ContObj.GetOrderedItemPermissionsv2_0(cTmp, retString)
            usergroup_data = m_refUserAPI.GetUserGroupByIdForFolderAdmin(nFolderId, Convert.ToInt64(Request.QueryString["PermID"]));
            _IsMembership = usergroup_data.IsMemberShipGroup;
        }
        else
        {
            userpermission_data = _ContentApi.GetUserPermissions(_Id, _ItemType, Convert.ToInt64(Request.QueryString["PermID"]), "", ContentAPI.PermissionUserType.All, ContentAPI.PermissionRequestType.All);
            user_data = m_refUserAPI.GetUserByIDForFolderAdmin(nFolderId, Convert.ToInt64(Request.QueryString["PermID"]), false, false);
            _IsMembership = user_data.IsMemberShip;

        }
        frm_itemid.Value = _Id.ToString();
        frm_type.Value = Request.QueryString["type"];
        frm_base.Value = _Base;
        frm_permid.Value = Request.QueryString["PermID"];
        frm_membership.Value = Request.QueryString["membership"];

        if (_IsMembership)
        {
            td_ep_membership.Visible = false;
            hmembershiptype.Value = "1";
        }
        else
        {
            td_ep_membership.InnerHtml = _StyleHelper.GetEnableAllPrompt();
            hmembershiptype.Value = "0";
        }
        Populate_EditPermissionsGenericGrid(userpermission_data);
        Populate_EditPermissionsAdvancedGrid(userpermission_data);
    }
Example #45
0
    private void ViewCatalogToolBar()
    {
        System.Text.StringBuilder result = new System.Text.StringBuilder();
        if (content_data == null)
        {
            content_data = m_refContentApi.GetContentById(m_intId, 0);
        }
        long ParentId = content_data.FolderId;
        Ektron.Cms.Commerce.ProductType pProductType = new Ektron.Cms.Commerce.ProductType(m_refContentApi.RequestInformationRef);
        int count = 0;
        int lAddMultiType = 0;
        bool bSelectedFound = false;
        bool bViewContent = System.Convert.ToBoolean("view" == m_strPageAction); // alternative is archived content
        string SRC = "";
        string str;
        string backStr;
        bool bFromApproval = false;
        int type = 3333;
        bool folderIsHidden = m_refContentApi.IsFolderHidden(content_data.FolderId);
        bool IsOrdered = m_refContentApi.EkContentRef.IsOrdered(content_data.Id);

        if (type == 1)
        {
            if (bFromApproval)
            {
                backStr = "back_file=approval.aspx";
            }
            else
            {
                backStr = "back_file=content.aspx";
            }
        }
        else
        {
            backStr = "back_file=cmsform.aspx";
        }
        str = Request.QueryString["action"];
        if (str != null && str.Length > 0)
        {
            backStr = backStr + "&back_action=" + str;
        }

        if (bFromApproval)
        {
            str = Request.QueryString["page"];
            if (str != null && str.Length > 0)
            {
                backStr = backStr + "&back_page=" + str;
            }
        }

        if (!bFromApproval)
        {
            str = Request.QueryString["folder_id"];
            if (str != null && str.Length > 0)
            {
                backStr = backStr + "&back_folder_id=" + str;
            }
        }

        if (type == 1)
        {
            str = Request.QueryString["id"];
            if (str != null && str.Length > 0)
            {
                backStr = backStr + "&back_id=" + str;
            }
        }
        else
        {
            str = Request.QueryString["form_id"];
            if (str != null && str.Length > 0)
            {
                backStr = backStr + "&back_form_id=" + str;
            }
        }
        if (!(Request.QueryString["callerpage"] == null))
        {
            str = AntiXss.UrlEncode(Request.QueryString["callerpage"]);
            if (str != null && str.Length > 0)
            {
                backStr = backStr + "&back_callerpage=" + str;
            }
        }
        if (!(Request.QueryString["origurl"] == null))
        {
            str = Request.QueryString["origurl"];
            if (str != null && str.Length > 0)
            {
                backStr = backStr + "&back_origurl=" + EkFunctions.UrlEncode(str);
            }
        }
        str = ContentLanguage.ToString();
        if (str != null && str.Length > 0)
        {
            backStr = backStr + "&back_LangType=" + str + "&rnd=" + System.Convert.ToInt32(Conversion.Int((10 * VBMath.Rnd()) + 1));
        }

        SRC = (string)("commerce/catalogentry.aspx?close=false&LangType=" + ContentLanguage + "&id=" + m_intId + "&type=update&" + backStr);
        if (bFromApproval)
        {
            SRC += "&pullapproval=true";
        }

        if (m_strPageAction == "view" || m_strPageAction == "viewstaged")
        {
            string WorkareaTitlebarTitle = (string)(m_refMsg.GetMessage("lbl view catalog entry") + " \"" + content_data.Title + "\" ");
            if (m_strPageAction == "viewstaged")
            {
                WorkareaTitlebarTitle = WorkareaTitlebarTitle + m_refMsg.GetMessage("staged version msg");
            }
            txtTitleBar.InnerHtml = m_refStyle.GetTitleBar(WorkareaTitlebarTitle);
        }

        result.Append("<table><tr>" + "\r\n");
        if ((security_data.CanAdd && bViewContent) || security_data.IsReadOnly == true)
        {

            if (security_data.CanAdd && bViewContent)
            {
                if (!bSelectedFound)
                {
                    lContentType = Ektron.Cms.Common.EkConstants.CMSContentType_AllTypes;
                }
            }
        }

        SetViewImage("");

        if (!folderIsHidden && content_data.SubType != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData && content_data.SubType != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) //hiding the move button for pagebuilder type.
        {
            if (Request.QueryString["callerpage"] == "dashboard.aspx")
            {
                result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/back.png", "javascript:top.switchDesktopTab()", m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
            }
            else if (!String.IsNullOrEmpty(Request.QueryString["callerpage"]))
            {
                result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/back.png", (string)(Request.QueryString["callerpage"] + "?" + HttpUtility.UrlDecode(Request.QueryString["origurl"])), m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
            }
            else if (Request.QueryString["backpage"] == "history")
            {
                result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/back.png", "javascript:history.back()", m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
            }
            else
            {
                result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/back.png", (string)("content.aspx?LangType=" + ContentLanguage + "&action=ViewContentByCategory&id=" + content_data.FolderId), m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
            }
        }

        string buttonId = Guid.NewGuid().ToString();

        result.Append("<td class=\"menuRootItem\" onclick=\"MenuUtil.use(event, \'action\', \'" + buttonId + "\');\" onmouseover=\"this.className=\'menuRootItemSelected\';MenuUtil.use(event, \'action\', \'" + buttonId + "\');\" onmouseout=\"this.className=\'menuRootItem\'\"><span id=\"" + buttonId + "\" class=\"action\">" + m_refMsg.GetMessage("lbl Action") + "</span></td>");

        if ((security_data.CanAdd) || security_data.IsReadOnly)
        {
            buttonId = Guid.NewGuid().ToString();

            result.Append("<td class=\"menuRootItem\" onclick=\"MenuUtil.use(event, \'view\', \'" + buttonId + "\');\" onmouseover=\"this.className=\'menuRootItemSelected\';MenuUtil.use(event, \'view\', \'" + buttonId + "\');\" onmouseout=\"this.className=\'menuRootItem\'\"><span id=\"" + buttonId + "\" class=\"folderView\">" + m_refMsg.GetMessage("lbl View") + "</span></td>");
        }

        buttonId = Guid.NewGuid().ToString();

        result.Append("<td class=\"menuRootItem\" onclick=\"MenuUtil.use(event, \'delete\', \'" + buttonId + "\');\" onmouseover=\"this.className=\'menuRootItemSelected\';MenuUtil.use(event, \'delete\', \'" + buttonId + "\');\" onmouseout=\"this.className=\'menuRootItem\'\"><span id=\"" + buttonId + "\" class=\"chartBar\">" + m_refMsg.GetMessage("generic reports title") + "</span></td>");

        StringBuilder localizationMenuOptions = new StringBuilder();
        if (EnableMultilingual == 1)
        {
            string strViewDisplay = "";
            string strAddDisplay = "";
            LanguageData[] result_language;

            if (security_data.CanEdit || security_data.CanEditSumit)
            {
                LocalizationObject l10nObj = new LocalizationObject();
                Ektron.Cms.Localization.LocalizationState locState = l10nObj.GetContentLocalizationState(m_intId, content_data);
                if (m_refStyle.IsExportTranslationSupportedForContentType((EkEnumeration.CMSContentType)content_data.Type))
                {
                    string statusIcon = "";
                    string statusMsg = "";
                    m_refStyle.GetTranslationStatusIconAndMessage(locState, ref statusIcon, ref statusMsg);
                    // localizationMenuOptions.Append("    {0}.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + statusIcon + " \' />&nbsp;&nbsp;" + statusMsg + "\", function() { return false; } );" + Environment.NewLine);
                    // result.Append(m_refStyle.GetTranslationStatusMenu(content_data, m_refMsg.GetMessage("alt click here to update this content translation status"), m_refMsg.GetMessage("lbl mark ready for translation"), locState));
                    localizationMenuOptions.Append(m_refStyle.PopupTranslationMenu(content_data, locState, "actionmenu", statusMsg, statusIcon, false));
                    // result.Append(m_refStyle.PopupTranslationMenu(content_data, locState));

                    if (locState.IsExportableState())
                    {
                        localizationMenuOptions.Append("    actionmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + m_refContentApi.AppPath + "images/UI/Icons/translation.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("lbl Export for translation") + "\", function() { window.location.href=\"" + "content.aspx?LangType=" + ContentLanguage + "&action=Localize&backpage=View&id=" + m_intId + "&folder_id=" + content_data.FolderId + "\"; } );" + Environment.NewLine);
                        // result.Append(m_refStyle.GetExportTranslationButton((string)("content.aspx?LangType=" + ContentLanguage + "&action=Localize&backpage=View&id=" + m_intId + "&folder_id=" + content_data.FolderId), m_refMsg.GetMessage("alt Click here to export this content for translation"), m_refMsg.GetMessage("lbl Export for translation")));
                    }
                }
            }

            result_language = m_refContentApi.DisplayAddViewLanguage(m_intId);
            for (count = 0; count <= result_language.Length - 1; count++)
            {
                if (result_language[count].Type == "VIEW")
                {
                    if (content_data.LanguageId == result_language[count].Id)
                    {
                        strViewDisplay = strViewDisplay + "<option value=" + result_language[count].Id + " selected>" + result_language[count].Name + "</option>";
                    }
                    else
                    {
                        strViewDisplay = strViewDisplay + "<option value=" + result_language[count].Id + ">" + result_language[count].Name + "</option>";
                    }
                }
            }

            bool languageDividerAdded = false;

            if (strViewDisplay != "")
            {
                result.Append(StyleHelper.ActionBarDivider);
                languageDividerAdded = true;
                result.Append("<td nowrap=\"true\">" + m_refMsg.GetMessage("lbl View") + ":");
                result.Append("<select id=viewcontent name=viewcontent OnChange=\"javascript:LoadContent(\'frmContent\',\'VIEW\');\">");
                result.Append(strViewDisplay);
                result.Append("</select></td>");
            }
            if (security_data.CanAdd)
            {
                //If (bCanAddNewLanguage) Then
                for (count = 0; count <= result_language.Length - 1; count++)
                {
                    if (result_language[count].Type == "ADD")
                    {
                        strAddDisplay = strAddDisplay + "<option value=" + result_language[count].Id + ">" + result_language[count].Name + "</option>";
                    }
                }
                if (strAddDisplay != "")
                {
                    if (!languageDividerAdded)
                    {
                        result.Append(StyleHelper.ActionBarDivider);
                    }
                    else
                    {
                        result.Append("<td>&nbsp;&nbsp;</td>");
                    }
                    result.Append("<td class=\"label\">" + m_refMsg.GetMessage("add title") + ":");
                    if (folder_data == null)
                    {
                        folder_data = m_refContentApi.GetFolderById(content_data.FolderId);
                    }
                    if (Utilities.IsNonFormattedContentAllowed(m_refContentApi.GetEnabledXmlConfigsByFolder(this.folder_data.Id)))
                    {
                        allowHtml = "&AllowHtml=1";
                    }
                    result.Append("<select id=addcontent name=addcontent OnChange=\"javascript:LoadContent(\'frmContent\',\'ADD\');\">");
                    result.Append("<option value=" + "0" + ">" + "-select language-" + "</option>");
                    result.Append(strAddDisplay);
                    result.Append("</select></td>");
                }
                //End If
            }

            //End If
        }

        bool canAddAssets = System.Convert.ToBoolean((security_data.CanAdd || security_data.CanAddFolders) && bViewContent);

        result.Append(StyleHelper.ActionBarDivider);
        result.Append("<td>");
        result.Append(m_refStyle.GetHelpButton(m_strPageAction, ""));
        result.Append("</td>");
        result.Append("</tr></table>");

        result.Append("<script language=\"javascript\">" + Environment.NewLine);

        result.Append("    var filemenu = new Menu( \"file\" );" + Environment.NewLine);
        if (security_data.CanAddFolders)
        {
            result.Append("    filemenu.addItem(\"&nbsp;<img valign=\'center\' src=\'" + "images/ui/icons/folderGreen.png" + "\' />&nbsp;&nbsp;" + m_refMsg.GetMessage("lbl commerce catalog") + "\", function() { window.location.href = \'content.aspx?LangType=" + ContentLanguage + "&action=AddSubFolder&type=catalog&id=" + m_intId + "\' } );" + Environment.NewLine);
            result.Append("    filemenu.addBreak();" + Environment.NewLine);
        }

        if (security_data.IsCollections || m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AminCollectionMenu) || m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminCollection))
        {
            result.Append("" + Environment.NewLine);
        }
        result.Append("    var viewmenu = new Menu( \"view\" );" + Environment.NewLine);
        if (security_data.CanHistory)
        {
            result.Append("    viewmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' valign=\'center\' src=\'" + "images/ui/icons/history.png" + "\' />&nbsp;&nbsp;" + MakeBold(m_refMsg.GetMessage("lbl content history"), 98) + "\", function() { top.document.getElementById(\'ek_main\').src=\"historyarea.aspx?action=report&LangType=" + ContentLanguage + "&id=" + m_intId + "\";return false;});" + Environment.NewLine);
        }
        if (content_data.Status != "A")
        {
            if (!((Ektron.Cms.Common.EkConstants.ManagedAsset_Min <= content_data.Type) && (content_data.Type <= Ektron.Cms.Common.EkConstants.ManagedAsset_Max)))
            {
                result.Append("    viewmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' valign=\'center\' src=\'" + "images/UI/Icons/contentViewDifferences.png" + "\' />&nbsp;&nbsp;" + MakeBold(m_refMsg.GetMessage("btn view diff"), 98) + "\", function() { PopEditWindow(\'compare.aspx?LangType=" + ContentLanguage + "&id=" + m_intId + "\', \'Compare\', 785, 500, 1, 1); } );" + Environment.NewLine);
            }
        }
        if (security_data.IsAdmin || IsFolderAdmin())
        {
            result.Append("    viewmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' valign=\'center\' src=\'" + "images/UI/Icons/approvals.png" + "\' />&nbsp;&nbsp;" + MakeBold(m_refMsg.GetMessage("btn view approvals"), 98) + "\", function() { location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=ViewApprovals&type=content&id=" + m_intId + "\";} );" + Environment.NewLine);
            result.Append("    viewmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' valign=\'center\' src=\'" + "images/UI/Icons/permissions.png" + "\' />&nbsp;&nbsp;" + MakeBold(m_refMsg.GetMessage("btn view permissions"), 98) + "\", function() { location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=ViewPermissions&type=content&id=" + m_intId + "\";} );" + Environment.NewLine);
        }
        result.Append("    viewmenu.addBreak();" + Environment.NewLine);
        result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'center\' src=\'" + "images/ui/icons/brickLeftRight.png" + "\' />&nbsp;&nbsp;" + MakeBold(m_refMsg.GetMessage("lbl cross sell"), 98) + "\", function() { location.href = \"commerce/recommendations/recommendations.aspx?action=crosssell&folder=" + m_intFolderId + "&id=" + m_intId + "\";} );" + Environment.NewLine);
        result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'center\' src=\'" + "images/ui/icons/brickUp.png" + "\' />&nbsp;&nbsp;" + MakeBold(m_refMsg.GetMessage("lbl up sell"), Ektron.Cms.Common.EkConstants.CMSContentType_Content) + "\", function() { location.href = \"commerce/recommendations/recommendations.aspx?action=upsell&folder=" + m_intFolderId + "&id=" + m_intId + "\";} );" + Environment.NewLine);
        if ((security_data.CanEditFolders && bViewContent) || m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommerceAdmin))
        {
            result.Append("    viewmenu.addBreak();" + Environment.NewLine);
            result.Append("    viewmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' valign=\'center\' src=\'" + "images/UI/Icons/properties.png" + "\' />&nbsp;&nbsp;" + MakeBold(m_refMsg.GetMessage("btn properties"), Ektron.Cms.Common.EkConstants.CMSContentType_Content) + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=EditContentProperties&id=" + m_intId + "\";} );" + Environment.NewLine);
        }

        if (((security_data.CanAdd) && bViewContent) || security_data.IsReadOnly == true)
        {
            if (!(asset_data == null))
            {
                if (asset_data.Length > 0)
                {
                    for (count = 0; count <= asset_data.Length - 1; count++)
                    {
                        if (Ektron.Cms.Common.EkConstants.ManagedAsset_Min <= asset_data[count].TypeId && asset_data[count].TypeId <= Ektron.Cms.Common.EkConstants.ManagedAsset_Max)
                        {
                            if ("*" == asset_data[count].PluginType)
                            {
                                lAddMultiType = asset_data[count].TypeId;
                            }
                            else
                            {
                                string imgsrc = string.Empty;
                                string txtCommName = string.Empty;
                                if (asset_data[count].TypeId == 101)
                                {
                                    imgsrc = "&nbsp;<img src=\'" + "images/UI/Icons/FileTypes/word.png" + "\' />&nbsp;&nbsp;";
                                    txtCommName = m_refMsg.GetMessage("lbl Office Documents");
                                }
                                else if (asset_data[count].TypeId == 102 || asset_data[count].TypeId == 106)
                                {
                                    imgsrc = "&nbsp;<img valign=\'center\' src=\'" + "images/UI/Icons/contentHtml.png" + " \' />&nbsp;&nbsp;";
                                    txtCommName = m_refMsg.GetMessage("lbl Managed Files");
                                }
                                else if (asset_data[count].TypeId == 104)
                                {
                                    imgsrc = "&nbsp;<img valign=\'center\' src=\'" + "images/UI/Icons/film.png" + " \' />&nbsp;&nbsp;";
                                    txtCommName = m_refMsg.GetMessage("lbl Multimedia");
                                }
                                else
                                {
                                    imgsrc = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                                }
                                if (asset_data[count].TypeId != 105)
                                {
                                    result.Append("viewmenu.addItem(\"" + imgsrc + "" + MakeBold(txtCommName, System.Convert.ToInt32(asset_data[count].TypeId)) + "\", function() { UpdateView(" + asset_data[count].TypeId + "); } );" + Environment.NewLine);
                                }
                            }
                        }
                    }
                }
            }

            result.Append("    MenuUtil.add( viewmenu );" + Environment.NewLine);

            result.Append("    var deletemenu = new Menu( \"delete\" );" + Environment.NewLine);
            result.Append("    deletemenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' valign=\'center\' src=\'" + "images/UI/Icons/chartBar.png" + "\' />&nbsp;&nbsp;" + m_refMsg.GetMessage("content stats") + "\", function() { location.href = \"ContentStatistics.aspx?LangType=" + ContentLanguage + "&id=" + m_intId + "\";} );" + Environment.NewLine);
            result.Append("    deletemenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' valign=\'center\' src=\'" + "images/ui/icons/chartPie.png" + "\' />&nbsp;&nbsp;" + m_refMsg.GetMessage("lbl entry reports") + "\", function() { location.href = \"Commerce/reporting/analytics.aspx?LangType=" + ContentLanguage + "&id=" + m_intId + "\";} );" + Environment.NewLine);
            string quicklinkUrl = SitePath + content_data.Quicklink;
            if (Ektron.Cms.Common.EkConstants.IsAssetContentType(content_data.Type, true) && Ektron.Cms.Common.EkFunctions.IsImage((string)("." + content_data.AssetData.FileExtension)))
            {
                quicklinkUrl = m_refContentApi.RequestInformationRef.AssetPath + content_data.Quicklink;
            }
            else if (Ektron.Cms.Common.EkConstants.IsAssetContentType(content_data.Type, true) && SitePath != "/")
            {
                string appPathOnly = m_refContentApi.RequestInformationRef.ApplicationPath.Replace(SitePath, "");
                if (content_data.Quicklink.Contains(appPathOnly) || !content_data.Quicklink.Contains("downloadasset.aspx"))
                {
                    quicklinkUrl = SitePath + ((content_data.Quicklink.StartsWith("/")) ? (content_data.Quicklink.Substring(1)) : content_data.Quicklink);
                }
                else
                {
                    quicklinkUrl = m_refContentApi.RequestInformationRef.ApplicationPath + content_data.Quicklink;
                }
            }
            if (IsAnalyticsViewer() && ObjectFactory.GetAnalytics().HasProviders())
            {
                string modalUrl = string.Format("window.open(\"{0}/analytics/seo.aspx?tab=traffic&uri={1}\", \"Analytics400\", \"width=900,height=580,scrollable=1,resizable=1\");", ApplicationPath, quicklinkUrl);
                result.Append("    deletemenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' valign=\'center\' src=\'" + "images/ui/icons/chartBar.png" + "\' />&nbsp;&nbsp;" + m_refMsg.GetMessage("lbl entry analytics") + "\", function() { " + modalUrl + " } );" + Environment.NewLine);
            }
            result.Append("    MenuUtil.add( deletemenu );" + Environment.NewLine);
        }

        result.Append("    var actionmenu = new Menu( \"action\" );" + Environment.NewLine);
        if (security_data.CanEdit && (content_data.Status != "S" && content_data.Status != "O" || (content_data.Status == "O" && content_state_data.CurrentUserId == CurrentUserId)))
        {
            result.Append("    actionmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/contentEdit.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn edit") + "\", function() { javascript:top.document.getElementById(\'ek_main\').src=\'" + SRC + "\';return false;\"" + ",\'EDIT\',790,580,1,1);return false;" + "\" ; } );" + Environment.NewLine);
        }

        if (security_data.CanDelete)
        {
            string href;
            href = (string)("content.aspx?LangType=" + ContentLanguage + "&action=submitDelCatalogAction&delete_id=" + m_intId + "&page=" + Request.QueryString["calledfrom"] + "&folder_id=" + content_data.FolderId);
            if (!IsOrdered)
            {
                result.Append("    actionmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/delete.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn delete") + ("\", function() { DeleteConfirmationDialog(\'" + href) + "\');return false;} );" + Environment.NewLine);
            }
        }

        if (security_data.CanEdit)
        {

            if ((content_data.Status == "O") && ((content_state_data.CurrentUserId == CurrentUserId) || (security_data.IsAdmin || IsFolderAdmin())))
            {
                if ((content_data.Status == "O") && ((content_state_data.CurrentUserId == CurrentUserId) || (security_data.IsAdmin || m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommerceAdmin))))
                {

                    result.Append("    actionmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + "images/ui/icons/checkIn.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn checkin") + "\", function() { DisplayHoldMsg(true); window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=CheckIn&id=" + m_intId + "&content_type=" + content_data.Type + "\" ; } );" + Environment.NewLine);

                }
                else if (IsFolderAdmin())
                {

                    result.Append("    actionmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + "images/ui/icons/lockEdit.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("lbl take ownership") + "\", function() { DisplayHoldMsg(true); window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=TakeOwnerShip&id=" + m_intId + "&content_type=" + content_data.Type + "\" ; } );" + Environment.NewLine);

                }

                if (m_strPageAction == "view")
                {
                    result.Append("    actionmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/preview.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn view stage") + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=ViewStaged&id=" + m_intId + "\" ; } );" + Environment.NewLine);
                }
                else
                {
                    result.Append("    actionmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/contentViewPublished.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn view publish") + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=View&id=" + m_intId + "\" ; } );" + Environment.NewLine);
                }
            }
            else if (((content_data.Status == "I") || (content_data.Status == "T")) && (content_data.UserId == CurrentUserId))
            {
                if (security_data.CanPublish)
                {
                    bool metaRequuired = false;
                    bool categoryRequired = false;
                    bool manaliasRequired = false;
                    string msg = string.Empty;
                    m_refContentApi.EkContentRef.ValidateMetaDataTaxonomyAndAlias(content_data.FolderId, content_data.Id, content_data.LanguageId, ref metaRequuired, ref categoryRequired, ref manaliasRequired);
                    if (metaRequuired == false && categoryRequired == false && manaliasRequired == false)
                    {
                        result.Append("    actionmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + "images/application/commerce/submit.gif" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn publish") + "\", function() { if(CheckTitle()) { DisplayHoldMsg(true); window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=Submit&id=" + m_intId + "\" ; } } );" + Environment.NewLine);
                    }
                    else
                    {
                        if (metaRequuired && categoryRequired && manaliasRequired)
                        {
                            msg = m_refMsg.GetMessage("validate meta and manualalias and category required");
                        }
                        else if (metaRequuired && categoryRequired && !manaliasRequired)
                        {
                            msg = m_refMsg.GetMessage("validate meta and category required");
                        }
                        else if (metaRequuired && !categoryRequired && manaliasRequired)
                        {
                            msg = m_refMsg.GetMessage("validate meta and manualalias required");
                        }
                        else if (!metaRequuired && categoryRequired && manaliasRequired)
                        {
                            msg = m_refMsg.GetMessage("validate manualalias and category required");
                        }
                        else if (metaRequuired)
                        {
                            msg = m_refMsg.GetMessage("validate meta required");
                        }
                        else if (manaliasRequired)
                        {
                            msg = m_refMsg.GetMessage("validate manualalias required");
                        }
                        else
                        {
                            msg = m_refMsg.GetMessage("validate category required");
                        }
                        result.Append("    actionmenu.addItem(\"&nbsp;<img  height=\'16px\' width=\'16px\' src=\'" + "images/application/commerce/submit.gif" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn publish") + "\", function() { DisplayHoldMsg(true); window.location.href = \"alert(\'" + msg + "\')\"" + "; } );" + Environment.NewLine);
                    }
                }
                else
                {
                    result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/approvalSubmitFor.png", "content.aspx?LangType=" + ContentLanguage + "&action=Submit&id=" + m_intId + "&fldid=" + content_data.FolderId + "&page=workarea", m_refMsg.GetMessage("alt submit button text"), m_refMsg.GetMessage("btn submit"), "onclick=\"DisplayHoldMsg(true);return CheckForMeta(" + Convert.ToInt32(security_data.CanMetadataComplete) + ");\"")); //TODO need to pass integer not boolean
                }
                if (m_strPageAction == "view")
                {
                    result.Append("    actionmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/preview.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn view stage") + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=ViewStaged&id=" + m_intId + "&fldid=" + content_data.FolderId + "\" ; } );" + Environment.NewLine);
                }
                else
                {
                    result.Append("    actionmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/contentViewPublished.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn view publish") + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=View&id=" + m_intId + "&fldid=" + content_data.FolderId + "\" ; } );" + Environment.NewLine);
                }
            }
            else if ((content_data.Status == "O") || (content_data.Status == "I") || (content_data.Status == "S") || (content_data.Status == "T") || (content_data.Status == "P"))
            {

                if (m_strPageAction == "view")
                {
                    result.Append("    actionmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/preview.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn view stage") + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=ViewStaged&id=" + m_intId + "&fldid=" + content_data.FolderId + "\" ; } );" + Environment.NewLine);
                }
                else
                {
                    result.Append("    actionmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/contentViewPublished.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn view publish") + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=View&id=" + m_intId + "&fldid=" + content_data.FolderId + "\" ; } );" + Environment.NewLine);
                }
            }

            if (content_data.Status == "S" || content_data.Status == "M")
            {

                Util_CheckIsCurrentApprover(CurrentUserId);

                ApprovalScript.Visible = true;
                string AltPublishMsg = "";
                string AltApproveMsg = "";
                string AltDeclineMsg = "";
                string PublishIcon = "";
                string CaptionKey = "";
                bool m_TaskExists = m_refContent.DoesTaskExistForContent(content_data.Id);
                string m_sPage = "workarea"; //To be remove not required.
                if (content_data.Status == "S")
                {
                    AltPublishMsg = m_refMsg.GetMessage("approvals:Alt Publish Msg (change)");
                    AltApproveMsg = m_refMsg.GetMessage("approvals:Alt Approve Msg (change)");
                    AltDeclineMsg = m_refMsg.GetMessage("approvals:Alt Decline Msg (change)");
                    PublishIcon = "commerce/submit.gif";
                    CaptionKey = "btn publish";
                }
                else
                {
                    AltPublishMsg = m_refMsg.GetMessage("approvals:Alt Publish Msg (delete)");
                    AltApproveMsg = m_refMsg.GetMessage("approvals:Alt Approve Msg (delete)");
                    AltDeclineMsg = m_refMsg.GetMessage("approvals:Alt Decline Msg (delete)");
                    PublishIcon = "../UI/Icons/delete.png";
                    CaptionKey = "btn delete";
                }
                if (security_data.CanPublish && IsLastApproval)
                {
                    if (m_TaskExists == true)
                    {
                        result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/application/" + PublishIcon + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage(CaptionKey) + "\", function() { if(CheckTitle()) { DisplayHoldMsg(true); window.location.href = (\'content.aspx?action=approveContent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + content_data.LanguageId + "\') ; } } );" + Environment.NewLine);
                    }
                    else
                    {
                        result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/application/" + PublishIcon + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage(CaptionKey) + "\", function() { if(CheckTitle()) { DisplayHoldMsg(true); window.location.href = \"content.aspx?action=approvecontent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + ContentLanguage + "" + "\" ; } } );" + Environment.NewLine);
                    }
                }
                else if (security_data.CanApprove && IsCurrentApproval)
                {
                    if (m_TaskExists == true)
                    {
                        result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/application/Commerce/Approve.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn approve") + "\", function() { DisplayHoldMsg(true); window.location.href = (\'content.aspx?action=approveContent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + content_data.LanguageId + "\') ; } );" + Environment.NewLine);
                    }
                    else
                    {
                        result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/application/Commerce/Approve.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn approve") + "\", function() { DisplayHoldMsg(true); window.location.href = \"content.aspx?action=approvecontent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + ContentLanguage + "" + "\" ; } );" + Environment.NewLine);
                    }
                }
                if ((security_data.CanPublish || security_data.CanApprove) && IsCurrentApproval)
                {
                    if (m_TaskExists == true)
                    {
                        result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/application/DMSMenu/page_white_decline.gif" + "\' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn decline") + "\", function() { window.location.href = (\'content.aspx?action=declineContent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + content_data.LanguageId + "\') ; } );" + Environment.NewLine);
                    }
                    else
                    {
                        result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/application/DMSMenu/page_white_decline.gif" + "\' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn decline") + "\", function() { DeclineContent(\'" + content_data.Id + "\', \'" + content_data.FolderId + "\', \'" + m_sPage + "\', \'" + ContentLanguage + "\')" + " ; } );" + Environment.NewLine);
                    }
                }
            }
        }
        else
        {
            if (content_data.Status == "S" || content_data.Status == "M")
            {
                Util_CheckIsCurrentApprover(CurrentUserId);

                ApprovalScript.Visible = true;
                string AltPublishMsg = "";
                string AltApproveMsg = "";
                string AltDeclineMsg = "";
                string PublishIcon = "";
                string CaptionKey = "";
                bool m_TaskExists = m_refContent.DoesTaskExistForContent(content_data.Id);
                string m_sPage = "workarea"; //To be remove not required.
                if (content_data.Status == "S")
                {
                    AltPublishMsg = m_refMsg.GetMessage("approvals:Alt Publish Msg (change)");
                    AltApproveMsg = m_refMsg.GetMessage("approvals:Alt Approve Msg (change)");
                    AltDeclineMsg = m_refMsg.GetMessage("approvals:Alt Decline Msg (change)");
                    PublishIcon = "commerce/submit.gif";
                    CaptionKey = "btn publish";
                }
                else
                {
                    AltPublishMsg = m_refMsg.GetMessage("approvals:Alt Publish Msg (delete)");
                    AltApproveMsg = m_refMsg.GetMessage("approvals:Alt Approve Msg (delete)");
                    AltDeclineMsg = m_refMsg.GetMessage("approvals:Alt Decline Msg (delete)");
                    PublishIcon = "commerce/ApproveDelete.png";
                    CaptionKey = "approvals:lbl publish msg (delete)";
                }
                if (security_data.CanPublish && IsLastApproval)
                {
                    if (m_TaskExists == true)
                    {
                        result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/application/" + PublishIcon + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage(CaptionKey) + "\", function() { if(CheckTitle()) { DisplayHoldMsg(true); window.location.href = (\'content.aspx?action=approveContent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + content_data.LanguageId + "\') ; } } );" + Environment.NewLine);
                    }
                    else
                    {
                        result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/application/" + PublishIcon + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage(CaptionKey) + "\", function() { if(CheckTitle()) { DisplayHoldMsg(true); window.location.href = \"content.aspx?action=approvecontent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + ContentLanguage + "" + "\" ; } } );" + Environment.NewLine);
                    }
                }
                else if (security_data.CanApprove && IsCurrentApproval)
                {
                    if (m_TaskExists == true)
                    {
                        result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/application/Commerce/Approve.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn approve") + "\", function() { DisplayHoldMsg(true); window.location.href = (\'content.aspx?action=approveContent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + content_data.LanguageId + "\') ; } );" + Environment.NewLine);
                    }
                    else
                    {
                        result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/application/Commerce/Approve.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn approve") + "\", function() { DisplayHoldMsg(true); window.location.href = \"content.aspx?action=approvecontent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + ContentLanguage + "" + "\" ; } );" + Environment.NewLine);
                    }
                }
                if ((security_data.CanPublish || security_data.CanApprove) && IsCurrentApproval)
                {
                    if (m_TaskExists == true)
                    {
                        result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/application/DMSMenu/page_white_decline.gif" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn decline") + "\", function() { window.location.href = (\'content.aspx?action=declineContent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + content_data.LanguageId + "\') ; } );" + Environment.NewLine);
                    }
                    else
                    {
                        result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/application/DMSMenu/page_white_decline.gif" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn decline") + "\", function() { DeclineContent(\'" + content_data.Id + "\', \'" + content_data.FolderId + "\', \'" + m_sPage + "\', \'" + ContentLanguage + "\')" + " ; } );" + Environment.NewLine);
                    }
                }
                if (security_data.CanEditSumit)
                {
                    // Don't show edit button for Mac when using XML config:
                    if (!(m_bIsMac && (content_data.XmlConfiguration != null)) || m_SelectedEditControl == "ContentDesigner")
                    {
                        // result.Append(m_refStyle.GetEditAnchor(m_intId, , True))
                    }
                }
                if (m_strPageAction == "view")
                {
                    result.Append("    actionmenu.addItem(\"&nbsp;<img  height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/preview.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn view stage") + "\", function() { window.location.href = \"content.aspx?action=ViewStaged&id=" + m_intId + "&LangType=" + ContentLanguage + "\" ; } );" + Environment.NewLine);
                }
                else
                {
                    result.Append("    actionmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/contentViewPublished.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn view publish") + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=View&id=" + m_intId + "\" ; } );" + Environment.NewLine);
                }
                //End If
                //END
            }
            else
            {
                if ((content_data.Status == "O") && ((security_data.IsAdmin || IsFolderAdmin()) || (security_data.CanBreakPending)))
                {
                    if ((content_data.Status == "O") && ((content_state_data.CurrentUserId == CurrentUserId) || (security_data.IsAdmin || m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommerceAdmin))))
                    {

                        result.Append("    actionmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + "images/ui/icons/checkIn.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn checkin") + "\", function() { DisplayHoldMsg(true); window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=CheckIn&id=" + m_intId + "&fldid=" + content_data.FolderId + "&page=workarea" + "&content_type=" + content_data.Type + "\" ; \"DisplayHoldMsg(true);return true;\"" + " } );" + Environment.NewLine);

                    }

                    if (m_strPageAction == "view")
                    {
                        result.Append("    actionmenu.addItem(\"&nbsp;<img  height=\'16px\' width=\'16px\'  src=\'" + "images/UI/Icons/preview.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn view stage") + "\", function() { window.location.href = \"content.aspx?action=ViewStaged&id=" + m_intId + "&LangType=" + ContentLanguage + "\" ; } );" + Environment.NewLine);
                    }
                    else
                    {
                        result.Append("    actionmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/contentViewPublished.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn view publish") + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=View&id=" + m_intId + "\" ; } );" + Environment.NewLine);
                    }
                }
            }
        }
        result.Append("    actionmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/linkSearch.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn link search") + "\", function() { window.location.href = \"isearch.aspx?LangType=" + ContentLanguage + "&action=dofindcontent&folderid=0&content_id=" + m_intId + ((content_data.AssetData.MimeType.IndexOf("image") != -1) ? "&asset_name=" + content_data.AssetData.Id + "." + content_data.AssetData.FileExtension : "") + "\" ; } );" + Environment.NewLine);
        if (security_data.CanAddTask)
        {
            result.Append("    actionmenu.addItem(\"&nbsp;<img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/taskAdd.png" + " \' />&nbsp;&nbsp;" + m_refMsg.GetMessage("btn add task") + "\", function() { window.location.href = \"tasks.aspx?LangType=" + ContentLanguage + "&action=AddTask&cid=" + m_intId + "&callbackpage=content.aspx&parm1=action&value1=" + m_strPageAction + "&parm2=id&value2=" + m_intId + "&parm3=LangType&value3=" + ContentLanguage + "\" ; } );" + Environment.NewLine);
        }
        if (localizationMenuOptions.Length > 0)
        {
            result.Append("    actionmenu.addBreak();" + Environment.NewLine);
            result.Append(localizationMenuOptions);
        }
        result.Append("    MenuUtil.add( actionmenu );" + Environment.NewLine);
        result.Append("    </script>" + Environment.NewLine);
        result.Append("" + Environment.NewLine);
        htmToolBar.InnerHtml = result.ToString();
    }
Example #46
0
    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;
            }
    }
Example #47
0
    private ContentMetaData GetMetadata(ContentData content, long metadataTypeId)
    {
        foreach (ContentMetaData meta in content.MetaData)
            if (meta.TypeId == metadataTypeId)
                return meta;

        return null;
    }
Example #48
0
 private string MakeLink(ContentData _data)
 {
     string _link = string.Empty;
     if (_EmailHelper.IsLoggedInUsersEmailValid())
     {
         string strNotesTitle = _data.Title;
         string strNotesName = "Content";
         _link = "<a href=\"#\"" + "onclick=\"LoadEmailChildPage('userid=" + _data.UserId + _EmailHelper.MakeNotes_Email(strNotesName, strNotesTitle) + "&contentid=" + _data.Id + "&emailclangid=" + _data.LanguageId + "')\"" + " title='" + _MessageHelper.GetMessage("alt send email to") + " \"" + _data.EditorLastName + ", " + _data.EditorFirstName + "\"" + "'>" + _data.EditorLastName + ", " + _data.EditorFirstName + _EmailHelper.MakeEmailGraphic() + "</a>";
     }
     return _link;
 }
Example #49
0
 private string GetTitleHref(ContentData contentData)
 {
     string href = String.Empty;
     switch (contentData.ContType)
     {
         case 2:
             href = _ContentApi.AppPath + "cmsform.aspx?action=ViewForm" + "&LangType=" + contentData.LanguageId + "&form_id=" + contentData.Id + "&folder_id=" + contentData.FolderId;
             break;
         default:
             href = _ContentApi.AppPath + "content.aspx?action=ViewStaged&LangType=" + contentData.LanguageId + "&id=" + contentData.Id + "&callerpage=reports.aspx" + "&origurl=" + EkFunctions.UrlEncode("action=ViewCheckedOut" + "&filtertype=" + Request.QueryString["filtertype"] + "&filterid=" + Request.QueryString["filterid"] + "&orderby=" + Request.QueryString["orderby"] + "&interval=" + Request.QueryString["interval"]);
             break;
     }
     return href;
 }
Example #50
0
    private void ViewMetaData(ContentData data)
    {
        System.Text.StringBuilder result = new System.Text.StringBuilder();
        string strResult = "";
        string strImagePath = "";
        FolderData fldr_Data = new FolderData();
        ContentAPI contentapi = new ContentAPI();

        fldr_Data = contentapi.GetFolderById(data.FolderId);
        if (data != null)
        {
            List<ContentMetaData> displayMetaDataList = new List<ContentMetaData>();
            for (int i = 0; i < data.MetaData.Length; i++)
            {
                string typeName = data.MetaData[i].TypeName;
                 if (!typeName.StartsWith("L10n", StringComparison.OrdinalIgnoreCase) && !typeName.StartsWith("Xliff", StringComparison.OrdinalIgnoreCase) && data.MetaData[i].Type.ToString() != "ImageSelector")
                {
                    displayMetaDataList.Add(data.MetaData[i]);
                }
                else if (data.MetaData[i].Type.ToString() == "ImageSelector")
                {
                    data.MetaData[i].Text = data.MetaData[i].Text.Replace(SitePath + "assets/", "");
                    data.MetaData[i].Text = System.Text.RegularExpressions.Regex.Replace(data.MetaData[i].Text, "\\?.*", "");
                    displayMetaDataList.Add(data.MetaData[i]);
                }
          }

            if (displayMetaDataList.Count > 0)
            {
                strResult = Ektron.Cms.CustomFields.WriteFilteredMetadataForView(displayMetaDataList.ToArray(), m_intFolderId, false).Trim();
            }

            strImagePath = data.Image;
            if (strImagePath.IndexOf(this.AppImgPath + "spacer.gif") != -1)
            {
                strImagePath = "";
            }

            //if ((fldr_Data.IsDomainFolder == true || fldr_Data.DomainProduction != "") && SitePath != "/")
            //{
            //    if (strImagePath.IndexOf("http://") != -1)
            //    {
            //        strImagePath = strImagePath.Substring(strImagePath.IndexOf("http://"));
            //        data.ImageThumbnail = data.ImageThumbnail.Substring(data.ImageThumbnail.IndexOf("http://"));
            //    }
            //    else
            //    {
            //        if (strImagePath != "")
            //        {
            //            strImagePath = strImagePath.Replace(SitePath, "");
            //            data.ImageThumbnail = data.ImageThumbnail.Replace(SitePath, "");
            //            strImagePath = (string)("http://" + fldr_Data.DomainProduction + "/" + strImagePath);
            //            data.ImageThumbnail = (string)("http://" + fldr_Data.DomainProduction + "/" + data.ImageThumbnail);
            //        }
            //    }
            //}
            //else if ((fldr_Data.IsDomainFolder == true || fldr_Data.DomainProduction != "") && SitePath == "/")
            //{

            //    if (strImagePath.IndexOf("http://") != -1)
            //    {
            //        strImagePath = strImagePath.Substring(strImagePath.IndexOf("http://"));
            //        data.ImageThumbnail = data.ImageThumbnail.Substring(data.ImageThumbnail.IndexOf("http://"));
            //    }
            //    else
            //    {
            //        if (strImagePath != "")
            //        {
            //            strImagePath = (string)("http://" + fldr_Data.DomainProduction + "/" + strImagePath.Substring(1));
            //            data.ImageThumbnail = (string)("http://" + fldr_Data.DomainProduction + "/" + data.ImageThumbnail.Substring(1));
            //        }
            //    }
            //}
            //else if (fldr_Data.IsDomainFolder == false && strImagePath.IndexOf("http://") != -1)
            //{
            //    if (strImagePath.IndexOf(SitePath) == 0)
            //    {
            //        strImagePath = Strings.Replace(strImagePath, SitePath, "", 1, 1, 0);
            //        data.ImageThumbnail = Strings.Replace(data.ImageThumbnail, SitePath, "", 1, 1, 0);
            //    }
            //}
            //strImagePath = strImagePath;//Strings.Replace(strImagePath, SitePath, "", 1, 1, 0);
            data.ImageThumbnail = data.ImageThumbnail;// Strings.Replace(data.ImageThumbnail, SitePath, "", 1, 1, 0);
            if (fldr_Data.FolderType != 9)
            {
                // display tag info for this library item
                System.Text.StringBuilder taghtml = new System.Text.StringBuilder();
                taghtml.Append("<fieldset style=\"margin:10px\">");
                taghtml.Append("<legend>" + m_refMsg.GetMessage("lbl personal tags") + "</legend>");
                taghtml.Append("<div style=\"height: 80px; overflow: auto;\" >");
                if (content_data.Id > 0)
                {
                    LocalizationAPI localizationApi = new LocalizationAPI();
                    TagData[] tdaUser;
                    tdaUser = (new Ektron.Cms.Community.TagsAPI()).GetTagsForObject(content_data.Id, Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.Content, m_refContentApi.ContentLanguage);

                    if (tdaUser != null && tdaUser.Length > 0)
                    {

                        foreach (TagData td in tdaUser)
                        {
                            taghtml.Append("<input disabled=\"disabled\" checked=\"checked\" type=\"checkbox\" id=\"userPTagsCbx_" + td.Id.ToString() + "\" name=\"userPTagsCbx_" + td.Id.ToString() + "\" />&#160;");
                            taghtml.Append("<img src=\'" + localizationApi.GetFlagUrlByLanguageID(td.LanguageId) + "\' />");
                            taghtml.Append("&#160;" + td.Text + "<br />");
                        }
                    }
                    else
                    {
                        taghtml.Append(m_refMsg.GetMessage("lbl notagsselected"));
                    }
                }
                taghtml.Append("</div>");
                taghtml.Append("</fieldset>");
                strResult = strResult + taghtml.ToString();
                if (System.IO.Path.GetExtension(data.ImageThumbnail).ToLower().IndexOf(".gif") != -1 && data.ImageThumbnail.ToLower().IndexOf("spacer.gif") == -1)
                {

                    data.ImageThumbnail = data.ImageThumbnail.Replace(".gif", ".png");
                }

                strResult = strResult + "<fieldset style=\"margin:10px\"><legend>" + this.m_refMsg.GetMessage("lbl image data") + "</legend><table width=\"100%\"><tr><td class=\"info\" width=\"1%\" nowrap=\"true\" align=\"left\">" + this.m_refMsg.GetMessage("images label") + "</td><td width=\"99%\" align=\"left\">" + strImagePath + "</td></tr><tr><td class=\"info\" colomnspan=\"2\" align=\"left\"><img src=\"" + data.ImageThumbnail + "\" atl=\"Thumbnail\" /></td></tr></table></fieldset>";

            }
            if (strResult != "")
            {
                result.Append(strResult);
            }
            else
            {
                result.Append(this.m_refMsg.GetMessage("lbl nometadefined"));
            }
        }

        MetaDataValue.Text = result.ToString();
    }
Example #51
0
    private void ViewContentProperties(ContentData data)
    {
        System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "NAME";
            colBound.ItemStyle.CssClass = "label";
            PropertiesGrid.Columns.Add(colBound);

            colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "TITLE";
            PropertiesGrid.Columns.Add(colBound);

            DataTable dt = new DataTable();
            DataRow dr;

            dt.Columns.Add(new DataColumn("NAME", typeof(string)));
            dt.Columns.Add(new DataColumn("TITLE", typeof(string)));

            int i = 0;

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("content title label");
            dr[1] = data.Title;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("content id label");
            dr[1] = data.Id;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("content language label");
            dr[1] = data.LanguageId;
            dt.Rows.Add(dr);

            if (content_data.Type == 3333)
            {
                dr = dt.NewRow();
                dr[0] = m_refMsg.GetMessage("lbl calatog entry sku") + "&nbsp;#:";
                dr[1] = entry_data.Sku;
                dt.Rows.Add(dr);
            }

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("content status label");
            switch (data.Status.ToLower())
            {
                case "a":
                    dr[1] = m_refMsg.GetMessage("status:Approved (Published)");
                    break;
                case "o":
                    dr[1] = m_refMsg.GetMessage("status:Checked Out");
                    break;
                case "i":
                    dr[1] = m_refMsg.GetMessage("status:Checked In");
                    break;
                case "p":
                    dr[1] = m_refMsg.GetMessage("status:Approved (PGLD)");
                    break;
                case "m":
                    dr[1] = "<font color=\"Red\">" + m_refMsg.GetMessage("status:Submitted for Deletion") + "</font>";
                    break;
                case "s":
                    dr[1] = "<font color=\"Red\">" + m_refMsg.GetMessage("status:Submitted for Approval") + "</font>";
                    break;
                case "t":
                    dr[1] = m_refMsg.GetMessage("status:Waiting Approval");
                    break;
                case "d":
                    dr[1] = "Deleted (Pending Start Date)";
                    break;
            }
            dt.Rows.Add(dr);
            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("content LUE label");
            dr[1] = data.EditorFirstName + " " + data.EditorLastName; //DisplayUserName
            dt.Rows.Add(dr);
            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("content LED label");
            dr[1] = data.DisplayLastEditDate;
            dt.Rows.Add(dr);
            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("generic start date label");
            if (data.DisplayGoLive.Length == 0)
            {
                dr[1] = m_refMsg.GetMessage("none specified msg");
            }
            else
            {
                dr[1] = data.DisplayGoLive;
            }
            dt.Rows.Add(dr);
            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("generic end date label");
            if (data.DisplayEndDate == "")
            {
                dr[1] = m_refMsg.GetMessage("none specified msg");
            }
            else
            {
                dr[1] = data.DisplayEndDate;
            }
            dt.Rows.Add(dr);
            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("End Date Action Title");
            if (data.DisplayEndDate.Length > 0)
            {
                if (data.EndDateAction == Ektron.Cms.Common.EkConstants.EndDateActionType_archive_display)
                {
                    dr[1] = m_refMsg.GetMessage("Archive display descrp");
                }
                else if (data.EndDateAction == Ektron.Cms.Common.EkConstants.EndDateActionType_refresh)
                {
                    dr[1] = m_refMsg.GetMessage("Refresh descrp");
                }
                else
                {
                    dr[1] = m_refMsg.GetMessage("Archive expire descrp");
                }
            }
            else
            {
                dr[1] = m_refMsg.GetMessage("none specified msg");
            }
            dt.Rows.Add(dr);
            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("content DC label");
            dr[1] = data.DateCreated; //DisplayDateCreated
            dt.Rows.Add(dr);
            dr = dt.NewRow();
            dr[0] = this.m_refMsg.GetMessage("lbl approval method");
            if (data.ApprovalMethod == 1)
            {
                dr[1] = m_refMsg.GetMessage("display for force all approvers");
            }
            else
            {
                dr[1] = m_refMsg.GetMessage("display for do not force all approvers");
            }
            dt.Rows.Add(dr);
            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("content approvals label");
            System.Text.StringBuilder approvallist = new System.Text.StringBuilder();
            ApprovalData[] approvaldata;
            approvaldata = m_refContentApi.GetCurrentApprovalInfoByID(ContentId);
            approvallist.Append(m_refMsg.GetMessage("none specified msg"));
            if (!(approvaldata == null))
            {
                if (approvaldata.Length > 0)
                {
                    approvallist.Length = 0;
                    for (i = 0; i <= approvaldata.Length - 1; i++)
                    {
                        if (approvaldata[i].Type == "user")
                        {
                            approvallist.Append("<img src=\"" + imagePath + "user.png\" align=\"absbottom\" alt=\"" + m_refMsg.GetMessage("approver is user") + "\" title=\"" + m_refMsg.GetMessage("approver is user") + "\">");
                        }
                        else
                        {
                            approvallist.Append("<img src=\"" + imagePath + "user.png\" align=\"absbottom\" alt=\"" + m_refMsg.GetMessage("approver is user group") + "\" title=\"" + m_refMsg.GetMessage("approver is user group") + "\">");
                        }
                        if (approvaldata[i].IsCurrentApprover)
                        {
                            approvallist.Append("<span class=\"important\">");
                        }
                        else
                        {
                            approvallist.Append("<span>");
                        }
                        approvallist.Append(approvaldata[i].DisplayUserName + "</span>");
                    }
                }
            }
            dr[1] = approvallist.ToString();
            dt.Rows.Add(dr);
            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("xml configuration label");
            if (data.IsXmlInherited != false)
            {
                if (!(data.XmlConfiguration == null))
                {
                    dr[1] = "&nbsp;" + data.XmlConfiguration.Title;
                }
                else
                {
                    dr[1] = m_refMsg.GetMessage("none specified msg") + " " + m_refMsg.GetMessage("html content assumed");
                }
            }
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("generic template label");
            dr[1] = "";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = m_refMsg.GetMessage("generic Path");
            dr[1] = m_refContentApi.EkContentRef.GetFolderPath(data.FolderId);
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = "Content Searchable:";
            dr[1] = data.IsSearchable;

            DataView dv = new DataView(dt);
            PropertiesGrid.ShowHeader = false;
            PropertiesGrid.DataSource = dv;
            PropertiesGrid.DataBind();
    }
Example #52
0
    private void Display_PropertiesTab(ContentData data)
    {
        System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "NAME";
        colBound.ItemStyle.CssClass = "label";
        PropertiesGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "TITLE";
        PropertiesGrid.Columns.Add(colBound);
        DataTable dt = new DataTable();
        DataRow dr;

        dt.Columns.Add(new DataColumn("NAME", typeof(string)));
        dt.Columns.Add(new DataColumn("TITLE", typeof(string)));
        int i = 0;
        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("generic title");
        dr[1] = entry_edit_data.Title;
        dt.Rows.Add(dr);
        dr = dt.NewRow();

        content_title.Value = data.Title;

        dr[0] = m_refMsg.GetMessage("generic id");
        dr[1] = entry_edit_data.Id;
        dt.Rows.Add(dr);
        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("generic language");
        dr[1] = LanguageName;
        dt.Rows.Add(dr);

        // commerce

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("lbl product type xml config");
        dr[1] = entry_edit_data.ProductType.Title;
        xml_id = entry_edit_data.ProductType.Id;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("lbl calatog entry sku");
        dr[1] = entry_edit_data.Sku;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("lbl number of units");
        dr[1] = entry_edit_data.QuantityMultiple;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("lbl tax class");
        dr[1] = (new TaxClass(m_refContentApi.RequestInformationRef)).GetItem(entry_edit_data.TaxClassId).Name;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("lbl archived");
        dr[1] = "<input type=\"checkbox\" " + (entry_edit_data.IsArchived ? "checked=\"checked\" " : "") + "disabled=\"disabled\" />";
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("lbl buyable");
        dr[1] = "<input type=\"checkbox\" " + (entry_edit_data.IsBuyable ? "checked=\"checked\" " : "") + "disabled=\"disabled\" />";
        dt.Rows.Add(dr);

        // dimensions

        string sizeMeasure = m_refMsg.GetMessage("lbl inches");
        string weightMeasure = m_refMsg.GetMessage("lbl pounds");

        if (m_refContentApi.RequestInformationRef.MeasurementSystem == Ektron.Cms.Common.EkEnumeration.MeasurementSystem.Metric)
        {

            sizeMeasure = m_refMsg.GetMessage("lbl centimeters");
            weightMeasure = m_refMsg.GetMessage("lbl kilograms");

        }

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("lbl tangible");
        dr[1] = "<input type=\"checkbox\" " + (entry_edit_data.IsTangible ? "checked=\"checked\" " : "") + "disabled=\"disabled\" />";
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("lbl height");
        dr[1] = entry_edit_data.Dimensions.Height + " " + sizeMeasure;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("lbl width");
        dr[1] = entry_edit_data.Dimensions.Width + " " + sizeMeasure;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("lbl length");
        dr[1] = entry_edit_data.Dimensions.Length + " " + sizeMeasure;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("lbl weight");
        dr[1] = entry_edit_data.Weight.Amount + " " + weightMeasure;
        dt.Rows.Add(dr);

        // dimensions

        // inventory
        InventoryApi inventoryApi = new InventoryApi();
        InventoryData inventoryData = inventoryApi.GetInventory(entry_edit_data.Id);

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("lbl disable inventory");
        dr[1] = "<input type=\"checkbox\" " + (entry_edit_data.DisableInventoryManagement ? "checked=\"checked\" " : "") + "disabled=\"disabled\" />";
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("lbl in stock");
        dr[1] = inventoryData.UnitsInStock;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("lbl on order");
        dr[1] = inventoryData.UnitsOnOrder;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("lbl reorder");
        dr[1] = inventoryData.ReorderLevel;
        dt.Rows.Add(dr);

        // inventory

        // end commerce

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("content status label");
        switch (entry_edit_data.ContentStatus.ToLower())
        {
            case "a":
                dr[1] = m_refMsg.GetMessage("status:Approved (Published)");
                break;
            case "o":
                dr[1] = m_refMsg.GetMessage("status:Checked Out");
                break;
            case "i":
                dr[1] = m_refMsg.GetMessage("status:Checked In");
                break;
            case "p":
                dr[1] = m_refMsg.GetMessage("status:Approved (PGLD)");
                break;
            case "m":
                dr[1] = "<font color=\"Red\">" + m_refMsg.GetMessage("status:Submitted for Deletion") + "</font>";
                break;
            case "s":
                dr[1] = "<font color=\"Red\">" + m_refMsg.GetMessage("status:Submitted for Approval") + "</font>";
                break;
            case "t":
                dr[1] = m_refMsg.GetMessage("status:Waiting Approval");
                break;
            case "d":
                dr[1] = "Deleted (Pending Start Date)";
                break;
        }
        dt.Rows.Add(dr);
        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("content LUE label");
        dr[1] = entry_edit_data.LastEditorFirstName + " " + entry_edit_data.LastEditorLastName;
        dt.Rows.Add(dr);
        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("content LED label");
        dr[1] = entry_edit_data.DateModified;
        dt.Rows.Add(dr);
        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("generic start date label");
        if (entry_edit_data.GoLive == DateTime.MinValue || entry_edit_data.GoLive == DateTime.MaxValue)
        {
            dr[1] = m_refMsg.GetMessage("none specified msg");
        }
        else
        {
            dr[1] = entry_edit_data.GoLive.ToLongDateString() + " " + entry_edit_data.GoLive.ToShortTimeString();
        }
        dt.Rows.Add(dr);
        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("generic end date label");
        if (entry_edit_data.EndDate == DateTime.MinValue || entry_edit_data.EndDate == DateTime.MaxValue)
        {
            dr[1] = m_refMsg.GetMessage("none specified msg");
        }
        else
        {
            dr[1] = entry_edit_data.EndDate.ToLongDateString() + " " + entry_edit_data.EndDate.ToShortTimeString();
        }
        dt.Rows.Add(dr);
        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("End Date Action Title");
        if (!(entry_edit_data.EndDate == DateTime.MinValue || entry_edit_data.EndDate == DateTime.MaxValue))
        {
            if (entry_edit_data.EndDateAction == Ektron.Cms.Common.EkConstants.EndDateActionType_archive_display)
            {
                dr[1] = m_refMsg.GetMessage("Archive display descrp");
            }
            else if (entry_edit_data.EndDateAction == Ektron.Cms.Common.EkConstants.EndDateActionType_refresh)
            {
                dr[1] = m_refMsg.GetMessage("Refresh descrp");
            }
            else
            {
                dr[1] = m_refMsg.GetMessage("Archive expire descrp");
            }
        }
        else
        {
            dr[1] = m_refMsg.GetMessage("none specified msg");
        }
        dt.Rows.Add(dr);
        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("content DC label");
        dr[1] = data.DateCreated; //DisplayDateCreated
        dt.Rows.Add(dr);
        dr = dt.NewRow();
        dr[0] = this.m_refMsg.GetMessage("lbl approval method");
        if (data.ApprovalMethod == 1)
        {
            dr[1] = m_refMsg.GetMessage("display for force all approvers");
        }
        else
        {
            dr[1] = m_refMsg.GetMessage("display for do not force all approvers");
        }
        dt.Rows.Add(dr);
        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("content approvals label");
        System.Text.StringBuilder approvallist = new System.Text.StringBuilder();
        if (approvaldata == null)
        {
            approvaldata = m_refContentApi.GetCurrentApprovalInfoByID(m_intId);
        }
        approvallist.Append(m_refMsg.GetMessage("none specified msg"));
        if (!(approvaldata == null))
        {
            if (approvaldata.Length > 0)
            {
                approvallist.Length = 0;
                for (i = 0; i <= approvaldata.Length - 1; i++)
                {
                    if (approvaldata[i].Type.ToLower() == "user")
                    {
                        approvallist.Append("<img src=\"" + m_refContentApi.AppPath + "images/UI/Icons/user.png\" align=\"absbottom\" alt=\"" + m_refMsg.GetMessage("approver is user") + "\" title=\"" + m_refMsg.GetMessage("approver is user") + "\">");
                    }
                    else
                    {
                        approvallist.Append("<img src=\"" + m_refContentApi.AppPath + "images/UI/Icons/users.png\" align=\"absbottom\" alt=\"" + m_refMsg.GetMessage("approver is user group") + "\" title=\"" + m_refMsg.GetMessage("approver is user group") + "\">");
                    }
                    if (approvaldata[i].IsCurrentApprover)
                    {
                        approvallist.Append("<span class=\"important\">");
                    }
                    else
                    {
                        approvallist.Append("<span>");
                    }
                    if (approvaldata[i].Type.ToLower() == "user")
                    {
                        approvallist.Append(approvaldata[i].DisplayUserName);
                    }
                    else
                    {
                        approvallist.Append(approvaldata[i].DisplayUserName);
                    }
                    approvallist.Append("</span>");
                }
            }
        }
        dr[1] = approvallist.ToString();
        dt.Rows.Add(dr);

        if (folder_data == null)
        {
            folder_data = m_refContentApi.EkContentRef.GetFolderById(entry_edit_data.FolderId);
        }

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("template label");

        if (m_refContent.MultiConfigExists(entry_edit_data.Id, m_refContentApi.RequestInformationRef.ContentLanguage))
        {
            TemplateData t_templateData = m_refContent.GetMultiTemplateASPX(entry_edit_data.Id);
            if (t_templateData != null)
            {
                dr[1] = t_templateData.FileName;
            }
            else
            {
                dr[1] = folder_data.TemplateFileName;
            }
        }
        else
        {
            dr[1] = folder_data.TemplateFileName;
        }

        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("generic Path");
        dr[1] = data.Path;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr[0] = m_refMsg.GetMessage("rating label");

        Collection dataCol = m_refContentApi.GetContentRatingStatistics(entry_edit_data.Id, 0, null);
        int total = 0;
        int sum = 0;
        int hits = 0;
        if (dataCol.Count > 0)
        {
            total = Convert.ToInt32 (dataCol["total"]);
            sum = Convert.ToInt32 (dataCol["sum"]);
            hits = Convert.ToInt32 (dataCol["hits"]);
        }

        if (total == 0)
        {
            dr[1] = m_refMsg.GetMessage("content not rated");
        }
        else
        {
            dr[1] = Math.Round(System.Convert.ToDouble(Convert.ToDouble((short)sum) / total), 2);
        }

        dt.Rows.Add(dr);

        //dr = dt.NewRow()
        //dr(0) = "Content Hits:"
        //dr(1) = hits

        //dt.Rows.Add(dr)

        dr = dt.NewRow();
        dr[0] = this.m_refMsg.GetMessage("lbl content searchable");
        dr[1] = data.IsSearchable.ToString();
        dt.Rows.Add(dr);

        DataView dv = new DataView(dt);
        PropertiesGrid.DataSource = dv;
        PropertiesGrid.DataBind();
    }
Example #53
0
    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("&#39;", "\'");
                                                    hist_content_data.MetaData[i].Text = hist_content_data.MetaData[i].Text.Replace("&quot", "\"");
                                                    hist_content_data.MetaData[i].Text = hist_content_data.MetaData[i].Text.Replace("&gt;", ">");
                                                    hist_content_data.MetaData[i].Text = hist_content_data.MetaData[i].Text.Replace("&lt;", "<");
                                                    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);

            }
    }
Example #54
0
    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("&#39;", "\'");
                    content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace("&quot", "\"");
                    content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace("&gt;", ">");
                    content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace("&lt;", "<");
                    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") + " &quot;" + content_data.Title + "&quot;</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>&nbsp;" + 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);
        }
    }
Example #55
0
    /// <summary>
    /// Fills the history tabs with content body, summary, meta, and properties
    /// </summary>
    /// <param name="content_data_history"></param>
    /// <param name="content_data">This parameter is needed to get the XML XSLT INFO </param>
    /// <remarks></remarks>
    private void PopulatePageData(ContentData content_data_history, ContentData content_data)
    {
        bool bPackageDisplayXSLT = false;
            string CurrentXslt = "";

            phPricingTab.Visible = false;
            phPricing.Visible = false;
            phAttributesTab.Visible = false;
            phAttributes.Visible = false;
            phItemsTab.Visible = false;
            phItems.Visible = false;

            ViewContentProperties(content_data_history);
            ViewMetaData(content_data_history);
            if ((!(content_data.XmlConfiguration == null)) && (content_data.Type == 1 || content_data.Type == 2))
            {
                if ((!(content_data.XmlConfiguration == null)) && (bApplyXslt))
                {
                    if (content_data.XmlConfiguration.PackageDisplayXslt.Length > 0)
                    {
                        bPackageDisplayXSLT = true;
                    }
                    else
                    {
                        if (content_data.XmlConfiguration.DefaultXslt.Length > 0)
                        {
                            bPackageDisplayXSLT = false;

                            Collection xsltPhysPath = (Collection)content_data.XmlConfiguration.PhysPathComplete;
                            Collection xsltLogicalPath = (Collection)content_data.XmlConfiguration.LogicalPathComplete;
                            if (xsltPhysPath.Contains("Xslt" + content_data.XmlConfiguration.DefaultXslt))
                            {
                                CurrentXslt = xsltPhysPath["Xslt" + content_data.XmlConfiguration.DefaultXslt].ToString();
                            }
                            else
                            {
                                CurrentXslt = xsltLogicalPath["Xslt" + content_data.XmlConfiguration.DefaultXslt].ToString();
                            }
                        }
                        else
                        {
                            bPackageDisplayXSLT = true;
                        }
                    }

                    if (bPackageDisplayXSLT)
                    {
                        divContentHtml.InnerHtml = m_refContentApi.XSLTransform(content_data_history.Html, content_data.XmlConfiguration.PackageDisplayXslt, false, false, null, false, true);
                    }
                    else
                    {
                        divContentHtml.InnerHtml = m_refContentApi.TransformXSLT(content_data_history.Html, CurrentXslt);
                    }
                }
                else
                {
                    divContentHtml.InnerHtml = content_data_history.Html;
                }
            }
            else
            {
                if (content_data_history.Type == 104)
                {
                    divContentHtml.InnerHtml = FixContentHistory(content_data_history, content_data_history.Html);
                }
                else
                {
                    if (content_data_history.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_data_history.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData)
                    {
                        divContentHtml.InnerHtml = Ektron.Cms.PageBuilder.PageData.RendertoString(content_data_history.Html);
                    }
                    else
                    {
                        divContentHtml.InnerHtml = content_data_history.Html;
                    }
                }
            }

            tdsummaryhead.InnerHtml = m_refMsg.GetMessage("content summary label");
            Ektron.Cms.Common.EkEnumeration.CMSContentType contenttype_history = (Ektron.Cms.Common.EkEnumeration.CMSContentType)Enum.Parse(typeof(Ektron.Cms.Common.EkEnumeration.CMSContentType), content_data_history.Type.ToString());
            if (Ektron.Cms.Common.EkEnumeration.CMSContentType.Forms == contenttype_history || Ektron.Cms.Common.EkEnumeration.CMSContentType.Archive_Forms == contenttype_history)
            {
                if (content_data_history.Teaser != null)
                {
                    if (content_data_history.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_history.Teaser;
                    }
                }
                else
                {
                    tdsummarytext.InnerHtml = "";
                }
            }
            else
            {
                if (bIsBlog)
                {
                    tdsummarytext.InnerHtml += "<table border=\"0\" cellpadding=\"4\" width=\"550\">";
                    tdsummarytext.InnerHtml += "	<tr>";
                    tdsummarytext.InnerHtml += "		<td width=\"20\">&nbsp;</td>";
                    tdsummarytext.InnerHtml += "		<td valign=\"top\" width=\"80%\">";
                    tdsummarytext.InnerHtml += "			<b>Description</b>";
                    tdsummarytext.InnerHtml += "		</td>";
                    tdsummarytext.InnerHtml += "		<td width=\"20\">&nbsp;</td>";
                    tdsummarytext.InnerHtml += "		<td valign=\"top\" width=\"20%\">";
                    tdsummarytext.InnerHtml += "			<b>Categories</b>";
                    tdsummarytext.InnerHtml += "		</td>";
                    tdsummarytext.InnerHtml += "	</tr>";
                    tdsummarytext.InnerHtml += "	<tr>";
                    tdsummarytext.InnerHtml += "		<td width=\"20\">&nbsp;</td>";
                    tdsummarytext.InnerHtml += "		<td valign=\"top\">";
                }
                tdsummarytext.InnerHtml += content_data_history.Teaser;
                if (bIsBlog)
                {
                    tdsummarytext.InnerHtml += "			<br/><br/>";
                    tdsummarytext.InnerHtml += "			<b>Tags</b>";
                    tdsummarytext.InnerHtml += "			<br/>";
                    if (!(blog_post_data == null))
                    {
                        tdsummarytext.InnerHtml += blog_post_data.Tags;
                    }
                    tdsummarytext.InnerHtml += "		</td>";
                    tdsummarytext.InnerHtml += "		<td width=\"20\">&nbsp;</td>";
                    tdsummarytext.InnerHtml += "		<td valign=\"top\" style=\"border: 1px solid #fffff; \"  width=\"20%\">";
                    tdsummarytext.InnerHtml += "	<p>";

                    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() != "")
                            {
                                tdsummarytext.InnerHtml += "				<input type=\"checkbox\" name=\"blogcategories" + i.ToString() + "\" value=\"" + blog_post_data.Categories[i].ToString() + "\" checked=\"true\" disabled>&nbsp;" + Strings.Replace((string) (blog_post_data.Categories[i].ToString()), "~@~@~", ";", 1, -1, 0) + "<br>";
                            }
                        }
                    }
                    else
                    {
                        tdsummarytext.InnerHtml += "No categories defined.";
                    }
                    tdsummarytext.InnerHtml += "				<br/>";
                    tdsummarytext.InnerHtml += "			</p>";
                    tdsummarytext.InnerHtml += "		</td>";
                    tdsummarytext.InnerHtml += "	</tr>";
                    tdsummarytext.InnerHtml += "	<tr>";
                    tdsummarytext.InnerHtml += "		<td width=\"20\">&nbsp;</td>";
                    tdsummarytext.InnerHtml += "	    <td colspan=\"3\">";
                    if (!(blog_post_data == null))
                    {
                        tdsummarytext.InnerHtml += "<br/><input type=\"hidden\" name=\"blogposttrackbackid\" id=\"blogposttrackbackid\" value=\"" + blog_post_data.TrackBackURLID.ToString() + "\" /><input type=\"hidden\" id=\"isblogpost\" name=\"isblogpost\" value=\"true\"/><br/><b>TrackBack URL</b><br/>";
                        tdsummarytext.InnerHtml += "<input type=\"text\" size=\"75\" id=\"trackback\" name=\"trackback\" value=\"" + EkFunctions.HtmlEncode(blog_post_data.TrackBackURL) + "\" disabled/>";
                        tdsummarytext.InnerHtml += "<br/><br/>";
                        if (blog_post_data.Pingback == true)
                        {
                            tdsummarytext.InnerHtml += "<input type=\"checkbox\" name=\"pingback\" id=\"pingback\" checked disabled/>&nbsp;PingBack URLs in this post";
                        }
                        else
                        {
                            tdsummarytext.InnerHtml += "<input type=\"checkbox\" name=\"pingback\" id=\"pingback\" disabled/>&nbsp;PingBack URLs in this post";
                        }
                    }
                    else
                    {
                        tdsummarytext.InnerHtml += "<br/><input type=\"hidden\" name=\"blogposttrackbackid\" id=\"blogposttrackbackid\" value=\"\" /><input type=\"hidden\" id=\"isblogpost\" name=\"isblogpost\" value=\"true\"/><br/><b>TrackBack URL</b><br/>";
                        tdsummarytext.InnerHtml += "<input type=\"text\" size=\"75\" id=\"trackback\" name=\"trackback\" value=\"\" disabled/>";
                        tdsummarytext.InnerHtml += "<br/><br/>";
                        tdsummarytext.InnerHtml += "<input type=\"checkbox\" name=\"pingback\" id=\"pingback\" disabled/>&nbsp;PingBack URLs in this post";
                    }
                    tdsummarytext.InnerHtml += "		</td>";
                    tdsummarytext.InnerHtml += "	</tr>";
                    tdsummarytext.InnerHtml += "</table>";
                }
            }

            tdcommenthead.InnerHtml = m_refMsg.GetMessage("content HC label");
            tdcommenttext.InnerHtml = content_data_history.Comment;
    }
Example #56
0
    private void Display_AddPermissions()
    {
        UserGroupData usergroup_data;
        System.Collections.Generic.List<UserGroupData> userGroupDataList = new System.Collections.Generic.List<UserGroupData>();
        UserData user_data;
        System.Collections.Generic.List<UserData> userDataList = new System.Collections.Generic.List<UserData>();
        UserAPI m_refUserAPI = new UserAPI();
        long nFolderId;

        frm_itemid.Value = _Id.ToString();
        frm_type.Value = Request.QueryString["type"];
        frm_base.Value = Request.QueryString["base"];
        frm_permid.Value = Request.QueryString["PermID"];
        frm_membership.Value = Request.QueryString["membership"];

        if (_ItemType == "folder")
        {
            _FolderData = _ContentApi.GetFolderById(_Id);
            nFolderId = _Id;
            if (_FolderData.FolderType == Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionBoard) || _FolderData.FolderType == Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionForum))
            {
                _IsBoard = true;
            }
            else if (_FolderData.FolderType == Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.FolderType.Blog))
            {
                _IsBlog = true;
            }
        }
        else
        {
            _ContentData = _ContentApi.GetContentById(_Id, 0);
            _FolderData = _ContentApi.GetFolderById(_ContentData.FolderId);
            nFolderId = _ContentData.FolderId;
        }
        AddPermissionsToolBar();
        if (Request.QueryString["base"] == "group")
        {
            usergroup_data = m_refUserAPI.GetUserGroupByIdForFolderAdmin(nFolderId, Convert.ToInt64(Request.QueryString["PermID"]));
            Populate_AddPermissionsGenericGrid(usergroup_data);
            Populate_AddPermissionsAdvancedGrid(usergroup_data);
            _IsMembership = usergroup_data.IsMemberShipGroup;
        }
        else if (Request.QueryString["base"] == "user")
        {
            user_data = m_refUserAPI.GetUserByIDForFolderAdmin(nFolderId, Convert.ToInt64(Request.QueryString["PermID"]), false, false);
            Populate_AddPermissionsGenericGrid(user_data);
            Populate_AddPermissionsAdvancedGrid(user_data);
            _IsMembership = user_data.IsMemberShip;
        }
        else
        {
            string[] Groups = Request.QueryString["groupIDS"].Split(",".ToCharArray());
            string[] Users = Request.QueryString["userIDS"].Split(",".ToCharArray());
            int groupCount = 0;
            int userCount = 0;

            if (Request.QueryString["groupIDS"] != "")
            {
                for (groupCount = 0; groupCount <= Groups.Length - 1; groupCount++)
                {
                    userGroupDataList.Add(m_refUserAPI.GetUserGroupByIdForFolderAdmin(nFolderId, Convert.ToInt64(Groups[groupCount])));
                }
                _IsMembership = userGroupDataList[0].IsMemberShipGroup;
            }
            if (Request.QueryString["userIDS"] != "")
            {
                for (userCount = 0; userCount <= Users.Length - 1; userCount++)
                {
                    userDataList.Add(m_refUserAPI.GetUserByIDForFolderAdmin(nFolderId, Convert.ToInt64(Users[userCount]), false, false));
                }
                _IsMembership = userDataList[0].IsMemberShip;
            }
            Populate_AddPermissionsGenericGridForUsersAndGroup(userGroupDataList, userDataList);
            Populate_AddPermissionsAdvancedGridForUsersAndGroup(userGroupDataList, userDataList);
        }

        if (_IsMembership)
        {
            td_ep_membership.Visible = false;
            hmembershiptype.Value = "1";
        }
        else
        {
            td_ep_membership.InnerHtml = _StyleHelper.GetEnableAllPrompt();
            hmembershiptype.Value = "0";
        }
    }
Example #57
0
    private void PopulateContentGridData()
    {
        TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("CHECK", "<input type=\"checkbox\" name=\"checkall\" onclick=\"checkAll(\'selected_items\',false);\">", "title-header", HorizontalAlign.Center, HorizontalAlign.Center, Unit.Percentage(2), Unit.Percentage(2), false, false));
            TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("TITLE", _MessageHelper.GetMessage("generic title"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(30), Unit.Percentage(50), false, false));
            TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("ID", _MessageHelper.GetMessage("generic id"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
            TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("LANGUAGE", _MessageHelper.GetMessage("generic language"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
            TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("URL", _MessageHelper.GetMessage("generic url link"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(30), false, false));
            TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("ARCHIVED", _MessageHelper.GetMessage("lbl archived"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));

            DataTable dt = new DataTable();
            DataRow dr;
            LibraryData libraryInfo;
            ContentData contData = new ContentData();
            dt.Columns.Add(new DataColumn("CHECK", typeof(string)));
            dt.Columns.Add(new DataColumn("TITLE", typeof(string)));
            dt.Columns.Add(new DataColumn("ID", typeof(string)));
            dt.Columns.Add(new DataColumn("LANGUAGE", typeof(string)));
            dt.Columns.Add(new DataColumn("URL", typeof(string)));
            dt.Columns.Add(new DataColumn("ARCHIVED", typeof(string)));
            if (_ViewItem != "folder")
            {
                PageSettings();
                if ((taxonomy_data != null)&& (taxonomy_data.TaxonomyItems != null)&& taxonomy_data.TaxonomyItems.Length > 0)
                {
                    AddDeleteIcon = true;
                    foreach (TaxonomyItemData item in taxonomy_data.TaxonomyItems)
                    {
                        TaxonomyItemCount++;
                        dr = dt.NewRow();
                        dr["CHECK"] = "<input type=\"checkbox\" name=\"selected_items\" id=\"selected_items\" value=\"" + item.TaxonomyItemId + "\" onclick=\"checkAll(\'selected_items\',true);\">";
                        string contenturl = "";
                        switch (Convert.ToInt32(item.ContentType))
                        {
                            case 1:
                                if (item.ContentSubType == EkEnumeration.CMSContentSubtype.WebEvent)
                                {
                                    long fid = _Common.EkContentRef.GetFolderIDForContent(item.TaxonomyItemId);
                                    contenturl = (string) ("content.aspx?action=ViewContentByCategory&LangType=" + item.TaxonomyItemLanguage + "&id=" + fid + "&callerpage=taxonomy.aspx&origurl=" + EkFunctions.UrlEncode((string) ("action=view&view=item&taxonomyid=" + TaxonomyId + "&treeViewId=-1&LangType=" + TaxonomyLanguage)));
                                }
                                else
                                {
                                    contenturl = (string) ("content.aspx?action=View&LangType=" + item.TaxonomyItemLanguage + "&id=" + item.TaxonomyItemId + "&callerpage=taxonomy.aspx&origurl=" + EkFunctions.UrlEncode((string) ("action=view&view=item&taxonomyid=" + TaxonomyId + "&treeViewId=-1&LangType=" + TaxonomyLanguage)));
                                }
                                break;
                            case 7: // Library Item
                                libraryInfo = m_refContentApi.GetLibraryItemByContentID(item.TaxonomyItemId);
                                if(libraryInfo != null)
                                  contenturl = (string) ("library.aspx?LangType=" + libraryInfo.LanguageId + "&action=ViewLibraryItem&id=" + libraryInfo.Id + "&parent_id=" + libraryInfo.ParentId);
                                break;
                            case 1111:
                                // forum id, board id, taskid
                                DiscussionBoard board_data = _Content.GetTopicbyID(item.TaxonomyItemId.ToString());
                                string taskId = GetTaskIdForTopic(m_refContentApi.EkTaskRef.GetTopicReplies(item.TaxonomyItemId, board_data.Id), item.TaxonomyItemId);
                                contenturl = (string)("threadeddisc/addeditreply.aspx?action=Edit&topicid=" + item.TaxonomyItemId.ToString() + "&forumid=" + board_data.Forums[0].Id.ToString() + "&id=" + taskId.ToString() + "&boardid=" + board_data.Id.ToString());
                                break;
                            default:
                                contenturl = (string) ("content.aspx?action=View&LangType=" + item.TaxonomyItemLanguage + "&id=" + item.TaxonomyItemId + "&callerpage=taxonomy.aspx&origurl=" + EkFunctions.UrlEncode((string) ("action=view&view=item&taxonomyid=" + TaxonomyId + "&treeViewId=-1&LangType=" + TaxonomyLanguage)));
                                break;
                        }
                        dr["TITLE"] = m_refContentApi.GetDmsContextMenuHTML(item.TaxonomyItemId, Convert.ToInt64(item.TaxonomyItemLanguage), Convert.ToInt64(item.ContentType),Convert.ToInt32(item.ContentSubType), item.TaxonomyItemTitle.ToString(), _MessageHelper.GetMessage("generic Title") + " " + item.TaxonomyItemTitle.ToString(), contenturl, item.TaxonomyItemAssetInfo.FileName, item.TaxonomyItemAssetInfo.ImageUrl);
                        //dr["TITLE"] = m_refContentApi.GetDmsContextMenuHTML(item.TaxonomyItemId, item.TaxonomyItemLanguage, item.ContentType, item.ContentSubType, item.TaxonomyItemTitle, (string) (_MessageHelper.GetMessage("generic Title") + " " + item.TaxonomyItemTitle), contenturl, item.TaxonomyItemAssetInfo.FileName, item.TaxonomyItemAssetInfo.ImageUrl);
                        dr["ID"] = item.TaxonomyItemId;
                        dr["LANGUAGE"] = item.TaxonomyItemLanguage;
                        switch (Convert.ToInt32(item.ContentType))
                        {
                            case 102: // ManagedAsset (non-office documents)
                                libraryInfo = m_refContentApi.GetLibraryItemByContentID(item.TaxonomyItemId);
                                if(libraryInfo != null)
                                    dr["URL"] = libraryInfo.FileName.Replace("//", "/");
                                break;
                            case 103: // Generic asset content type
                                libraryInfo = m_refContentApi.GetLibraryItemByContentID(item.TaxonomyItemId);
                                if (libraryInfo != null)
                                    dr["URL"] = libraryInfo.FileName.Replace("//", "/");
                                break;
                            case 106: // All images have content_Type 106
                                libraryInfo = m_refContentApi.GetLibraryItemByContentID(item.TaxonomyItemId);
                                if (libraryInfo != null)
                                    dr["URL"] = libraryInfo.FileName.Replace("//", "/");
                                break;
                            default:
                                Ektron.Cms.API.Content.Content api = new Ektron.Cms.API.Content.Content();
                                contData = api.GetContent(item.TaxonomyItemId);
                                //contData = m_refContentApi.GetContentById(item.TaxonomyItemId)
                                dr["URL"] = contData.Quicklink;
                                break;
                        }
                        if (item.ContentType == Convert.ToInt32(EkEnumeration.CMSContentType.Archive_Content).ToString() || item.ContentType == Convert.ToInt32(EkEnumeration.CMSContentType.Archive_Forms).ToString() || item.ContentType == Convert.ToInt32(EkEnumeration.CMSContentType.Archive_Media).ToString() || (Convert.ToInt32(item.ContentType) >= EkConstants.Archive_ManagedAsset_Min && Convert.ToInt32(item.ContentType) < EkConstants.Archive_ManagedAsset_Max && Convert.ToInt32(item.ContentType) != 3333 && Convert.ToInt32(item.ContentType) != 1111))
                        {
                            dr["ARCHIVED"] = "<span class=\"Archived\"></span>";
                        }
                        dt.Rows.Add(dr);
                    }
                }
                else
                {
                    dr = dt.NewRow();
                    dt.Rows.Add(dr);
                    TaxonomyItemList.GridLines = GridLines.None;
                }
            }
            else
            {
                VisiblePageControls(false);
                TaxonomyFolderSyncData[] taxonomy_sync_folder = null;
                TaxonomyBaseRequest tax_sync_folder_req = new TaxonomyBaseRequest();
                tax_sync_folder_req.TaxonomyId = TaxonomyId;
                tax_sync_folder_req.TaxonomyLanguage = TaxonomyLanguage;
                taxonomy_sync_folder = _Content.GetAllAssignedCategoryFolder(tax_sync_folder_req);
                if ((taxonomy_sync_folder != null)&& taxonomy_sync_folder.Length > 0)
                {
                    AddDeleteIcon = true;
                    for (int i = 0; i <= taxonomy_sync_folder.Length - 1; i++)
                    {
                        TaxonomyItemCount++;
                        dr = dt.NewRow();
                        dr["CHECK"] = "<input type=\"checkbox\" name=\"selected_items\" id=\"selected_items\" value=\"" + taxonomy_sync_folder[i].FolderId + "\" onclick=\"checkAll(\'selected_items\',true);\">";

                        string contenturl;
                        contenturl = "content.aspx?action=ViewContentByCategory&id=" + taxonomy_sync_folder[i].FolderId + "&treeViewId=0";

                        dr["TITLE"] = "<a href=\"" + contenturl + "\">";
                        dr["TITLE"] += "<img src=\"";
                        switch ((EkEnumeration.FolderType)taxonomy_sync_folder[i].FolderType)
                        {
                            case EkEnumeration.FolderType.Catalog:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folderGreen.png";
                                break;
                            case EkEnumeration.FolderType.Community:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folderCommunity.png";
                                break;
                            case EkEnumeration.FolderType.Blog:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folderBlog.png";
                                break;
                            case EkEnumeration.FolderType.DiscussionBoard:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folderBoard.png";
                                break;
                            case EkEnumeration.FolderType.DiscussionForum:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folderBoard.png";
                                break;
                            default:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folder.png";
                                break;
                        }
                        dr["TITLE"] += "\"></img>";
                        dr["TITLE"] += "</a><a href=\"" + contenturl + "\">";
                        dr["TITLE"] += taxonomy_sync_folder[i].FolderTitle; //& GetRecursiveTitle(item.FolderRecursive)
                        dr["TITLE"] += "</a>";

                        dr["ID"] = taxonomy_sync_folder[i].FolderId;
                        dr["LANGUAGE"] = taxonomy_sync_folder[i].TaxonomyLanguage;
                        dt.Rows.Add(dr);
                    }
                }
                else
                {
                    dr = dt.NewRow();
                    dt.Rows.Add(dr);
                    TaxonomyItemList.GridLines = GridLines.None;
                }
            }
            DataView dv = new DataView(dt);
            TaxonomyItemList.DataSource = dv;
            TaxonomyItemList.DataBind();
    }
Example #58
0
    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;
    }
Example #59
0
    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);
    }
Example #60
0
 private string GetMetadataValue(ContentData content, long metadataTypeId)
 {
     ContentMetaData meta = GetMetadata(content, metadataTypeId);
     return meta == null ? null : meta.Text;
 }