public ultimatePickerPrevalueEditor(umbraco.cms.businesslogic.datatype.BaseDataType DataType)
        {
            // state it knows its datatypedefinitionid
            _datatype = DataType;
            setupChildControls();

        }
Esempio n. 2
0
        public DataEditor(umbraco.interfaces.IData Data, SortedList Prevalues)
        {
            _data = (cms.businesslogic.datatype.DefaultData)Data;

            if (Prevalues["group"] != null)
                _group = Prevalues["group"].ToString();
        }
        public System.Xml.Linq.XElement GetProperty(umbraco.cms.businesslogic.property.Property prop)
        {
            //get access to media item based on some path.
            var itm = new Document(int.Parse(prop.Value.ToString()));

            return new XElement(prop.PropertyType.Alias, itm.ConfigPath());
        }
        public MultipleUploaderDataEditors(umbraco.interfaces.IData Data, string Configuration)
        {
            _data = Data;
            _configuration = Configuration;

            config = _configuration.Split("|".ToCharArray());
        }
        public void SetProperty(umbraco.cms.businesslogic.property.Property prop, System.Xml.Linq.XElement root)
        {
            var s = new Settings(prop);

            var elm = root.Element(prop.PropertyType.Alias);
            var paths = elm.Elements("item").Select(x => x.Value);

            IEnumerable<CMSNode> nodes = null;
            if (s.Source == Settings.DataSource.Content)
            {
                nodes = paths.Select(x => ContentSyncer.Find(x));
            }
            else
            {
                nodes = paths.Select(x => MediaSyncer.Find(x));
            }

            var ids = nodes.Select(x => x.Id);
            if (s.Format == Settings.DataFormat.Csv)
            {
                prop.Value = string.Join(",", ids);
            }
            else {

                var xml = new XElement("MultiNodePicker",
                        new XAttribute("type", s.Source.ToString().ToLower())
                    );
                foreach (var id in ids) {
                    xml.Add(new XElement("nodeId", id));
                }

                prop.Value = xml.ToString();
            }
        }
Esempio n. 6
0
        /// <summary> Document_BeforeSave(Document sender, umbraco.cms.businesslogic.SaveEventArgs e) umbraco  Document BeforeSave event :Document prüfen
        /// </summary>
        void Document_BeforeSave(Document sender, umbraco.cms.businesslogic.SaveEventArgs e)
        {
            try
                        {
                            Config config = Config.GetConfig();

                            foreach (ConfigDatatype author in config.Datatypes)
                            {

                                foreach (Property pr in sender.GenericProperties)
                                {
                                    if (author.Guid == pr.PropertyType.DataTypeDefinition.DataType.Id)
                                    {

                                        Property fileprop = sender.getProperty("" + pr.PropertyType.Alias + "");

                                        e.Cancel = File_Scanner(fileprop);

                                    }
                                }
                            }

                        }
                        catch (Exception ex)
                        {

                        }
                        if (html_msg.Length > 0)
                        {
                            HtmlContent(html_msg);
                            html_msg.Clear();
                        }
        }
        public override void Populate(ref umbraco.cms.presentation.Trees.XmlTree tree, int keyId)
        {
            var season = _seasonRepository.GetById(keyId);
            var race = season.Races.First(r => r.Id == keyId);

            var quali = XmlTreeNode.Create(_baseTree);
            quali.NodeID = race.Id.ToString();
            quali.Text = "Qualifying Results";
            quali.Icon = "folder.gif";
            quali.NodeType = "qualiResults";

            quali.Menu.Clear();
            quali.Menu.AddRange(new List<IAction> { ActionNew.Instance, ActionDelete.Instance, ContextMenuSeperator.Instance, ActionRefresh.Instance });

            var treeService = GetTreeService(keyId, string.Format("Qualifying-{0}", race.Id));
            quali.Source = race.GetQualificationResults().Count() > 0 ? treeService.GetServiceUrl() : "";

            tree.Add(quali);

            var raceResults = XmlTreeNode.Create(_baseTree);
            raceResults.NodeID = "r" + race.Id.ToString();
            raceResults.Text = "Race Results";
            raceResults.Icon = "folder.gif";
            raceResults.NodeType = "raceResults";

            raceResults.Menu.Clear();
            raceResults.Menu.AddRange(new List<IAction> { ActionNew.Instance, ActionDelete.Instance, ContextMenuSeperator.Instance, ActionRefresh.Instance });

            treeService = GetTreeService(keyId, string.Format("RaceResult-{0}", race.Id));
            raceResults.Source = race.GetRaceResults().Count() > 0 ? treeService.GetServiceUrl() : "";

            tree.Add(raceResults);
        }
 public GoogleMapEditor(umbraco.interfaces.IData Data, MapState Configuration)
 {
     _data = Data;
     if (Configuration != null)
     {
         value = Configuration;
     }
     else
     {
         value = new MapState()
         {
             Width = Constants.DEFAULT_WIDTH,
             Height = Constants.DEFAULT_HEIGHT,
             Zoom = Constants.DEFAULT_ZOOM,
             Language = Constants.DEFAULT_LANGUAGE,
             DrawingTools = Constants.DEFAULT_DRAWINGTOOLS,
             SingleLocation = false,
             SearchBox = true,
             RichtextEditor = false,
             ZoomControl = true,
             PanControl = true,
             StreetViewControl = true,
             ScaleControl = true,
             Center = new Center
             {
                 Latitude = Constants.DEFAULT_LAT,
                 Longitude = Constants.DEFAULT_LNG
             }
         };
     }
 }
