Beispiel #1
0
        protected override FormElementCollection AddFormElements()
        {
            FormElementCollection fec = new FormElementCollection();

            fec.Add(AddTitleElement());
            ListFormElement lfe = new ListFormElement("minNumberOfPosts", "Minimum Number of Posts", "The minimum number of posts a tag must be found in.");

            lfe.Add(new ListItemFormElement("No Minimum", "-1"));
            lfe.Add(new ListItemFormElement("1", "1", true));
            lfe.Add(new ListItemFormElement("2", "2"));
            lfe.Add(new ListItemFormElement("3", "3"));
            lfe.Add(new ListItemFormElement("5", "5"));
            lfe.Add(new ListItemFormElement("10", "10"));
            fec.Add(lfe);

            ListFormElement lfeMax = new ListFormElement("maxNumberOfTags", "Maximum number of Tags", "The maximum number of tags to display. If selected only the most popular tags will be returned.");

            lfeMax.Add(new ListItemFormElement("No Maximum", "-1"));
            lfeMax.Add(new ListItemFormElement("25", "25", true));
            lfeMax.Add(new ListItemFormElement("50", "50"));
            lfeMax.Add(new ListItemFormElement("100", "100"));
            fec.Add(lfeMax);

            return(fec);
        }
        protected override FormElementCollection AddFormElements()
        {
            FormElementCollection fec = new FormElementCollection();

            fec.Add(AddTitleElement());

            ListFormElement lfe = new ListFormElement("numberOfPosts", "Number of Posts", "The number of popular posts to list");

            lfe.Add(new ListItemFormElement("3", "3"));
            lfe.Add(new ListItemFormElement("5", "5", true));
            lfe.Add(new ListItemFormElement("10", "10"));
            fec.Add(lfe);

            ListFormElement lfeCats = new ListFormElement("categoryId", "Filter by Category",
                                                          "Do you want to filter by a category?");

            lfeCats.Add(new ListItemFormElement("All Categories", "-1", CategoryId == -1));
            foreach (Category c in new CategoryController().GetTopLevelCachedCategories())
            {
                lfeCats.Add(new ListItemFormElement(c.Name, c.Id.ToString(), c.Id == CategoryId));
                if (c.HasChildren)
                {
                    foreach (Category child in c.Children)
                    {
                        lfeCats.Add(new ListItemFormElement("--" + child.Name, child.Id.ToString(), child.Id == CategoryId));
                    }
                }
            }

            fec.Add(lfeCats);

            fec.Add(new CheckFormElement("showExcerpt", "Show Excerpt", "Do you want to display a short excerpt", false));

            return(fec);
        }
        protected override FormElementCollection AddFormElements()
        {
            FormElementCollection fec = new FormElementCollection();

            fec.Add(AddTitleElement());
            ListFormElement lfe = new ListFormElement("numberOFcomments", "Number of Comments", "The number of most recent comments to list");

            lfe.Add(new ListItemFormElement("3", "3"));
            lfe.Add(new ListItemFormElement("5", "5", true));
            lfe.Add(new ListItemFormElement("10", "10"));
            fec.Add(lfe);

            return(fec);
        }
Beispiel #4
0
        protected override FormElementCollection AddFormElements()
        {
            FormElementCollection fec = new FormElementCollection();

            fec.Add(AddTitleElement());
            fec.Add(new TextFormElement("username", "UserName", "(your twitter username)"));
            ListFormElement lfe = new ListFormElement("itemsToDisplay", "Number of Tweets", "(how many tweets do you want to display?)");

            lfe.Add(new ListItemFormElement("1", "1"));
            lfe.Add(new ListItemFormElement("3", "3", true));
            lfe.Add(new ListItemFormElement("5", "5"));
            fec.Add(lfe);

            return(fec);
        }
        protected override FormElementCollection AddFormElements()
        {
            FormElementCollection fec = new FormElementCollection();

            fec.Add(AddTitleElement());

            fec.Add(new TextFormElement("FeedUri", "Feed", "The Url of the feed you wish to display"));
            ListFormElement lfe = new ListFormElement("itemsToDisplay", "Number of Posts", "(how many posts do you want to display?)");

            lfe.Add(new ListItemFormElement("1", "1"));
            lfe.Add(new ListItemFormElement("3", "3", true));
            lfe.Add(new ListItemFormElement("5", "5"));
            lfe.Add(new ListItemFormElement("7", "7"));
            fec.Add(lfe);

            return(fec);
        }
