コード例 #1
0
        /// <summary>
        /// Takes the id from the querystring and returns the nodename of the node with this id.
        /// </summary>
        /// <param name="context">the current HttpContext</param>
        private static void ReadUmbracoNodeName(HttpContext context)
        {
            context.Response.ContentType = "text/xml";

            var qid = context.Request.QueryString["id"];

            if (string.IsNullOrEmpty(qid))
            {
                context.Response.Write("<data>no node found</data>");
            }

            try
            {
                int id;
                if (int.TryParse(qid, out id))
                {
                    var ci = new ContentItem(id);
                    context.Response.Write("<data>" + ci.Text + "</data>");
                }
            }
            catch (Exception)
            {
                context.Response.Write("<data>no node found</data>");
            }
        }
コード例 #2
0
ファイル: contentItemTasks.cs プロジェクト: KerwinMa/Umbraco
        public bool Delete()
        {
            cms.businesslogic.contentitem.ContentItem d = new cms.businesslogic.contentitem.ContentItem(ParentID);

            // Version3.0 - moving to recycle bin instead of deletion
            //d.delete();
            d.Move(-20);
            return(true);
        }
コード例 #3
0
        public override bool PerformDelete()
        {
            var d = new cms.businesslogic.contentitem.ContentItem(ParentID);

            // Version3.0 - moving to recycle bin instead of deletion
            //d.delete();
            d.Move(-20);
            return true;
        }
コード例 #4
0
ファイル: ContentItem.cs プロジェクト: jracabado/justEdit-
 public static ContentItem MakeNew(string Name, ContentItemType cit, BusinessLogic.User u, int ParentId)
 {
     Guid newId = Guid.NewGuid();
     // Updated to match level from base node
     CMSNode n = new CMSNode(ParentId);
     int newLevel = n.Level;
     newLevel++;
     CMSNode.MakeNew(ParentId,_objectType, u.Id, newLevel,  Name, newId);
     ContentItem tmp = new ContentItem(newId);
     tmp.CreateContent(cit);
     return tmp;
 }
コード例 #5
0
ファイル: ContentItem.cs プロジェクト: jracabado/justEdit-
 public static void DeleteFromType(ContentItemType cit)
 {
     var objs = Content.getContentOfContentType(cit);
     foreach (Content c in objs)
     {
         // due to recursive structure document might already been deleted..
         if (CMSNode.IsNode(c.UniqueId))
         {
             ContentItem tmp = new ContentItem(c.UniqueId);
             tmp.delete();
         }
     }
 }
コード例 #6
0
        public string ReadUmbracoNodeName(string qid)
        {
            if (string.IsNullOrEmpty(qid))
            {
                return "";
            }

            try
            {
                int id;
                if (int.TryParse(qid, out id))
                {
                    var ci = new ContentItem(id);
                    return ci.Text;
                }
            }
            catch (Exception)
            {
                return "";
            }
            return "";
        }