Esempio n. 9
0
		public OrderData(umbraco.DataLayer.IRecordsReader reader)
		{
			DatabaseId = reader.GetInt("id");
			UniqueId = reader.GetGuid("uniqueID");
			StoreAlias = reader.GetString("storeAlias");
			if (!reader.IsNull("storeOrderReferenceID"))
				StoreOrderReferenceId = reader.GetInt("storeOrderReferenceID");
			OrderReferenceNumber = reader.GetString("orderNumber");

			OrderXML = reader.GetString("orderInfo");
			OrderStatus = reader.GetString("orderStatus");

			if (!reader.IsNull("createDate"))
				CreateDate = reader.GetDateTime("createDate");
			if (!reader.IsNull("updateDate"))
				UpdateDate = reader.GetDateTime("updateDate");

			if (!reader.IsNull("customerID"))
				CustomerId = reader.GetInt("customerID");
			CustomerUsername = reader.GetString("customerUsername");
			CustomerEmail = reader.GetString("customerEmail");
			CustomerFirstName = reader.GetString("customerFirstName");
			CustomerLastName = reader.GetString("customerLastName");

			TransactionId = reader.GetString("transactionID");
		}
        //private DropDownList _dropdownlist;
        //private CheckBox _showUrls;

        public RelatedLinksPrevalueEditor(umbraco.cms.businesslogic.datatype.BaseDataType DataType)
        {

            _datatype = DataType;
            setupChildControls();

        }
        public System.Xml.Linq.XElement GetProperty(umbraco.cms.businesslogic.property.Property prop)
        {
            var s = new Settings(prop);

            IEnumerable<CMSNode> nodes = new List<CMSNode>();
            IEnumerable<int> nodeIds = new List<int>();
            if ((string)prop.Value != "")
            {
                if (s.Format == Settings.DataFormat.Csv)
                {
                    nodeIds = prop.Value.ToString().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x));
                }
                else
                {

                    nodeIds = XElement.Parse(prop.Value.ToString()).Elements("nodeId").Select(x => int.Parse(x.Value));

                }
            }

            nodes = nodeIds.Select(x => new CMSNode(x));

            var elm = new XElement(prop.PropertyType.Alias);
            foreach (var n in nodes) {
                elm.Add(new XElement("item", n.ConfigPath()));
            }
            return elm;
        }
Esempio n. 12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CsvToXmlData"/> class.
 /// </summary>
 /// <param name="dataType">Type of the data.</param>
 /// <param name="rootName">Name of the root.</param>
 /// <param name="elementName">Name of the element.</param>
 /// <param name="separator">The separator.</param>
 public CsvToXmlData(umbraco.cms.businesslogic.datatype.BaseDataType dataType, string rootName, string elementName, string[] separator)
     : base(dataType)
 {
     this.rootName = rootName;
     this.elementName = elementName;
     this.separator = separator;
 }
Esempio n. 13
0
        private string GetPropertyValue(umbraco.NodeFactory.Node umbracoNode, string propertyAlias)
        {
            if (umbracoNode.GetProperty(propertyAlias) == null && string.IsNullOrWhiteSpace(umbracoNode.GetProperty(propertyAlias).Value))
                return string.Empty;

            return umbracoNode.GetProperty(propertyAlias).Value;
        }
