Ejemplo n.º 1
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
        {
            pp.ID = sender.GetName().Replace(" ", "_");

            pp.Value = _val;
            return pp;
        }
Ejemplo n.º 2
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
        {
            ddl.ID = sender.GetName();

            ddl.Items.Clear();
            List<KeyValuePair<String, String>> items = new List<KeyValuePair<String, String>>();

            if (ObjectGuid != Guid.Empty)
            {
                Guid[] guids = umbraco.cms.businesslogic.CMSNode.getAllUniquesFromObjectType(ObjectGuid);
                foreach (Guid g in guids)
                {
                    umbraco.cms.businesslogic.CMSNode node = new umbraco.cms.businesslogic.CMSNode(g);
                    items.Add(new KeyValuePair<string, string>(node.Id.ToString(), node.Text));
                }
            }

            items.Sort(delegate(KeyValuePair<String, String> x, KeyValuePair<String, String> y) { return x.Value.CompareTo(y.Value); });

            foreach (KeyValuePair<String, String> kv in items)
            {
                ddl.Items.Add(new System.Web.UI.WebControls.ListItem(kv.Value, kv.Key));
            }

            System.Web.UI.WebControls.ListItem li = new System.Web.UI.WebControls.ListItem("Choose...", "");
            li.Selected = true;
            ddl.Items.Insert(0, li);

            ddl.SelectedValue = _val;

            return ddl;
        }
Ejemplo n.º 3
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
        {
            cbl.ID = sender.GetName();

            cbl.Items.Clear();

            foreach (string s in Prevalues)
            {
                System.Web.UI.WebControls.ListItem item = new System.Web.UI.WebControls.ListItem(s);

                if(_val.Contains(s + ";"))
                    item.Selected = true;

                cbl.Items.Add(item);
                


            }

            if (string.IsNullOrEmpty(_val) && !string.IsNullOrEmpty(DefaultValue))
                cbl.SelectedValue = DefaultValue;


            return cbl;
        }
Ejemplo n.º 4
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
        {
            cc.ShowXPath = true;
            cc.ID = sender.GetName().Replace(" ", "_");

            cc.Value = _val;
            return cc;
        }
Ejemplo n.º 5
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
        {
            cb.ID = sender.GetName();

            if (string.IsNullOrEmpty(_val) && !string.IsNullOrEmpty(DefaultValue) && DefaultValue == true.ToString())
                cb.Checked = true;
            else if(_val == true.ToString())
                cb.Checked = true;

            return cb;
        }
Ejemplo n.º 6
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
        {
            tb.ID = sender.GetName();

            tb.TextMode = TextBoxMode.Password;
            tb.CssClass = "guiInputText guiInputStandardSize";

            if (string.IsNullOrEmpty(tb.Text) && !string.IsNullOrEmpty(DefaultValue))
                tb.Text = DefaultValue;

            return tb;
        }
Ejemplo n.º 7
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
        {

            dp.ShowTime = true;

            dp.ID = sender.GetName().Replace(" ", "_");

            if (!string.IsNullOrEmpty(_val))
                dp.DateTime = Convert.ToDateTime(_val);

            return dp;
        }
Ejemplo n.º 8
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
        {

            
            pp.ID = sender.GetName().Replace(" ", "_");

            if (string.IsNullOrEmpty(_val) && !string.IsNullOrEmpty(DefaultValue))
                pp.Value = DefaultValue;
            else
                pp.Value = _val;

            return pp;
        }
Ejemplo n.º 9
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
        {
            rbl.ID = sender.GetName();

            rbl.Items.Clear();

            foreach (string s in Prevalues)
            {
                rbl.Items.Add(s);
            }

            rbl.SelectedValue = _val;

            return rbl;
        }
Ejemplo n.º 10
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
        {
            tb.ID = sender.GetName();
            tb.TextMode = TextBoxMode.MultiLine;
            tb.CssClass = "guiInputText guiInputStandardSize";
            tb.Rows = 7;

            if (string.IsNullOrEmpty(tb.Text) && this.Prevalues.Count > 0)
                tb.Text = this.Prevalues[0];
            else if (string.IsNullOrEmpty(tb.Text) && !string.IsNullOrEmpty(DefaultValue))
                tb.Text = DefaultValue;


            return tb;
        }
Ejemplo n.º 11
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
        {

            mp.ID = sender.GetName().Replace(" ", "_");

            mp.AppAlias = "media";
            mp.TreeAlias = "media";

            int output;
            if (!string.IsNullOrEmpty(_val) && int.TryParse(_val, out output))
            {
                mp.Value = _val;
               
            }
            return mp;
        }
Ejemplo n.º 12
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
        {
            lb.ID = sender.GetName();

            lb.CssClass = "guiInputStandardSize";

               lb.Items.Clear();

            foreach (string s in Prevalues)
            {
                lb.Items.Add(s);
            }

            lb.SelectedValue = _val;

            return lb;
        }
Ejemplo n.º 13
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
        {
            rbl.ID = sender.GetName();

            rbl.Items.Clear();

            foreach (string s in Prevalues)
            {
                rbl.Items.Add(s);
            }

            if (string.IsNullOrEmpty(_val) && !string.IsNullOrEmpty(DefaultValue))
                rbl.SelectedValue = DefaultValue;
            else
                rbl.SelectedValue = _val;

            return rbl;
        }
