// If the user is an admin AND the the skin // contains an edit Hyperlink control, this // will display the edit control. protected virtual void BindEditLink(Entry entry, RepeaterItemEventArgs e) { var editLink = e.Item.FindControl("editLink") as HyperLink; var editInWlwLink = e.Item.FindControl("editInWlwLink") as HyperLink; ExecDisplayEditLink(editLink, AdminUrl.PostsEdit(entry.Id).ToString(), Url.EditIconUrl().ToString()); ExecDisplayEditLink(editInWlwLink, Url.WindowsLiveWriterEditUrl(entry.Id, this.Blog), Url.EditInWlwIconUrl().ToString()); }
private void BindLocalUI() { var newPostLink = new HyperLink { Text = Resources.Label_NewPost, NavigateUrl = AdminUrl.PostsEdit() }; AdminMasterPage.AddToActions(newPostLink); HyperLink lnkEditCategories = Utilities.CreateHyperLink(Resources.Label_EditCategories, AdminUrl.EditCategories(categoryLinks.CategoryType)); AdminMasterPage.AddToActions(lnkEditCategories); LinkButton lkbRebuildTags = Utilities.CreateLinkButton(Resources.Label_RebuildAllTags); lkbRebuildTags.CausesValidation = false; lkbRebuildTags.Click += OnRebuildTagsClick; AdminMasterPage.AddToActions(lkbRebuildTags); }
// If the user is an admin AND the the skin // contains an edit Hyperlink control, this // will display the edit control. private void DisplayEditLink(IIdentifiable entry) { if (editLink != null) { if (SecurityHelper.IsAdmin) { editLink.Visible = true; editLink.NavigateUrl = AdminUrl.PostsEdit(entry.Id); ControlHelper.SetTitleIfNone(editLink, Resources.ViewPost_EditThisEntry); if (String.IsNullOrEmpty(editLink.Text) && String.IsNullOrEmpty(editLink.ImageUrl)) { //We'll slap on our little pencil icon. editLink.ImageUrl = Url.EditIconUrl(); } } else { editLink.Visible = false; } } }
// If the user is an admin AND the the skin // contains an edit Hyperlink control, this // will display the edit control. protected virtual void BindEditLink(Entry entry, RepeaterItemEventArgs e) { var editLink = e.Item.FindControl("editLink") as HyperLink; if (editLink != null) { if (SecurityHelper.IsAdmin) { editLink.Visible = true; if (editLink.Text.Length == 0 && editLink.ImageUrl.Length == 0) { //We'll slap on our little pencil icon. editLink.ImageUrl = Url.EditIconUrl(); ControlHelper.SetTitleIfNone(editLink, Resources.EntryList_ClickToView); editLink.NavigateUrl = AdminUrl.PostsEdit(entry.Id); } } else { editLink.Visible = false; } } }
public string PostsEditUrl(object item) { var entry = (Entry)item; return(AdminUrl.PostsEdit(entry.Id)); }
// If the user is an admin AND the the skin // contains an edit Hyperlink control, this // will display the edit control. private void DisplayEditLink(IIdentifiable entry) { ExecDisplayEditLink(editLink, AdminUrl.PostsEdit(entry.Id).ToString(), Url.EditIconUrl().ToString()); ExecDisplayEditLink(editInWlwLink, Url.WindowsLiveWriterEditUrl(entry.Id, this.Blog), Url.EditInWlwIconUrl().ToString()); }