Esempio n. 14
0
        void Document_AfterPublish(Document sender, umbraco.cms.businesslogic.PublishEventArgs e) {
            if (sender.ContentType.Alias == "BlogPost") {
                string urls = GetValueRecursively("pingServices", sender.Id);

                if (!string.IsNullOrEmpty(urls)) {
                    string blogUrl;
                    XmlDocument xd = new XmlDocument();

                    try { xd.LoadXml(urls); }
                    catch { }

                    string blogName = GetValueRecursively("blogName", sender.Id);
                    string currentDomain = HttpContext.Current.Request.ServerVariables["SERVER_NAME"].ToLower();
                    library.UpdateDocumentCache(sender.Id);
                    try {
                        blogUrl = library.NiceUrlFullPath(sender.Id);
                        if (!UmbracoSettings.UseDomainPrefixes) blogUrl = "http://" + currentDomain + blogUrl;
                    } catch (Exception) {
                        Log.Add(LogTypes.Debug, sender.Id, "Cound not get 'NiceUrlFullPath' from current application");
                        blogUrl = "http://" + currentDomain + "/" + library.NiceUrl(sender.Id);
                    }

                    foreach (XmlNode link in xd.SelectNodes("//link [@type = 'external']")) {
                        string ping = link.Attributes["link"].Value;
                        //Log.Add(LogTypes.Debug, sender.Id, ping + " n:" + blogName + " u:" + blogUrl);
                        PingService(ping, blogName, blogUrl);
                    }
                }
            }
        }
Esempio n. 15
0
 protected static void OnDocumentDeleted(Document sender, umbraco.cms.businesslogic.DeleteEventArgs e)
 {
     var page = CmsService.Instance.GetItem<Page>(new Id(sender.Id));
     if (!page.Template.Path.StartsWith("/WebPage"))
         return;
     SearchBackgroundCrawler.QueueDocumentDelete(page);
 }
Esempio n. 16
0
		public static void SendTestmail(string email, 
			umbraco.cms.businesslogic.property.Property Property, 
			string fromName, string fromEmail, bool IsHtml) 
		{
			// version
			string version = Property.VersionId.ToString();

			// Get document
			umbraco.cms.businesslogic.web.Document d = new umbraco.cms.businesslogic.web.Document(umbraco.cms.businesslogic.Content.GetContentFromVersion(Property.VersionId).Id);
			System.Web.HttpContext.Current.Items["pageID"] = d.Id;

			// Format mail
			string subject = d.Text;
			string sender = "\"" + fromName + "\" <" + fromEmail + ">";

			// Get template			
			System.Text.StringBuilder sb = new System.Text.StringBuilder();
			System.IO.StringWriter sw = new StringWriter(sb);
			System.Web.UI.HtmlTextWriter writer = new System.Web.UI.HtmlTextWriter(sw);
			umbraco.template t = new template(d.Template);
			t.ParseWithControls(new umbraco.page(d.Id, d.Version)).RenderControl(writer);
			
			// Embedded emails ;) added by DB, 2005-10-04

			EmailMessage message = mailerHelper.CreateEmbeddedEmail(sb.ToString(), Cms.BusinessLogic.web.Document.GetContentFromVersion(Property.VersionId).Id);
            			
			message.FromAddress = new EmailAddress(fromEmail, fromName);
			message.ToAddresses.Add(new EmailAddress(email));
			message.Subject = subject;
			message.Send(new SmtpServer(GlobalSettings.SmtpServer));
            
		}
Esempio n. 17
0
        public DataEditor(umbraco.interfaces.IData Data, Options Configuration)
        {
            //load the prevalues
            savedOptions = Configuration;

            //ini the savedData object
            savedData = Data;
        }