Ejemplo n.º 14
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
        {
            lb.ID = sender.GetName();
            lb.SelectionMode = System.Web.UI.WebControls.ListSelectionMode.Multiple;
            lb.CssClass = "guiInputStandardSize";
            lb.Items.Clear();

            foreach (string s in Prevalues)
            {
                System.Web.UI.WebControls.ListItem item = new System.Web.UI.WebControls.ListItem(s);

                if (_val.Contains(s + ";"))
                    item.Selected = true;

                lb.Items.Add(item);

            }

            return lb;
        }
Ejemplo n.º 15
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
        {
            lb.ID = sender.GetName();

            lb.CssClass = "guiInputStandardSize";

           lb.Items.Clear();

            foreach (string s in Prevalues)
            {
                lb.Items.Add(s);
            }

            if (string.IsNullOrEmpty(_val) && !string.IsNullOrEmpty(DefaultValue))
                lb.SelectedValue = DefaultValue;
            else
                lb.SelectedValue = _val;

            return lb;
        }
Ejemplo n.º 16
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
        {
            tb.ID = sender.GetName();
            tb.CssClass = "valuesInput";
            tb.Attributes.Add("style", "display:none;");


            string html = "<div class='values'>";

            html += "</div>";

            html += "<input type='text' class='valueInput' />";
            html += " <a onclick=\"valuesDataEditorSettingTypeAddValue(this); return false;\" href='#' class='Add'>Add Value</a>";


            p.Controls.Add(new System.Web.UI.LiteralControl("<div class='valuesDataEditorSettingType'>"));
            p.Controls.Add(new System.Web.UI.LiteralControl(html));
            p.Controls.Add(tb);
            p.Controls.Add(new System.Web.UI.LiteralControl("</div>"));
          

            System.Web.UI.Page page = (System.Web.UI.Page)HttpContext.Current.Handler;


            page.ClientScript.RegisterClientScriptInclude(
                "umbraco.editorControls.SettingControls.js.Values.js",
                page.ClientScript.GetWebResourceUrl(typeof(Values), "umbraco.editorControls.SettingControls.js.Values.js"));


            HtmlHead head = (HtmlHead)page.Header;
            HtmlLink link = new HtmlLink();
            link.Attributes.Add("href", page.ClientScript.GetWebResourceUrl(typeof(Values), "umbraco.editorControls.SettingControls.css.Values.css"));
            link.Attributes.Add("type", "text/css");
            link.Attributes.Add("rel", "stylesheet");
            head.Controls.Add(link);

   
            return p;
        }
Ejemplo n.º 17
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting setting)
        {
            _checkBoxList.ID = setting.GetName();
            _checkBoxList.RepeatColumns = 4;

            _checkBoxList.Items.Clear();

            IDictionary<string, string> propertyTypes = PropertyType.GetAll()
                .GroupBy(p => p.Alias)
                .Select(grp => grp.First())
                .Select(prop =>
                            {
                                if (prop.DataTypeDefinition.DataType.Id == new Guid("5e9b75ae-face-41c8-b47e-5f4b0fd82f83"))
                                {
                                    return new { Value = "rteLink" + prop.Alias, Key = prop.Alias };
                                }
                                return new { Value = prop.Alias, Key = prop.Alias };

                            })
                .ToDictionary(i => i.Key, i => i.Value);

            _checkBoxList.Items.AddRange(propertyTypes.Select(property => new ListItem(property.Key, property.Value)).ToArray());

            // default to all RTEs, MNTPs and Content Pickers if empty
            if (string.IsNullOrEmpty(_val))
            {
                _val = string.Join(",", _defaultDataTypes.SelectMany(GetFields));
            }

            foreach (string value in _val.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
            {
                if (_checkBoxList.Items.OfType<ListItem>().Any(item => item.Value == value))
                {
                    _checkBoxList.Items.OfType<ListItem>().Single(item => item.Value == value).Selected = true;
                }
            }

            return _checkBoxList;
        }
Ejemplo n.º 18
0
        public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
        {

            ddl.ID = sender.GetName();

            ddl.Items.Clear();
            List<KeyValuePair<String, String>> items = new List<KeyValuePair<String, String>>();


            string[] preValuesSource = { "@createDate", "@creatorName", "@level", "@nodeType", "@nodeTypeAlias", "@pageID", "@pageName", "@parentID", "@path", "@template", "@updateDate", "@writerID", "@writerName" };

            string fieldSql = "select distinct alias from cmsPropertyType order by alias";

            IRecordsReader dataTypes = umbraco.BusinessLogic.Application.SqlHelper.ExecuteReader(fieldSql);
            ddl.DataTextField = "alias";
            ddl.DataValueField = "alias";
            ddl.DataSource = dataTypes;
            ddl.DataBind();

            foreach (string s in preValuesSource)
            {
                ddl.Items.Add(new System.Web.UI.WebControls.ListItem(s, s.Replace("@", "")));
            }


            System.Web.UI.WebControls.ListItem li = new System.Web.UI.WebControls.ListItem("Choose...", "");
            li.Selected = true;
            ddl.Items.Insert(0, li);

            if (string.IsNullOrEmpty(_val) && !string.IsNullOrEmpty(DefaultValue))
                ddl.SelectedValue = DefaultValue;
            else
                ddl.SelectedValue = _val;

            return ddl;
        }
Ejemplo n.º 19
0
 public abstract System.Web.UI.Control RenderControl(DataEditorSetting setting);
 public abstract System.Web.UI.Control RenderControl(DataEditorSetting setting);
Ejemplo n.º 21
0
 public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
 {
     cb.ID = sender.GetName();
     return cb;
 }