public static HtmlBuilder LinkCreations(
     this HtmlBuilder hb,
     Context context,
     SiteSettings ss,
     long linkId,
     BaseModel.MethodTypes methodType,
     List <Link> links = null)
 {
     links = links ?? Links(
         context: context,
         ss: ss);
     return
         (methodType != BaseModel.MethodTypes.New &&
          links.Any()
             ? hb.FieldSet(
              css: " enclosed link-creations",
              legendText: Displays.LinkCreations(context: context),
              action: () => hb
              .LinkCreations(
                  context: context,
                  ss: ss,
                  links: links,
                  linkId: linkId))
             : hb);
 }
Ejemplo n.º 2
0
 public static HtmlBuilder Template(
     this HtmlBuilder hb,
     Context context,
     SiteSettings ss,
     View view,
     Versions.VerTypes verType,
     BaseModel.MethodTypes methodType,
     long siteId              = 0,
     long parentId            = 0,
     string referenceType     = null,
     string siteReferenceType = null,
     string title             = null,
     string body              = null,
     bool useBreadcrumb       = true,
     bool useTitle            = true,
     bool useSearch           = true,
     bool useNavigationMenu   = true,
     string script            = null,
     string userScript        = null,
     string userStyle         = null,
     Action action            = null)
 {
     return(hb.Container(
                context: context,
                ss: ss,
                body: body,
                action: () => hb
                .MainContainer(
                    context: context,
                    ss: ss,
                    view: view,
                    verType: verType,
                    methodType: methodType,
                    siteId: siteId,
                    parentId: parentId,
                    referenceType: referenceType,
                    siteReferenceType: siteReferenceType,
                    title: title,
                    useBreadcrumb: useBreadcrumb,
                    useTitle: useTitle,
                    useSearch: useSearch,
                    useNavigationMenu: useNavigationMenu,
                    action: action)
                .HiddenData(
                    context: context,
                    ss: ss)
                .VideoDialog(
                    context: context,
                    ss: ss)
                .Styles(
                    context: context,
                    ss: ss,
                    userStyle: userStyle)
                .Scripts(
                    context: context,
                    ss: ss,
                    script: script,
                    userScript: userScript)));
 }
 public static HtmlBuilder MainContainer(
     this HtmlBuilder hb,
     Context context,
     SiteSettings ss,
     View view,
     Versions.VerTypes verType,
     BaseModel.MethodTypes methodType,
     long siteId,
     long parentId,
     string referenceType,
     string siteReferenceType,
     string title,
     Error.Types errorType  = General.Error.Types.None,
     string[] messageData   = null,
     bool useBreadcrumb     = true,
     bool useTitle          = true,
     bool useSearch         = true,
     bool useNavigationMenu = true,
     ServerScriptModelRow serverScriptModelRow = null,
     Action action = null)
 {
     return(hb.Div(id: "MainContainer", action: () => hb
                   .Header(
                       context: context,
                       ss: ss,
                       siteId: siteId,
                       referenceType: referenceType,
                       errorType: errorType,
                       useNavigationMenu: useNavigationMenu,
                       useSearch: useSearch,
                       serverScriptModelRow: serverScriptModelRow)
                   .Content(
                       context: context,
                       ss: ss,
                       view: view,
                       errorType: errorType,
                       messageData: messageData,
                       siteId: siteId,
                       title: title,
                       useBreadcrumb: useBreadcrumb,
                       useTitle: useTitle,
                       action: action)
                   .Div(id: "BottomMargin")
                   .Footer()
                   .BackUrl(
                       context: context,
                       siteId: siteId,
                       parentId: parentId,
                       referenceType: referenceType,
                       siteReferenceType: siteReferenceType)));
 }
