Exemplo n.º 1
0
        private void UpdatedObjectFromFields(MediaTypeField mediaTypeField)
        {
            mediaTypeField.MediaTypeID             = mediaType.ID;
            mediaTypeField.FieldCode               = FieldCode.Text;
            mediaTypeField.FieldLabel              = FieldLabel.Text;
            mediaTypeField.FieldDescription        = FieldDescription.GetValue().ToString();
            mediaTypeField.AdminControl            = AdminControl.Text;
            mediaTypeField.FrontEndLayout          = FrontEndLayout.Text;
            mediaTypeField.GroupName               = GroupName.Text;
            mediaTypeField.RenderLabelAfterControl = RenderLabelAfterControl.Checked;
            mediaTypeField.GetAdminControlValue    = GetAdminControlValue.Text;
            mediaTypeField.SetAdminControlValue    = SetAdminControlValue.Text;
            mediaTypeField.ShowFrontEndFieldEditor = ShowFrontEndFieldEditor.Checked;
            mediaTypeField.FieldValue              = FieldValue.Text;
            mediaTypeField.UsageExample            = UsageExample.Text;

            if (mediaTypeField.FrontEndSubmissions == null)
            {
                mediaTypeField.FrontEndSubmissions = "";
            }

            if (mediaTypeField.FieldSettings == null)
            {
                mediaTypeField.FieldSettings = "";
            }

            mediaTypeField.DateCreated      = DateTime.Now;
            mediaTypeField.DateLastModified = DateTime.Now;
            mediaTypeField.Instructions     = "";
            mediaTypeField.IsGlobalField    = IsGlobalField.Checked;
        }
Exemplo n.º 2
0
 private void UpdateObjectFromFields()
 {
     selectedItem.Name = Name.Text;
     selectedItem.CodeToRenderAdminControl   = CodeToRenderAdminControl.Text;
     selectedItem.CodeToGetAdminControlValue = CodeToGetAdminControlValue.Text;
     selectedItem.CodeToSetAdminControlValue = CodeToSetAdminControlValue.Text;
     selectedItem.CodeToRenderFrontEndLayout = CodeToRenderFrontEndLayout.Text;
     selectedItem.FieldDescription           = FieldDescription.GetValue().ToString();
 }
Exemplo n.º 3
0
        private void UpdatedObjectFromFields(MediaDetailField mediaField)
        {
            mediaField.MediaDetailID                = mediaDetail.ID;
            mediaField.FieldCode                    = FieldCode.Text;
            mediaField.FieldLabel                   = FieldLabel.Text;
            mediaField.AdminControl                 = AdminControl.Text;
            mediaField.FieldValue                   = ParserHelper.ParseData(FieldValue.Text, BasePage.TemplateVars, true);
            mediaField.GroupName                    = GroupName.Text;
            mediaField.RenderLabelAfterControl      = RenderLabelAfterControl.Checked;
            mediaField.GetAdminControlValue         = GetAdminControlValue.Text;
            mediaField.SetAdminControlValue         = SetAdminControlValue.Text;
            mediaField.FrontEndLayout               = FrontEndLayout.Text;
            mediaField.FieldDescription             = FieldDescription.GetValue().ToString();
            mediaField.UseMediaTypeFieldDescription = UseMediaTypeFieldDescription.Checked;
            mediaField.ShowFrontEndFieldEditor      = ShowFrontEndFieldEditor.Checked;
            mediaField.IsGlobalField                = IsGlobalField.Checked;

            if (string.IsNullOrEmpty(UsageExample.Text))
            {
                if (mediaField.MediaDetail == null && mediaField.MediaDetailID != 0)
                {
                    mediaField.MediaDetail = (MediaDetail)MediaDetailsMapper.GetByID(mediaField.MediaDetailID);
                }

                if (mediaField.MediaDetail != null)
                {
                    UsageExample.Text = "{Field:" + mediaField.FieldCode + "} OR {{Load:" + mediaField.MediaDetail.MediaID + "}.Field:" + mediaField.FieldCode + "}";
                }
            }

            mediaField.UsageExample = UsageExample.Text;


            if (mediaField.FieldSettings == null)
            {
                mediaField.FieldSettings = "";
            }

            if (mediaField.FrontEndSubmissions == null)
            {
                mediaField.FrontEndSubmissions = "";
            }


            var mediaTypeField = mediaDetail.MediaType.Fields.SingleOrDefault(i => i.FieldCode == mediaField.FieldCode);

            if (mediaTypeField != null)
            {
                mediaField.UseMediaTypeFieldFrontEndLayout = UseMediaTypeFieldFrontEndLayout.Checked;

                if (AssociateWithMediaTypeField.Checked)
                {
                    mediaField.MediaTypeField = mediaTypeField;
                }
                else
                {
                    mediaField.MediaTypeField = null;
                }
            }
            else
            {
                mediaField.UseMediaTypeFieldFrontEndLayout = false;
            }

            mediaField.DateCreated      = DateTime.Now;
            mediaField.DateLastModified = DateTime.Now;

            //BindVisibility(mediaField);
        }