Beispiel #6
0
        protected override FormElementCollection AddFormElements()
        {
            FormElementCollection fec = new FormElementCollection();

            fec.Add(new TextFormElement("title", "Name", "Give your list of items a name"));
            fec.Add(new TextFormElement("amazonid", "Amazon Id", "Please enter your Amazon Seller Id"));
            fec.Add(new TextAreaFormElement("amazonLinkItems", "Items", "Copy a link from amazon on each line", 5));
            ListFormElement lfe = new ListFormElement("show", "Items to Show", "How many items do you want to show at a time?");

            lfe.Add(new ListItemFormElement("All", "-1", true));
            lfe.Add(new ListItemFormElement("All (random)", "0"));
            lfe.Add(new ListItemFormElement("1 random item", "1"));
            lfe.Add(new ListItemFormElement("3 random items", "3"));
            lfe.Add(new ListItemFormElement("5 random items", "5"));
            fec.Add(lfe);

            return(fec);
        }
Beispiel #7
0
 protected override FormElementCollection AddFormElements()
 {
     FormElementCollection fec = new FormElementCollection();
     fec.Add(AddTitleElement());
     fec.Add(new TextFormElement("username", "UserName", "(your Del.icio.us username)"));
     ListFormElement lfe = new ListFormElement("itemsToDisplay", "Number of Links", "(how many links do you want to display?)");
     lfe.Add(new ListItemFormElement("1","1"));
     lfe.Add(new ListItemFormElement("3", "3"));
     lfe.Add(new ListItemFormElement("5", "5", true));
     lfe.Add(new ListItemFormElement("10", "10"));
     fec.Add(lfe);
     return fec;
 }
        protected override FormElementCollection AddFormElements()
        {
            FormElementCollection fec = new FormElementCollection();
            fec.Add(new TextFormElement("title", "Name", "Give your list of items a name"));
            fec.Add(new TextFormElement("amazonid", "Amazon Id", "Please enter your Amazon Seller Id"));
            fec.Add(new TextAreaFormElement("amazonLinkItems", "Items", "Copy a link from amazon on each line", 5));
            ListFormElement lfe = new ListFormElement("show", "Items to Show", "How many items do you want to show at a time?");
            lfe.Add(new ListItemFormElement("All", "-1", true));
            lfe.Add(new ListItemFormElement("All (random)", "0"));
            lfe.Add(new ListItemFormElement("1 random item", "1"));
            lfe.Add(new ListItemFormElement("3 random items", "3"));
            lfe.Add(new ListItemFormElement("5 random items", "5"));
            fec.Add(lfe);

            return fec;
        }
        protected override FormElementCollection AddFormElements()
        {
            FormElementCollection fec = new FormElementCollection();
            fec.Add(AddTitleElement());

            ListFormElement lfe = new ListFormElement("numberOfPosts", "Number of Posts", "The number of most recent posts to list");
            lfe.Add(new ListItemFormElement("3", "3"));
            lfe.Add(new ListItemFormElement("5", "5", true));
            lfe.Add(new ListItemFormElement("10", "10"));
            fec.Add(lfe);

            ListFormElement lfeCats = new ListFormElement("categoryId", "Filter by Category", "Do you want to filter by a category?");
            lfeCats.Add(new ListItemFormElement("All Categories", "-1", CategoryId == -1));
            foreach (Category c in new CategoryController().GetTopLevelCachedCategories())
            {
                lfeCats.Add(new ListItemFormElement(c.Name, c.Id.ToString(), c.Id == CategoryId));
                if (c.HasChildren)
                {
                    foreach (Category child in c.Children)
                    {
                        lfeCats.Add(new ListItemFormElement("--" + child.Name, child.Id.ToString(), child.Id == CategoryId));
                    }
                }
            }

            fec.Add(lfeCats);

            fec.Add(new CheckFormElement("showExcerpt", "Show Excerpt", "Do you want to display a short excerpt", false));

            return fec;
        }
        protected override FormElementCollection AddFormElements()
        {
            FormElementCollection fec = new FormElementCollection();
            fec.Add(AddTitleElement());

            fec.Add(new TextFormElement("FeedUri", "Feed", "The Url of the feed you wish to display"));
            ListFormElement lfe = new ListFormElement("itemsToDisplay", "Number of Posts", "(how many posts do you want to display?)");
            lfe.Add(new ListItemFormElement("1","1"));
            lfe.Add(new ListItemFormElement("3", "3", true));
            lfe.Add(new ListItemFormElement("5", "5"));
            lfe.Add(new ListItemFormElement("7", "7"));
            fec.Add(lfe);

            return fec;
        }
        /// <summary>
        /// Adds the form elements.
        /// </summary>
        /// <returns></returns>
        protected override FormElementCollection AddFormElements()
        {
            FormElementCollection form = new FormElementCollection();

            ListFormElement itemsToDisplay = new ListFormElement("itemstodisplay", "Number of Photos", "(how many photos do you want to display?)");
            itemsToDisplay.Add(new ListItemFormElement("3", "3"));
            itemsToDisplay.Add(new ListItemFormElement("6", "6", true));
            itemsToDisplay.Add(new ListItemFormElement("9", "9"));

            form.Add(AddTitleElement());
            form.Add(new TextFormElement("nickname", "NickName", "(your SmugMug nickname)"));
            form.Add(itemsToDisplay);

            return form;
        }
        public string GetHtmlForm(NameValueCollection customFieldValues, bool isNew)
        {
            NameValueCollection fieldValues = new NameValueCollection();

            foreach (CustomField cf in this.Fields)
            {
                if (customFieldValues[cf.Name] != null)
                {
                    fieldValues[cf.Id.ToString()] = customFieldValues[cf.Name];
                }
                else
                {
                    fieldValues[cf.Id.ToString()] = customFieldValues[cf.Id.ToString()];
                }
            }

            StringBuilder sb = new StringBuilder();

            foreach (CustomField cf in this.Fields)
            {
                switch (cf.FieldType)
                {
                case FieldType.TextBox:
                    new TextFormElement(cf.Id.ToString(), cf.Name, cf.Description).Write(sb, fieldValues);
                    break;

                case FieldType.TextArea:
                    new TextAreaFormElement(cf.Id.ToString(), cf.Name, cf.Description, cf.Rows).Write(sb, fieldValues);
                    break;

                case FieldType.CheckBox:
                    new CheckFormElement(cf.Id.ToString(), cf.Name, cf.Description, cf.Checked, isNew).Write(sb, fieldValues);
                    break;

                case FieldType.File:
                    new FileFormElement(cf.Id.ToString(), cf.Name, cf.Description).Write(sb, fieldValues);
                    break;

                case FieldType.WYSIWYG:
                    new WYWIWYGFormElement(cf.Id.ToString(), cf.Name, cf.Description).Write(sb, fieldValues);
                    break;

                case FieldType.DateTime:
                    new DateTimeFormElement(cf.Id.ToString(), cf.Name, cf.Description).Write(sb, fieldValues);
                    break;

                case FieldType.List:
                    if (cf.ListOptions != null && cf.ListOptions.Count > 0)
                    {
                        ListFormElement lfe = new ListFormElement(cf.Id.ToString(), cf.Name, cf.Description);
                        foreach (ListItemFormElement life in cf.ListOptions)
                        {
                            lfe.Add(life);
                        }

                        lfe.Write(sb, fieldValues);
                    }
                    break;
                }
            }

            return(sb.ToString());
        }
        public string GetHtmlForm(NameValueCollection customFieldValues, bool isNew)
        {
            NameValueCollection fieldValues = new NameValueCollection();
            foreach (CustomField cf in this.Fields)
            {
                if (customFieldValues[cf.Name] != null)
                    fieldValues[cf.Id.ToString()] = customFieldValues[cf.Name];
                else
                    fieldValues[cf.Id.ToString()] = customFieldValues[cf.Id.ToString()];
            }

            StringBuilder sb = new StringBuilder();
            foreach (CustomField cf in this.Fields)
            {
                switch (cf.FieldType)
                {
                    case FieldType.TextBox:
                        new TextFormElement(cf.Id.ToString(), cf.Name, cf.Description).Write(sb, fieldValues);
                        break;

                    case FieldType.TextArea:
                        new TextAreaFormElement(cf.Id.ToString(), cf.Name, cf.Description, cf.Rows).Write(sb, fieldValues);
                        break;

                    case FieldType.CheckBox:
                        new CheckFormElement(cf.Id.ToString(), cf.Name, cf.Description, cf.Checked, isNew).Write(sb, fieldValues);
                        break;

                    case FieldType.File:
                        new FileFormElement(cf.Id.ToString(), cf.Name, cf.Description).Write(sb, fieldValues);
                        break;

                    case FieldType.WYSIWYG:
                        new WYWIWYGFormElement(cf.Id.ToString(), cf.Name, cf.Description).Write(sb, fieldValues);
                        break;

                    case FieldType.DateTime:
                        new DateTimeFormElement(cf.Id.ToString(), cf.Name, cf.Description).Write(sb, fieldValues);
                        break;

                    case FieldType.List:
                        if (cf.ListOptions != null && cf.ListOptions.Count > 0)
                        {
                            ListFormElement lfe = new ListFormElement(cf.Id.ToString(), cf.Name, cf.Description);
                            foreach (ListItemFormElement life in cf.ListOptions)
                                lfe.Add(life);

                            lfe.Write(sb, fieldValues);
                        }
                        break;
                }
            }

            return sb.ToString();
        }
        protected override FormElementCollection AddFormElements()
        {
            FormElementCollection fec = new FormElementCollection();
            fec.Add(AddTitleElement());
            ListFormElement lfe = new ListFormElement("numberOFcomments", "Number of Comments", "The number of most recent comments to list");
            lfe.Add(new ListItemFormElement("3", "3"));
            lfe.Add(new ListItemFormElement("5", "5", true));
            lfe.Add(new ListItemFormElement("10", "10"));
            fec.Add(lfe);

            return fec;
        }
