mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -27,37 +27,23 @@ namespace Orchard.Azure {
|
||||
ContainerName = containerName;
|
||||
_root = String.IsNullOrEmpty(root) || root == "/" ? String.Empty : root + "/";
|
||||
|
||||
AzureHelper.InjectHttpContext(()
|
||||
=>
|
||||
{
|
||||
using ( new HttpContextWeaver() ) {
|
||||
|
||||
BlobClient = _storageAccount.CreateCloudBlobClient();
|
||||
// Get and create the container if it does not exist
|
||||
// The container is named with DNS naming restrictions (i.e. all lower case)
|
||||
Container = BlobClient.GetContainerReference(ContainerName);
|
||||
BlobClient = _storageAccount.CreateCloudBlobClient();
|
||||
// Get and create the container if it does not exist
|
||||
// The container is named with DNS naming restrictions (i.e. all lower case)
|
||||
Container = BlobClient.GetContainerReference(ContainerName);
|
||||
|
||||
Container.CreateIfNotExist();
|
||||
Container.CreateIfNotExist();
|
||||
|
||||
if (isPrivate) {
|
||||
Container.SetPermissions(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Off });
|
||||
}
|
||||
else {
|
||||
Container.SetPermissions(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Container });
|
||||
}
|
||||
}
|
||||
|
||||
if (isPrivate)
|
||||
{
|
||||
Container.SetPermissions(new BlobContainerPermissions
|
||||
{
|
||||
PublicAccess =
|
||||
BlobContainerPublicAccessType
|
||||
.Off
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Container.SetPermissions(new BlobContainerPermissions
|
||||
{
|
||||
PublicAccess =
|
||||
BlobContainerPublicAccessType
|
||||
.Container
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private static void EnsurePathIsRelative(string path) {
|
||||
@@ -68,13 +54,20 @@ namespace Orchard.Azure {
|
||||
public IStorageFile GetFile(string path) {
|
||||
EnsurePathIsRelative(path);
|
||||
path = String.Concat(_root, path);
|
||||
Container.EnsureBlobExists(path);
|
||||
return new AzureBlobFileStorage(Container.GetBlockBlobReference(path));
|
||||
|
||||
using ( new HttpContextWeaver() )
|
||||
{
|
||||
Container.EnsureBlobExists(path);
|
||||
return new AzureBlobFileStorage(Container.GetBlockBlobReference(path));
|
||||
}
|
||||
}
|
||||
|
||||
public bool FileExists(string path) {
|
||||
path = String.Concat(_root, path);
|
||||
return Container.BlobExists(path);
|
||||
using ( new HttpContextWeaver() )
|
||||
{
|
||||
path = String.Concat(_root, path);
|
||||
return Container.BlobExists(path);
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<IStorageFile> ListFiles(string path) {
|
||||
@@ -83,51 +76,67 @@ namespace Orchard.Azure {
|
||||
string prefix = String.Concat(Container.Name, "/", _root, path);
|
||||
if ( !prefix.EndsWith("/") )
|
||||
prefix += "/";
|
||||
|
||||
foreach ( var blobItem in BlobClient.ListBlobsWithPrefix(prefix).OfType<CloudBlockBlob>() ) {
|
||||
yield return new AzureBlobFileStorage(blobItem);
|
||||
using ( new HttpContextWeaver() )
|
||||
{
|
||||
foreach (var blobItem in BlobClient.ListBlobsWithPrefix(prefix).OfType<CloudBlockBlob>())
|
||||
{
|
||||
yield return new AzureBlobFileStorage(blobItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<IStorageFolder> ListFolders(string path) {
|
||||
EnsurePathIsRelative(path);
|
||||
path = String.Concat(_root, path);
|
||||
using ( new HttpContextWeaver() )
|
||||
{
|
||||
if (!Container.DirectoryExists(path))
|
||||
{
|
||||
try
|
||||
{
|
||||
CreateFolder(path);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ArgumentException(string.Format("The folder could not be created at path: {0}. {1}",
|
||||
path, ex));
|
||||
}
|
||||
}
|
||||
|
||||
if ( !Container.DirectoryExists(path) ) {
|
||||
try {
|
||||
CreateFolder(path);
|
||||
}
|
||||
catch ( Exception ex ) {
|
||||
throw new ArgumentException(string.Format("The folder could not be created at path: {0}. {1}", path, ex));
|
||||
}
|
||||
return Container.GetDirectoryReference(path)
|
||||
.ListBlobs()
|
||||
.OfType<CloudBlobDirectory>()
|
||||
.Select<CloudBlobDirectory, IStorageFolder>(d => new AzureBlobFolderStorage(d))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
return Container.GetDirectoryReference(path)
|
||||
.ListBlobs()
|
||||
.OfType<CloudBlobDirectory>()
|
||||
.Select<CloudBlobDirectory, IStorageFolder>(d => new AzureBlobFolderStorage(d))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public void CreateFolder(string path) {
|
||||
public void CreateFolder(string path)
|
||||
{
|
||||
EnsurePathIsRelative(path);
|
||||
path = String.Concat(_root, path);
|
||||
|
||||
Container.EnsureDirectoryDoesNotExist(path);
|
||||
Container.GetDirectoryReference(path);
|
||||
using (new HttpContextWeaver())
|
||||
{
|
||||
Container.EnsureDirectoryDoesNotExist(path);
|
||||
Container.GetDirectoryReference(path);
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteFolder(string path) {
|
||||
EnsurePathIsRelative(path);
|
||||
path = String.Concat(_root, path);
|
||||
|
||||
Container.EnsureDirectoryExists(path);
|
||||
foreach ( var blob in Container.GetDirectoryReference(path).ListBlobs() ) {
|
||||
if ( blob is CloudBlob )
|
||||
( (CloudBlob)blob ).Delete();
|
||||
using ( new HttpContextWeaver() )
|
||||
{
|
||||
Container.EnsureDirectoryExists(path);
|
||||
foreach (var blob in Container.GetDirectoryReference(path).ListBlobs())
|
||||
{
|
||||
if (blob is CloudBlob)
|
||||
((CloudBlob) blob).Delete();
|
||||
|
||||
if ( blob is CloudBlobDirectory )
|
||||
DeleteFolder(blob.Uri.ToString().Substring(Container.Uri.ToString().Length + 1 + _root.Length));
|
||||
if (blob is CloudBlobDirectory)
|
||||
DeleteFolder(blob.Uri.ToString().Substring(Container.Uri.ToString().Length + 1 + _root.Length));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,32 +150,39 @@ namespace Orchard.Azure {
|
||||
|
||||
if ( !newPath.EndsWith("/") )
|
||||
newPath += "/";
|
||||
using ( new HttpContextWeaver() )
|
||||
{
|
||||
foreach (var blob in Container.GetDirectoryReference(_root + path).ListBlobs())
|
||||
{
|
||||
if (blob is CloudBlob)
|
||||
{
|
||||
string filename = Path.GetFileName(blob.Uri.ToString());
|
||||
string source = String.Concat(path, filename);
|
||||
string destination = String.Concat(newPath, filename);
|
||||
RenameFile(source, destination);
|
||||
}
|
||||
|
||||
foreach ( var blob in Container.GetDirectoryReference(_root + path).ListBlobs() ) {
|
||||
if ( blob is CloudBlob ) {
|
||||
string filename = Path.GetFileName(blob.Uri.ToString());
|
||||
string source = String.Concat(path, filename);
|
||||
string destination = String.Concat(newPath, filename);
|
||||
RenameFile(source, destination);
|
||||
}
|
||||
|
||||
if ( blob is CloudBlobDirectory ) {
|
||||
string foldername = blob.Uri.Segments.Last();
|
||||
string source = String.Concat(path, foldername);
|
||||
string destination = String.Concat(newPath, foldername);
|
||||
RenameFolder(source, destination);
|
||||
if (blob is CloudBlobDirectory)
|
||||
{
|
||||
string foldername = blob.Uri.Segments.Last();
|
||||
string source = String.Concat(path, foldername);
|
||||
string destination = String.Concat(newPath, foldername);
|
||||
RenameFolder(source, destination);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void DeleteFile(string path) {
|
||||
EnsurePathIsRelative(path);
|
||||
path = String.Concat(_root, path);
|
||||
|
||||
Container.EnsureBlobExists(path);
|
||||
var blob = Container.GetBlockBlobReference(path);
|
||||
blob.Delete();
|
||||
using ( new HttpContextWeaver() )
|
||||
{
|
||||
Container.EnsureBlobExists(path);
|
||||
var blob = Container.GetBlockBlobReference(path);
|
||||
blob.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public void RenameFile(string path, string newPath) {
|
||||
@@ -175,14 +191,16 @@ namespace Orchard.Azure {
|
||||
|
||||
EnsurePathIsRelative(newPath);
|
||||
newPath = String.Concat(_root, newPath);
|
||||
using ( new HttpContextWeaver() )
|
||||
{
|
||||
Container.EnsureBlobExists(path);
|
||||
Container.EnsureBlobDoesNotExist(newPath);
|
||||
|
||||
Container.EnsureBlobExists(path);
|
||||
Container.EnsureBlobDoesNotExist(newPath);
|
||||
|
||||
var blob = Container.GetBlockBlobReference(path);
|
||||
var newBlob = Container.GetBlockBlobReference(newPath);
|
||||
newBlob.CopyFromBlob(blob);
|
||||
blob.Delete();
|
||||
var blob = Container.GetBlockBlobReference(path);
|
||||
var newBlob = Container.GetBlockBlobReference(newPath);
|
||||
newBlob.CopyFromBlob(blob);
|
||||
blob.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public IStorageFile CreateFile(string path) {
|
||||
@@ -201,8 +219,11 @@ namespace Orchard.Azure {
|
||||
public string GetPublicUrl(string path) {
|
||||
EnsurePathIsRelative(path);
|
||||
path = String.Concat(_root, path);
|
||||
Container.EnsureBlobExists(path);
|
||||
return Container.GetBlockBlobReference(path).Uri.ToString();
|
||||
using ( new HttpContextWeaver() )
|
||||
{
|
||||
Container.EnsureBlobExists(path);
|
||||
return Container.GetBlockBlobReference(path).Uri.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private class AzureBlobFileStorage : IStorageFile {
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.IO;
|
||||
|
||||
namespace Orchard.Azure {
|
||||
public class AzureHelper {
|
||||
public static void InjectHttpContext(Action action) {
|
||||
if(HttpContext.Current == null )
|
||||
{
|
||||
action();
|
||||
return;
|
||||
}
|
||||
|
||||
var currentContext = HttpContext.Current;
|
||||
try {
|
||||
// THIS IS A HACK
|
||||
// There is a bug in ASP.NET 4.0 in HttpEncoder.Current, which prevents some calls to HttpUtiliy.Decode/Encode
|
||||
// from Application_Start, on IIS or Azure. This hack will be removed when the bug is corrected.
|
||||
// This is fired by the assembly Microsoft.WindowsAzure.StorageClient. Should be corrected in .NET4 SP1
|
||||
|
||||
HttpContext.Current = new HttpContext(new HttpRequest(String.Empty, "http://localhost", String.Empty), new HttpResponse(new StringWriter()));
|
||||
|
||||
action();
|
||||
}
|
||||
finally {
|
||||
HttpContext.Current = currentContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,11 @@ namespace Orchard.Azure {
|
||||
throw new ArgumentException("Path can't be empty");
|
||||
|
||||
try {
|
||||
var blob = container.GetBlockBlobReference(path);
|
||||
blob.FetchAttributes();
|
||||
using ( new HttpContextWeaver() )
|
||||
{
|
||||
var blob = container.GetBlockBlobReference(path);
|
||||
blob.FetchAttributes();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch ( StorageClientException e ) {
|
||||
|
||||
@@ -35,23 +35,18 @@ namespace Orchard.Azure.Environment.Configuration {
|
||||
_storageAccount = storageAccount;
|
||||
_events = events;
|
||||
|
||||
AzureHelper.InjectHttpContext(() =>
|
||||
{
|
||||
BlobClient = _storageAccount.CreateCloudBlobClient();
|
||||
using ( new HttpContextWeaver() ) {
|
||||
BlobClient = _storageAccount.CreateCloudBlobClient();
|
||||
|
||||
// Get and create the container if it does not exist
|
||||
// The container is named with DNS naming restrictions (i.e. all lower case)
|
||||
Container = new CloudBlobContainer(ContainerName, BlobClient);
|
||||
Container.CreateIfNotExist();
|
||||
// Get and create the container if it does not exist
|
||||
// The container is named with DNS naming restrictions (i.e. all lower case)
|
||||
Container = new CloudBlobContainer(ContainerName, BlobClient);
|
||||
Container.CreateIfNotExist();
|
||||
|
||||
// Tenant settings are protected by default
|
||||
Container.SetPermissions(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Off });
|
||||
}
|
||||
|
||||
// Tenant settings are protected by default
|
||||
Container.SetPermissions(new BlobContainerPermissions
|
||||
{
|
||||
PublicAccess =
|
||||
BlobContainerPublicAccessType.Off
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
IEnumerable<ShellSettings> IShellSettingsManager.LoadSettings() {
|
||||
@@ -65,37 +60,29 @@ namespace Orchard.Azure.Environment.Configuration {
|
||||
if ( string.IsNullOrEmpty(settings.Name) )
|
||||
throw new ArgumentException(T("Settings \"Name\" is not set.").ToString());
|
||||
|
||||
AzureHelper.InjectHttpContext(
|
||||
() =>
|
||||
{
|
||||
var filePath = String.Concat(settings.Name, "/", "Settings.txt");
|
||||
var blob = Container.GetBlockBlobReference(filePath);
|
||||
blob.UploadText(ComposeSettings(settings));
|
||||
});
|
||||
using ( new HttpContextWeaver() ) {
|
||||
var filePath = String.Concat(settings.Name, "/", "Settings.txt");
|
||||
var blob = Container.GetBlockBlobReference(filePath);
|
||||
blob.UploadText(ComposeSettings(settings));
|
||||
}
|
||||
|
||||
_events.Saved(settings);
|
||||
}
|
||||
|
||||
IEnumerable<ShellSettings> LoadSettings() {
|
||||
|
||||
var result = new List<ShellSettings>();
|
||||
using ( new HttpContextWeaver() ) {
|
||||
var settingsBlobs =
|
||||
BlobClient.ListBlobsWithPrefix(Container.Name + "/").OfType<CloudBlobDirectory>()
|
||||
.SelectMany(directory => directory.ListBlobs()).OfType<CloudBlockBlob>()
|
||||
.Where(
|
||||
blob =>
|
||||
string.Equals(Path.GetFileName(blob.Uri.ToString()),
|
||||
"Settings.txt",
|
||||
StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
AzureHelper.InjectHttpContext(
|
||||
() =>
|
||||
{
|
||||
var settingsBlobs =
|
||||
BlobClient.ListBlobsWithPrefix(Container.Name + "/").OfType<CloudBlobDirectory>()
|
||||
.SelectMany(directory => directory.ListBlobs()).OfType<CloudBlockBlob>()
|
||||
.Where(
|
||||
blob =>
|
||||
string.Equals(Path.GetFileName(blob.Uri.ToString()),
|
||||
"Settings.txt",
|
||||
StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
result.AddRange(settingsBlobs.Select(settingsBlob => ParseSettings(settingsBlob.DownloadText())));
|
||||
});
|
||||
|
||||
return result;
|
||||
return settingsBlobs.Select(settingsBlob => ParseSettings(settingsBlob.DownloadText())).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
class Content {
|
||||
|
||||
@@ -15,21 +15,25 @@ namespace Orchard.Azure.FileSystems.AppData {
|
||||
}
|
||||
|
||||
public void CreateFile(string path, string content) {
|
||||
if(_fs.FileExists(path)) {
|
||||
DeleteFile(path);
|
||||
}
|
||||
using ( new HttpContextWeaver() ) {
|
||||
if (_fs.FileExists(path)) {
|
||||
DeleteFile(path);
|
||||
}
|
||||
|
||||
using (var stream = _fs.CreateFile(path).OpenWrite()) {
|
||||
using(var writer = new StreamWriter(stream)) {
|
||||
writer.Write(content);
|
||||
using (var stream = _fs.CreateFile(path).OpenWrite()) {
|
||||
using (var writer = new StreamWriter(stream)) {
|
||||
writer.Write(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string ReadFile(string path) {
|
||||
using ( var stream = _fs.GetFile(path).OpenRead() ) {
|
||||
using ( var reader = new StreamReader(stream) ) {
|
||||
return reader.ReadToEnd();
|
||||
using ( new HttpContextWeaver() ) {
|
||||
using (var stream = _fs.GetFile(path).OpenRead()) {
|
||||
using (var reader = new StreamReader(stream)) {
|
||||
return reader.ReadToEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
28
src/Orchard.Azure/HttpContextWeaver.cs
Normal file
28
src/Orchard.Azure/HttpContextWeaver.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.IO;
|
||||
|
||||
namespace Orchard.Azure {
|
||||
/// <summary>
|
||||
/// THIS IS A HACK
|
||||
/// There is a bug in ASP.NET 4.0 in HttpEncoder.Current, which prevents some calls to HttpUtiliy.Decode/Encode
|
||||
/// from Application_Start, on IIS or Azure. This hack will be removed when the bug is corrected.
|
||||
/// This is fired by the assembly Microsoft.WindowsAzure.StorageClient. Should be corrected in .NET4 SP1
|
||||
/// </summary>
|
||||
public class HttpContextWeaver : IDisposable {
|
||||
private readonly HttpContext _current;
|
||||
|
||||
public HttpContextWeaver()
|
||||
{
|
||||
_current = HttpContext.Current;
|
||||
HttpContext.Current = new HttpContext(new HttpRequest(String.Empty, "http://localhost", String.Empty), new HttpResponse(new StringWriter()));
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
HttpContext.Current = _current;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure", "Orchard.Az
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Framework", "..\Orchard\Orchard.Framework.csproj", "{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Core", "..\Orchard.Web\Core\Orchard.Core.csproj", "{9916839C-39FC-4CEB-A5AF-89CA7E87119F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -31,6 +33,10 @@ Global
|
||||
{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9916839C-39FC-4CEB-A5AF-89CA7E87119F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9916839C-39FC-4CEB-A5AF-89CA7E87119F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9916839C-39FC-4CEB-A5AF-89CA7E87119F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9916839C-39FC-4CEB-A5AF-89CA7E87119F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,18 +1,3 @@
|
||||
<?xml version="1.0"?>
|
||||
<ServiceConfiguration serviceName="OrchardCloudService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">
|
||||
<Role name="Orchard.Azure.Web">
|
||||
<Instances count="1" />
|
||||
<ConfigurationSettings>
|
||||
<!-- Development Settings -->
|
||||
<Setting name="DiagnosticsConnectionString" value="UseDevelopmentStorage=true" />
|
||||
<Setting name="DataConnectionString" value="UseDevelopmentStorage=true" />
|
||||
|
||||
<!-- Cloud Settings -->
|
||||
<!--
|
||||
<Setting name="DiagnosticsConnectionString" value="DefaultEndpointsProtocol=https; AccountName=ACCOUNT; AccountKey=KEY" />
|
||||
<Setting name="DataConnectionString" value="DefaultEndpointsProtocol=https; AccountName=ACCOUNT; AccountKey=KEY" />
|
||||
-->
|
||||
|
||||
</ConfigurationSettings>
|
||||
</Role>
|
||||
</ServiceConfiguration>
|
||||
@@ -1,12 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ServiceDefinition name="OrchardCloudService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
|
||||
<WebRole name="Orchard.Azure.Web">
|
||||
<InputEndpoints>
|
||||
<InputEndpoint name="HttpIn" protocol="http" port="8080" />
|
||||
</InputEndpoints>
|
||||
<ConfigurationSettings>
|
||||
<Setting name="DiagnosticsConnectionString" />
|
||||
<Setting name="DataConnectionString" />
|
||||
</ConfigurationSettings>
|
||||
</WebRole>
|
||||
</ServiceDefinition>
|
||||
@@ -92,29 +92,424 @@
|
||||
<Compile Include="WebRole.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Core\Common\Module.txt" />
|
||||
<Content Include="Core\Common\Scripts\jquery.slugify.js" />
|
||||
<Content Include="Core\Common\Views\DisplayTemplates\Parts\Common.Body.ascx" />
|
||||
<Content Include="Core\Common\Views\DisplayTemplates\Parts\Common.Body.Manage.ascx" />
|
||||
<Content Include="Core\Common\Views\DisplayTemplates\Parts\Common.Body.ManageWrapperPost.ascx" />
|
||||
<Content Include="Core\Common\Views\DisplayTemplates\Parts\Common.Body.ManageWrapperPre.ascx" />
|
||||
<Content Include="Core\Common\Views\DisplayTemplates\Parts\Common.Body.Summary.ascx" />
|
||||
<Content Include="Core\Common\Views\EditorTemplates\Parts\Common.Body.ascx" />
|
||||
<Content Include="Core\Common\Views\EditorTemplates\Parts\Common.Container.ascx" />
|
||||
<Content Include="Core\Common\Views\EditorTemplates\Parts\Common.Owner.ascx" />
|
||||
<Content Include="Core\Common\Views\EditorTemplates\Parts\Common.Routable.ascx" />
|
||||
<Content Include="Core\Contents\Module.txt" />
|
||||
<Content Include="Core\Contents\Views\Admin\CreatableTypeList.aspx" />
|
||||
<Content Include="Core\Contents\Views\Admin\Create.aspx" />
|
||||
<Content Include="Core\Contents\Views\Admin\Edit.aspx" />
|
||||
<Content Include="Core\Contents\Views\Admin\List.aspx" />
|
||||
<Content Include="Core\Contents\Views\Admin\Types.aspx" />
|
||||
<Content Include="Core\Contents\Views\DisplayTemplates\Items\Contents.Item.ascx" />
|
||||
<Content Include="Core\Contents\Views\EditorTemplates\Items\Contents.Item.ascx" />
|
||||
<Content Include="Core\Contents\Views\Item\Display.aspx" />
|
||||
<Content Include="Core\Contents\Views\Item\Preview.aspx" />
|
||||
<Content Include="Core\Dashboard\Module.txt" />
|
||||
<Content Include="Core\Dashboard\Views\Admin\Index.ascx" />
|
||||
<Content Include="Core\Feeds\Module.txt" />
|
||||
<Content Include="Core\HomePage\Module.txt" />
|
||||
<Content Include="Core\Indexing\Module.txt" />
|
||||
<Content Include="Core\Localization\Module.txt" />
|
||||
<Content Include="Core\Navigation\Module.txt" />
|
||||
<Content Include="Core\Navigation\Views\Admin\Index.ascx" />
|
||||
<Content Include="Core\Navigation\Views\EditorTemplates\Parts\Navigation.EditMenuPart.ascx" />
|
||||
<Content Include="Core\Routable\Module.txt" />
|
||||
<Content Include="Core\Routable\Scripts\jquery.slugify.js" />
|
||||
<Content Include="Core\Routable\Views\EditorTemplates\Parts\Routable.IsRoutable.ascx" />
|
||||
<Content Include="Core\Routable\Views\Item\Display.aspx" />
|
||||
<Content Include="Core\Scheduling\Module.txt" />
|
||||
<Content Include="Core\Settings\Module.txt" />
|
||||
<Content Include="Core\Settings\Styles\admin.css" />
|
||||
<Content Include="Core\Settings\Views\Admin\Culture.ascx" />
|
||||
<Content Include="Core\Settings\Views\Admin\Index.ascx" />
|
||||
<Content Include="Core\Settings\Views\DisplayTemplates\CurrentCulture.ascx" />
|
||||
<Content Include="Core\Settings\Views\DisplayTemplates\RemovableCulture.ascx" />
|
||||
<Content Include="Core\Settings\Views\EditorTemplates\Items\Settings.Site.ascx" />
|
||||
<Content Include="Core\XmlRpc\Module.txt" />
|
||||
<Content Include="Core\XmlRpc\Views\Home\Index.aspx" />
|
||||
<Content Include="Global.asax" />
|
||||
<Content Include="Modules\Futures.Widgets\Module.txt" />
|
||||
<Content Include="Modules\Futures.Widgets\Views\Admin\Edit.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Content\Admin\images\draft.gif" />
|
||||
<Content Include="Modules\Orchard.Blogs\Content\Admin\images\offline.gif" />
|
||||
<Content Include="Modules\Orchard.Blogs\Content\Admin\images\online.gif" />
|
||||
<Content Include="Modules\Orchard.Blogs\Content\Admin\images\published.gif" />
|
||||
<Content Include="Modules\Orchard.Blogs\Content\Admin\images\scheduled.gif" />
|
||||
<Content Include="Modules\Orchard.Blogs\Module.txt" />
|
||||
<Content Include="Modules\Orchard.Blogs\Scripts\archives.js" />
|
||||
<Content Include="Modules\Orchard.Blogs\Scripts\jquery.ui.core.js" />
|
||||
<Content Include="Modules\Orchard.Blogs\Scripts\jquery.ui.datepicker.js" />
|
||||
<Content Include="Modules\Orchard.Blogs\Scripts\jquery.ui.widget.js" />
|
||||
<Content Include="Modules\Orchard.Blogs\Scripts\jquery.utils.js" />
|
||||
<Content Include="Modules\Orchard.Blogs\Scripts\ui.timepickr.js" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\admin.css" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\archives.css" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\datetime.css" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\images\ui-bg_flat_0_aaaaaa_40x100.png" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\images\ui-bg_flat_75_ffffff_40x100.png" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\images\ui-bg_glass_55_fbf9ee_1x400.png" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\images\ui-bg_glass_65_ffffff_1x400.png" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\images\ui-bg_glass_75_dadada_1x400.png" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\images\ui-bg_glass_75_e6e6e6_1x400.png" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\images\ui-bg_glass_95_fef1ec_1x400.png" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\images\ui-bg_highlight-soft_75_cccccc_1x100.png" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\images\ui-icons_222222_256x240.png" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\images\ui-icons_2e83ff_256x240.png" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\images\ui-icons_454545_256x240.png" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\images\ui-icons_888888_256x240.png" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\images\ui-icons_cd0a0a_256x240.png" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\jquery-ui-1.7.2.custom.css" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\ui.datepicker.css" />
|
||||
<Content Include="Modules\Orchard.Blogs\Styles\ui.timepickr.css" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\Archives.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\BlogAdmin\Create.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\BlogAdmin\Edit.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\BlogAdmin\Item.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\BlogAdmin\List.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\BlogPostAdmin\Create.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\BlogPostAdmin\Edit.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\BlogPost\Item.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\BlogPost\ListByArchive.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\Blog\Item.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\Blog\List.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\DisplayTemplates\Items\Blogs.Blog.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\DisplayTemplates\Items\Blogs.Blog.DetailAdmin.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\DisplayTemplates\Items\Blogs.Blog.SummaryAdmin.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\DisplayTemplates\Items\Blogs.BlogPost.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\DisplayTemplates\Items\Blogs.BlogPost.Summary.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\DisplayTemplates\Items\Blogs.BlogPost.SummaryAdmin.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\DisplayTemplates\Parts\Blogs.Blog.Description.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\DisplayTemplates\Parts\Blogs.Blog.Manage.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\DisplayTemplates\Parts\Blogs.Blog.Metadata.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\DisplayTemplates\Parts\Blogs.BlogPost.List.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\DisplayTemplates\Parts\Blogs.BlogPost.Metadata.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\DisplayTemplates\Parts\Blogs.BlogPost.Metadata.Summary.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\DisplayTemplates\Parts\Blogs.BlogPost.Metadata.SummaryAdmin.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\EditorTemplates\Items\Blogs.Blog.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\EditorTemplates\Items\Blogs.BlogPost.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\EditorTemplates\Parts\Blogs.Blog.Fields.ascx" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\EditorTemplates\Parts\Blogs.BlogPost.Publish.ascx" />
|
||||
<Content Include="Modules\Orchard.Comments\Module.txt" />
|
||||
<Content Include="Modules\Orchard.Comments\Views\Admin\Details.aspx" />
|
||||
<Content Include="Modules\Orchard.Comments\Views\Admin\Edit.aspx" />
|
||||
<Content Include="Modules\Orchard.Comments\Views\Admin\Index.aspx" />
|
||||
<Content Include="Modules\Orchard.Comments\Views\DisplayTemplates\Parts\Comments.Count.ascx" />
|
||||
<Content Include="Modules\Orchard.Comments\Views\DisplayTemplates\Parts\Comments.CountAdmin.ascx" />
|
||||
<Content Include="Modules\Orchard.Comments\Views\DisplayTemplates\Parts\Comments.HasComments.ascx" />
|
||||
<Content Include="Modules\Orchard.Comments\Views\EditorTemplates\Parts\Comments.HasComments.ascx" />
|
||||
<Content Include="Modules\Orchard.Comments\Views\EditorTemplates\Parts\Comments.SiteSettings.ascx" />
|
||||
<Content Include="Modules\Orchard.Comments\Views\ListOfComments.ascx" />
|
||||
<Content Include="Modules\Orchard.DevTools\Module.txt" />
|
||||
<Content Include="Modules\Orchard.DevTools\Views\Content\Details.aspx" />
|
||||
<Content Include="Modules\Orchard.DevTools\Views\Content\Index.aspx" />
|
||||
<Content Include="Modules\Orchard.DevTools\Views\DisplayTemplates\Parts\DevTools.ShowDebugLink.ascx" />
|
||||
<Content Include="Modules\Orchard.DevTools\Views\EditorTemplates\Parts\DevTools.ShowDebugLink.ascx" />
|
||||
<Content Include="Modules\Orchard.DevTools\Views\Home\Index.aspx" />
|
||||
<Content Include="Modules\Orchard.DevTools\Views\Home\Simple.aspx" />
|
||||
<Content Include="Modules\Orchard.DevTools\Views\Home\_RenderableAction.ascx" />
|
||||
<Content Include="Modules\Orchard.DevTools\Views\Metadata\Index.aspx" />
|
||||
<Content Include="Modules\Orchard.Media\Content\Admin\images\folder.gif" />
|
||||
<Content Include="Modules\Orchard.Media\Content\Site.css" />
|
||||
<Content Include="Modules\Orchard.Media\Module.txt" />
|
||||
<Content Include="Modules\Orchard.Media\Styles\admin.css" />
|
||||
<Content Include="Modules\Orchard.Media\Views\Admin\Add.aspx" />
|
||||
<Content Include="Modules\Orchard.Media\Views\Admin\Create.aspx" />
|
||||
<Content Include="Modules\Orchard.Media\Views\Admin\Edit.aspx" />
|
||||
<Content Include="Modules\Orchard.Media\Views\Admin\EditMedia.aspx" />
|
||||
<Content Include="Modules\Orchard.Media\Views\Admin\EditProperties.aspx" />
|
||||
<Content Include="Modules\Orchard.Media\Views\Admin\Index.aspx" />
|
||||
<Content Include="Modules\Orchard.Media\Views\EditorTemplates\Parts\Media.SiteSettings.ascx" />
|
||||
<Content Include="Modules\Orchard.MetaData\Module.txt" />
|
||||
<Content Include="Modules\Orchard.MetaData\Styles\ContentTypes.css" />
|
||||
<Content Include="Modules\Orchard.MetaData\Views\Admin\ContentTypeList.ascx" />
|
||||
<Content Include="Modules\Orchard.Modules\Content\Admin\images\disabled.gif" />
|
||||
<Content Include="Modules\Orchard.Modules\Content\Admin\images\enabled.gif" />
|
||||
<Content Include="Modules\Orchard.Modules\Module.txt" />
|
||||
<Content Include="Modules\Orchard.Modules\scripts\jquery.switchable.js" />
|
||||
<Content Include="Modules\Orchard.Modules\styles\admin.css" />
|
||||
<Content Include="Modules\Orchard.Modules\styles\images\detail-view-on.gif" />
|
||||
<Content Include="Modules\Orchard.Modules\styles\images\detail-view.gif" />
|
||||
<Content Include="Modules\Orchard.Modules\styles\images\summary-view-on.gif" />
|
||||
<Content Include="Modules\Orchard.Modules\styles\images\summary-view.gif" />
|
||||
<Content Include="Modules\Orchard.Modules\styles\jquery.switchable.css" />
|
||||
<Content Include="Modules\Orchard.Modules\Views\Admin\Add.ascx" />
|
||||
<Content Include="Modules\Orchard.Modules\Views\Admin\Features.ascx" />
|
||||
<Content Include="Modules\Orchard.Modules\Views\Admin\Index.ascx" />
|
||||
<Content Include="Modules\Orchard.MultiTenancy\Content\Admin\images\disabled.gif" />
|
||||
<Content Include="Modules\Orchard.MultiTenancy\Content\Admin\images\enabled.gif" />
|
||||
<Content Include="Modules\Orchard.MultiTenancy\Module.txt" />
|
||||
<Content Include="Modules\Orchard.MultiTenancy\Views\Admin\Add.ascx" />
|
||||
<Content Include="Modules\Orchard.MultiTenancy\Views\Admin\DisplayTemplates\ActionsForDisabled.ascx" />
|
||||
<Content Include="Modules\Orchard.MultiTenancy\Views\Admin\DisplayTemplates\ActionsForInvalid.ascx" />
|
||||
<Content Include="Modules\Orchard.MultiTenancy\Views\Admin\DisplayTemplates\ActionsForRunning.ascx" />
|
||||
<Content Include="Modules\Orchard.MultiTenancy\Views\Admin\DisplayTemplates\ActionsForUninitialized.ascx" />
|
||||
<Content Include="Modules\Orchard.MultiTenancy\Views\Admin\Edit.ascx" />
|
||||
<Content Include="Modules\Orchard.MultiTenancy\Views\Admin\Index.ascx" />
|
||||
<Content Include="Modules\Orchard.Pages\Content\Admin\images\draft.gif" />
|
||||
<Content Include="Modules\Orchard.Pages\Content\Admin\images\offline.gif" />
|
||||
<Content Include="Modules\Orchard.Pages\Content\Admin\images\online.gif" />
|
||||
<Content Include="Modules\Orchard.Pages\Content\Admin\images\published.gif" />
|
||||
<Content Include="Modules\Orchard.Pages\Content\Admin\images\scheduled.gif" />
|
||||
<Content Include="Modules\Orchard.Pages\Content\Site.css" />
|
||||
<Content Include="Modules\Orchard.Pages\Module.txt" />
|
||||
<Content Include="Modules\Orchard.Pages\Scripts\jquery.ui.core.js" />
|
||||
<Content Include="Modules\Orchard.Pages\Scripts\jquery.ui.datepicker.js" />
|
||||
<Content Include="Modules\Orchard.Pages\Scripts\jquery.ui.widget.js" />
|
||||
<Content Include="Modules\Orchard.Pages\Scripts\jquery.utils.js" />
|
||||
<Content Include="Modules\Orchard.Pages\Scripts\ui.timepickr.js" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\admin.css" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\datetime.css" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\images\ui-bg_flat_0_aaaaaa_40x100.png" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\images\ui-bg_flat_75_ffffff_40x100.png" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\images\ui-bg_glass_55_fbf9ee_1x400.png" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\images\ui-bg_glass_65_ffffff_1x400.png" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\images\ui-bg_glass_75_dadada_1x400.png" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\images\ui-bg_glass_75_e6e6e6_1x400.png" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\images\ui-bg_glass_95_fef1ec_1x400.png" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\images\ui-bg_highlight-soft_75_cccccc_1x100.png" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\images\ui-icons_222222_256x240.png" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\images\ui-icons_2e83ff_256x240.png" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\images\ui-icons_454545_256x240.png" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\images\ui-icons_888888_256x240.png" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\images\ui-icons_cd0a0a_256x240.png" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\jquery-ui-1.7.2.custom.css" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\ui.datepicker.css" />
|
||||
<Content Include="Modules\Orchard.Pages\Styles\ui.timepickr.css" />
|
||||
<Content Include="Modules\Orchard.Pages\Views\Admin\Create.ascx" />
|
||||
<Content Include="Modules\Orchard.Pages\Views\Admin\Edit.ascx" />
|
||||
<Content Include="Modules\Orchard.Pages\Views\Admin\List.aspx" />
|
||||
<Content Include="Modules\Orchard.Pages\Views\DisplayTemplates\Items\Pages.Page.ascx" />
|
||||
<Content Include="Modules\Orchard.Pages\Views\DisplayTemplates\Items\Pages.Page.Summary.ascx" />
|
||||
<Content Include="Modules\Orchard.Pages\Views\DisplayTemplates\Parts\Pages.Page.Metadata.ascx" />
|
||||
<Content Include="Modules\Orchard.Pages\Views\EditorTemplates\Items\Pages.Page.ascx" />
|
||||
<Content Include="Modules\Orchard.Pages\Views\EditorTemplates\Parts\Pages.Page.Publish.ascx" />
|
||||
<Content Include="Modules\Orchard.Pages\Views\Page\Item.ascx" />
|
||||
<Content Include="Modules\Orchard.Roles\Content\Site.css" />
|
||||
<Content Include="Modules\Orchard.Roles\Module.txt" />
|
||||
<Content Include="Modules\Orchard.Roles\Views\Admin\Create.aspx" />
|
||||
<Content Include="Modules\Orchard.Roles\Views\Admin\Edit.aspx" />
|
||||
<Content Include="Modules\Orchard.Roles\Views\Admin\Index.aspx" />
|
||||
<Content Include="Modules\Orchard.Roles\Views\EditorTemplates\Parts\Roles.UserRoles.ascx" />
|
||||
<Content Include="Modules\Orchard.Sandbox\Module.txt" />
|
||||
<Content Include="Modules\Orchard.Sandbox\Views\DisplayTemplates\Items\Sandbox.Page.ascx" />
|
||||
<Content Include="Modules\Orchard.Sandbox\Views\DisplayTemplates\Items\Sandbox.Page.Summary.ascx" />
|
||||
<Content Include="Modules\Orchard.Sandbox\Views\DisplayTemplates\Parts\Sandbox.Page.Title.ascx" />
|
||||
<Content Include="Modules\Orchard.Sandbox\Views\EditorTemplates\Items\Sandbox.Page.ascx" />
|
||||
<Content Include="Modules\Orchard.Sandbox\Views\EditorTemplates\Parts\Sandbox.SiteSettings.ascx" />
|
||||
<Content Include="Modules\Orchard.Sandbox\Views\Page\Create.aspx" />
|
||||
<Content Include="Modules\Orchard.Sandbox\Views\Page\Edit.aspx" />
|
||||
<Content Include="Modules\Orchard.Sandbox\Views\Page\Index.aspx" />
|
||||
<Content Include="Modules\Orchard.Sandbox\Views\Page\Show.aspx" />
|
||||
<Content Include="Modules\Orchard.Search\Module.txt" />
|
||||
<Content Include="Modules\Orchard.Search\Styles\admin.css" />
|
||||
<Content Include="Modules\Orchard.Search\Styles\search.css" />
|
||||
<Content Include="Modules\Orchard.Search\Views\Admin\Index.ascx" />
|
||||
<Content Include="Modules\Orchard.Search\Views\SearchForm.ascx" />
|
||||
<Content Include="Modules\Orchard.Search\Views\Search\Index.ascx" />
|
||||
<Content Include="Modules\Orchard.Setup\Module.txt" />
|
||||
<Content Include="Modules\Orchard.Setup\Views\Setup\Index.ascx" />
|
||||
<Content Include="Modules\Orchard.Tags\Module.txt" />
|
||||
<Content Include="Modules\Orchard.Tags\Views\Admin\Create.aspx" />
|
||||
<Content Include="Modules\Orchard.Tags\Views\Admin\Edit.aspx" />
|
||||
<Content Include="Modules\Orchard.Tags\Views\Admin\Index.aspx" />
|
||||
<Content Include="Modules\Orchard.Tags\Views\Admin\Search.aspx" />
|
||||
<Content Include="Modules\Orchard.Tags\Views\DisplayTemplates\Parts\Tags.ShowTags.ascx" />
|
||||
<Content Include="Modules\Orchard.Tags\Views\EditorTemplates\Parts\Tags.EditTags.ascx" />
|
||||
<Content Include="Modules\Orchard.Tags\Views\Home\Index.ascx" />
|
||||
<Content Include="Modules\Orchard.Tags\Views\Home\Search.ascx" />
|
||||
<Content Include="Modules\Orchard.Themes\Content\orchard.ico" />
|
||||
<Content Include="Modules\Orchard.Themes\Module.txt" />
|
||||
<Content Include="Modules\Orchard.Themes\Scripts\base.js" />
|
||||
<Content Include="Modules\Orchard.Themes\Scripts\jquery-1.4.2.js" />
|
||||
<Content Include="Modules\Orchard.Themes\Scripts\jquery-1.4.2.min.js" />
|
||||
<Content Include="Modules\Orchard.Themes\Styles\admin.css" />
|
||||
<Content Include="Modules\Orchard.Themes\Styles\Images\toolBarActiveButtonBackground.gif" />
|
||||
<Content Include="Modules\Orchard.Themes\Styles\Images\toolBarBackground.gif" />
|
||||
<Content Include="Modules\Orchard.Themes\Styles\Images\toolBarHoverButtonBackground.gif" />
|
||||
<Content Include="Modules\Orchard.Themes\Styles\special.css" />
|
||||
<Content Include="Modules\Orchard.Themes\Views\Admin\Index.aspx" />
|
||||
<Content Include="Modules\Orchard.Themes\Views\Admin\Install.aspx" />
|
||||
<Content Include="Modules\Orchard.Themes\Views\Admin\ThemePreview.ascx" />
|
||||
<Content Include="Modules\Orchard.Themes\Views\DisplayTemplates\Items\ContentItem.ascx" />
|
||||
<Content Include="Modules\Orchard.Themes\Views\Document.aspx" />
|
||||
<Content Include="Modules\Orchard.Themes\Views\EditorTemplates\Items\ContentItem.ascx" />
|
||||
<Content Include="Modules\Orchard.Themes\Views\Header.ascx" />
|
||||
<Content Include="Modules\Orchard.Themes\Views\HeadPreload.ascx" />
|
||||
<Content Include="Modules\Orchard.Themes\Views\Layout.ascx" />
|
||||
<Content Include="Modules\Orchard.Themes\Views\Menu.ascx" />
|
||||
<Content Include="Modules\Orchard.Themes\Views\Messages.ascx" />
|
||||
<Content Include="Modules\Orchard.Themes\Views\NotFound.ascx" />
|
||||
<Content Include="Modules\Orchard.Themes\Views\User.ascx" />
|
||||
<Content Include="Modules\Orchard.Users\Module.txt" />
|
||||
<Content Include="Modules\Orchard.Users\Views\Account\AccessDenied.ascx" />
|
||||
<Content Include="Modules\Orchard.Users\Views\Account\ChangePassword.ascx" />
|
||||
<Content Include="Modules\Orchard.Users\Views\Account\ChangePasswordSuccess.ascx" />
|
||||
<Content Include="Modules\Orchard.Users\Views\Account\LogOn.ascx" />
|
||||
<Content Include="Modules\Orchard.Users\Views\Account\Register.ascx" />
|
||||
<Content Include="Modules\Orchard.Users\Views\Admin\Create.aspx" />
|
||||
<Content Include="Modules\Orchard.Users\Views\Admin\Edit.aspx" />
|
||||
<Content Include="Modules\Orchard.Users\Views\Admin\EditorTemplates\inputPasswordLarge.ascx" />
|
||||
<Content Include="Modules\Orchard.Users\Views\Admin\EditorTemplates\inputTextLarge.ascx" />
|
||||
<Content Include="Modules\Orchard.Users\Views\Admin\Index.aspx" />
|
||||
<Content Include="Modules\TinyMce\Module.txt" />
|
||||
<Content Include="Modules\TinyMce\Scripts\langs\en.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\license.txt" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\addmedia\addmedia.htm" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\addmedia\editor_plugin.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\addmedia\editor_plugin_src.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\addmedia\img\picture_add.png" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\addmedia\js\addmedia.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\addmedia\langs\en.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\addmedia\langs\en_dlg.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\autoresize\editor_plugin.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\autoresize\editor_plugin_src.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\fullscreen\editor_plugin.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\fullscreen\editor_plugin_src.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\fullscreen\fullscreen.htm" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\searchreplace\css\searchreplace.css" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\searchreplace\editor_plugin.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\searchreplace\editor_plugin_src.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\searchreplace\js\searchreplace.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\searchreplace\langs\en_dlg.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\plugins\searchreplace\searchreplace.htm" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\about.htm" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\anchor.htm" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\charmap.htm" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\color_picker.htm" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\editor_template.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\editor_template_src.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\image.htm" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\img\colorpicker.jpg" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\img\icons.gif" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\js\about.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\js\anchor.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\js\charmap.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\js\color_picker.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\js\image.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\js\link.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\js\source_editor.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\langs\en.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\langs\en_dlg.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\link.htm" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\skins\default\content.css" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\skins\default\dialog.css" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\skins\default\img\buttons.png" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\skins\default\img\items.gif" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\skins\default\img\menu_arrow.gif" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\skins\default\img\menu_check.gif" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\skins\default\img\progress.gif" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\skins\default\img\tabs.gif" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\skins\default\ui.css" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\skins\o2k7\content.css" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\skins\o2k7\dialog.css" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\skins\o2k7\img\button_bg.png" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\skins\o2k7\img\button_bg_black.png" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\skins\o2k7\img\button_bg_silver.png" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\skins\o2k7\ui.css" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\skins\o2k7\ui_black.css" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\skins\o2k7\ui_silver.css" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\advanced\source_editor.htm" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\simple\editor_template.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\simple\editor_template_src.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\simple\img\icons.gif" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\simple\langs\en.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\simple\skins\default\content.css" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\simple\skins\default\ui.css" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\simple\skins\o2k7\content.css" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\simple\skins\o2k7\img\button_bg.png" />
|
||||
<Content Include="Modules\TinyMce\Scripts\themes\simple\skins\o2k7\ui.css" />
|
||||
<Content Include="Modules\TinyMce\Scripts\tiny_mce.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\tiny_mce_popup.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\tiny_mce_src.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\utils\editable_selects.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\utils\form_utils.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\utils\mctabs.js" />
|
||||
<Content Include="Modules\TinyMce\Scripts\utils\validate.js" />
|
||||
<Content Include="Modules\TinyMce\Views\EditorTemplates\TinyMceTextEditor.ascx" />
|
||||
<Content Include="Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Config\Diagnostics.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Config\Host.config" />
|
||||
<Content Include="Config\Host.config">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Core\Orchard.Core.csproj">
|
||||
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
|
||||
<Name>Orchard.Core</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard\Orchard.Framework.csproj">
|
||||
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
||||
<Name>Orchard.Framework</Name>
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Orchard.Azure.csproj">
|
||||
<Project>{2505AA84-65A6-43D0-9C27-4F44FD576284}</Project>
|
||||
<Name>Orchard.Azure</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Content Include="Modules\Futures.Widgets\Views\Web.config" />
|
||||
<Content Include="Modules\Futures.Widgets\Web.config" />
|
||||
<Content Include="Modules\Orchard.Blogs\Views\Web.config" />
|
||||
<Content Include="Modules\Orchard.Blogs\Web.config" />
|
||||
<Content Include="Modules\Orchard.Comments\Views\Web.config" />
|
||||
<Content Include="Modules\Orchard.Comments\Web.config" />
|
||||
<Content Include="Modules\Orchard.DevTools\Views\Web.config" />
|
||||
<Content Include="Modules\Orchard.DevTools\Web.config" />
|
||||
<Content Include="Modules\Orchard.Media\Views\Web.config" />
|
||||
<Content Include="Modules\Orchard.Media\Web.config" />
|
||||
<Content Include="Modules\Orchard.MetaData\Views\Web.config" />
|
||||
<Content Include="Modules\Orchard.MetaData\Web.config" />
|
||||
<Content Include="Modules\Orchard.Modules\Views\Web.config" />
|
||||
<Content Include="Modules\Orchard.Modules\Web.config" />
|
||||
<Content Include="Modules\Orchard.MultiTenancy\Views\Web.config" />
|
||||
<Content Include="Modules\Orchard.MultiTenancy\Web.config" />
|
||||
<Content Include="Modules\Orchard.Pages\Views\Web.config" />
|
||||
<Content Include="Modules\Orchard.Pages\Web.config" />
|
||||
<Content Include="Modules\Orchard.Roles\Views\Web.config" />
|
||||
<Content Include="Modules\Orchard.Roles\Web.config" />
|
||||
<Content Include="Modules\Orchard.Sandbox\Views\Web.config" />
|
||||
<Content Include="Modules\Orchard.Sandbox\Web.config" />
|
||||
<Content Include="Modules\Orchard.Search\Views\Web.config" />
|
||||
<Content Include="Modules\Orchard.Search\Web.config" />
|
||||
<Content Include="Modules\Orchard.Setup\Views\Web.config" />
|
||||
<Content Include="Modules\Orchard.Setup\Web.config" />
|
||||
<Content Include="Modules\Orchard.Tags\Views\Web.config" />
|
||||
<Content Include="Modules\Orchard.Tags\Web.config" />
|
||||
<Content Include="Modules\Orchard.Themes\Views\Web.config" />
|
||||
<Content Include="Modules\Orchard.Themes\Web.config" />
|
||||
<Content Include="Modules\Orchard.Users\Views\Web.config" />
|
||||
<Content Include="Modules\Orchard.Users\Web.config" />
|
||||
<Content Include="Modules\TinyMce\Views\Web.config" />
|
||||
<Content Include="Modules\TinyMce\Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Core\Common\Views\Web.config" />
|
||||
<Content Include="Core\Contents\Views\Web.config" />
|
||||
<Content Include="Core\Dashboard\Views\Web.config" />
|
||||
<Content Include="Core\Navigation\Views\Web.config" />
|
||||
<Content Include="Core\Routable\Views\Web.config" />
|
||||
<Content Include="Core\Settings\Views\Web.config" />
|
||||
<Content Include="Core\Web.config" />
|
||||
<Content Include="Core\XmlRpc\Views\Web.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
||||
@@ -74,8 +74,8 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AzureHelper.cs" />
|
||||
<Compile Include="CloudBlobContainerExtensions.cs" />
|
||||
<Compile Include="HttpContextWeaver.cs" />
|
||||
<Compile Include="FileSystems\AppData\AzureAppDataFolder.cs" />
|
||||
<Compile Include="Environment\Configuration\AzureShellSettingsManager.cs" />
|
||||
<Compile Include="FileSystems\Media\AzureBlobStorageProvider.cs" />
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace Orchard.Core.Tests.Feeds.Controllers {
|
||||
|
||||
var mockContentManager = new Mock<IContentManager>();
|
||||
mockContentManager.Setup(x => x.GetItemMetadata(It.IsAny<IContent>()))
|
||||
.Returns(new ContentItemMetadata { DisplayText = "foo" });
|
||||
.Returns(new ContentItemMetadata(hello) { DisplayText = "foo" });
|
||||
|
||||
var builder = new ContainerBuilder();
|
||||
//builder.RegisterModule(new ImplicitCollectionSupportModule());
|
||||
|
||||
@@ -1,19 +1,37 @@
|
||||
using Orchard.Localization;
|
||||
using System.Linq;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.Localization;
|
||||
using Orchard.UI.Navigation;
|
||||
|
||||
namespace Orchard.Core.Contents {
|
||||
public class AdminMenu : INavigationProvider {
|
||||
private readonly IContentDefinitionManager _contentDefinitionManager;
|
||||
private readonly IContentManager _contentManager;
|
||||
|
||||
public AdminMenu(IContentDefinitionManager contentDefinitionManager, IContentManager contentManager) {
|
||||
_contentDefinitionManager = contentDefinitionManager;
|
||||
_contentManager = contentManager;
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
public string MenuName { get { return "admin"; } }
|
||||
|
||||
public void GetNavigation(NavigationBuilder builder) {
|
||||
builder.Add(T("Content"), "1",
|
||||
menu => {
|
||||
menu.Add(T("Create New Content"), "1.1", item => item.Action("Create", "Admin", new { area = "Contents" }));
|
||||
menu.Add(T("Manage Content"), "1.2", item => item.Action("List", "Admin", new { area = "Contents" }));
|
||||
});
|
||||
var contentTypeDefinitions = _contentDefinitionManager.ListTypeDefinitions().OrderBy(d => d.Name);
|
||||
|
||||
builder.Add(T("Content"), "1", menu => {
|
||||
menu.Add(T("Manage Content"), "1.2", item => item.Action("List", "Admin", new {area = "Contents"}));
|
||||
//foreach (var contentTypeDefinition in contentTypeDefinitions) {
|
||||
// var ci = _contentManager.New(contentTypeDefinition.Name);
|
||||
// var cim = _contentManager.GetItemMetadata(ci);
|
||||
// var createRouteValues = cim.CreateRouteValues;
|
||||
// if (createRouteValues.Any())
|
||||
// menu.Add(T("Create New {0}", contentTypeDefinition.DisplayName), "1.3", item => item.Action(cim.CreateRouteValues["Action"] as string, cim.CreateRouteValues["Controller"] as string, cim.CreateRouteValues));
|
||||
//}
|
||||
});
|
||||
builder.Add(T("Site Configuration"), "11",
|
||||
menu => menu.Add(T("Content Types"), "3", item => item.Action("Types", "Admin", new { area = "Contents" })));
|
||||
menu => menu.Add(T("Content Types"), "3", item => item.Action("Index", "Admin", new { area = "Contents" })));
|
||||
}
|
||||
}
|
||||
}
|
||||
10
src/Orchard.Web/Core/Contents/ContentTypeDefinitionStub.cs
Normal file
10
src/Orchard.Web/Core/Contents/ContentTypeDefinitionStub.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Orchard.Core.Contents {
|
||||
public class ContentTypeDefinitionStub {
|
||||
[StringLength(128)]
|
||||
public string Name { get; set; }
|
||||
[Required, StringLength(1024)]
|
||||
public string DisplayName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.ContentManagement.Records;
|
||||
using Orchard.Core.Contents.Services;
|
||||
using Orchard.Core.Contents.ViewModels;
|
||||
using Orchard.Data;
|
||||
using Orchard.Localization;
|
||||
@@ -16,37 +16,72 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
[ValidateInput(false)]
|
||||
public class AdminController : Controller, IUpdateModel {
|
||||
private readonly INotifier _notifier;
|
||||
private readonly IContentDefinitionManager _contentDefinitionManager;
|
||||
private readonly IContentDefinitionService _contentDefinitionService;
|
||||
private readonly IContentManager _contentManager;
|
||||
private readonly ITransactionManager _transactionManager;
|
||||
|
||||
public AdminController(
|
||||
IOrchardServices orchardServices,
|
||||
INotifier notifier,
|
||||
IContentDefinitionManager contentDefinitionManager,
|
||||
IContentDefinitionService contentDefinitionService,
|
||||
IContentManager contentManager,
|
||||
ITransactionManager transactionManager) {
|
||||
Services = orchardServices;
|
||||
_notifier = notifier;
|
||||
_contentDefinitionManager = contentDefinitionManager;
|
||||
_contentDefinitionService = contentDefinitionService;
|
||||
_contentManager = contentManager;
|
||||
_transactionManager = transactionManager;
|
||||
T = NullLocalizer.Instance;
|
||||
Logger = NullLogger.Instance;
|
||||
}
|
||||
|
||||
public IOrchardServices Services { get; private set; }
|
||||
public Localizer T { get; set; }
|
||||
public ILogger Logger { get; set; }
|
||||
|
||||
#region Types
|
||||
|
||||
public ActionResult Index() {
|
||||
return Types();
|
||||
}
|
||||
|
||||
public ActionResult Types() {
|
||||
return View("Types", new ContentTypeListViewModel {
|
||||
Types = _contentDefinitionManager.ListTypeDefinitions()
|
||||
return View("Types", new ListContentTypesViewModel {
|
||||
Types = _contentDefinitionService.GetTypeDefinitions()
|
||||
});
|
||||
}
|
||||
|
||||
public ActionResult List(ListContentViewModel model) {
|
||||
public ActionResult CreateType(CreateTypeViewModel viewModel) {
|
||||
if (!Services.Authorizer.Authorize(Permissions.CreateContentType, T("Not allowed to create a content type.")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
return View(viewModel);
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("CreateType")]
|
||||
public ActionResult CreateTypePOST(CreateTypeViewModel viewModel) {
|
||||
if (!Services.Authorizer.Authorize(Permissions.CreateContentType, T("Not allowed to create a content type.")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
var model = new ContentTypeDefinitionStub();
|
||||
TryUpdateModel(model);
|
||||
|
||||
if (!ModelState.IsValid) {
|
||||
Services.TransactionManager.Cancel();
|
||||
return View(viewModel);
|
||||
}
|
||||
|
||||
_contentDefinitionService.AddTypeDefinition(model);
|
||||
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Content
|
||||
#endregion
|
||||
|
||||
public ActionResult List(ListContentsViewModel model) {
|
||||
const int pageSize = 20;
|
||||
var skip = (Math.Max(model.Page ?? 0, 1) - 1) * pageSize;
|
||||
|
||||
@@ -63,8 +98,8 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
return View("List", model);
|
||||
}
|
||||
|
||||
private ListContentViewModel.Entry BuildEntry(ContentItem contentItem) {
|
||||
var entry = new ListContentViewModel.Entry {
|
||||
private ListContentsViewModel.Entry BuildEntry(ContentItem contentItem) {
|
||||
var entry = new ListContentsViewModel.Entry {
|
||||
ContentItem = contentItem,
|
||||
ContentItemMetadata = _contentManager.GetItemMetadata(contentItem),
|
||||
ViewModel = _contentManager.BuildDisplayModel(contentItem, "List"),
|
||||
@@ -84,8 +119,8 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
}
|
||||
|
||||
ActionResult CreatableTypeList() {
|
||||
var model = new ContentTypeListViewModel {
|
||||
Types = _contentDefinitionManager.ListTypeDefinitions()
|
||||
var model = new ListContentTypesViewModel {
|
||||
Types = _contentDefinitionService.GetTypeDefinitions()
|
||||
};
|
||||
|
||||
return View("CreatableTypeList", model);
|
||||
@@ -107,6 +142,7 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Create(CreateItemViewModel model) {
|
||||
//todo: need to integrate permissions into generic content management
|
||||
var contentItem = _contentManager.New(model.Id);
|
||||
model.Content = _contentManager.UpdateEditorModel(contentItem, this);
|
||||
if (ModelState.IsValid) {
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Routing;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
|
||||
namespace Orchard.Core.Contents.Handlers {
|
||||
public class ContentsModuleHandler : ContentHandlerBase {
|
||||
public override void GetContentItemMetadata(GetContentItemMetadataContext context) {
|
||||
if (context.Metadata.CreateRouteValues == null) {
|
||||
context.Metadata.CreateRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Contents"},
|
||||
{"Controller", "Item"},
|
||||
{"Action", "Create"}
|
||||
};
|
||||
}
|
||||
if (context.Metadata.EditorRouteValues == null) {
|
||||
context.Metadata.EditorRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Contents"},
|
||||
|
||||
27
src/Orchard.Web/Core/Contents/Permissions.cs
Normal file
27
src/Orchard.Web/Core/Contents/Permissions.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.Security.Permissions;
|
||||
|
||||
namespace Orchard.Core.Contents {
|
||||
public class Permissions : IPermissionProvider {
|
||||
public static readonly Permission CreateContentType = new Permission { Name = "CreateContentType", Description = "Create custom content type." };
|
||||
|
||||
public string ModuleName {
|
||||
get { return "Contents"; }
|
||||
}
|
||||
|
||||
public IEnumerable<Permission> GetPermissions() {
|
||||
return new Permission[] {
|
||||
CreateContentType,
|
||||
};
|
||||
}
|
||||
|
||||
public IEnumerable<PermissionStereotype> GetDefaultStereotypes() {
|
||||
return new[] {
|
||||
new PermissionStereotype {
|
||||
Name = "Administrator",
|
||||
Permissions = new[] {CreateContentType}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.ContentManagement.MetaData.Models;
|
||||
using Orchard.Localization;
|
||||
using Orchard.UI.Notify;
|
||||
|
||||
namespace Orchard.Core.Contents.Services {
|
||||
public class ContentDefinitionService : IContentDefinitionService {
|
||||
private readonly IContentDefinitionManager _contentDefinitionManager;
|
||||
|
||||
public ContentDefinitionService(IOrchardServices services, IContentDefinitionManager contentDefinitionManager) {
|
||||
Services = services;
|
||||
_contentDefinitionManager = contentDefinitionManager;
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
public IOrchardServices Services { get; set; }
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public IEnumerable<ContentTypeDefinition> GetTypeDefinitions() {
|
||||
return _contentDefinitionManager.ListTypeDefinitions();
|
||||
}
|
||||
|
||||
public ContentTypeDefinition GetTypeDefinition(string name) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void AddTypeDefinition(ContentTypeDefinitionStub definitionStub) {
|
||||
if (string.IsNullOrWhiteSpace(definitionStub.Name))
|
||||
definitionStub.Name = GenerateTypeName(definitionStub.DisplayName);
|
||||
|
||||
while (_contentDefinitionManager.GetTypeDefinition(definitionStub.Name) != null)
|
||||
definitionStub.Name = VersionTypeName(definitionStub.Name);
|
||||
|
||||
//just giving the new type some default parts for now
|
||||
_contentDefinitionManager.AlterTypeDefinition(
|
||||
definitionStub.Name,
|
||||
cfg => cfg.Named(definitionStub.Name, definitionStub.DisplayName)
|
||||
.WithPart("CommonAspect")
|
||||
//.WithPart("RoutableAspect") //need to go the new routable route
|
||||
.WithPart("BodyAspect"));
|
||||
|
||||
Services.Notifier.Information(T("Created content type: {0}", definitionStub.DisplayName));
|
||||
}
|
||||
|
||||
public void RemoveTypeDefinition(string name) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//gratuitously stolen from the RoutableService
|
||||
private static string GenerateTypeName(string displayName) {
|
||||
if (string.IsNullOrWhiteSpace(displayName))
|
||||
return "";
|
||||
|
||||
var name = displayName;
|
||||
//todo: might need to be made more restrictive depending on how name is used (like as an XML node name, for instance)
|
||||
var dissallowed = new Regex(@"[/:?#\[\]@!$&'()*+,;=\s]+");
|
||||
|
||||
name = dissallowed.Replace(name, "-");
|
||||
name = name.Trim('-');
|
||||
|
||||
if (name.Length > 128)
|
||||
name = name.Substring(0, 128);
|
||||
|
||||
return name.ToLowerInvariant();
|
||||
}
|
||||
|
||||
private static string VersionTypeName(string name) {
|
||||
var version = 2;
|
||||
var nameParts = name.Split(new[] { '-' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if (nameParts.Length > 1 && int.TryParse(nameParts.Last(), out version)) {
|
||||
version = version > 0 ? ++version : 2;
|
||||
//this could unintentionally chomp something that looks like a version
|
||||
name = string.Join("-", nameParts.Take(nameParts.Length - 1));
|
||||
}
|
||||
|
||||
return string.Format("{0}-{1}", name, version);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.ContentManagement.MetaData.Models;
|
||||
|
||||
namespace Orchard.Core.Contents.Services {
|
||||
public interface IContentDefinitionService : IDependency {
|
||||
IEnumerable<ContentTypeDefinition> GetTypeDefinitions();
|
||||
ContentTypeDefinition GetTypeDefinition(string name);
|
||||
void AddTypeDefinition(ContentTypeDefinitionStub contentTypeDefinition);
|
||||
void RemoveTypeDefinition(string name);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
using Orchard.Mvc.ViewModels;
|
||||
|
||||
namespace Orchard.Core.Contents.ViewModels {
|
||||
public class CreateTypeViewModel : BaseViewModel {
|
||||
public string DisplayName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using Orchard.ContentManagement.MetaData.Models;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
|
||||
namespace Orchard.Core.Contents.ViewModels {
|
||||
public class ContentTypeListViewModel : BaseViewModel {
|
||||
public class ListContentTypesViewModel : BaseViewModel {
|
||||
public IEnumerable<ContentTypeDefinition> Types { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using Orchard.ContentManagement;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
|
||||
namespace Orchard.Core.Contents.ViewModels {
|
||||
public class ListContentViewModel : BaseViewModel {
|
||||
public class ListContentsViewModel : BaseViewModel {
|
||||
public string Id { get; set; }
|
||||
public int? Page { get; set; }
|
||||
public IList<Entry> Entries { get; set; }
|
||||
@@ -1,5 +1,4 @@
|
||||
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<ContentTypeListViewModel>" %>
|
||||
|
||||
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<ListContentTypesViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Core.Contents.ViewModels" %>
|
||||
<% Html.AddTitleParts(T("Create Content").ToString()); %>
|
||||
<p>
|
||||
|
||||
13
src/Orchard.Web/Core/Contents/Views/Admin/CreateType.ascx
Normal file
13
src/Orchard.Web/Core/Contents/Views/Admin/CreateType.ascx
Normal file
@@ -0,0 +1,13 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<CreateTypeViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Core.Contents.ViewModels" %>
|
||||
<h1><%:Html.TitleForPage(T("New Content Type").ToString())%></h1><%
|
||||
using (Html.BeginFormAntiForgeryPost()) { %>
|
||||
<%:Html.ValidationSummary() %>
|
||||
<fieldset>
|
||||
<label for="DisplayName"><%:T("Display Name") %></label>
|
||||
<%:Html.TextBoxFor(m => m.DisplayName, new {@class = "textMedium", autofocus = "autofocus"}) %>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<button class="primaryAction" type="submit"><%:T("Create") %></button>
|
||||
</fieldset><%
|
||||
} %>
|
||||
@@ -1,5 +1,4 @@
|
||||
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<ListContentViewModel>" %>
|
||||
|
||||
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<ListContentsViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Core.Contents.ViewModels" %>
|
||||
<% Html.AddTitleParts(T("Browse Contents").ToString()); %>
|
||||
<p>
|
||||
|
||||
9
src/Orchard.Web/Core/Contents/Views/Admin/Types.ascx
Normal file
9
src/Orchard.Web/Core/Contents/Views/Admin/Types.ascx
Normal file
@@ -0,0 +1,9 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ListContentTypesViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Core.Contents.ViewModels" %>
|
||||
<h1><%:Html.TitleForPage(T("Content Types").ToString())%></h1>
|
||||
<div class="manage"><%: Html.ActionLink(T("Create new type").ToString(), "CreateType", null, new { @class = "button primaryAction" })%></div>
|
||||
<%=Html.UnorderedList(
|
||||
Model.Types,
|
||||
(t,i) => Html.DisplayFor(m => t).ToHtmlString(),
|
||||
"contentItems"
|
||||
) %>
|
||||
@@ -1,24 +0,0 @@
|
||||
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<ContentTypeListViewModel>" %>
|
||||
|
||||
<%@ Import Namespace="Orchard.Core.Contents.ViewModels" %>
|
||||
<% Html.AddTitleParts(T("Create Content").ToString()); %>
|
||||
<p>
|
||||
Create content</p>
|
||||
<table>
|
||||
<% foreach (var t in Model.Types) {%>
|
||||
<tr>
|
||||
<td>
|
||||
<%:t.Name %>
|
||||
</td>
|
||||
<td>
|
||||
<%:Html.ActionLink(T("List Items").ToString(), "List", "Admin", new RouteValueDictionary{{"Area","Contents"},{"Id",t.Name}}, new Dictionary<string, object>()) %>
|
||||
</td>
|
||||
<td>
|
||||
<%:Html.ActionLink(T("Create Item").ToString(), "Create", "Admin", new RouteValueDictionary{{"Area","Contents"},{"Id",t.Name}}, new Dictionary<string, object>()) %>
|
||||
</td>
|
||||
<td>
|
||||
<%:Html.ActionLink(T("Edit Type").ToString(), "ContentTypeList", "Admin", new RouteValueDictionary{{"Area","Orchard.MetaData"},{"Id",t.Name}}, new Dictionary<string, object>()) %>
|
||||
</td>
|
||||
</tr>
|
||||
<%} %>
|
||||
</table>
|
||||
@@ -0,0 +1,14 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.ContentManagement.MetaData.Models.ContentTypeDefinition>" %>
|
||||
<div class="summary">
|
||||
<div class="properties">
|
||||
<h3><%:Model.DisplayName%></h3>
|
||||
<p><%:Model.Name %> - <%:Html.ActionLink("[new content]", "Create", new {area = "Contents", id = Model.Name}) %></p>
|
||||
</div>
|
||||
<div class="related">
|
||||
<%:Html.ActionLink(T("List Items").ToString(), "List", new {area = "Contents", id = Model.Name})%><%:T(" | ")%>
|
||||
<%:Html.ActionLink(T("[Edit]").ToString(), "EditType", new {area = "Contents", id = Model.Name})%><%:T(" | ") %>
|
||||
<% using (Html.BeginFormAntiForgeryPost(Url.Action("RemoveType", new {area = "Contents", id = Model.Name}), FormMethod.Post, new { @class = "inline link" })) { %>
|
||||
<button type="submit" class="linkButton" title="<%:T("Delete") %>"><%:T("[Delete]")%></button><%
|
||||
} %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -76,8 +76,15 @@
|
||||
<Compile Include="Common\ViewModels\ContainerEditorViewModel.cs" />
|
||||
<Compile Include="Common\ViewModels\TextContentFieldDisplayViewModel.cs" />
|
||||
<Compile Include="Common\ViewModels\TextContentFieldEditorViewModel.cs" />
|
||||
<Compile Include="Contents\ContentTypeDefinitionStub.cs" />
|
||||
<Compile Include="Contents\Controllers\ItemController.cs" />
|
||||
<Compile Include="Contents\Handlers\ContentsModuleHandler.cs" />
|
||||
<Compile Include="Contents\Permissions.cs" />
|
||||
<Compile Include="Contents\Services\ContentDefinitionService.cs" />
|
||||
<Compile Include="Contents\Services\IContentDefinitionService.cs" />
|
||||
<Compile Include="Contents\ViewModels\CreateTypeViewModel.cs" />
|
||||
<Compile Include="Contents\ViewModels\ListContentsViewModel.cs" />
|
||||
<Compile Include="Contents\ViewModels\ListContentTypesViewModel.cs" />
|
||||
<Compile Include="Localization\Drivers\LocalizedDriver.cs" />
|
||||
<Compile Include="Routable\Controllers\ItemController.cs" />
|
||||
<Compile Include="Routable\Drivers\RoutableDriver.cs" />
|
||||
@@ -105,9 +112,7 @@
|
||||
<Compile Include="Contents\AdminMenu.cs" />
|
||||
<Compile Include="Contents\Controllers\AdminController.cs" />
|
||||
<Compile Include="Contents\ViewModels\CreateItemViewModel.cs" />
|
||||
<Compile Include="Contents\ViewModels\ContentTypeListViewModel.cs" />
|
||||
<Compile Include="Contents\ViewModels\EditItemViewModel.cs" />
|
||||
<Compile Include="Contents\ViewModels\ListContentViewModel.cs" />
|
||||
<Compile Include="Dashboard\AdminMenu.cs" />
|
||||
<Compile Include="Dashboard\Controllers\AdminController.cs" />
|
||||
<Compile Include="Dashboard\Routes.cs" />
|
||||
@@ -216,11 +221,13 @@
|
||||
<Content Include="Common\Views\EditorTemplates\Parts\Common.Container.ascx" />
|
||||
<Content Include="Common\Views\EditorTemplates\Parts\Common.TextContentField.ascx" />
|
||||
<Content Include="Contents\Module.txt" />
|
||||
<Content Include="Contents\Views\Admin\Types.aspx" />
|
||||
<Content Include="Contents\Views\Admin\CreateType.ascx" />
|
||||
<Content Include="Contents\Views\Admin\Types.ascx" />
|
||||
<Content Include="Contents\Views\Admin\List.aspx" />
|
||||
<Content Include="Contents\Views\Admin\Edit.aspx" />
|
||||
<Content Include="Contents\Views\Admin\CreatableTypeList.aspx" />
|
||||
<Content Include="Contents\Views\Admin\Create.aspx" />
|
||||
<Content Include="Contents\Views\DisplayTemplates\ContentTypeDefinition.ascx" />
|
||||
<Content Include="Contents\Views\DisplayTemplates\Items\Contents.Item.ascx" />
|
||||
<Content Include="Contents\Views\EditorTemplates\Items\Contents.Item.ascx" />
|
||||
<Content Include="Contents\Views\Item\Preview.aspx" />
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Orchard.Core.Settings.Metadata {
|
||||
private ContentTypeDefinitionRecord Acquire(ContentTypeDefinition contentTypeDefinition) {
|
||||
var result = _typeDefinitionRepository.Fetch(x => x.Name == contentTypeDefinition.Name).SingleOrDefault();
|
||||
if (result == null) {
|
||||
result = new ContentTypeDefinitionRecord { Name = contentTypeDefinition.Name };
|
||||
result = new ContentTypeDefinitionRecord { Name = contentTypeDefinition.Name, DisplayName = contentTypeDefinition.DisplayName};
|
||||
_typeDefinitionRepository.Create(result);
|
||||
}
|
||||
return result;
|
||||
@@ -100,6 +100,7 @@ namespace Orchard.Core.Settings.Metadata {
|
||||
ContentTypeDefinition Build(ContentTypeDefinitionRecord source) {
|
||||
return new ContentTypeDefinition(
|
||||
source.Name,
|
||||
source.DisplayName,
|
||||
source.ContentTypePartDefinitionRecords.Select(Build),
|
||||
_settingsReader.Map(Parse(source.Settings)));
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace Orchard.Core.Settings.Metadata.Records {
|
||||
|
||||
public virtual int Id { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual string DisplayName { get; set; }
|
||||
public virtual bool Hidden { get; set; }
|
||||
public virtual string Settings { get; set; }
|
||||
|
||||
|
||||
@@ -40,6 +40,9 @@ namespace Orchard.Blogs.Drivers {
|
||||
}
|
||||
|
||||
public override RouteValueDictionary GetDisplayRouteValues(BlogPost post) {
|
||||
if (post.Blog == null)
|
||||
return new RouteValueDictionary();
|
||||
|
||||
return new RouteValueDictionary {
|
||||
{"Area", "Orchard.Blogs"},
|
||||
{"Controller", "BlogPost"},
|
||||
@@ -50,6 +53,9 @@ namespace Orchard.Blogs.Drivers {
|
||||
}
|
||||
|
||||
public override RouteValueDictionary GetEditorRouteValues(BlogPost post) {
|
||||
if (post.Blog == null)
|
||||
return new RouteValueDictionary();
|
||||
|
||||
return new RouteValueDictionary {
|
||||
{"Area", "Orchard.Blogs"},
|
||||
{"Controller", "BlogPostAdmin"},
|
||||
@@ -59,6 +65,18 @@ namespace Orchard.Blogs.Drivers {
|
||||
};
|
||||
}
|
||||
|
||||
public override RouteValueDictionary GetCreateRouteValues(BlogPost post) {
|
||||
if (post.Blog == null)
|
||||
return new RouteValueDictionary();
|
||||
|
||||
return new RouteValueDictionary {
|
||||
{"Area", "Orchard.Blogs"},
|
||||
{"Controller", "BlogPostAdmin"},
|
||||
{"Action", "Create"},
|
||||
{"blogSlug", post.Blog.Slug},
|
||||
};
|
||||
}
|
||||
|
||||
protected override DriverResult Display(BlogPost post, string displayType) {
|
||||
return Combined(
|
||||
ContentItemTemplate("Items/Blogs.BlogPost").LongestMatch(displayType, "Summary", "SummaryAdmin"),
|
||||
|
||||
@@ -10,9 +10,9 @@ namespace Orchard.MetaData {
|
||||
|
||||
public void GetNavigation(NavigationBuilder builder)
|
||||
{
|
||||
builder.Add(T("Content Types"), "5",
|
||||
builder.Add(T("Site Configuration"), "11",
|
||||
menu => menu
|
||||
.Add(T("Content Types"), "1.0", item => item.Action("ContentTypeList", "Admin", new { area = "Orchard.MetaData" }).Permission(Permissions.ManageMetaData))
|
||||
.Add(T("Content Types (metadata)"), "3.1", item => item.Action("ContentTypeList", "Admin", new { area = "Orchard.MetaData" }).Permission(Permissions.ManageMetaData))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
%>
|
||||
<tr class="<%=contentTypeClass %>">
|
||||
<td>
|
||||
<%= Html.ActionLink(item.Name, "ContentTypeList", new {id=item.Name})%>
|
||||
<%= Html.ActionLink(string.IsNullOrWhiteSpace(item.Name) ? "unkwn" : item.Name, "ContentTypeList", new {id=item.Name})%>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -61,6 +61,14 @@ namespace Orchard.Pages.Drivers {
|
||||
};
|
||||
}
|
||||
|
||||
public override RouteValueDictionary GetCreateRouteValues(Page page) {
|
||||
return new RouteValueDictionary {
|
||||
{"Area", "Orchard.Pages"},
|
||||
{"Controller", "Admin"},
|
||||
{"Action", "Create"},
|
||||
};
|
||||
}
|
||||
|
||||
protected override DriverResult Display(Page page, string displayType) {
|
||||
return Combined(
|
||||
ContentItemTemplate("Items/Pages.Page").LongestMatch(displayType, "Summary", "SummaryAdmin"),
|
||||
|
||||
@@ -1,24 +1,9 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Comments.Models;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Core.Navigation.Models;
|
||||
using Orchard.Core.Settings.Models;
|
||||
using Orchard.Data;
|
||||
using Orchard.Environment;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Environment.ShellBuilders;
|
||||
using Orchard.Environment.Descriptor;
|
||||
using Orchard.Environment.Descriptor.Models;
|
||||
using Orchard.FileSystems.AppData;
|
||||
using Orchard.Security;
|
||||
using Orchard.Settings;
|
||||
using Orchard.Setup.Services;
|
||||
using Orchard.Setup.ViewModels;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Themes;
|
||||
using Orchard.UI.Notify;
|
||||
|
||||
namespace Orchard.Setup.Controllers {
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.Web;
|
||||
using Orchard.Comments.Models;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.ContentManagement.MetaData.Builders;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Core.Navigation.Models;
|
||||
using Orchard.Core.Settings.Models;
|
||||
@@ -15,7 +14,6 @@ using Orchard.Environment.ShellBuilders;
|
||||
using Orchard.Environment.Descriptor;
|
||||
using Orchard.Environment.Descriptor.Models;
|
||||
using Orchard.Localization;
|
||||
using Orchard.ContentManagement.MetaData.Services;
|
||||
using Orchard.Localization.Services;
|
||||
using Orchard.Security;
|
||||
using Orchard.Settings;
|
||||
@@ -149,9 +147,9 @@ namespace Orchard.Setup.Services {
|
||||
//hackInstallationGenerator.GenerateInstallEvents();
|
||||
|
||||
var contentDefinitionManager = environment.Resolve<IContentDefinitionManager>();
|
||||
contentDefinitionManager.AlterTypeDefinition("blogpost", cfg => cfg.WithPart("HasComments").WithPart("HasTags").WithPart("Localized"));
|
||||
contentDefinitionManager.AlterTypeDefinition("page", cfg => cfg.WithPart("HasComments").WithPart("HasTags").WithPart("Localized"));
|
||||
contentDefinitionManager.AlterTypeDefinition("sandboxpage", cfg => cfg.WithPart("HasComments").WithPart("HasTags").WithPart("Localized"));
|
||||
contentDefinitionManager.AlterTypeDefinition("blogpost", cfg => cfg.Named("blogpost", "Blog Post").WithPart("HasComments").WithPart("HasTags").WithPart("Localized"));
|
||||
contentDefinitionManager.AlterTypeDefinition("page", cfg => cfg.Named("page", "Page").WithPart("HasComments").WithPart("HasTags").WithPart("Localized"));
|
||||
contentDefinitionManager.AlterTypeDefinition("sandboxpage", cfg => cfg.Named("sandboxpage", "Sandbox Page").WithPart("HasComments").WithPart("HasTags").WithPart("Localized"));
|
||||
|
||||
// create home page as a CMS page
|
||||
var page = contentManager.Create("page", VersionOptions.Draft);
|
||||
|
||||
@@ -638,9 +638,6 @@ table .button {
|
||||
overflow:hidden;
|
||||
padding:0 1.4em .8em;
|
||||
}
|
||||
.contentItems li.last {
|
||||
border-bottom:0;
|
||||
}
|
||||
#main .contentItems li .actions {
|
||||
color:#EAE9D9;
|
||||
height:auto;
|
||||
|
||||
@@ -3,11 +3,45 @@ using System.Web.Routing;
|
||||
|
||||
namespace Orchard.ContentManagement {
|
||||
public class ContentItemMetadata {
|
||||
public ContentItemMetadata(IContent item) {
|
||||
DisplayRouteValues = GetDisplayRouteValues(item);
|
||||
EditorRouteValues = GetEditorRouteValues(item);
|
||||
CreateRouteValues = GetCreateRouteValues(item);
|
||||
}
|
||||
|
||||
public string DisplayText { get; set; }
|
||||
public RouteValueDictionary DisplayRouteValues { get; set; }
|
||||
public RouteValueDictionary EditorRouteValues { get; set; }
|
||||
public RouteValueDictionary CreateRouteValues { get; set; }
|
||||
|
||||
public IEnumerable<string> DisplayGroups { get; set; }
|
||||
public IEnumerable<string> EditorGroups { get; set; }
|
||||
|
||||
private static RouteValueDictionary GetDisplayRouteValues(IContent item) {
|
||||
return new RouteValueDictionary {
|
||||
{"Area", "Contents"},
|
||||
{"Controller", "Item"},
|
||||
{"Action", "Display"},
|
||||
{"id", item.ContentItem.Id}
|
||||
};
|
||||
}
|
||||
|
||||
private static RouteValueDictionary GetEditorRouteValues(IContent item) {
|
||||
return new RouteValueDictionary {
|
||||
{"Area", "Contents"},
|
||||
{"Controller", "Admin"},
|
||||
{"Action", "Edit"},
|
||||
{"id", item.ContentItem.Id}
|
||||
};
|
||||
}
|
||||
|
||||
private static RouteValueDictionary GetCreateRouteValues(IContent item) {
|
||||
return new RouteValueDictionary {
|
||||
{"Area", "Contents"},
|
||||
{"Controller", "Admin"},
|
||||
{"Action", "Create"},
|
||||
{"id", item.ContentItem.ContentType}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -375,7 +375,7 @@ namespace Orchard.ContentManagement {
|
||||
public ContentItemMetadata GetItemMetadata(IContent content) {
|
||||
var context = new GetContentItemMetadataContext {
|
||||
ContentItem = content.ContentItem,
|
||||
Metadata = new ContentItemMetadata()
|
||||
Metadata = new ContentItemMetadata(content)
|
||||
};
|
||||
foreach (var handler in Handlers) {
|
||||
handler.GetContentItemMetadata(context);
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace Orchard.ContentManagement.Drivers {
|
||||
context.Metadata.DisplayText = GetDisplayText(item) ?? context.Metadata.DisplayText;
|
||||
context.Metadata.DisplayRouteValues = GetDisplayRouteValues(item) ?? context.Metadata.DisplayRouteValues;
|
||||
context.Metadata.EditorRouteValues = GetEditorRouteValues(item) ?? context.Metadata.EditorRouteValues;
|
||||
context.Metadata.CreateRouteValues = GetCreateRouteValues(item) ?? context.Metadata.CreateRouteValues;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +68,7 @@ namespace Orchard.ContentManagement.Drivers {
|
||||
protected virtual string GetDisplayText(TContent item) { return null; }
|
||||
public virtual RouteValueDictionary GetDisplayRouteValues(TContent item) { return null; }
|
||||
public virtual RouteValueDictionary GetEditorRouteValues(TContent item) { return null; }
|
||||
public virtual RouteValueDictionary GetCreateRouteValues(TContent item) { return null; }
|
||||
|
||||
protected virtual DriverResult Display(ContentItemViewModel<TContent> viewModel, string displayType) { return GetDefaultItemTemplate(); }
|
||||
protected virtual DriverResult Editor(ContentItemViewModel<TContent> viewModel) { return GetDefaultItemTemplate(); }
|
||||
|
||||
@@ -6,6 +6,7 @@ using Orchard.ContentManagement.MetaData.Models;
|
||||
namespace Orchard.ContentManagement.MetaData.Builders {
|
||||
public class ContentTypeDefinitionBuilder {
|
||||
private string _name;
|
||||
private string _displayName;
|
||||
private readonly IList<ContentTypeDefinition.Part> _parts;
|
||||
private readonly IDictionary<string, string> _settings;
|
||||
|
||||
@@ -20,6 +21,7 @@ namespace Orchard.ContentManagement.MetaData.Builders {
|
||||
}
|
||||
else {
|
||||
_name = existing.Name;
|
||||
_displayName = existing.DisplayName;
|
||||
_parts = existing.Parts.ToList();
|
||||
_settings = existing.Settings.ToDictionary(kv => kv.Key, kv => kv.Value);
|
||||
}
|
||||
@@ -30,11 +32,12 @@ namespace Orchard.ContentManagement.MetaData.Builders {
|
||||
}
|
||||
|
||||
public ContentTypeDefinition Build() {
|
||||
return new ContentTypeDefinition(_name, _parts, _settings);
|
||||
return new ContentTypeDefinition(_name, _displayName, _parts, _settings);
|
||||
}
|
||||
|
||||
public ContentTypeDefinitionBuilder Named(string name) {
|
||||
public ContentTypeDefinitionBuilder Named(string name, string displayName = null) {
|
||||
_name = name;
|
||||
_displayName = displayName ?? name;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,9 @@ using System.Linq;
|
||||
|
||||
namespace Orchard.ContentManagement.MetaData.Models {
|
||||
public class ContentTypeDefinition {
|
||||
public ContentTypeDefinition(string name, IEnumerable<Part> parts, IDictionary<string, string> settings) {
|
||||
public ContentTypeDefinition(string name, string displayName, IEnumerable<Part> parts, IDictionary<string, string> settings) {
|
||||
Name = name;
|
||||
DisplayName = displayName;
|
||||
Parts = parts;
|
||||
Settings = settings;
|
||||
}
|
||||
@@ -16,6 +17,7 @@ namespace Orchard.ContentManagement.MetaData.Models {
|
||||
}
|
||||
|
||||
public string Name { get; private set; }
|
||||
public string DisplayName { get; set; }
|
||||
public IEnumerable<Part> Parts { get; private set; }
|
||||
public IDictionary<string, string> Settings { get; private set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user