mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
- Adding localizers to admin menu providers.
- A few missing localized strings and french translations were added. Need native french speakers to fully translate Orchard in french. --HG-- branch : dev
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Linq;
|
||||
using Orchard.Blogs.Services;
|
||||
using Orchard.Localization;
|
||||
using Orchard.UI.Navigation;
|
||||
|
||||
namespace Orchard.Blogs {
|
||||
@@ -10,10 +11,12 @@ namespace Orchard.Blogs {
|
||||
_blogService = blogService;
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public string MenuName { get { return "admin"; } }
|
||||
|
||||
public void GetNavigation(NavigationBuilder builder) {
|
||||
builder.Add("Blogs", "2", BuildMenu);
|
||||
builder.Add(T("Blogs"), "2", BuildMenu);
|
||||
}
|
||||
|
||||
private void BuildMenu(NavigationItemBuilder menu) {
|
||||
@@ -22,20 +25,20 @@ namespace Orchard.Blogs {
|
||||
var singleBlog = blogCount == 1 ? blogs.ElementAt(0) : null;
|
||||
|
||||
if (blogCount > 0 && singleBlog == null)
|
||||
menu.Add("Manage Blogs", "1.0",
|
||||
menu.Add(T("Manage Blogs"), "1.0",
|
||||
item =>
|
||||
item.Action("List", "BlogAdmin", new {area = "Orchard.Blogs"}).Permission(Permissions.MetaListBlogs));
|
||||
else if (singleBlog != null)
|
||||
menu.Add("Manage Blog", "1.0",
|
||||
menu.Add(T("Manage Blog"), "1.0",
|
||||
item =>
|
||||
item.Action("Item", "BlogAdmin", new {area = "Orchard.Blogs", blogSlug = singleBlog.Slug}).Permission(Permissions.MetaListBlogs));
|
||||
|
||||
menu.Add("Add New Blog", "1.1",
|
||||
menu.Add(T("Add New Blog"), "1.1",
|
||||
item =>
|
||||
item.Action("Create", "BlogAdmin", new {area = "Orchard.Blogs"}).Permission(Permissions.ManageBlogs));
|
||||
|
||||
if (singleBlog != null)
|
||||
menu.Add("Add New Post", "1.2",
|
||||
menu.Add(T("Add New Post"), "1.2",
|
||||
item =>
|
||||
item.Action("Create", "BlogPostAdmin", new {area = "Orchard.Blogs", blogSlug = singleBlog.Slug}).Permission(Permissions.PublishBlogPost));
|
||||
}
|
||||
|
Reference in New Issue
Block a user