Esempio n. 1
0
        /// <summary>
        /// Sets up a new workroom and redirects to that workroom when it's been set up.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void CreateNewWorkroom_Click(object sender, EventArgs e)
        {
            if (IsValid)
            {
                PageData newWorkroom = CopyAndSetUpWorkroomPage(PageReference.Parse(SelectTemplateDropDown.SelectedValue));

                CreateFolder(newWorkroom);

                SetUpAccessRights(newWorkroom);

                DeleteNotPublishedPageVersions(newWorkroom.PageLink);

                Response.Redirect(newWorkroom.LinkURL);
            }
        }
        public ActionResult Index(string id)
        {
            var contextContentLink = PageReference.Parse(id);

            PublishItem(contextContentLink);

            var descendents = ContentRepository.GetDescendents(contextContentLink);

            foreach (var descendent in descendents)
            {
                PublishItem(descendent);
            }

            // Return identifier to the updated version of the page, i.e. page ID including work ID
            return(new JsonResult {
                Data = id
            });
        }
Esempio n. 3
0
        /// <summary>
        /// Handles the Click event of the SaveVisibility button.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void SaveVisibility_Click(object sender, EventArgs e)
        {
            bool itemsModified = false;

            PageDataCollection pages = GetChildren(PageLink);

            foreach (ListItem item in VisibilityList.Items)
            {
                PageData page = FindPage(pages, PageReference.Parse(item.Value));
                if (page != null && page.VisibleInMenu != item.Selected)
                {
                    page = page.CreateWritableClone();
                    page.VisibleInMenu = item.Selected;
                    DataFactory.Instance.Save(page, SaveAction.Publish | SaveAction.ForceCurrentVersion);
                    itemsModified = true;
                }
            }
            if (itemsModified)
            {
                _requiresDataBinding = true;
                OnVisibilityChanged(EventArgs.Empty);
            }
            DataBind();
        }
Esempio n. 4
0
        /// <summary>
        /// Deletes a reply page. Reloads the data for the list of replies.
        /// </summary>
        protected void DeleteReply_Command(Object sender, CommandEventArgs e)
        {
            Manager.DeleteReply(PageReference.Parse((string)e.CommandArgument), CurrentPageLink);

            PostList.DataBind();
        }