Ejemplo n.º 4
0
 public static HtmlBuilder Field(
     this HtmlBuilder hb,
     SiteSettings ss,
     Column column,
     BaseModel.MethodTypes methodType = BaseModel.MethodTypes.NotSet,
     string value = null,
     Permissions.ColumnPermissionTypes columnPermissionType =
     Permissions.ColumnPermissionTypes.Update,
     string fieldCss            = null,
     string labelCss            = null,
     string controlContainerCss = null,
     string controlCss          = null,
     bool preview = false,
     bool _using  = true)
 {
     if (column.Section != null)
     {
         hb.Div(css: "field-section", action: () => hb
                .Text(text: column.Section));
     }
     if (column.UserColumn && value == User.UserTypes.Anonymous.ToInt().ToString())
     {
         value = string.Empty;
     }
     if (columnPermissionType != Permissions.ColumnPermissionTypes.Deny && _using)
     {
         value = methodType == BaseModel.MethodTypes.New
             ? value.ToDefault(ss, column)
             : value;
         return(hb.SwitchField(
                    column: column,
                    columnPermissionType: columnPermissionType,
                    controlId: !preview
                 ? column.Id
                 : null,
                    fieldCss: FieldCss(column, fieldCss),
                    labelCss: labelCss,
                    controlContainerCss: controlContainerCss,
                    controlCss: Strings.CoalesceEmpty(controlCss, column.ControlCss),
                    controlType: ControlType(column),
                    value: value,
                    optionCollection: EditChoices(ss, column, value),
                    preview: preview));
     }
     else
     {
         return(hb);
     }
 }
Ejemplo n.º 5
0
 public static HtmlBuilder MainContainer(
     this HtmlBuilder hb,
     SiteSettings ss,
     Versions.VerTypes verType,
     BaseModel.MethodTypes methodType,
     long siteId,
     long parentId,
     string referenceType,
     string siteReferenceType,
     string title,
     Error.Types errorType  = General.Error.Types.None,
     bool useBreadcrumb     = true,
     bool useTitle          = true,
     bool useSearch         = true,
     bool useNavigationMenu = true,
     string userStyle       = null,
     Action action          = null)
 {
     return(hb.Div(id: "MainContainer", action: () => hb
                   .Header(
                       ss: ss,
                       siteId: siteId,
                       referenceType: referenceType,
                       errorType: errorType,
                       useNavigationMenu: useNavigationMenu,
                       useSearch: useSearch)
                   .Content(
                       ss: ss,
                       errorType: errorType,
                       siteId: siteId,
                       title: title,
                       useBreadcrumb: useBreadcrumb,
                       useTitle: useTitle,
                       action: action)
                   .Div(id: "BottomMargin both")
                   .Footer()
                   .BackUrl(
                       siteId: siteId,
                       parentId: parentId,
                       referenceType: referenceType,
                       siteReferenceType: siteReferenceType)
                   .Styles(style: userStyle)));
 }
Ejemplo n.º 6
0
 public static HtmlBuilder Template(
     this HtmlBuilder hb,
     SiteSettings ss,
     Versions.VerTypes verType,
     BaseModel.MethodTypes methodType,
     long siteId              = 0,
     long parentId            = 0,
     string referenceType     = null,
     string siteReferenceType = null,
     string title             = null,
     bool useBreadcrumb       = true,
     bool useTitle            = true,
     bool useSearch           = true,
     bool useNavigationMenu   = true,
     string script            = null,
     string userScript        = null,
     string userStyle         = null,
     Action action            = null)
 {
     return(hb
            .MainContainer(
                ss: ss,
                verType: verType,
                methodType: methodType,
                siteId: siteId,
                parentId: parentId,
                referenceType: referenceType,
                siteReferenceType: siteReferenceType,
                title: title,
                useBreadcrumb: useBreadcrumb,
                useTitle: useTitle,
                useSearch: useSearch,
                useNavigationMenu: useNavigationMenu,
                userStyle: userStyle,
                action: action)
            .HiddenData()
            .Scripts(
                script: script,
                userScript: userScript,
                referenceType: referenceType));
 }
Ejemplo n.º 7
0
        public static HtmlBuilder LinkCreations(
            this HtmlBuilder hb,
            SiteSettings ss,
            long linkId,
            BaseModel.MethodTypes methodType)
        {
            var linkCollection = LinkCollection(ss);

            return
                (methodType != BaseModel.MethodTypes.New &&
                 linkCollection.Any()
                    ? hb.FieldSet(
                     css: " enclosed link-creations",
                     legendText: Displays.LinkCreations(),
                     action: () => hb
                     .LinkCreations(
                         linkCollection: linkCollection,
                         siteId: ss.SiteId,
                         linkId: linkId))
                    : hb);
        }