Esempio n. 18
0
 protected static void OnDocumentPublished(Document sender, umbraco.cms.businesslogic.PublishEventArgs e)
 {
     global::umbraco.library.UpdateDocumentCache(sender.Id);
     var page = CmsService.Instance.GetItem<Page>(new Id(sender.Id));
     if (!page.Template.Path.StartsWith("/WebPage"))
         return;
     SearchBackgroundCrawler.QueueDocumentAdd(page);
 }
 public DataType_PrevalueEditor(umbraco.cms.businesslogic.datatype.BaseDataType DataType)
 {
     //Log.Add(LogTypes.Debug, 0, "Prevalue Constructor");
     _datatype = DataType;
     jsonSerializer = new JavaScriptSerializer();
     savedOptions = Configuration;
     if (savedOptions == null)
         savedOptions = new TextBoxListOptions();
 }
        public void SetProperty(umbraco.cms.businesslogic.property.Property prop, System.Xml.Linq.XElement root)
        {
            var elm = root.Element(prop.PropertyType.Alias);

            if (elm != null)
            {
                prop.Value = elm.Value;
            }
        }
        public ultimatePickerDataEditor(umbraco.interfaces.IData Data, string Configuration)
        {
            _data = Data;
            _configuration = Configuration;

            config = _configuration.Split("|".ToCharArray());
            controlType = config[0];

            RenderMode = UpdatePanelRenderMode.Inline;
        }
        public TextBoxList_DataEditor(umbraco.interfaces.IData Data, TextBoxListOptions Configuration)
        {
            //load the prevalues
            options = Configuration;

            //ini the savedData object
            savedData = Data;

            //setupChildControls();
        }
Esempio n. 23
0
        public Widget_Builder_DataEditor(umbraco.interfaces.IData Data, Widget_Builder_Options Configuration)
        {
            //load the prevalues
            savedOptions = Configuration;

            //ini the savedData object
            savedData = Data;

            jsonSerializer = new JavaScriptSerializer();
        }
Esempio n. 24
0
        void Member_AfterSave(umbraco.cms.businesslogic.member.Member sender, umbraco.cms.businesslogic.SaveEventArgs e)
        {
            string groups = "";
            foreach (MemberGroup mg in sender.Groups.Values) {
                groups += mg.Text + ",";
            }

            sender.getProperty("groups").Value = groups.Trim().Trim(','); ;
            sender.XmlGenerate(new System.Xml.XmlDocument());
        }
 private Node GetNode(umbraco.cms.businesslogic.media.Media media)
 {
     var result = new Node();
     result.Id = media.Id.ToString();
     result.Icon = "/umbraco/images/umbraco/" + media.ContentTypeIcon;
     result.Draggable = false;
     result.HelpText = media.Text;
     result.Text = media.Text;
     result.Selectable = IsSelectable(media);
     return result;
 }
Esempio n. 26
0
        /// <summary>
        /// Document_s the new.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="umbraco.cms.businesslogic.NewEventArgs"/> instance containing the event data.</param>
        void Document_New(Document sender, umbraco.cms.businesslogic.NewEventArgs e)
        {
            if (sender.ContentType.Alias == "BlogPost")
            {

                if (sender.getProperty("PostDate") != null)
                {
                    sender.getProperty("PostDate").Value = sender.CreateDateTime.Date;
                }

            }
        }
        public System.Xml.Linq.XElement GetProperty(umbraco.cms.businesslogic.property.Property prop)
        {
            //get access to media item based on some path.
            try
            {
                var mediaItem = new Media(int.Parse(prop.Value.ToString()));

                return new XElement(prop.PropertyType.Alias, mediaItem.ConfigPath());
            }
            catch { }

            return  new XElement(prop.PropertyType.Alias, "");
        }
Esempio n. 28
0
 void BaseTree_BeforeNodeRender(ref umbraco.cms.presentation.Trees.XmlTree sender, ref umbraco.cms.presentation.Trees.XmlTreeNode node, EventArgs e)
 {
     if (node.NodeType == "content")
     {
         if (node.Menu != null)
         {
             // Replacing the built in delete with our own
             int currentDeleteIndex = node.Menu.IndexOf(ActionDelete.Instance);
             node.Menu.Remove(ActionDelete.Instance);
             node.Menu.Insert(currentDeleteIndex, new DeleteActionItem());
         }
     }
 }
        public void SetProperty(umbraco.cms.businesslogic.property.Property prop, System.Xml.Linq.XElement root)
        {
            var elm = root.Element(prop.PropertyType.Alias);

            if (elm != null)
            {
                var file = new File(elm.Value);
                if (file.Info.Exists)
                    prop.Value = file;
                else
                    prop.Value = elm.Value;
            }
        }
Esempio n. 30
0
    void Document_BeforeSave(Document sender, umbraco.cms.businesslogic.SaveEventArgs e)
    {
        //throw new NotImplementedException();
        //Property SendEmailNotification = sender.getProperty("sendEmailNotification");
        //if (SendEmailNotification.Value.ToString() == "0")
        //{

        //}
        //Property SendPushNotification = sender.getProperty("sendPushNotification");
        //if (SendPushNotification.Value.ToString() == "0")
        //{

        //}
    }