Esempio n. 1
0
        private static string DetermineFieldSource(Field field)
        {
            var fieldSource  = new StringBuilder();
            var addCommaFlag = false;

            if (field.Unversioned)
            {
                fieldSource.Append(Translate.Text("unversioned"));
                addCommaFlag = true;
            }

            if (field.Shared)
            {
                if (addCommaFlag)
                {
                    fieldSource.Append(",");
                }

                fieldSource.Append(Translate.Text("shared"));
                addCommaFlag = true;
            }

            if (field.InheritsValueFromOtherItem)
            {
                if (addCommaFlag)
                {
                    fieldSource.Append(",");
                }

                fieldSource.Append(Translate.Text("original value"));
                addCommaFlag = true;
            }

            if (LanguageFallbackFieldValuesManager.IsValidForFallback(field))
            {
                if (addCommaFlag)
                {
                    fieldSource.Append(",");
                }

                fieldSource.Append(Translate.Text("fallback value"));
            }
            else if (field.ContainsStandardValue)
            {
                if (addCommaFlag)
                {
                    fieldSource.Append(",");
                }

                fieldSource.Append(Translate.Text("standard value"));
            }

            if (fieldSource.Length > 0)
            {
                fieldSource.Insert(0, "<span class=scEditorFieldLabelAdministrator>[");
                fieldSource.Append("]</span>");
            }

            return(fieldSource.ToString());
        }
 public void Process(GetFieldValueArgs args)
 {
     if (args.AllowFallbackValue && !IsUiStatic(args.Field) && !IsOldLayout(args.Field))
     {
         args.IsValidForLanguageFallback = LanguageFallbackFieldValuesManager.IsValidForFallback(args.Field);
     }
 }