Beispiel #15
0
 protected override FormElementCollection AddFormElements()
 {
     FormElementCollection fec = new FormElementCollection();
     fec.Add(AddTitleElement());
     fec.Add(new TextFormElement("username", "UserName", "(your twitter username)"));
     ListFormElement lfe = new ListFormElement("itemsToDisplay", "Number of Tweets", "(how many tweets do you want to display?)");
     lfe.Add(new ListItemFormElement("1", "1"));
     lfe.Add(new ListItemFormElement("2", "2"));
     lfe.Add(new ListItemFormElement("3", "3", true));
     lfe.Add(new ListItemFormElement("4", "4"));
     lfe.Add(new ListItemFormElement("5", "5"));
     fec.Add(lfe);
     fec.Add(new CheckFormElement("displayFollowMe", "Display 'Follow Me on Twitter' link", null, true));
     return fec;
 }
Beispiel #16
0
        protected override FormElementCollection AddFormElements()
        {
            FormElementCollection fec = new FormElementCollection();
            fec.Add(AddTitleElement());
            ListFormElement lfe = new ListFormElement("minNumberOfPosts", "Minimum Number of Posts", "The minimum number of posts a tag must be found in.");
            lfe.Add(new ListItemFormElement("No Minimum", "-1"));
            lfe.Add(new ListItemFormElement("1", "1", true));
            lfe.Add(new ListItemFormElement("2", "2"));
            lfe.Add(new ListItemFormElement("3", "3"));
            lfe.Add(new ListItemFormElement("5", "5"));
            lfe.Add(new ListItemFormElement("10", "10"));
            fec.Add(lfe);

            ListFormElement lfeMax = new ListFormElement("maxNumberOfTags", "Maximum number of Tags", "The maximum number of tags to display. If selected only the most popular tags will be returned.");
            lfeMax.Add(new ListItemFormElement("No Maximum", "-1"));
            lfeMax.Add(new ListItemFormElement("25", "25", true));
            lfeMax.Add(new ListItemFormElement("50", "50"));
            lfeMax.Add(new ListItemFormElement("100", "100"));
            fec.Add(lfeMax);

            return fec;
        }