diff --git a/.gitignore b/.gitignore index 3e759b7..f475759 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,11 @@ +# Created by http://www.gitignore.io + +### VisualStudio ### ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# 2015 +.vs/ # User-specific files *.suo @@ -19,24 +23,25 @@ [Rr]eleases/ x64/ x86/ +#build/ bld/ [Bb]in/ [Oo]bj/ -[Ll]og/ -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ +# Cleanup project results +*.[Ff]ile[Ll]ist[Aa]bsolute.txt # Visual Studio 2017 auto generated files Generated\ Files/ +# Roslyn cache directories +*.ide/ + # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* -# NUNIT +#NUNIT *.VisualState.xml TestResult.xml @@ -145,6 +150,9 @@ nCrunchTemp_* *.mm.* AutoTest.Net/ +#GhostDoc +*.[Gg]host[Dd]oc.xml + # Web workbench (sass) .sass-cache/ @@ -167,7 +175,7 @@ publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, +# TODO: Comment the next line if you want to checkin your web deploy settings # but database connection strings (with potential passwords) will be unencrypted *.pubxml *.publishproj @@ -183,13 +191,13 @@ PublishScripts/ **/[Pp]ackages/* # except build/, which is used as an MSBuild target. !**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed +# If using the old MSBuild-Integrated Package Restore, uncomment this: #!**/[Pp]ackages/repositories.config # NuGet v3's project.json files produces more ignorable files *.nuget.props *.nuget.targets -# Microsoft Azure Build Output +# Windows Azure Build Output csx/ *.build.csdef @@ -211,7 +219,10 @@ _pkginfo.txt !*.[Cc]ache/ # Others +sql/ +*.Cache ClientBin/ +[Ss]tyle[Cc]op.* ~$* *~ *.dbmdl @@ -228,6 +239,7 @@ orleans.codegen.cs # Since there are multiple workflows, uncomment next line to ignore bower_components # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) #bower_components/ +node_modules/ # RIA/Silverlight projects Generated_Code/ @@ -316,15 +328,44 @@ __pycache__/ # OpenCover UI analysis results OpenCover/ +### Windows ### +# Windows image file caches +Thumbs.db +ehthumbs.db # Azure Stream Analytics local run output ASALocalRun/ # MSBuild Binary and Structured Log *.binlog +# Folder config file +Desktop.ini # NVidia Nsight GPU debugger configuration file *.nvuser +# Recycle Bin used on file shares +$RECYCLE.BIN/ # MFractors (Xamarin productivity tool) working folder .mfractor/ +# Azure Stream Analytics local run output +ASALocalRun/ +# Windows Installer files +*.cab +*.msi +*.msm +*.msp +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# DNN website +[Ww]ebsite/ + +# DNN Lucene.net index files +[Ww]ebsite/[Aa]pp_[Dd]ata/[Ss]earch/ + +# DNN Logs +[Ww]ebsite/[Pp]ortals/_default/[Ll]ogs/ \ No newline at end of file diff --git a/Build/DotNetNuke.MSBuild.Tasks.dll b/Build/DotNetNuke.MSBuild.Tasks.dll new file mode 100644 index 0000000..ec20a03 Binary files /dev/null and b/Build/DotNetNuke.MSBuild.Tasks.dll differ diff --git a/Build/ICSharpCode.SharpZipLib.dll b/Build/ICSharpCode.SharpZipLib.dll new file mode 100644 index 0000000..77bafe8 Binary files /dev/null and b/Build/ICSharpCode.SharpZipLib.dll differ diff --git a/Build/MSBuild.Community.Tasks.Targets b/Build/MSBuild.Community.Tasks.Targets new file mode 100644 index 0000000..284a039 --- /dev/null +++ b/Build/MSBuild.Community.Tasks.Targets @@ -0,0 +1,104 @@ + + + + + + $(MSBuildProjectDirectory)\..\..\..\..\BuildScripts + $(BuildScriptsPath)\MSBuild.Community.Tasks.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Build/MSBuild.Community.Tasks.dll b/Build/MSBuild.Community.Tasks.dll new file mode 100644 index 0000000..cf847a5 Binary files /dev/null and b/Build/MSBuild.Community.Tasks.dll differ diff --git a/Build/ModulePackage.targets b/Build/ModulePackage.targets new file mode 100644 index 0000000..28f6e98 --- /dev/null +++ b/Build/ModulePackage.targets @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Build/ModulePackageSource.targets b/Build/ModulePackageSource.targets new file mode 100644 index 0000000..aecaa66 --- /dev/null +++ b/Build/ModulePackageSource.targets @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DNN.Media.sln b/DNN.Media.sln new file mode 100644 index 0000000..65129cc --- /dev/null +++ b/DNN.Media.sln @@ -0,0 +1,127 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{70FB7EDF-2E12-405F-B9CD-8A437E96FB11}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetNuke.Media", "Modules\Media\DotNetNuke.Media.csproj", "{176CE33F-FF0C-451A-8A38-1DE475B00A78}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Files", "Build Files", "{F84D698C-3163-472D-95E9-EC36712D597B}" + ProjectSection(SolutionItems) = preProject + Build\ModulePackage.targets = Build\ModulePackage.targets + Build\ModulePackageSource.targets = Build\ModulePackageSource.targets + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration Files", "Configuration Files", "{B51AA4AF-EE33-49E1-B621-DF1BCD22A28C}" + ProjectSection(SolutionItems) = preProject + .gitignore = .gitignore + README.md = README.md + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {520F475F-9F3D-4826-BDC4-7B2C903BCE97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {520F475F-9F3D-4826-BDC4-7B2C903BCE97}.Debug|Any CPU.Build.0 = Debug|Any CPU + {520F475F-9F3D-4826-BDC4-7B2C903BCE97}.Release|Any CPU.ActiveCfg = Release|Any CPU + {520F475F-9F3D-4826-BDC4-7B2C903BCE97}.Release|Any CPU.Build.0 = Release|Any CPU + {E0C9E035-5254-4FF2-AAD3-AC632B3CB587}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E0C9E035-5254-4FF2-AAD3-AC632B3CB587}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E0C9E035-5254-4FF2-AAD3-AC632B3CB587}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E0C9E035-5254-4FF2-AAD3-AC632B3CB587}.Release|Any CPU.Build.0 = Release|Any CPU + {C9B9FC2D-2D76-4446-897C-BA9E7B68EB0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C9B9FC2D-2D76-4446-897C-BA9E7B68EB0E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C9B9FC2D-2D76-4446-897C-BA9E7B68EB0E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C9B9FC2D-2D76-4446-897C-BA9E7B68EB0E}.Release|Any CPU.Build.0 = Release|Any CPU + {58D56768-8690-41D3-B30F-4003D12264C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {58D56768-8690-41D3-B30F-4003D12264C2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {58D56768-8690-41D3-B30F-4003D12264C2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {58D56768-8690-41D3-B30F-4003D12264C2}.Release|Any CPU.Build.0 = Release|Any CPU + {7D61A32C-0F21-453F-A981-BD8E5A3A5304}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7D61A32C-0F21-453F-A981-BD8E5A3A5304}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7D61A32C-0F21-453F-A981-BD8E5A3A5304}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7D61A32C-0F21-453F-A981-BD8E5A3A5304}.Release|Any CPU.Build.0 = Release|Any CPU + {176CE33F-FF0C-451A-8A38-1DE475B00A78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {176CE33F-FF0C-451A-8A38-1DE475B00A78}.Debug|Any CPU.Build.0 = Debug|Any CPU + {176CE33F-FF0C-451A-8A38-1DE475B00A78}.Release|Any CPU.ActiveCfg = Release|Any CPU + {176CE33F-FF0C-451A-8A38-1DE475B00A78}.Release|Any CPU.Build.0 = Release|Any CPU + {77A2EDA2-22F4-41A2-91F3-F60CF77A1EB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {77A2EDA2-22F4-41A2-91F3-F60CF77A1EB0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {77A2EDA2-22F4-41A2-91F3-F60CF77A1EB0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {77A2EDA2-22F4-41A2-91F3-F60CF77A1EB0}.Release|Any CPU.Build.0 = Release|Any CPU + {6339C785-AABA-464F-8193-91B4F8A5610D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6339C785-AABA-464F-8193-91B4F8A5610D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6339C785-AABA-464F-8193-91B4F8A5610D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6339C785-AABA-464F-8193-91B4F8A5610D}.Release|Any CPU.Build.0 = Release|Any CPU + {35118921-95CD-4421-BB1A-1354DDEECEFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {35118921-95CD-4421-BB1A-1354DDEECEFB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {35118921-95CD-4421-BB1A-1354DDEECEFB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {35118921-95CD-4421-BB1A-1354DDEECEFB}.Release|Any CPU.Build.0 = Release|Any CPU + {BF44F3B0-07CB-47EE-8ED7-B501437E209D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BF44F3B0-07CB-47EE-8ED7-B501437E209D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BF44F3B0-07CB-47EE-8ED7-B501437E209D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BF44F3B0-07CB-47EE-8ED7-B501437E209D}.Release|Any CPU.Build.0 = Release|Any CPU + {304B5963-7E6B-4808-9B31-254CBFF00A0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {304B5963-7E6B-4808-9B31-254CBFF00A0D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {304B5963-7E6B-4808-9B31-254CBFF00A0D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {304B5963-7E6B-4808-9B31-254CBFF00A0D}.Release|Any CPU.Build.0 = Release|Any CPU + {7C3B6D5A-2AA5-4650-8ACC-91C5E9010A38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7C3B6D5A-2AA5-4650-8ACC-91C5E9010A38}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7C3B6D5A-2AA5-4650-8ACC-91C5E9010A38}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7C3B6D5A-2AA5-4650-8ACC-91C5E9010A38}.Release|Any CPU.Build.0 = Release|Any CPU + {977F30FD-2F4D-4CFA-A088-5F7B53FB1BAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {977F30FD-2F4D-4CFA-A088-5F7B53FB1BAB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {977F30FD-2F4D-4CFA-A088-5F7B53FB1BAB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {977F30FD-2F4D-4CFA-A088-5F7B53FB1BAB}.Release|Any CPU.Build.0 = Release|Any CPU + {20B1F85D-D99E-4D51-9D64-E94127E9989C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {20B1F85D-D99E-4D51-9D64-E94127E9989C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {20B1F85D-D99E-4D51-9D64-E94127E9989C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {20B1F85D-D99E-4D51-9D64-E94127E9989C}.Release|Any CPU.Build.0 = Release|Any CPU + {3AA05F81-F470-434B-81D4-CF65DA69CD5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3AA05F81-F470-434B-81D4-CF65DA69CD5E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3AA05F81-F470-434B-81D4-CF65DA69CD5E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3AA05F81-F470-434B-81D4-CF65DA69CD5E}.Release|Any CPU.Build.0 = Release|Any CPU + {7D2DB282-5F48-44AB-9426-32E063049151}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7D2DB282-5F48-44AB-9426-32E063049151}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7D2DB282-5F48-44AB-9426-32E063049151}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7D2DB282-5F48-44AB-9426-32E063049151}.Release|Any CPU.Build.0 = Release|Any CPU + {CDD55E7E-00B4-4AA5-BE3B-991905BFD35C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CDD55E7E-00B4-4AA5-BE3B-991905BFD35C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CDD55E7E-00B4-4AA5-BE3B-991905BFD35C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CDD55E7E-00B4-4AA5-BE3B-991905BFD35C}.Release|Any CPU.Build.0 = Release|Any CPU + {04005764-BB35-497E-ACB0-A6222718DF46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {04005764-BB35-497E-ACB0-A6222718DF46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {04005764-BB35-497E-ACB0-A6222718DF46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {04005764-BB35-497E-ACB0-A6222718DF46}.Release|Any CPU.Build.0 = Release|Any CPU + {DB235C56-7ABE-4E83-BD33-F8C5C0623F41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DB235C56-7ABE-4E83-BD33-F8C5C0623F41}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DB235C56-7ABE-4E83-BD33-F8C5C0623F41}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DB235C56-7ABE-4E83-BD33-F8C5C0623F41}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {520F475F-9F3D-4826-BDC4-7B2C903BCE97} = {70FB7EDF-2E12-405F-B9CD-8A437E96FB11} + {E0C9E035-5254-4FF2-AAD3-AC632B3CB587} = {70FB7EDF-2E12-405F-B9CD-8A437E96FB11} + {C9B9FC2D-2D76-4446-897C-BA9E7B68EB0E} = {70FB7EDF-2E12-405F-B9CD-8A437E96FB11} + {58D56768-8690-41D3-B30F-4003D12264C2} = {70FB7EDF-2E12-405F-B9CD-8A437E96FB11} + {7D61A32C-0F21-453F-A981-BD8E5A3A5304} = {70FB7EDF-2E12-405F-B9CD-8A437E96FB11} + {176CE33F-FF0C-451A-8A38-1DE475B00A78} = {70FB7EDF-2E12-405F-B9CD-8A437E96FB11} + {77A2EDA2-22F4-41A2-91F3-F60CF77A1EB0} = {70FB7EDF-2E12-405F-B9CD-8A437E96FB11} + {6339C785-AABA-464F-8193-91B4F8A5610D} = {70FB7EDF-2E12-405F-B9CD-8A437E96FB11} + {35118921-95CD-4421-BB1A-1354DDEECEFB} = {70FB7EDF-2E12-405F-B9CD-8A437E96FB11} + {BF44F3B0-07CB-47EE-8ED7-B501437E209D} = {70FB7EDF-2E12-405F-B9CD-8A437E96FB11} + {304B5963-7E6B-4808-9B31-254CBFF00A0D} = {70FB7EDF-2E12-405F-B9CD-8A437E96FB11} + {04005764-BB35-497E-ACB0-A6222718DF46} = {70FB7EDF-2E12-405F-B9CD-8A437E96FB11} + {7C3B6D5A-2AA5-4650-8ACC-91C5E9010A38} = {7F8EF0B3-E868-4303-9A29-79DE3CF277CF} + {977F30FD-2F4D-4CFA-A088-5F7B53FB1BAB} = {7F8EF0B3-E868-4303-9A29-79DE3CF277CF} + {20B1F85D-D99E-4D51-9D64-E94127E9989C} = {EAE79EDB-A03E-445B-AF45-8508AB5CB551} + {3AA05F81-F470-434B-81D4-CF65DA69CD5E} = {EAE79EDB-A03E-445B-AF45-8508AB5CB551} + {7D2DB282-5F48-44AB-9426-32E063049151} = {C137B0AB-EE66-482B-B3A6-EADD2E616208} + {CDD55E7E-00B4-4AA5-BE3B-991905BFD35C} = {94A23A1D-1AD4-4AC9-953E-E5205F980512} + {DB235C56-7ABE-4E83-BD33-F8C5C0623F41} = {49C5B9DC-0A6D-4B94-B1D9-741559BA1387} + EndGlobalSection +EndGlobal diff --git a/Modules/Media/04.04.02.txt b/Modules/Media/04.04.02.txt new file mode 100644 index 0000000..6f22db8 --- /dev/null +++ b/Modules/Media/04.04.02.txt @@ -0,0 +1,23 @@ +Install\Module\Media_03.01.00_Install.resources +Install\Module\Media_03.02.00_Install.resources +Install\Module\Media_03.02.02_Install.resources +Install\Module\Media_03.02.03_Install.resources +Install\Module\Media_03.03.00_Install.resources +Install\Module\Media_04.00.00_Install.resources +Install\Module\Media_04.03.00_Install.resources +Install\Module\Media_04.04.00_Install.resources +Install\Module\Media_04.04.01_Install.resources +DesktopModules\Media\03.01.00.txt +DesktopModules\Media\03.02.00.txt +DesktopModules\Media\03.02.02.txt +DesktopModules\Media\03.02.03.txt +DesktopModules\Media\03.03.00.txt +DesktopModules\Media\04.00.00.txt +DesktopModules\Media\04.01.00.txt +DesktopModules\Media\04.02.00.txt +DesktopModules\Media\04.02.01.txt +DesktopModules\Media\04.03.00.txt +DesktopModules\Media\04.04.00.txt +DesktopModules\Media\04.04.01.txt +DesktopModules\Media\DNN_Media.dnn +Bin\DotNetNuke.Modules.Media.SqlDataProvider.dll \ No newline at end of file diff --git a/Modules/Media/App_LocalResources/EditMedia.ascx.resx b/Modules/Media/App_LocalResources/EditMedia.ascx.resx new file mode 100644 index 0000000..f6e4b97 --- /dev/null +++ b/Modules/Media/App_LocalResources/EditMedia.ascx.resx @@ -0,0 +1,356 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + File Location + + + Select a media file from your file system, or upload one to select. + + + Alternate Text + + + Enter text that will be displayed by browsers that are not able to display the Media + + + Alternate text is required. + + + Width must be a valid integer. Only numbers are allowed. + + + Height must be a valid integer. Only numbers are allowed. + + + Width + + + Enter a width (in pixels) for the Media. Images will automatically inherit their appropriate value. Required for videos to render properly. + + + Height + + + Enter a height (in pixels) for the Media. Images will automatically inherit their appropriate value. Required for videos to render properly. + + + Link Your Image To + + + Specify a URL to link to, if desired (Note: The link setting is only applicable to image types; other media types are not supported) + + + <h1>About The Media Module</h1> + +<p>The Media Module renders media from a relative or absolute URL. The media file does not need to reside on the host system. Height and width attributes for the media can be entered, which provides adjustment of the media dimensions. Alternative text is mandatory.</p> + +<h2>Edit Media Options</h2> + +<ol><li>Add an <b>Media</b> module, or go to an existing <b>Media</b> module.</li> +<li>Click <b>Edit Media Options</b>. +<li>At <b>Media</b>, select the <b>media</b> or click <b>Upload New File</b>. +<li>At <b>Alternate Text</b>, enter the text to be displayed on media mouse over. +<li>Click <b>Update</b>.</ol> + + + Edit Media Module Options + + + Use Module Settings Value + + + None + + + Left + + + Center + + + Right + + + Media Alignment + + + This setting will override the alignment that's defined in the container that's being used. + + + Automatically start videos when the page loads. + + + Auto-Start Videos + + + Only Images Use the Following Settings + + + Loop videos when they complete. + + + Loop Videos + + + Only Videos Use the Following Settings + + + Required for all videos and some embedded media content to render properly. + + + In order to use most of these file formats, you will need to enable them. Consult your website administrator for more information. + + + Basic Settings + + + The following file types are currently supported by the website configuration + + + <p>WARNING! Videos are played by their respective client-side players, installed by your website visitors on their own computers. Each video player and video player version will treat and ignore these settings differently.</p> +<p>Flash videos must be auto-started and looped within the Flash object itself.</p> + + + click to view/hide + + + Supported + + + File Extension + + + Site + + + Module + + + Not Supported + + + Copy embed codes from sites like YouTube, Flicker, and Vimeo. Then, paste it in the textbox above. + + + Specify Your Media + + + There isn't a URL to validate. + + + The URL entered is supported. + + + The URL or URL format entered is not supported by this module. + + + A technology called OEmbed allows you to copy the URL of certain web pages, and paste it here. This allows the module to automatically pull out the media from the page without you needing to know how to find the embed code. + + + The following sites are supported with OEmbed: Clearspring Widgets, Flickr, Hulu, MyOpera, oohEmbed, Poll Everywhere, Qik, Revision3, Viddler, Vimeo, YouTube, and over 30 other popular sites. + + + Large files might throw an error due to file size limitations on your website. If this happens, either upload the file using FTP, or consult your website administrator. + + + >> Validate URL + + + Paste in the embed code copied from sites like Vimeo, Flickr, and YouTube. + + + Embed Code + + + Choose the kind of media you will be using right now. + + + Media Type + + + Paste the URL of the webpage for a supportable OEmbed website. A list of the supported websites are below the textbox. + + + Embedable URL + + + Standard File System + + + Embed Code + + + Website URL + + + You must select and specify a media type. + + + Last Updated by {0} On {1} + + + This value will be displayed below the media by default, but can be customized in numerous ways through your site design. It will also be indexed by the website search engine. + + + Description of the Media + + + Unknown + + + Social Integration + + + If checked, this instance of the Media Module will ignore the site wide setting. + + + Override Site Setting + + + If checked, this module will post a status update on the journal that media has been saved. + + + Post to Journal + + + If checked, this setting will be used for every instance of this module on the site. + + + For All Media Modules? + + + just updated <a href="{1}">{0}</a> on <a href="{1}">{2}</a>! + + + If checked, all admins will be notified when this module is updated. This is a site-wide setting for all instances of the Media Module. + + + Notify Administrators on Update? + + + Thanks for telling me. + + + The <strong>{0}</strong> media module on <a href="{1}">{2}</a> has been updated. + + + Media Module Updated + + \ No newline at end of file diff --git a/Modules/Media/App_LocalResources/MediaModule.ascx.resx b/Modules/Media/App_LocalResources/MediaModule.ascx.resx new file mode 100644 index 0000000..9b64eb0 --- /dev/null +++ b/Modules/Media/App_LocalResources/MediaModule.ascx.resx @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Edit Media Options + + + <h1>About The Media Module</h1> + +<p>The Media Module renders media from a relative or absolute URL. The media file does not need to reside on the host system. Height and width attributes for the media can be entered, which provides adjustment of the media dimensions. Alternative text is mandatory.</p> + +<h1>Edit Media Options</h1> + +<ol><li>Add an <b>Media</b> module, or go to an existing <b>Media</b> module.</li> +<li>Click <b>Edit Media Options</b>. +<li>At <b>Media</b>, select the <b>media</b> or click <b>Upload New File</b>. +<li>At <b>Alternate Text</b>, enter the text to be displayed on media mouse over. +<li>Click <b>Update</b>.</ol> + + + Invalid Media + + + You haven't set-up any media for this module yet. It's easy to do. Just edit the Media Options. + + + The media that was requested was not returned by the remote server. This may be a temporary error, or the media and/or hosting server may no longer be available. + + \ No newline at end of file diff --git a/Modules/Media/Components/DataProvider.cs b/Modules/Media/Components/DataProvider.cs new file mode 100644 index 0000000..b3cf19c --- /dev/null +++ b/Modules/Media/Components/DataProvider.cs @@ -0,0 +1,99 @@ +// +// DNN Corp - http://www.dnnsoftware.com +// Copyright (c) 2002-2014 +// by DNN Corp +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + +//INSTANT C# NOTE: Formerly VB project-level imports: +using DotNetNuke; +using DotNetNuke.Common; +using DotNetNuke.Common.Utilities; +using DotNetNuke.Services.Exceptions; +using DotNetNuke.Services.Localization; +using System; +using System.Collections; +using System.Data; +using System.Diagnostics; + +namespace DotNetNuke.Modules.Media +{ + + /// ----------------------------------------------------------------------------- + /// + /// The DataProvider Class Is an abstract class that provides the DataLayer + /// for the Image Module. + /// + /// + /// + /// + /// [lpointer] 31.10.2005 documented + /// + /// ----------------------------------------------------------------------------- + public abstract class DataProvider + { + +#region Constants + + private const string ASSEMBLY = "DotNetNuke.Modules.Media.SqlDataprovider, DotNetNuke.Modules.Media"; + +#endregion + +#region Shared/Static Methods + + // singleton reference to the instantiated object + private static DataProvider objProvider = null; + + // constructor + static DataProvider() + { + CreateProvider(); + } + + // dynamically create provider + private static void CreateProvider() + { + if (objProvider == null) + { + Type objectType = Type.GetType(ASSEMBLY, true, true); + + objProvider = (DataProvider)Activator.CreateInstance(objectType); + DataCache.SetCache(objectType.FullName, objProvider); + } + } + + // return the provider + public static new DataProvider Instance() + { + if (objProvider == null) CreateProvider(); + return objProvider; + } + +#endregion + +#region Abstract Methods + + public abstract void AddMedia(int ModuleId, string Src, string Alt, int Width, int Height, string NavigateUrl, int MediaAlignment, bool AutoStart, bool MediaLoop, bool NewWindow, bool TrackClicks, int MediaType, string MediaMessage, int LastUpdatedBy); + public abstract IDataReader GetMedia(int ModuleId); + public abstract void UpdateMedia(int ModuleId, string src, string alt, int width, int height, string navigateUrl, int MediaAlignment, bool AutoStart, bool MediaLoop, bool NewWindow, bool TrackClicks, int MediaType, string MediaMessage, int LastUpdatedBy); + public abstract void UpgradeMedia(int OldModuleDefID, int NewModuleDefID); + public abstract void DeleteMedia(int ModuleId); + +#endregion + + } + +} \ No newline at end of file diff --git a/Modules/Media/Components/MediaController.cs b/Modules/Media/Components/MediaController.cs new file mode 100644 index 0000000..bdcf6fc --- /dev/null +++ b/Modules/Media/Components/MediaController.cs @@ -0,0 +1,738 @@ +// +// DNN Corp - http://www.dnnsoftware.com +// Copyright (c) 2002-2014 +// by DNN Corp +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + +//INSTANT C# NOTE: Formerly VB project-level imports: +using DotNetNuke; +using DotNetNuke.Common; +using DotNetNuke.Common.Utilities; +using DotNetNuke.Services.Exceptions; +using DotNetNuke.Services.Journal; +using DotNetNuke.Services.Localization; +using System; +using System.Collections; +using System.Data; +using System.Diagnostics; +using System.Linq; + +using DotNetNuke.Entities.Controllers; +using DotNetNuke.Entities.Modules; +using DotNetNuke.Entities.Modules.Definitions; +using DotNetNuke.Entities.Portals; +using DotNetNuke.Entities.Users; +using DotNetNuke.Services.FileSystem; +using DotNetNuke.Services.Search; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Xml; +using WillStrohl.API.oEmbed; + +namespace DotNetNuke.Modules.Media +{ + + /// ----------------------------------------------------------------------------- + /// Namespace: DotNetNuke.Modules.Media + /// Project: DotNetNuke + /// Class: MediaController + /// ----------------------------------------------------------------------------- + /// + /// The MediaController is the Controller class for the Media Module + /// + /// + /// + /// + /// [lpointer] 31.10.2005 documented + /// + /// ----------------------------------------------------------------------------- + public class MediaController : DotNetNuke.Entities.Modules.IPortable, DotNetNuke.Entities.Modules.IUpgradeable, DotNetNuke.Entities.Modules.ISearchable + { + + #region Constants + + // constants for UI elements to filter supported file types + public const string MEDIA_FILE_TYPES_LEGACY = "swf,avi,wmv,midi,wav,asx,mp3,mpg,mpeg,asf,wma,ram,rpm,rm,mov,qt,mp4"; + public const string MEDIA_FILE_TYPES_CURRENT = ".swf,.avi,.wmv,.midi,.wav,.asx,.mp3,.mpg,.mpeg,.asf,.wma,.ram,.rpm,.rm,.mov,.qt,.mp4"; + + // constants for module settings + public const string SETTING_POSTTOJOURNAL = "DNNMedia-PostToJournal"; + public const string SETTING_POSTTOJOURNALSITEWIDE = "DNNMedia-PostToJournalSiteWide"; + public const string SETTING_OVERRIDEJOURNALSETTING = "DNNMedia-OverrideJournalSetting"; + public const string SETTING_NOTIFYONUPDATE = "DNNMedia-NotifyOnUpdate"; + + // constants for the journal + public const string KEY_JOURNALTYPE = "DNNMedia"; + private const string JOURNAL_OBJECTKEY_FORMAT = "{0}-{1}-{2}-{3}"; + private const string MEDIA_JOURNALTYPE = "link"; + private const int JOURNAL_TYPE_ID = 2; + + #endregion + + #region Properties + + /// + /// MEDIA_FILE_TYPES - in conjunction with the DNN global images, these are the file types that this module will work with. + /// + /// + /// + /// + /// This property had to be created to replace the constant, because DNN 5.x handles the file extensions differently than 4.x. + /// + /// + /// [wstrohl] - 20100523 - Created from a constant. + /// [wstrohl] - 20101124 - Changed the application version reference from the glbAppVersion; Added support for MP4 + /// [wstrohl] - 20101127 - Moved from the EditMedia view + /// + public static string MEDIA_FILE_TYPES + { + get + { + if (DotNetNuke.Application.DotNetNukeContext.Current.Application.Version.Major < 5 | DotNetNuke.Application.DotNetNukeContext.Current.Application.Version.Major >= 6) + { + return MEDIA_FILE_TYPES_LEGACY; + } + else + { + return MEDIA_FILE_TYPES_CURRENT; + } + } + } + + /// + /// SUPPORTED_MEDIA_FILE_TYPES - These are the file types that this module will allow, per the Host Settings. + /// + /// + /// + /// + /// This property is a reflection of the Host Settings configuration. + /// + /// + /// [wstrohl] - 20101127 - Created + /// + public static string SUPPORTED_MEDIA_FILE_TYPES + { + get + { + Dictionary settingsDictionary = null; + settingsDictionary = HostController.Instance.GetSettingsDictionary(); + + foreach (KeyValuePair kvp in settingsDictionary) + { + + if (string.Equals(kvp.Key, "FileExtensions", StringComparison.InvariantCultureIgnoreCase)) + { + + return kvp.Value; + + } + + } + + return string.Empty; + } + } + + #endregion + + #region Data Access + + /// + /// AddMedia adds a MediaInfo object to the Database + /// + /// + /// + /// The MediaInfo object + /// + /// [lpointer] 31.10.2005 documented + /// + public void AddMedia(MediaInfo objMedia) + { + DataProvider.Instance().AddMedia(objMedia.ModuleID, objMedia.Src, objMedia.Alt, objMedia.Width, objMedia.Height, objMedia.NavigateUrl, objMedia.MediaAlignment, objMedia.AutoStart, objMedia.MediaLoop, objMedia.NewWindow, objMedia.TrackClicks, objMedia.MediaType, objMedia.MediaMessage, objMedia.LastUpdatedBy); + } + + /// + /// GetMedia gets the MediaInfo object from the Database + /// + /// + /// + /// The Id of the module + /// + /// [lpointer] 31.10.2005 documented + /// + public MediaInfo GetMedia(int ModuleID) + { + MediaInfo objMedia = new MediaInfo(); + objMedia.Fill(DataProvider.Instance().GetMedia(ModuleID)); + return objMedia; + } + + /// + /// UpdateMedia saves the MediaInfo object to the Database + /// + /// + /// + /// The MediaInfo object + /// + /// [lpointer] 31.10.2005 documented + /// + public void UpdateMedia(MediaInfo objMedia) + { + DataProvider.Instance().UpdateMedia(objMedia.ModuleID, objMedia.Src, objMedia.Alt, objMedia.Width, objMedia.Height, objMedia.NavigateUrl, objMedia.MediaAlignment, objMedia.AutoStart, objMedia.MediaLoop, objMedia.NewWindow, objMedia.TrackClicks, objMedia.MediaType, objMedia.MediaMessage, objMedia.LastUpdatedBy); + } + + /// + /// UpgradeMedia updates the image control references to Media in the Database + /// + /// + /// + /// The Id of the old module + /// The Id of the new module + /// + /// [lpointer] 31.10.2005 documented + /// + public void UpgradeMedia(int OldModuleDefID, int NewModuleDefID) + { + // only proceed if the expected module ids are passed + if (OldModuleDefID > Null.NullInteger & NewModuleDefID > Null.NullInteger) + { + DataProvider.Instance().UpgradeMedia(OldModuleDefID, NewModuleDefID); + } + } + + /// + /// DeleteMedia deletes the media associated with the specified module instance + /// + /// Integer - the id of the specific module instance + /// + /// + /// [wstrohl] - 20100602 - Created. + /// + public void DeleteMedia(int ModuleId) + { + DataProvider.Instance().DeleteMedia(ModuleId); + } + + #endregion + + #region Public Methods + + /// + /// EncodeUrl - this method switches any ampersands with the encoded versions of the ampersands for XHTML compliance + /// + /// String - the URL to encode + /// + /// This method does not check to see if the encoding has already been done. + /// + /// [wstrohl] - 20100605 - Created. + /// + public static string EncodeUrl(string URL) + { + return Regex.Replace(URL, "&", "&"); + } + + /// + /// Retrieves the markup to display to the end-user + /// + /// + /// + /// + /// + /// + /// + public List DisplayMedia(int moduleId, int tabId, bool isEditable, ModuleInfo config, PortalSettings settings) + { + MediaInfo objMedia = GetMedia(moduleId); + List lstMedia = new List { string.Empty, string.Empty, string.Empty }; + string HTMLTag = string.Empty; + + if (objMedia != null && objMedia.ModuleID > Null.NullInteger) + { + + if (objMedia.MediaType == 0) // standard file system + { + // 20120822 - WStrohl + // old way of retrieving files from the file system + // no longer needed with folder providers + //objMedia.Src = Globals.LinkClick(objMedia.Src.ToLower(), tabId, moduleId, false); + + //if (objMedia.Src.IndexOf("://") == 0) + //{ + // objMedia.Src = string.Concat(settings.HomeDirectory, objMedia.Src); + //} + + MediaMarkUpUtility utilMedia = new MediaMarkUpUtility(); + + // Check extension + switch (utilMedia.GetMediaType(objMedia)) + { + case MediaType.Flash: + HTMLTag = utilMedia.GetFlashMarkUp(objMedia, config); + break; + case MediaType.WindowsMedia: + HTMLTag = utilMedia.GetWindowsMediaMarkUp(objMedia, config); + break; + case MediaType.RealPlayer: + HTMLTag = utilMedia.GetRealPlayerMarkUp(objMedia, config); + break; + case MediaType.Quicktime: + HTMLTag = utilMedia.GetQuicktimeMarkUp(objMedia, config); + break; + default: + HTMLTag = utilMedia.GetImageMarkUp(objMedia, config); + break; + } + + lstMedia[0] = HTMLTag; + + } + else if (objMedia.MediaType == 1) // embed code + { + + lstMedia[0] = System.Web.HttpUtility.HtmlDecode(objMedia.Src); + + } + else if (objMedia.MediaType == 2) // oembed + { + + try + { + Wrapper ctlOEmbed = new Wrapper(); + if (objMedia.Width > 0 & objMedia.Height > 0) + { + lstMedia[0] = ctlOEmbed.GetContent(new RequestInfo(objMedia.Src)); + } + else + { + lstMedia[0] = ctlOEmbed.GetContent(new RequestInfo(objMedia.Src, objMedia.Width, objMedia.Height)); + } + } + catch (Exception ex) + { + Exceptions.LogException(ex); + lstMedia[2] = "oEmbed.ErrorMessage"; + } + + } + + } + + return lstMedia; + } + + #endregion + + #region Journal Integration + + /// + /// GetObjectKeyForJournal - a centralized way to always get a properly formatted key for journal items + /// + /// The module ID (not TabModuleId) + /// Valid objectKey for use with the journal + public static string GetObjectKeyForJournal(int moduleId, int userId) + { + return GetObjectKeyForJournal(KEY_JOURNALTYPE, moduleId, userId); + } + + /// + /// GetObjectKeyForJournal - a centralized way to always get a properly formatted key for journal items + /// + /// The type of content being saved to the journal + /// The module ID (not TabModuleId) + /// Valid objectKey for use with the journal + public static string GetObjectKeyForJournal(string contentType, int moduleId, int userId) + { + return string.Format(JOURNAL_OBJECTKEY_FORMAT, contentType, moduleId, userId, DateTime.Now.ToString("yyyyMMdd")); + } + + /// + /// Returns a journal type associated with voting (using one of the core built in journal types). + /// + /// + /// + public static int GetMediaJournalTypeID(int portalId) + { + var colJournalTypes = (from t in JournalController.Instance.GetJournalTypes(portalId) where t.JournalType == MEDIA_JOURNALTYPE select t); + int journalTypeId; + + if (colJournalTypes.Count() > 0) + { + var journalType = colJournalTypes.Single(); + journalTypeId = journalType.JournalTypeId; + } + else + { + journalTypeId = JOURNAL_TYPE_ID; + } + + return journalTypeId; + } + + #endregion + + #region File Access + + /// + /// GetFileFromProvider - returns a API-based file reference to files, regardless of FolderProvider + /// + /// the ID of the portal + /// the name of the folder + /// the name of the file + /// + public IFileInfo GetImageFromProvider(int portalId, string folderName, string fileName) + { + IFolderInfo oFolder = FolderManager.Instance.GetFolder(portalId, folderName); + IFileInfo oFile = FileManager.Instance.GetFile(oFolder, fileName); + + return oFile; + } + + /// + /// GetFileFromProvider - returns a API-based file reference to files, regardless of FolderProvider + /// + /// the ID of the portal + /// the reference object for the folder + /// the name of the file + /// + public IFileInfo GetFileFromProvider(int portalId, IFolderInfo oFolder, string fileName) + { + IFileInfo oFile = FileManager.Instance.GetFile(oFolder, fileName); + return oFile; + } + + /// + /// GetImageFileUrl - this method returns the valid URL for any file, regardless to folder or folder provider in use + /// + /// Fully loaded IFileInfo object + /// + /// + /// WARNING!!! This method can return exceptions. They should be caught and processed in the UI though. + /// + public string GetFileUrl(IFileInfo oFile) + { + /******************************************************* + ' WARNING!!! + ' This method can return exceptions. They should be + ' caught and processed in the UI though. + '*******************************************************/ + FolderMappingInfo mapFolder = FolderMappingController.Instance.GetFolderMapping(oFile.FolderMappingID); + return FolderProvider.Instance(mapFolder.FolderProviderType).GetFileUrl(oFile); + } + + #endregion + + #region IPortable + + /// + /// ExportModule implements the IPortable ExportModule Interface + /// + /// + /// + /// The Id of the module to be exported + /// + /// [lpointer] 31.10.2005 documented + /// + public string ExportModule(int ModuleID) + { + + try + { + + StringBuilder sbXML = new StringBuilder(); + + MediaInfo objMedia = GetMedia(ModuleID); + if (objMedia != null) + { + sbXML.Append(""); + + // maintain the following xml tags as-is for backwards compatibility with old export files + if (objMedia.MediaType == 0) + { + int intFileId = FileManager.Instance.GetFile(DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings().PortalId, objMedia.Src).FileId; + sbXML.AppendFormat("FileId={0}", intFileId.ToString()); + } + else + { + sbXML.AppendFormat("", objMedia.Src); + } + sbXML.AppendFormat("{0}", objMedia.Alt); + sbXML.AppendFormat("{0}", objMedia.Width.ToString()); + sbXML.AppendFormat("{0}", objMedia.Height.ToString()); + sbXML.AppendFormat("{0}", objMedia.NavigateUrl); + + // new/missing properties added for version 03.03.00 + sbXML.AppendFormat("{0}", objMedia.AutoStart.ToString()); + sbXML.AppendFormat("{0}", objMedia.MediaAlignment.ToString()); + sbXML.AppendFormat("{0}", objMedia.MediaLoop.ToString()); + + // new/missing properties added for version 04.00.00 + sbXML.AppendFormat("{0}", objMedia.NewWindow.ToString()); + sbXML.AppendFormat("{0}", objMedia.TrackClicks.ToString()); + sbXML.AppendFormat("{0}", objMedia.MediaType.ToString()); + + // new/missing properties added for version 04.01.00 + sbXML.AppendFormat("", objMedia.MediaMessage); + sbXML.AppendFormat("{0}", objMedia.LastUpdatedBy); + sbXML.AppendFormat("{0}", objMedia.LastUpdatedDate.ToString("MM/dd/yyyy hh:mm:ss tt")); + + sbXML.Append(""); + } + + // + // Add settings here + // + + return sbXML.ToString(); + + } + catch (Exception ex) + { + Exceptions.LogException(ex); + throw ex; + } + + //INSTANT C# NOTE: Inserted the following 'return' since all code paths must return a value in C#: + return null; + } + + /// + /// ImportModule implements the IPortable ImportModule Interface + /// + /// + /// + /// The Id of the module to be imported + /// + /// [lpointer] 31.10.2005 documented + /// + public void ImportModule(int ModuleID, string Content, string Version, int UserId) + { + + try + { + + // Check to see if the module already has media. If it does, get rid of it. + MediaInfo oMedia = new MediaInfo(); + oMedia = GetMedia(ModuleID); + + if (oMedia != null) + { + DeleteMedia(ModuleID); + } + + XmlNode xmlImage = Globals.GetContent(Content, "image"); + MediaInfo objImage = new MediaInfo(); + + objImage.ModuleID = ModuleID; + objImage.Src = xmlImage.SelectSingleNode("src").InnerText; //ImportUrl(ModuleID, xmlImage.SelectSingleNode("src").InnerText) + objImage.Alt = xmlImage.SelectSingleNode("alt").InnerText; + objImage.Width = int.Parse(xmlImage.SelectSingleNode("width").InnerText); + objImage.Height = int.Parse(xmlImage.SelectSingleNode("height").InnerText); + objImage.NavigateUrl = xmlImage.SelectSingleNode("navigateUrl").InnerText; + + // new/missing properties to assign in v03.03.00 + + if (xmlImage.SelectSingleNode("AutoStart") != null) + { + System.Boolean tempVar = false; + bool.TryParse(xmlImage.SelectSingleNode("AutoStart").InnerText, out tempVar); + objImage.AutoStart = tempVar; + } + if (xmlImage.SelectSingleNode("MediaAlignment") != null) + { + System.Int32 tempVar2 = 0; + int.TryParse(xmlImage.SelectSingleNode("MediaAlignment").InnerText, out tempVar2); + objImage.MediaAlignment = tempVar2; + } + if (xmlImage.SelectSingleNode("MediaLoop") != null) + { + System.Boolean tempVar3 = false; + bool.TryParse(xmlImage.SelectSingleNode("MediaLoop").InnerText, out tempVar3); + objImage.MediaLoop = tempVar3; + } + + // new/missing properties to assign in v04.00.00 + + if (xmlImage.SelectSingleNode("NewWindow") != null) + { + System.Boolean tempVar4 = false; + bool.TryParse(xmlImage.SelectSingleNode("NewWindow").InnerText, out tempVar4); + objImage.NewWindow = tempVar4; + } + if (xmlImage.SelectSingleNode("TrackClicks") != null) + { + System.Boolean tempVar5 = false; + bool.TryParse(xmlImage.SelectSingleNode("TrackClicks").InnerText, out tempVar5); + objImage.TrackClicks = tempVar5; + } + if (xmlImage.SelectSingleNode("MediaType") != null) + { + System.Int32 tempVar6 = 0; + int.TryParse(xmlImage.SelectSingleNode("MediaType").InnerText, out tempVar6); + objImage.MediaType = tempVar6; + } + + // new/missing properties to assign in v04.01.00 + + if (xmlImage.SelectSingleNode("MediaMessage") != null) + { + objImage.MediaMessage = xmlImage.SelectSingleNode("MediaMessage").InnerText; + } + + UserInfo currentUser = UserController.GetCurrentUserInfo(); + + if (currentUser != null && currentUser.UserID > 0) + { + objImage.LastUpdatedBy = currentUser.UserID; + } + else + { + PortalSettings portalSettings = PortalController.GetCurrentPortalSettings(); + + if (portalSettings != null) + { + objImage.LastUpdatedBy = portalSettings.AdministratorId; + } + } + + objImage.LastUpdatedDate = DateTime.Now; + + + AddMedia(objImage); + + // calling this method to clear the module cache, and ensure all is wired up from the DAL for the next page load + DotNetNuke.Entities.Modules.ModuleController.SynchronizeModule(ModuleID); + + } + catch (Exception ex) + { + Exceptions.LogException(ex); + throw ex; + } + + } + + #endregion + + #region IUpgradeable + + public string UpgradeModule(string Version) + { + + // Upgrade 03.02.00 + // Sets the Modules with Image to Media + + if (string.Equals(Version, "03.02.00")) + { + + try + { + + MediaController objMC = new MediaController(); + objMC.UpgradeMedia(GetModuleDefID("DNN_Image"), GetModuleDefID("DNN_Media")); + // clear entire cache + DataCache.ClearHostCache(true); + + return "True"; + + } + catch (Exception ex) + { + Exceptions.LogException(ex); + return "False"; + } + + } + + return "True"; + + } + + #endregion + + #region ISearchable + + public DotNetNuke.Services.Search.SearchItemInfoCollection GetSearchItems(DotNetNuke.Entities.Modules.ModuleInfo ModInfo) + { + + SearchItemInfoCollection itmSearchColl = new SearchItemInfoCollection(); + MediaInfo itm = GetMedia(ModInfo.ModuleID); + + if (itm != null) + { + + string content = string.Concat(itm.Alt, " :: ", StripTags(itm.MediaMessage)); + + SearchItemInfo itmSearch = new SearchItemInfo(ModInfo.ModuleTitle, content, itm.LastUpdatedBy, itm.LastUpdatedDate, ModInfo.ModuleID, itm.ModuleID.ToString(), content); + itmSearchColl.Add(itmSearch); + + } + + return itmSearchColl; + + } + + private string StripTags(string html) + { + + string newHtml = html; + string replaceHtml = "(<(.|\\n)*?>|<(.|\\n)*?>)"; + string replaceSpaces = "&(amp;)*nbsp;"; + string replaceQuotes = "&(amp;)*quot;"; + + newHtml = System.Web.HttpUtility.HtmlDecode(newHtml); + newHtml = Regex.Replace(newHtml, replaceHtml, ""); + newHtml = Regex.Replace(newHtml, replaceSpaces, ""); + newHtml = Regex.Replace(newHtml, replaceQuotes, ""); + + // for troubleshooting + //LogException(New Exception(String.Concat("newHtml = ", newHtml))) + + return newHtml; + + } + + #endregion + + #region Private Helper Functions + + private int GetModuleDefID(string ModuleName) + { + + try + { + + DesktopModuleInfo desktopInfo = DesktopModuleController.GetDesktopModuleByModuleName(ModuleName, DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings().PortalId); + ModuleDefinitionInfo modDefInfo = ModuleDefinitionController.GetModuleDefinitionByFriendlyName(ModuleName, desktopInfo.DesktopModuleID); + + return modDefInfo.ModuleDefID; + + } + catch + { + // WStrohl: + // do nothing - an expected nullreference exception should happen here if the module is not going through the expected upgrade + return Null.NullInteger; + } + + } + + #endregion + + } + +} diff --git a/Modules/Media/Components/MediaModuleBase.cs b/Modules/Media/Components/MediaModuleBase.cs new file mode 100644 index 0000000..d87309d --- /dev/null +++ b/Modules/Media/Components/MediaModuleBase.cs @@ -0,0 +1,160 @@ +// +// DNN Corp - http://www.dnnsoftware.com +// Copyright (c) 2002-2014 +// by DNN Corp +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + +//INSTANT C# NOTE: Formerly VB project-level imports: +using DotNetNuke; +using DotNetNuke.Common; +using DotNetNuke.Common.Utilities; +using DotNetNuke.Entities.Portals; +using DotNetNuke.Services.Exceptions; +using DotNetNuke.Services.Localization; +using System; +using System.Collections; +using System.Data; +using System.Diagnostics; + +namespace DotNetNuke.Modules.Media +{ + + public abstract class MediaModuleBase : DotNetNuke.Entities.Modules.PortalModuleBase + { + + #region Private Members + + private bool _PostToJournal = false; + private bool _PostToJournalSiteWide = false; + private bool _OverrideJournalSetting = false; + private bool _NotifyOnUpdate = false; + + #endregion + + #region Properties + + /// + /// PostToJournal - If true, the module can post a message to the journal + /// + protected bool PostToJournal{ + get{ + if (PostToJournalSiteWide && OverrideJournalSetting == false) + { + string strSettingValue = PortalController.GetPortalSetting(MediaController.SETTING_POSTTOJOURNAL, PortalId, string.Empty); + + if (!string.IsNullOrEmpty(strSettingValue)) + { + _PostToJournal = bool.Parse(strSettingValue); + } + } + else + { + if (Settings[MediaController.SETTING_POSTTOJOURNAL] != null) + { + _PostToJournal = bool.Parse(Settings[MediaController.SETTING_POSTTOJOURNAL].ToString()); + } + } + + return _PostToJournal; + } + private set + { + _PostToJournal = value; + } + } + + /// + /// PostToJournalSiteWide - if true, all instances of the media module will post to the journal when updated + /// + protected bool PostToJournalSiteWide + { + get + { + string strSettingValue = PortalController.GetPortalSetting(MediaController.SETTING_POSTTOJOURNALSITEWIDE, PortalId, string.Empty); + + if (!string.IsNullOrEmpty(strSettingValue)) + { + _PostToJournalSiteWide = bool.Parse(strSettingValue); + } + return _PostToJournalSiteWide; + } + private set + { + _PostToJournalSiteWide = value; + } + } + + /// + /// OverrideJournalSetting - if true, the module will override the site setting (if it exists) + /// + protected bool OverrideJournalSetting + { + get + { + if (Settings[MediaController.SETTING_OVERRIDEJOURNALSETTING] != null) + { + _OverrideJournalSetting = bool.Parse(Settings[MediaController.SETTING_OVERRIDEJOURNALSETTING].ToString()); + } + return _OverrideJournalSetting; + } + private set + { + _OverrideJournalSetting = value; + } + } + + /// + /// NotifyOnUpdate - if true, the module will notify people in the message center when an update is performed + /// + protected bool NotifyOnUpdate + { + get + { + string strSettingValue = PortalController.GetPortalSetting(MediaController.SETTING_NOTIFYONUPDATE, PortalId, string.Empty); + + if (!string.IsNullOrEmpty(strSettingValue)) + { + _NotifyOnUpdate = bool.Parse(strSettingValue); + } + + return _NotifyOnUpdate; + } + private set + { + _NotifyOnUpdate = value; + } + } + + #endregion + + #region Localization + + protected string GetLocalizedString(string Key) + { + return GetLocalizedString(Key, this.LocalResourceFile); + } + + protected string GetLocalizedString(string Key, string LocalizationFilePath) + { + return Localization.GetString(Key, LocalizationFilePath); + } + + #endregion + + } + +} \ No newline at end of file diff --git a/Modules/Media/Components/MediaType.cs b/Modules/Media/Components/MediaType.cs new file mode 100644 index 0000000..ab6c447 --- /dev/null +++ b/Modules/Media/Components/MediaType.cs @@ -0,0 +1,45 @@ +// +// DNN Corp - http://www.dnnsoftware.com +// Copyright (c) 2002-2014 +// by DNN Corp +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + +//INSTANT C# NOTE: Formerly VB project-level imports: +using DotNetNuke; +using DotNetNuke.Common; +using DotNetNuke.Common.Utilities; +using DotNetNuke.Services.Exceptions; +using DotNetNuke.Services.Localization; +using System; +using System.Collections; +using System.Data; +using System.Diagnostics; + +namespace DotNetNuke.Modules.Media +{ + + public enum MediaType: int + { + Unknown, + Image, + Flash, + WindowsMedia, + Quicktime, + RealPlayer + } + +} \ No newline at end of file diff --git a/Modules/Media/Components/SimulateIsDate.cs b/Modules/Media/Components/SimulateIsDate.cs new file mode 100644 index 0000000..945d5bc --- /dev/null +++ b/Modules/Media/Components/SimulateIsDate.cs @@ -0,0 +1,20 @@ +//---------------------------------------------------------------------------------------- +// Copyright © 2003 - 2011 Tangible Software Solutions Inc. +// This class can be used by anyone provided that the copyright notice remains intact. +// +// This class simulates the behavior of the classic VB 'IsDate' function. +//---------------------------------------------------------------------------------------- +namespace DotNetNuke.Modules.Media +{ + public static class SimulateIsDate + { + public static bool IsDate(object expression) + { + if (expression == null) + return false; + + System.DateTime testDate; + return System.DateTime.TryParse(expression.ToString(), out testDate); + } + } +} \ No newline at end of file diff --git a/Modules/Media/DNN_Media.dnn b/Modules/Media/DNN_Media.dnn new file mode 100644 index 0000000..44b11f8 --- /dev/null +++ b/Modules/Media/DNN_Media.dnn @@ -0,0 +1,211 @@ + + + + Media + This module renders Media files of various kinds, including social media, images, videos, music, and more. + Images/logo/dnnmedia-logo-150x150.png + + DotNetNuke + DotNetNuke Corporation + http://www.dotnetnuke.com]]> + support@dotnetnuke.com]]> + + + + true + + 07.02.00 + + + + + DesktopModules\Media + + + + + + + + + + + + + + + + + DNN_Media + Media + DotNetNuke.Modules.Media.MediaController, DotNetNuke.Modules.Media + + + + + + + + Media + 0 + + + + DesktopModules/Media/MediaModule.ascx + False + + View + + http://www.dotnetnuke.com/default.aspx?tabid=787 + 0 + + + Edit + DesktopModules/Media/EditMedia.ascx + True + True + Edit Media + Edit + + http://www.dotnetnuke.com/default.aspx?tabid=787 + 0 + + + + + + + DotNetNuke.Entities.Modules.EventMessageProcessor, DotNetNuke + UpgradeModule + + DotNetNuke.Modules.Media.MediaController, DotNetNuke.Modules.Media + [DESKTOPMODULEID] + 03.02.00,03.02.03,03.03.00,04.00.00,04.01.00,04.02.00,04.03.00,04.04.00,04.04.01,04.04.02 + + + + + + bin + + bin + DotNetNuke.Modules.Media.dll + 04.04.02 + + + WillStrohl.API.oEmbed.dll + 00.03.00 + + + + + + DesktopModules\Media + + 04.04.02.txt + + + DNN_Media.dnn + + + Providers\DataProviders\SqlDataProvider + 03.02.00.SqlDataProvider + + + Providers\DataProviders\SqlDataProvider + 03.02.03.SqlDataProvider + + + Providers\DataProviders\SqlDataProvider + 03.03.00.SqlDataProvider + + + Providers\DataProviders\SqlDataProvider + 04.00.00.SqlDataProvider + + + Providers\DataProviders\SqlDataProvider + 04.01.00.SqlDataProvider + + + Providers\DataProviders\SqlDataProvider + 04.02.00.SqlDataProvider + + + Providers\DataProviders\SqlDataProvider + 04.03.00.SqlDataProvider + + + Providers\DataProviders\SqlDataProvider + 04.04.00.SqlDataProvider + + + Providers\DataProviders\SqlDataProvider + 04.04.01.SqlDataProvider + + + Providers\DataProviders\SqlDataProvider + 04.04.02.SqlDataProvider + + + Providers\DataProviders\SqlDataProvider + Uninstall.SqlDataProvider + + + + + + DesktopModules\Media + + Resources.zip + + + + + + + \ No newline at end of file diff --git a/Modules/Media/DotNetNuke.Media.csproj b/Modules/Media/DotNetNuke.Media.csproj new file mode 100644 index 0000000..451efc8 --- /dev/null +++ b/Modules/Media/DotNetNuke.Media.csproj @@ -0,0 +1,214 @@ + + + + + ..\..\References\ + $(ReferencesPath)DNN\07.02.00 + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {176CE33F-FF0C-451A-8A38-1DE475B00A78} + {349c5851-65df-11da-9384-00065b846f21};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + + DotNetNuke.Modules.Media + + + 4.0 + + + v4.0 + + + true + full + DEBUG;TRACE + bin\ + Bin\DotNetNuke.Modules.Media.xml + 1 + AllRules.ruleset + + + pdbonly + TRACE + true + bin\ + DotNetNuke.Modules.Media.xml + AllRules.ruleset + + + + False + $(DnnReferencesPath)\DotNetNuke.dll + False + + + False + $(DnnReferencesPath)\DotNetNuke.Web.dll + False + + + False + $(DnnReferencesPath)\Microsoft.ApplicationBlocks.Data.dll + False + + + + System + False + + + System.Data + + + + System.Drawing + + + System.Web + + + + + + + System.XML + + + + False + $(DnnReferencesPath)oEmbed\WillStrohl.API.oEmbed.dll + True + + + + + + + + + + + + + + + + + EditMedia.ascx + ASPXCodeBehind + + + EditMedia.ascx + + + + ASPXCodeBehind + + + + + + + + + + + Code + + + Code + + + Code + + + Code + + + MediaModule.ascx + + + MediaModule.ascx + ASPXCodeBehind + + + + + + + + + + + + + ASPXCodeBehind + + + + + + + Designer + + + + + + + + + + + + + + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + + + Designer + + + Designer + + + + + + + + + + + + + True + + + + + + \ No newline at end of file diff --git a/Modules/Media/DotNetNuke.Media.sln b/Modules/Media/DotNetNuke.Media.sln new file mode 100644 index 0000000..12eaf16 --- /dev/null +++ b/Modules/Media/DotNetNuke.Media.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetNuke.Media", "DotNetNuke.Media.csproj", "{176CE33F-FF0C-451A-8A38-1DE475B00A78}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {176CE33F-FF0C-451A-8A38-1DE475B00A78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {176CE33F-FF0C-451A-8A38-1DE475B00A78}.Debug|Any CPU.Build.0 = Debug|Any CPU + {176CE33F-FF0C-451A-8A38-1DE475B00A78}.Release|Any CPU.ActiveCfg = Release|Any CPU + {176CE33F-FF0C-451A-8A38-1DE475B00A78}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(.Test) = postSolution + .TestFiles = .TEST\Products\symbols.xml;.TEST\Products\violations.xml;.TEST\Products\coverage.xml + ActiveConfiguration = BuiltIn\Combined\CompleteAnalysis.tcfg + GRSAttributes = + EndGlobalSection +EndGlobal diff --git a/Modules/Media/DotNetNuke.Modules.Media.xml b/Modules/Media/DotNetNuke.Modules.Media.xml new file mode 100644 index 0000000..b6b8f8b --- /dev/null +++ b/Modules/Media/DotNetNuke.Modules.Media.xml @@ -0,0 +1,974 @@ + + + + DotNetNuke.Modules.Media + + + + + OnInit - initialization of the module + + + + + + Page_Load runs when the control is loaded + + + + + + + + + cmdCancel_Click runs when the cancel button is clicked + + + + + + + + + cmdUpdate_Click runs when the update button is clicked + + + + + + + + + SaveMediaSettings - this allows you to abstract the saving of the settings that can be defined + + + 20120820 - Created. + + + + + Adds the media update to the journal + + + + + + Sends a notification to the message center + + + + + + This will create a notification type used by the module and also handle the actions that must be associated with it. + + + + + lblMediaType control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + radMediaType control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cvMediaType control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + liFileSystem control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plURL control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ctlURL control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + rptMediaFileTypes control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + liEmbed control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblEmbed control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtEmbed control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + liOEmbed control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblOEmbed control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtOEmbed control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lnkOEmbed control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblOEmbedCheck control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plAlt control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtAlt control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + valAltText control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plWidth control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtWidth control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + valWidth control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plHeight control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtHeight control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + valHeight control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plMessage control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtMessage control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plAlignment control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ddlImageAlignment control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblAutoStart control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + chkAutoStart control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblLoop control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + chkLoop control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plNavigateUrl control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ctlNavigateUrl control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + liPostToJournal control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblPostToJournal control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + chkPostToJournal control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + liSideWideJournalSetting control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblPostToJournalSiteWide control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + chkPostToJournalSiteWide control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblOverrideJournalSetting control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + chkOverrideJournalSetting control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + liNotifyOnUpdate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblNotifyOnUpdate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + chkNotifyOnUpdate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdUpdate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdCancel control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ctlTracking control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + PostToJournal - If true, the module can post a message to the journal + + + + + PostToJournalSiteWide - if true, all instances of the media module will post to the journal when updated + + + + + OverrideJournalSetting - if true, the module will override the site setting (if it exists) + + + + + NotifyOnUpdate - if true, the module will notify people in the message center when an update is performed + + + + + Represents a File Type object. + + + + ----------------------------------------------------------------------------- + + The SqlDataProvider Class is an SQL Server implementation of the DataProvider Abstract + class that provides the DataLayer for the HTML Module. + + + + + [cnurse] 9/21/2004 Moved HTML to a separate Project + + ----------------------------------------------------------------------------- + + + + IsNumber - this method uses a regular expression to determine if the value object is in a valid numeric format. + + Object - the object to parse to see if it's a number + If true, the Value object was in a valid numeric format + + This method does not consider commas (,) to be a valid character. This overload defaults PositiveOnly to True. + + + [wstrohl] - 20100130 - created + + + + + IsNumber - this method uses a regular expression to determine if the value object is in a valid numeric format. + + Object - the object to parse to see if it's a number + Boolean - if true, a negative number will be considered valid + If true, the Value object was in a valid numeric format + + This method does not consider commas (,) to be a valid character. + + + [wstrohl] - 20100130 - created + + + + + IsBoolean - this method uses a regular expression to determine if the value object is in a valid boolean format. + + Object - the object to parse to see if it is in a boolean fomat + If true, the Value object was in a valid boolean format + + This method looks for one of the following: 1, 0, true, false (case insensitive) + + + [wstrohl] - 20100130 - created + + + + ----------------------------------------------------------------------------- + + The DataProvider Class Is an abstract class that provides the DataLayer + for the Image Module. + + + + + [lpointer] 31.10.2005 documented + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + Namespace: DotNetNuke.Modules.Media + Project: DotNetNuke + Class: MediaController + ----------------------------------------------------------------------------- + + The MediaController is the Controller class for the Media Module + + + + + [lpointer] 31.10.2005 documented + + ----------------------------------------------------------------------------- + + + + MEDIA_FILE_TYPES - in conjunction with the DNN global images, these are the file types that this module will work with. + + + + + This property had to be created to replace the constant, because DNN 5.x handles the file extensions differently than 4.x. + + + [wstrohl] - 20100523 - Created from a constant. + [wstrohl] - 20101124 - Changed the application version reference from the glbAppVersion; Added support for MP4 + [wstrohl] - 20101127 - Moved from the EditMedia view + + + + + SUPPORTED_MEDIA_FILE_TYPES - These are the file types that this module will allow, per the Host Settings. + + + + + This property is a reflection of the Host Settings configuration. + + + [wstrohl] - 20101127 - Created + + + + + AddMedia adds a MediaInfo object to the Database + + + + The MediaInfo object + + [lpointer] 31.10.2005 documented + + + + + GetMedia gets the MediaInfo object from the Database + + + + The Id of the module + + [lpointer] 31.10.2005 documented + + + + + UpdateMedia saves the MediaInfo object to the Database + + + + The MediaInfo object + + [lpointer] 31.10.2005 documented + + + + + UpgradeMedia updates the image control references to Media in the Database + + + + The Id of the old module + The Id of the new module + + [lpointer] 31.10.2005 documented + + + + + DeleteMedia deletes the media associated with the specified module instance + + Integer - the id of the specific module instance + + + [wstrohl] - 20100602 - Created. + + + + + EncodeUrl - this method switches any ampersands with the encoded versions of the ampersands for XHTML compliance + + String - the URL to encode + + This method does not check to see if the encoding has already been done. + + [wstrohl] - 20100605 - Created. + + + + + Retrieves the markup to display to the end-user + + + + + + + + + + + GetObjectKeyForJournal - a centralized way to always get a properly formatted key for journal items + + The module ID (not TabModuleId) + Valid objectKey for use with the journal + + + + GetObjectKeyForJournal - a centralized way to always get a properly formatted key for journal items + + The type of content being saved to the journal + The module ID (not TabModuleId) + Valid objectKey for use with the journal + + + + Returns a journal type associated with voting (using one of the core built in journal types). + + + + + + + GetFileFromProvider - returns a API-based file reference to files, regardless of FolderProvider + + the ID of the portal + the name of the folder + the name of the file + + + + + GetFileFromProvider - returns a API-based file reference to files, regardless of FolderProvider + + the ID of the portal + the reference object for the folder + the name of the file + + + + + GetImageFileUrl - this method returns the valid URL for any file, regardless to folder or folder provider in use + + Fully loaded IFileInfo object + + + WARNING!!! This method can return exceptions. They should be caught and processed in the UI though. + + + + + ExportModule implements the IPortable ExportModule Interface + + + + The Id of the module to be exported + + [lpointer] 31.10.2005 documented + + + + + ImportModule implements the IPortable ImportModule Interface + + + + The Id of the module to be imported + + [lpointer] 31.10.2005 documented + + + + + Represents a piece of Media. + + + + + Instantiates a new instance of the ImageInfo class. + + + + + Gets or sets the unique module identifier. + + + + + ModuleId - backwards compatibility following the VB to C# conversion + + + + + Gets or sets the URL of the Media to display. + + + + + Gets or sets the text to display if the Media cannot be displayed. + + + + + Gets or sets the display width of the Media. + + + + + Gets or sets the display height of the Media. + + + + + Gets or sets the URL to navigate to when the Media is clicked. + + + + + Gets or sets the target in which the will be opened in. + + + + + [Leigh] 26/02/2006 Created + + + + + Gets or sets the TrackClicks in which the will be opened in. + + + + + [Leigh] 26/02/2006 Created + + + + + Gets or sets the MediaAlignment in which the media will use. + + + + + [Leigh] 25/10/2006 Created + + + + + Gets or sets the MediaLoop in which the media will use. + + + + + [wstrohl] - 01/31/2010 - Created + + + + + Gets or sets the AutoStart in which the media will use. + + + + + [wstrohl] - 01/31/2010 - Created + + + + + Gets or sets the MediaType in which the media will use. + + + + + [wstrohl] - 20110319 - Created + + + + + Gets or sets the MediaMessage in which will be displayed with the media. + + + + + [wstrohl] - 20110708 - Created + + + + + Gets or sets the LastUpdatedBy to keep track of who updates the content. + + + + + [wstrohl] - 20110708 - Created + + + + + Gets or sets the LastUpdatedDate to keep track of when the content was last updated. + + + + + [wstrohl] - 20110708 - Created + + + + + WebFriendlyUrl - returns a URL that can immediately be used to display the media source path, regardless of folder provider + + + + + FileExtension - returns the extension for the file + + + + + ContentType - returns the content type of the file + + + + + The MediaModule Class provides the UI for displaying the Media + + + + + + + MediaLiteral control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + MessageLiteral control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + OnInit - initialization of the module + + + + + + Page_Load runs when the control is loaded + + + + + [lpointer] 31.10.2005 Read from Business Layer + [lpointer] 17.10.2006 Updated MediaSrc variable so it reads as lower case variable for Case check. + + + + diff --git a/Modules/Media/EditMedia.ascx b/Modules/Media/EditMedia.ascx new file mode 100644 index 0000000..ee85d1f --- /dev/null +++ b/Modules/Media/EditMedia.ascx @@ -0,0 +1,252 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EditMedia.ascx.cs" Inherits="DotNetNuke.Modules.Media.EditMedia" %> +<%@ Register TagPrefix="dnn" TagName="Tracking" Src="~/controls/URLTrackingControl.ascx" %> +<%@ Register TagPrefix="dnn" TagName="Url" Src="~/controls/URLControl.ascx" %> +<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %> +<%@ Register TagPrefix="dnn" TagName="Text" Src="~/controls/TextEditor.ascx" %> +
+ +

<%= GetLocalizedString("lblFileUpload.Text") %>

+
+
    +
  1. +
    + + + +
    +
  2. +
  3. +
    +
    <%= GetLocalizedString("lblUploadWarning.Text") %>
    +
    +
    + +
    + +
    +
    +
    +
    +

    <%= GetLocalizedString("HostFileTypes.Text") %>:
    [<%= GetLocalizedString("lnkViewFileTypes.Text") %>]

    +
    +

    <%= GetLocalizedString("lblSupportedFileTypes.Text") %>

    + + + "> + + + + + + + + + + + + + + + + + + + + + +
    <%= GetLocalizedString("tblMediaFileTypes.Header.FileType") %><%= GetLocalizedString("tblMediaFileTypes.Header.ModuleSupport") %><%= GetLocalizedString("tblMediaFileTypes.Header.HostSupport") %>
    <%#DataBinder.Eval(Container.DataItem, "FileType") %><%#GetSupportedImage(DataBinder.Eval(Container.DataItem, "ModuleSupport")) %><%#GetSupportedImage(DataBinder.Eval(Container.DataItem, "HostSupport")) %>
    <%#DataBinder.Eval(Container.DataItem, "FileType") %><%#GetSupportedImage(DataBinder.Eval(Container.DataItem, "ModuleSupport")) %><%#GetSupportedImage(DataBinder.Eval(Container.DataItem, "HostSupport")) %>
    + +
    +

    <%= SupportedImage %> = <%= GetLocalizedString("SupportedImage.Text") %>  <%= UnsupportedImage %> = <%= GetLocalizedString("UnsupportedImage.Text") %>

    +
    +
    +
    +
  4. +
  5. +
    + + +
    +
    +
    <%= GetLocalizedString("lblEmbedSupport.Text") %>
    +
    +
  6. +
  7. +
    +

    <%= GetLocalizedString("lblOEmbedDesc.Text") %>

    +
    +
    + + + +
    +
    + +
    +
    +
    <%= GetLocalizedString("lblOEmbedSupport.Text") %>
    +
    +
  8. +
  9. +
    + + + +
    +
  10. +
+
+

<%= GetLocalizedString("BasicSettings.Text") %>

+
+
    +
  1. +
    + + + +
    +
  2. +
  3. +

    <%= GetLocalizedString("VideoDimsRequired.Text") %>

    +
  4. +
  5. +
    + + + +
    +
  6. +
  7. +

    <%= GetLocalizedString("VideoDimsRequired.Text") %>

    +
  8. +
  9. +
    + +
    + +
    +
    +
  10. +
  11. +
    + + +
    +
  12. +
+
+

<%= GetLocalizedString("lblVideosOnly.Text") %>

+
+
    +
  1. +
    <%= GetLocalizedString("lblVideoMessage.Text") %>
    +
  2. +
  3. +
    + + +
    +
  4. +
  5. +
    + + +
    +
  6. +
+
+

<%= GetLocalizedString("lblImagesOnly.Text") %>

+
+
    +
  1. +
    + +
    + +
    +
    +
  2. +
+
+

<%= GetLocalizedString("lblJournalIntegration.Text") %>

+
+
    +
  1. +
    + + +
    +
  2. +
  3. +
    + + +
    +
  4. +
  5. +
    + + +
    +
  6. +
  7. +
    + + +
    +
  8. +
+
+
+
    +
  • + +
  • +
  • + +
  • +
+
+
+
+
+ +
+
+ <%= LastUpdated %> +
+
+ \ No newline at end of file diff --git a/Modules/Media/EditMedia.ascx.cs b/Modules/Media/EditMedia.ascx.cs new file mode 100644 index 0000000..d8cc1b8 --- /dev/null +++ b/Modules/Media/EditMedia.ascx.cs @@ -0,0 +1,917 @@ +// +// DNN Corp - http://www.dnnsoftware.com +// Copyright (c) 2002-2014 +// by DNN Corp +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + +using DotNetNuke.Common; +using DotNetNuke.Common.Utilities; +using DotNetNuke.Entities.Modules; +using DotNetNuke.Security.Roles; +using DotNetNuke.Services.Exceptions; +using DotNetNuke.Services.Journal; +using DotNetNuke.Services.Social.Notifications; +using System; +using DotNetNuke.Entities.Users; +using DotNetNuke.Services.FileSystem; +using DotNetNuke.Security; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using System.Web.UI.WebControls; +using WillStrohl.API.oEmbed; + +namespace DotNetNuke.Modules.Media +{ + public partial class EditMedia : MediaModuleBase + { + #region Private Members + + protected bool p_isNew = true; + private bool? _isAdmin = null; + private string p_UseModuleSettings = Null.NullString; + private string p_None = Null.NullString; + private string p_Left = Null.NullString; + private string p_Center = Null.NullString; + private string p_Right = Null.NullString; + private string p_LastUpdated = Null.NullString; + + private string p_SupportedMediaFileTypes = Null.NullString; + + private const string SUPPORTED_IMAGE = "\"{0}\""; + private const string UNSUPPORTED_IMAGE = "\"{0}\""; + private const string FILE_TYPES_CACHE_KEY = "Media-SupportedFileTypes"; + + private const string YOUTUBE_MATCH = "http://.*\\.youtube\\.com/.*"; + private const string YOUTUBE_OPAQUE = "wmode=opaque"; + private const string YOUTUBE_OPAQUE_MATCH = "(\\?|&)wmode=opaque"; + private const string YOUTUBE_EMBED_URL_MATCH = "(https*://(www\\.)*youtube\\.com/embed/[A-Za-z0-9\\?&=]+)"; + private const string YOUTUBE_EMBED_MATCH = "src=\"(https*://(www\\.)*youtube\\.com/embed/[A-Za-z0-9\\?&=]+)\""; + + public const string NOTIFICATION_TYPE = "DNNMedia_Module_Updated"; + + #endregion + + #region Properties + + private string SupportedMediaFileTypes + { + get + { + if (!(string.IsNullOrEmpty(this.p_SupportedMediaFileTypes))) + { + return this.p_SupportedMediaFileTypes; + } + + this.p_SupportedMediaFileTypes = string.Concat(Globals.glbImageFileTypes, ",", MediaController.MEDIA_FILE_TYPES); + + return this.p_SupportedMediaFileTypes; + } + } + + protected string SupportedImage + { + get + { + return string.Format(SUPPORTED_IMAGE, this.GetLocalizedString("SupportedImage.Text")); + } + } + + protected string UnsupportedImage + { + get + { + return string.Format(UNSUPPORTED_IMAGE, this.GetLocalizedString("UnsupportedImage.Text")); + } + } + + protected string LastUpdated + { + get + { + if (!(string.IsNullOrEmpty(this.p_LastUpdated))) + { + return this.p_LastUpdated; + } + + MediaController objMediaController = new MediaController(); + MediaInfo objMedia = objMediaController.GetMedia(ModuleId); + + if (objMedia != null) + { + UserInfo user = UserController.GetUserById(this.PortalId, objMedia.LastUpdatedBy); + + if (user != null) + { + this.p_LastUpdated = string.Format(this.GetLocalizedString("lblLastUpdated.Text"), user.DisplayName, objMedia.LastUpdatedDate.ToString("MM/dd/yyyy hh:mm:ss tt")); + } + else + { + this.p_LastUpdated = string.Format(this.GetLocalizedString("lblLastUpdated.Text"), this.GetLocalizedString("Unknown.Text"), objMedia.LastUpdatedDate.ToString("MM/dd/yyyy hh:mm:ss tt")); + } + } + + return this.p_LastUpdated; + } + } + + private bool IsCurrentUserAdmin + { + get + { + if (!_isAdmin.HasValue) + { + try + { + _isAdmin = (bool)UserInfo.IsInRole(PortalSettings.AdministratorRoleName); + } + catch (Exception ex) + { + Exceptions.LogException(ex); + _isAdmin = false; + } + } + + return _isAdmin.Value; + } + } + + #endregion + + #region Event Handlers + + /// + /// OnInit - initialization of the module + /// + /// + override protected void OnInit(EventArgs e) + { + InitializeComponent(); + base.OnInit(e); + } + + private void InitializeComponent() + { + //INSTANT C# NOTE: Converted event handler wireups: + this.Load += new System.EventHandler(Page_Load); + cmdCancel.Click += new System.EventHandler(cmdCancel_Click); + cmdUpdate.Click += new System.EventHandler(cmdUpdate_Click); + cvMediaType.ServerValidate += new System.Web.UI.WebControls.ServerValidateEventHandler(cvMediaType_ServerValidate); + radMediaType.SelectedIndexChanged += new System.EventHandler(radMediaType_SelectedIndexChanged); + lnkOEmbed.Click += new System.EventHandler(lnkOEmbed_Click); + chkOverrideJournalSetting.CheckedChanged += new System.EventHandler(chkOverrideJournalSetting_CheckedChanged); + } + + /// + /// Page_Load runs when the control is loaded + /// + /// + /// + /// + /// + private void Page_Load(object sender, System.EventArgs e) + { + try + { + DotNetNuke.Framework.jQuery.RequestDnnPluginsRegistration(); + + //Get the IsNew state from the ViewState + p_isNew = Convert.ToBoolean(ViewState["IsNew"]); + + if (!Page.IsPostBack) + { + this.BindData(); + } + + //Save the IsNew state to the ViewState + ViewState["IsNew"] = p_isNew; + + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc); + } + + } + + /// + /// cmdCancel_Click runs when the cancel button is clicked + /// + /// + /// + /// + /// + private void cmdCancel_Click(object sender, EventArgs e) + { + + this.SendBackToModule(); + + } + + /// + /// cmdUpdate_Click runs when the update button is clicked + /// + /// + /// + /// + /// + private void cmdUpdate_Click(object sender, EventArgs e) + { + + if (Page.IsValid) + { + this.SaveMedia(); + this.SendBackToModule(); + } + + } + + private void cvMediaType_ServerValidate(object source, System.Web.UI.WebControls.ServerValidateEventArgs args) + { + + switch (this.radMediaType.SelectedIndex) + { + case 0: + if (string.IsNullOrEmpty(ctlURL.Url)) + { + args.IsValid = false; + } + break; + case 1: + if (string.IsNullOrEmpty(txtEmbed.Text)) + { + args.IsValid = false; + } + break; + case 2: + if (string.IsNullOrEmpty(txtOEmbed.Text)) + { + args.IsValid = false; + } + break; + } + + } + + private void radMediaType_SelectedIndexChanged(object sender, System.EventArgs e) + { + this.ToggleFileTypeView(this.radMediaType.SelectedIndex); + } + + private void lnkOEmbed_Click(object sender, System.EventArgs e) + { + + if (!(string.IsNullOrEmpty(this.txtOEmbed.Text))) + { + ProviderFormat ctlOEmbedProvider = new ProviderFormat(); + if (ctlOEmbedProvider.IsUrlSupported(this.txtOEmbed.Text)) + { + this.lblOEmbedCheck.Text = string.Concat("
", this.GetLocalizedString("lblOEmbedCheck.Text.Supported"), "
"); + } + else + { + this.lblOEmbedCheck.Text = string.Concat("
", this.GetLocalizedString("lblOEmbedCheck.Text.Unsupported"), "
"); + } + } + else + { + this.lblOEmbedCheck.Text = string.Concat("
", this.GetLocalizedString("lblOEmbedCheck.Text.EmptyString"), "
"); + } + + } + + private void chkOverrideJournalSetting_CheckedChanged(object sender, EventArgs e) + { + HandleOverrideCheckboxEvent(); + } + + #endregion + + #region Databinding + + private void BindData() + { + + this.LocalizeModule(); + + // Obtain a single row of text information + MediaController objMediaController = new MediaController(); + MediaInfo objMedia = objMediaController.GetMedia(ModuleId); + + this.BindControls(); + + if (objMedia != null && objMedia.ModuleID > Null.NullInteger) + { + p_isNew = false; + this.ddlImageAlignment.SelectedValue = objMedia.MediaAlignment.ToString(); + this.ToggleFileTypeView(objMedia.MediaType); + switch (objMedia.MediaType) + { + case 0: // local file system + this.ctlURL.Url = objMedia.Src; + break; + case 1: // embed code + this.txtEmbed.Text = System.Web.HttpUtility.HtmlDecode(objMedia.Src); + break; + case 2: // embedable url + this.txtOEmbed.Text = objMedia.Src; + break; + } + this.txtAlt.Text = objMedia.Alt; + if (objMedia.Width != Null.NullInteger) + { + this.txtWidth.Text = objMedia.Width.ToString(); + } + if (objMedia.Height != Null.NullInteger) + { + this.txtHeight.Text = objMedia.Height.ToString(); + } + this.ctlNavigateUrl.Url = objMedia.NavigateUrl; + this.ctlTracking.URL = objMedia.NavigateUrl; + this.ctlTracking.ModuleID = ModuleId; + this.chkAutoStart.Checked = objMedia.AutoStart; + this.chkLoop.Checked = objMedia.MediaLoop; + + this.txtMessage.Text = objMedia.MediaMessage; + } + else + { + p_isNew = true; + } + + // populate the setting controls + BindSettings(); + + // populate the support file types in the UI + this.BindSupportedFileTypes(); + + ToggleSettingViews(); + + // only show the side-wide settings when Admnistrators are logged in + liSideWideJournalSetting.Visible = UserInfo.IsInRole(PortalSettings.AdministratorRoleName); + liNotifyOnUpdate.Visible = liSideWideJournalSetting.Visible; + } + + private void BindControls() + { + + // Load the Alignment list with localised values + ddlImageAlignment.Items.Add(new ListItem(p_UseModuleSettings, "0")); + ddlImageAlignment.Items.Add(new ListItem(p_None, "1")); + ddlImageAlignment.Items.Add(new ListItem(p_Left, "2")); + ddlImageAlignment.Items.Add(new ListItem(p_Center, "3")); + ddlImageAlignment.Items.Add(new ListItem(p_Right, "4")); + + ctlURL.FileFilter = string.Concat(Globals.glbImageFileTypes, ",", MediaController.MEDIA_FILE_TYPES); + ctlNavigateUrl.ShowNewWindow = true; + ctlNavigateUrl.ShowTrack = true; + ctlNavigateUrl.ShowTabs = true; + ctlNavigateUrl.ShowFiles = true; + + this.ToggleFileTypeView(-1); + + } + + private void BindSupportedFileTypes() + { + + List collFiles = new List(); + object objCache = DotNetNuke.Services.Cache.CachingProvider.Instance().GetItem(FILE_TYPES_CACHE_KEY); + + if (objCache != null) + { + collFiles = (List)objCache; + } + else + { + + ICollection arrModuleSupport = (ICollection)(MediaController.MEDIA_FILE_TYPES.Replace(".", string.Empty).Replace(" ", string.Empty).Split(',')); + ICollection arrHostSupport = (ICollection)(MediaController.SUPPORTED_MEDIA_FILE_TYPES.Split(',')); + + foreach (string oString in arrModuleSupport) + { + FileTypeInfo oFile = new FileTypeInfo(); + oFile.FileType = oString.ToLower(); + oFile.ModuleSupport = true; + oFile.HostSupport = arrHostSupport.Contains(oString); + collFiles.Add(oFile); + } + + collFiles.Sort((p1, p2) => p1.FileType.CompareTo(p2.FileType)); + + DotNetNuke.Services.Cache.CachingProvider.Instance().Insert(FILE_TYPES_CACHE_KEY, collFiles); + + } + + this.rptMediaFileTypes.DataSource = collFiles; + this.rptMediaFileTypes.DataBind(); + + } + + private void BindSettings() + { + chkPostToJournal.Checked = PostToJournal; + chkPostToJournalSiteWide.Checked = PostToJournalSiteWide; + chkOverrideJournalSetting.Checked = OverrideJournalSetting; + chkNotifyOnUpdate.Checked = NotifyOnUpdate; + } + + private void LocalizeModule() + { + p_UseModuleSettings = this.GetLocalizedString("UseModuleSettings.Text"); + p_None = this.GetLocalizedString("None.Text"); + p_Left = this.GetLocalizedString("Left.Text"); + p_Center = this.GetLocalizedString("Center.Text"); + p_Right = this.GetLocalizedString("Right.Text"); + + if (radMediaType.Items.Count == 0) + { + this.radMediaType.Items.Insert(0, new ListItem(this.GetLocalizedString("radMediaType.Items.0"), "0")); + this.radMediaType.Items.Insert(1, new ListItem(this.GetLocalizedString("radMediaType.Items.1"), "1")); + this.radMediaType.Items.Insert(2, new ListItem(this.GetLocalizedString("radMediaType.Items.2"), "2")); + } + + this.txtEmbed.Attributes["title"] = this.GetLocalizedString("plEmbed.Help"); + this.txtOEmbed.Attributes["title"] = this.GetLocalizedString("plOEmbed.Help"); + this.txtAlt.Attributes["title"] = this.GetLocalizedString("plAlt.Help"); + this.txtWidth.Attributes["title"] = this.GetLocalizedString("plWidth.Help"); + this.txtHeight.Attributes["title"] = this.GetLocalizedString("plHeight.Help"); + this.ddlImageAlignment.Attributes["title"] = this.GetLocalizedString("plAlignment.Help"); + this.chkAutoStart.Attributes["title"] = this.GetLocalizedString("lblAutoStart.Help"); + this.chkLoop.Attributes["title"] = this.GetLocalizedString("lblLoop.Help"); + + this.valAltText.ErrorMessage = this.GetLocalizedString("valAltText.ErrorMessage"); + this.valHeight.ErrorMessage = this.GetLocalizedString("valHeight.ErrorMessage"); + this.valWidth.ErrorMessage = this.GetLocalizedString("valWidth.ErrorMessage"); + this.cvMediaType.ErrorMessage = this.GetLocalizedString("valMediaType.ErrorMessage"); + + this.lnkOEmbed.Text = this.GetLocalizedString("lnkOEmbed.Text"); + } + + #endregion + + #region Saving Methods + + private void SaveMedia() + { + + var objMediaController = new MediaController(); + var objMedia = new MediaInfo(); + + try + { + // Update settings in the database + if (this.radMediaType.SelectedIndex == 0) // standard file system + { + if (string.Equals(ctlURL.UrlType, "F")) + { + IFileInfo objFile = FileManager.Instance.GetFile(int.Parse(Regex.Match(this.ctlURL.Url, "\\d+").Value, System.Globalization.NumberStyles.Integer)); + if (objFile != null) + { + if (string.IsNullOrEmpty(this.txtWidth.Text)) + { + this.txtWidth.Text = objFile.Width.ToString(); + } + if (string.IsNullOrEmpty(this.txtHeight.Text)) + { + this.txtHeight.Text = objFile.Height.ToString(); + } + } + } + } + + var sec = new PortalSecurity(); + + objMedia.ModuleID = ModuleId; + objMedia.MediaType = this.radMediaType.SelectedIndex; + switch (this.radMediaType.SelectedIndex) + { + case 0: // standard file system + objMedia.Src = this.ctlURL.Url; + break; + case 1: // embed code + objMedia.Src = this.txtEmbed.Text; + break; + case 2: // oembed url + objMedia.Src = this.txtOEmbed.Text; + break; + } + + // ensure that youtube gets formatted correctly + objMedia.Src = ReformatForYouTube(objMedia.Src); + + objMedia.Alt = sec.InputFilter(this.txtAlt.Text, PortalSecurity.FilterFlag.NoMarkup); + if (!(string.IsNullOrEmpty(this.txtWidth.Text))) + { + objMedia.Width = int.Parse(sec.InputFilter(this.txtWidth.Text, PortalSecurity.FilterFlag.NoMarkup), System.Globalization.NumberStyles.Integer); + } + if (!(string.IsNullOrEmpty(this.txtHeight.Text))) + { + objMedia.Height = int.Parse(sec.InputFilter(this.txtHeight.Text, PortalSecurity.FilterFlag.NoMarkup), System.Globalization.NumberStyles.Integer); + } + objMedia.NavigateUrl = sec.InputFilter(this.ctlNavigateUrl.Url, PortalSecurity.FilterFlag.NoMarkup); + objMedia.MediaAlignment = int.Parse(sec.InputFilter(this.ddlImageAlignment.SelectedValue, PortalSecurity.FilterFlag.NoMarkup), System.Globalization.NumberStyles.Integer); + objMedia.AutoStart = this.chkAutoStart.Checked; + objMedia.MediaLoop = this.chkLoop.Checked; + objMedia.LastUpdatedBy = this.UserId; + objMedia.MediaMessage = sec.InputFilter(this.txtMessage.Text, PortalSecurity.FilterFlag.NoScripting); + + // url tracking + var objUrls = new UrlController(); + objUrls.UpdateUrl(PortalId, this.ctlNavigateUrl.Url, this.ctlNavigateUrl.UrlType, this.ctlNavigateUrl.Log, this.ctlNavigateUrl.Track, ModuleId, this.ctlNavigateUrl.NewWindow); + + // update settings/preferences + SaveMediaSettings(); + + // add/update + if (p_isNew) + { + // add new media + objMediaController.AddMedia(objMedia); + } + else + { + // update existing media + objMediaController.UpdateMedia(objMedia); + } + + // save the update into the journal + if (PostToJournal) AddMediaUpdateToJournal(objMedia); + + // notify the site administrators + if (NotifyOnUpdate) SendNotificationToMessageCenter(objMedia); + + } + catch (Exception exc) //Module failed to load + { + Exceptions.LogException(exc); + //ProcessModuleLoadException(Me, exc) + } + + } + + /// + /// SaveMediaSettings - this allows you to abstract the saving of the settings that can be defined + /// + /// + /// 20120820 - Created. + /// + private void SaveMediaSettings() + { + Entities.Modules.ModuleController ctlModule = new Entities.Modules.ModuleController(); + + // save settings to the module settings data store + ctlModule.UpdateModuleSetting(ModuleId, MediaController.SETTING_POSTTOJOURNAL, chkPostToJournal.Checked.ToString()); + ctlModule.UpdateModuleSetting(ModuleId, MediaController.SETTING_OVERRIDEJOURNALSETTING, chkOverrideJournalSetting.Checked.ToString()); + + /// + /// TODO: Need to add logic to take the setting changes below into account before leaving the page + /// Example: Notify users before leaving this view if that setting just got saved. + /// + + if (IsCurrentUserAdmin) + { + // save settings to the portal settings data store + Entities.Portals.PortalController.UpdatePortalSetting(PortalId, MediaController.SETTING_POSTTOJOURNAL, chkPostToJournal.Checked.ToString(), true, PortalSettings.CultureCode); + Entities.Portals.PortalController.UpdatePortalSetting(PortalId, MediaController.SETTING_POSTTOJOURNALSITEWIDE, chkPostToJournalSiteWide.Checked.ToString(), true, PortalSettings.CultureCode); + + Entities.Portals.PortalController.UpdatePortalSetting(PortalId, MediaController.SETTING_NOTIFYONUPDATE, chkNotifyOnUpdate.Checked.ToString(), true, PortalSettings.CultureCode); + } + + // force the module to use the new settings + Entities.Modules.ModuleController.SynchronizeModule(ModuleId); + } + + #endregion + + #region Navigation + + private void SendBackToModule() + { + + try + { + Response.Redirect(Globals.NavigateURL(), true); + } + catch + { + // do nothing + } + + } + + #endregion + + #region Utility Helpers + + protected string GetSupportedImage(object oValue) + { + + if (oValue != null) + { + var strValue = oValue.ToString(); + if (string.Equals(strValue.ToLower(), "true")) + { + return SupportedImage; + } + else + { + return UnsupportedImage; + } + } + else + { + return UnsupportedImage; + } + + } + + private void ToggleFileTypeView(int Selected) + { + + if (Selected < 0 | Selected > 2) + { + Selected = 0; + } + + this.radMediaType.SelectedIndex = Selected; + + this.liFileSystem.Visible = (Selected == 0); + this.liEmbed.Visible = (Selected == 1); + this.liOEmbed.Visible = (Selected == 2); + + } + + private string ReformatForYouTube(string embedCode) + { + + string strReturn = Server.HtmlDecode(embedCode); + + if (Regex.IsMatch(strReturn, YOUTUBE_EMBED_MATCH, RegexOptions.IgnoreCase)) + { + + // this is an embed code + string strUrl = Regex.Match(embedCode, YOUTUBE_EMBED_MATCH, RegexOptions.IgnoreCase).Groups[1].Value; + + if (!(Regex.IsMatch(strUrl, YOUTUBE_OPAQUE_MATCH, RegexOptions.IgnoreCase))) + { + strUrl = (strUrl.Contains("?")) ? string.Concat(strUrl, "&", YOUTUBE_OPAQUE) : string.Concat(strUrl, "?", YOUTUBE_OPAQUE); + } + + strReturn = Regex.Replace(embedCode, YOUTUBE_EMBED_URL_MATCH, strUrl, RegexOptions.IgnoreCase); + + } + else if (Regex.IsMatch(strReturn, YOUTUBE_MATCH, RegexOptions.IgnoreCase)) + { + + // this is a URL + if (!(Regex.IsMatch(strReturn, YOUTUBE_OPAQUE_MATCH, RegexOptions.IgnoreCase))) + { + strReturn = (strReturn.Contains("?")) ? string.Concat(strReturn, "&", YOUTUBE_OPAQUE) : string.Concat(strReturn, "?", YOUTUBE_OPAQUE); + } + + } + + var sec = new PortalSecurity(); + + return sec.InputFilter(strReturn, PortalSecurity.FilterFlag.NoMarkup); + + } + + private void ToggleSettingViews() + { + // enable the ability to specify post to journal when: + // 1. Site-wide setting is enabled + // ... AND ... + // 2. Override journal setting is disabled + if (PostToJournalSiteWide && OverrideJournalSetting == false) + { + chkPostToJournal.Enabled = false; + } + else + { + chkPostToJournal.Enabled = true; + } + + + // enabke the override capability with: + // 1. Site-wide setting is enabled + chkOverrideJournalSetting.Enabled = PostToJournalSiteWide; + } + + private void HandleOverrideCheckboxEvent() + { + if (PostToJournalSiteWide) + { + chkPostToJournal.Enabled = chkOverrideJournalSetting.Checked; + } + else + { + chkPostToJournal.Enabled = true; + } + } + + #endregion + + #region Social Integration + + /// + /// Adds the media update to the journal + /// + /// + private void AddMediaUpdateToJournal(MediaInfo oMedia) + { + MediaController ctlMedia = new MediaController(); + + // + // Object Keys - great to GET data out of the journal + // Create an oject key scheme unique to your data that will likely never change + // + var objectKey = MediaController.GetObjectKeyForJournal(ModuleId, UserId); + + // + // Defensive coding to prevent duplicate journal entries + // + + // attempt to get a reference to a journal item + var ji = JournalController.Instance.GetJournalItemByKey(PortalId, objectKey); + + // delete the journal item if it already exists + if (ji != null) JournalController.Instance.DeleteJournalItemByKey(PortalId, objectKey); + + // ensure we have a valid title for the journal status + string tabTitle = PortalSettings.ActiveTab.Title; + + // if there isn't a Page Title in the Page Settings, use the Page Name + if (string.IsNullOrEmpty(tabTitle)) tabTitle = PortalSettings.ActiveTab.TabName; + + // Method unique to the Media Module to generate Media markup for images, videos, music, etc. + List lstMedia = ctlMedia.DisplayMedia(ModuleId, TabId, IsEditable, ModuleConfiguration, PortalSettings); + + // + // Create a journal item object + // + + // If valid media was returned, create a new journal item object + if (!string.IsNullOrEmpty(lstMedia[0])) + { + // ensure that an acceptable description is generated for the journal + string desc = string.Empty; + if (!Regex.IsMatch(oMedia.ContentType, @"^image/", RegexOptions.IgnoreCase)) + { + // use a generic placeholder for non-image media as a click-through + desc = string.Format("\"{1}\"", + Common.Globals.NavigateURL(TabId), + oMedia.Alt); + } + else + { + // use the saved media + desc = lstMedia[0]; + } + + // create a new journal item object + ji = new JournalItem + { + PortalId = PortalId, // site id number + ProfileId = UserId, // profile id that this should be posted under + UserId = UserId, // id of the user account that generated the journal item + ContentItemId = ModuleId, // ordinarily, this will be a contentID + Title = oMedia.Alt, // title of the journal item in the meta data + ItemData = new ItemData { + ImageUrl = "\"/DesktopModules/Media/Images/play-button.png\"", + Description = desc, + Title = oMedia.Alt, + Url = Common.Globals.NavigateURL(TabId) }, // used to populate the journal item template, depending on the journal type + Summary = string.Format(GetLocalizedString("Journal.Status.Media.Updated"), + oMedia.Alt, + Common.Globals.NavigateURL(TabId), + tabTitle), // the text shown in the journal status + Body = null, // not really used in the default templates, but could be in your own + JournalTypeId = MediaController.GetMediaJournalTypeID(PortalId), // local method to choose the journal type globally + ObjectKey = objectKey, // your object key from above + SecuritySet = "E," // valid values include: E = Everyone, F = Friends Only, U = Private, P = Profile Only, R[n] = Role Id + }; + } + else + { + // create a generic journal item object for the media + ji = new JournalItem + { + PortalId = PortalId, + ProfileId = UserId, + UserId = UserId, + ContentItemId = ModuleId, // ordinarily, this will be a contentID + Title = oMedia.Alt, + Summary = string.Format(GetLocalizedString("Journal.Status.Media.Updated"), + oMedia.Alt, + Common.Globals.NavigateURL(TabId), + tabTitle), + Body = null, + JournalTypeId = MediaController.GetMediaJournalTypeID(PortalId), + ObjectKey = objectKey, + SecuritySet = "E," + }; + } + + // send your new journal item to the feed + JournalController.Instance.SaveJournalItem(ji, TabId); + } + + /// + /// Sends a notification to the message center + /// + /// + private void SendNotificationToMessageCenter(MediaInfo oMedia) + { + var notificationType = NotificationsController.Instance.GetNotificationType(NOTIFICATION_TYPE); + if (notificationType == null) + { + // add the required notification type + AddNotificationTypes(); + // repopulate the local variable + notificationType = NotificationsController.Instance.GetNotificationType(NOTIFICATION_TYPE); + } + + // generate a notification key + var notificationKey = string.Format("{0}:{1}:{2}", NOTIFICATION_TYPE, TabId, ModuleId); + + // generate a body for the notification message + var messsageBody = string.Format(GetLocalizedString("Notification.Body.ModuleUpdated"), + oMedia.Alt, + Globals.NavigateURL(), + PortalSettings.ActiveTab.TabName); + + // create a new notification object + var objNotification = new Notification + { + NotificationTypeID = notificationType.NotificationTypeId, + Subject = GetLocalizedString("Notification.Subject.ModuleUpdated"), + Body = messsageBody, + IncludeDismissAction = true, + SenderUserID = UserId, + Context = notificationKey + }; + + var colRoles = new List(); + var ctlRole = new RoleController(); + + // get admin role + colRoles.Add(ctlRole.GetRoleByName(PortalId, PortalSettings.AdministratorRoleName)); + + // notify admins + NotificationsController.Instance.SendNotification(objNotification, PortalId, colRoles, null); + } + + /// + /// This will create a notification type used by the module and also handle the actions that must be associated with it. + /// + static internal void AddNotificationTypes() + { + // part of the notification custom actions logic + //var actions = new List(); + + var deskModuleId = DesktopModuleController.GetDesktopModuleByFriendlyName("Media").DesktopModuleID; + + var objNotificationType = new NotificationType + { + Name = NOTIFICATION_TYPE, + Description = "DotNetNuke Media Settings Updated", + DesktopModuleId = deskModuleId + }; + + if (NotificationsController.Instance.GetNotificationType(objNotificationType.Name) != null) return; + + // part of the notification custom actions logic + // Code like this would allow us to call back our own code to perform an action + //var objAction = new NotificationTypeAction + //{ + // NameResourceKey = "Informed", + // DescriptionResourceKey = "InformedDnnMediaUpdate", + // APICall = "DesktopModules/Media/ServiceName.ashx/ActionMethod", + // Order = 1 + //}; + //actions.Add(objAction); + + NotificationsController.Instance.CreateNotificationType(objNotificationType); + + // part of the notification custom actions logic + //NotificationsController.Instance.SetNotificationTypeActions(actions, objNotificationType.NotificationTypeId); + } + + #endregion + } +} \ No newline at end of file diff --git a/Modules/Media/EditMedia.ascx.designer.cs b/Modules/Media/EditMedia.ascx.designer.cs new file mode 100644 index 0000000..e1b0eea --- /dev/null +++ b/Modules/Media/EditMedia.ascx.designer.cs @@ -0,0 +1,447 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DotNetNuke.Modules.Media { + + + public partial class EditMedia { + + /// + /// lblMediaType control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl lblMediaType; + + /// + /// radMediaType control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList radMediaType; + + /// + /// cvMediaType control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator cvMediaType; + + /// + /// liFileSystem control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl liFileSystem; + + /// + /// plURL control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl plURL; + + /// + /// ctlURL control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.UrlControl ctlURL; + + /// + /// rptMediaFileTypes control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater rptMediaFileTypes; + + /// + /// liEmbed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl liEmbed; + + /// + /// lblEmbed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl lblEmbed; + + /// + /// txtEmbed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEmbed; + + /// + /// liOEmbed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl liOEmbed; + + /// + /// lblOEmbed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl lblOEmbed; + + /// + /// txtOEmbed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtOEmbed; + + /// + /// lnkOEmbed control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lnkOEmbed; + + /// + /// lblOEmbedCheck control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblOEmbedCheck; + + /// + /// plAlt control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl plAlt; + + /// + /// txtAlt control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtAlt; + + /// + /// valAltText control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valAltText; + + /// + /// plWidth control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl plWidth; + + /// + /// txtWidth control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtWidth; + + /// + /// valWidth control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valWidth; + + /// + /// plHeight control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl plHeight; + + /// + /// txtHeight control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtHeight; + + /// + /// valHeight control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valHeight; + + /// + /// plMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl plMessage; + + /// + /// txtMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.TextEditor txtMessage; + + /// + /// plAlignment control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl plAlignment; + + /// + /// ddlImageAlignment control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlImageAlignment; + + /// + /// lblAutoStart control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl lblAutoStart; + + /// + /// chkAutoStart control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkAutoStart; + + /// + /// lblLoop control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl lblLoop; + + /// + /// chkLoop control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkLoop; + + /// + /// plNavigateUrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl plNavigateUrl; + + /// + /// ctlNavigateUrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.UrlControl ctlNavigateUrl; + + /// + /// liPostToJournal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl liPostToJournal; + + /// + /// lblPostToJournal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl lblPostToJournal; + + /// + /// chkPostToJournal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPostToJournal; + + /// + /// liSideWideJournalSetting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl liSideWideJournalSetting; + + /// + /// lblPostToJournalSiteWide control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl lblPostToJournalSiteWide; + + /// + /// chkPostToJournalSiteWide control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPostToJournalSiteWide; + + /// + /// lblOverrideJournalSetting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl lblOverrideJournalSetting; + + /// + /// chkOverrideJournalSetting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkOverrideJournalSetting; + + /// + /// liNotifyOnUpdate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl liNotifyOnUpdate; + + /// + /// lblNotifyOnUpdate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.LabelControl lblNotifyOnUpdate; + + /// + /// chkNotifyOnUpdate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkNotifyOnUpdate; + + /// + /// cmdUpdate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdUpdate; + + /// + /// cmdCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton cmdCancel; + + /// + /// ctlTracking control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::DotNetNuke.UI.UserControls.URLTrackingControl ctlTracking; + } +} diff --git a/Modules/Media/Entities/FileTypeInfo.cs b/Modules/Media/Entities/FileTypeInfo.cs new file mode 100644 index 0000000..400466d --- /dev/null +++ b/Modules/Media/Entities/FileTypeInfo.cs @@ -0,0 +1,100 @@ +// +// DNN Corp - http://www.dnnsoftware.com +// Copyright (c) 2002-2014 +// by DNN Corp +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + +using System; +using DotNetNuke.Common.Utilities; + +namespace DotNetNuke.Modules.Media +{ + + /// + /// Represents a File Type object. + /// + [Serializable] + public class FileTypeInfo : IFileTypeInfo + { + +#region Fields + + private string p_FileType = Null.NullString; + private bool p_HostSupport = Null.NullBoolean; + private bool p_ModuleSupport = Null.NullBoolean; + +#endregion + +#region Initialization + + public FileTypeInfo() + { + // do nothing + } + + public FileTypeInfo(string FileType, bool ModuleSupport, bool HostSupport) + { + this.p_FileType = FileType; + this.p_ModuleSupport = ModuleSupport; + this.p_HostSupport = HostSupport; + } + +#endregion + +#region Properties + + public string FileType + { + get + { + return this.p_FileType; + } + set + { + this.p_FileType = value; + } + } + + public bool HostSupport + { + get + { + return this.p_HostSupport; + } + set + { + this.p_HostSupport = value; + } + } + + public bool ModuleSupport + { + get + { + return this.p_ModuleSupport; + } + set + { + this.p_ModuleSupport = value; + } + } + +#endregion + + } + +} diff --git a/Modules/Media/Entities/IFileTypeInfo.cs b/Modules/Media/Entities/IFileTypeInfo.cs new file mode 100644 index 0000000..2d2858a --- /dev/null +++ b/Modules/Media/Entities/IFileTypeInfo.cs @@ -0,0 +1,42 @@ +// +// DNN Corp - http://www.dnnsoftware.com +// Copyright (c) 2002-2014 +// by DNN Corp +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + +//INSTANT C# NOTE: Formerly VB project-level imports: +using DotNetNuke; +using DotNetNuke.Common; +using DotNetNuke.Common.Utilities; +using DotNetNuke.Services.Exceptions; +using DotNetNuke.Services.Localization; +using System; +using System.Collections; +using System.Data; +using System.Diagnostics; + +namespace DotNetNuke.Modules.Media +{ + + public interface IFileTypeInfo + { + string FileType {get; set;} + bool ModuleSupport {get; set;} + bool HostSupport {get; set;} + } + +} \ No newline at end of file diff --git a/Modules/Media/Entities/IMediaInfo.cs b/Modules/Media/Entities/IMediaInfo.cs new file mode 100644 index 0000000..db6ca1c --- /dev/null +++ b/Modules/Media/Entities/IMediaInfo.cs @@ -0,0 +1,55 @@ +// +// DNN Corp - http://www.dnnsoftware.com +// Copyright (c) 2002-2014 +// by DNN Corp +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + +//INSTANT C# NOTE: Formerly VB project-level imports: +using DotNetNuke; +using DotNetNuke.Common; +using DotNetNuke.Common.Utilities; +using DotNetNuke.Services.Exceptions; +using DotNetNuke.Services.Localization; +using System; +using System.Collections; +using System.Data; +using System.Diagnostics; + +namespace DotNetNuke.Modules.Media +{ + + public interface IMediaInfo + { + int ModuleId { get; set; } + string Src { get; set; } + string Alt { get; set; } + int Width { get; set; } + int Height { get; set; } + string NavigateUrl { get; set; } + int MediaAlignment { get; set; } + bool MediaLoop { get; set; } + bool AutoStart { get; set; } + int MediaType { get; set; } + string MediaMessage { get; set; } + int LastUpdatedBy { get; set; } + DateTime LastUpdatedDate { get; set; } + string FileExtension { get; set; } + string WebFriendlyUrl { get; set; } + string ContentType { get; set; } + } + +} \ No newline at end of file diff --git a/Modules/Media/Entities/MediaInfo.cs b/Modules/Media/Entities/MediaInfo.cs new file mode 100644 index 0000000..2eabf0e --- /dev/null +++ b/Modules/Media/Entities/MediaInfo.cs @@ -0,0 +1,619 @@ +// +// DNN Corp - http://www.dnnsoftware.com +// Copyright (c) 2002-2014 +// by DNN Corp +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + +//ORIGINAL LINE: Imports DotNetNuke.Modules.Media.MediaInfoMembers +//INSTANT C# NOTE: The following line has been modified since C# non-aliased 'using' statements only operate on namespaces: +//INSTANT C# NOTE: Formerly VB project-level imports: +using DotNetNuke.Common.Utilities; +using DotNetNuke.Services.Exceptions; +using System; +using System.Text.RegularExpressions; +using DotNetNuke.Services.FileSystem; + +namespace DotNetNuke.Modules.Media +{ + + /// + /// Represents a piece of Media. + /// + [Serializable()] + public class MediaInfo : Entities.Modules.IHydratable, IMediaInfo + { + + #region Constants + + private const string FILE_PATH_PATTERN = @"^([\w-\s]+/)*([\w-\s]+\.\w{2,})$"; + + #endregion + + #region Fields + + private int p_ModuleID = Null.NullInteger; + private string p_Src = Null.NullString; + private string p_Alt = Null.NullString; + private int p_Width = Null.NullInteger; + private int p_Height = Null.NullInteger; + private string p_NavigateUrl = Null.NullString; + private bool p_NewWindow = Null.NullBoolean; + private bool p_TrackClicks = Null.NullBoolean; + // 03.02.03 + private int p_MediaAlignment = Null.NullInteger; + // 03.03.00 + private bool p_MediaLoop = Null.NullBoolean; + private bool p_AutoStart = Null.NullBoolean; + // 04.00.00 + private int p_MediaType = Null.NullInteger; + // 04.01.00 + private string p_MediaMessage = Null.NullString; + private int p_LastUpdatedBy = Null.NullInteger; + private DateTime p_LastUpdatedDate = Null.NullDate; + + #endregion + + #region Initialization + + /// + /// Instantiates a new instance of the ImageInfo class. + /// + public MediaInfo() + { + this.p_ModuleID = -1; + this.p_Src = string.Empty; + this.p_Alt = string.Empty; + this.p_Width = -1; + this.p_Height = -1; + this.p_NavigateUrl = string.Empty; + this.p_NewWindow = false; + this.p_TrackClicks = false; + this.p_MediaAlignment = 0; + this.p_MediaLoop = false; + this.p_AutoStart = false; + this.p_MediaType = 0; + this.p_MediaMessage = string.Empty; + this.p_LastUpdatedBy = -1; + this.p_LastUpdatedDate = DateTime.MinValue; + } + + #endregion + + #region Properties + + /// + /// Gets or sets the unique module identifier. + /// + public int ModuleId + { + get + { + return this.ModuleID; + } + set + { + this.ModuleID = value; + } + } + + /// + /// ModuleId - backwards compatibility following the VB to C# conversion + /// + public int ModuleID + { + get + { + return this.p_ModuleID; + } + set + { + this.p_ModuleID = value; + } + } + + /// + /// Gets or sets the URL of the Media to display. + /// + public string Src + { + get + { + return this.p_Src; + } + set + { + this.p_Src = value; + } + } + + /// + /// Gets or sets the text to display if the Media cannot be displayed. + /// + public string Alt + { + get + { + return this.p_Alt; + } + set + { + this.p_Alt = value; + } + } + + /// + /// Gets or sets the display width of the Media. + /// + public int Width + { + get + { + return this.p_Width; + } + set + { + this.p_Width = value; + } + } + + /// + /// Gets or sets the display height of the Media. + /// + public int Height + { + get + { + return this.p_Height; + } + set + { + this.p_Height = value; + } + } + + /// + /// Gets or sets the URL to navigate to when the Media is clicked. + /// + public string NavigateUrl + { + get + { + return this.p_NavigateUrl; + } + set + { + this.p_NavigateUrl = value; + } + } + + /// + /// Gets or sets the target in which the will be opened in. + /// + /// + /// + /// + /// [Leigh] 26/02/2006 Created + /// + public bool NewWindow + { + get + { + return this.p_NewWindow; + } + set + { + this.p_NewWindow = value; + } + } + + /// + /// Gets or sets the TrackClicks in which the will be opened in. + /// + /// + /// + /// + /// [Leigh] 26/02/2006 Created + /// + public bool TrackClicks + { + get + { + return this.p_TrackClicks; + } + set + { + this.p_TrackClicks = value; + } + } + + /// + /// Gets or sets the MediaAlignment in which the media will use. + /// + /// + /// + /// + /// [Leigh] 25/10/2006 Created + /// + public int MediaAlignment + { + get + { + return this.p_MediaAlignment; + } + set + { + this.p_MediaAlignment = value; + } + } + + /// + /// Gets or sets the MediaLoop in which the media will use. + /// + /// + /// + /// + /// [wstrohl] - 01/31/2010 - Created + /// + public bool MediaLoop + { + get + { + return this.p_MediaLoop; + } + set + { + this.p_MediaLoop = value; + } + } + + /// + /// Gets or sets the AutoStart in which the media will use. + /// + /// + /// + /// + /// [wstrohl] - 01/31/2010 - Created + /// + public bool AutoStart + { + get + { + return this.p_AutoStart; + } + set + { + this.p_AutoStart = value; + } + } + + /// + /// Gets or sets the MediaType in which the media will use. + /// + /// + /// + /// + /// [wstrohl] - 20110319 - Created + /// + public int MediaType + { + get + { + return this.p_MediaType; + } + set + { + this.p_MediaType = value; + } + } + + /// + /// Gets or sets the MediaMessage in which will be displayed with the media. + /// + /// + /// + /// + /// [wstrohl] - 20110708 - Created + /// + public string MediaMessage + { + get + { + return this.p_MediaMessage; + } + set + { + this.p_MediaMessage = value; + } + } + + /// + /// Gets or sets the LastUpdatedBy to keep track of who updates the content. + /// + /// + /// + /// + /// [wstrohl] - 20110708 - Created + /// + public int LastUpdatedBy + { + get + { + return this.p_LastUpdatedBy; + } + set + { + this.p_LastUpdatedBy = value; + } + } + + /// + /// Gets or sets the LastUpdatedDate to keep track of when the content was last updated. + /// + /// + /// + /// + /// [wstrohl] - 20110708 - Created + /// + public DateTime LastUpdatedDate + { + get + { + return this.p_LastUpdatedDate; + } + set + { + this.p_LastUpdatedDate = value; + } + } + + /// + /// WebFriendlyUrl - returns a URL that can immediately be used to display the media source path, regardless of folder provider + /// + public string WebFriendlyUrl + { + get + { + if (Regex.IsMatch(Src, @"^FileID=\d+$")) + { + int fileId = int.Parse(Regex.Replace(Src, @"FileID=", string.Empty)); + IFileInfo oFile = FileManager.Instance.GetFile(fileId); + MediaController ctlMedia = new MediaController(); + + return ctlMedia.GetFileUrl(oFile); + } + else if (Regex.IsMatch(Src, FILE_PATH_PATTERN)) + { + // IMPORTANT NOTE!! + // This code is not thread safe... The portal settings require an active web session + Entities.Portals.PortalSettings settings = Entities.Portals.PortalController.GetCurrentPortalSettings(); + //string folderPath = Regex.Match(Src, FILE_PATH_PATTERN).Groups[1].Value; + //string fileName = Regex.Match(Src, FILE_PATH_PATTERN).Groups[2].Value; + // Fix suggested from Issue 23595 + string fileName = Regex.Match(Src, FILE_PATH_PATTERN).Groups[2].Value; + string folderPath = Src.Substring(0, Src.Length - fileName.Length); + + IFolderInfo oFolder = FolderManager.Instance.GetFolder(settings.PortalId, folderPath); + MediaController ctlMedia = new MediaController(); + IFileInfo oFile = ctlMedia.GetFileFromProvider(settings.PortalId, oFolder, fileName); + + return ctlMedia.GetFileUrl(oFile); + } + else + { + return Src; + } + } + set { } + } + + /// + /// FileExtension - returns the extension for the file + /// + public string FileExtension + { + get + { + if (Regex.IsMatch(Src, @"^FileID=\d+$")) + { + int fileId = int.Parse(Regex.Replace(Src, @"FileID=", string.Empty)); + IFileInfo oFile = FileManager.Instance.GetFile(fileId); + + return oFile.Extension; + } + else if (Regex.IsMatch(Src, FILE_PATH_PATTERN)) + { + return Regex.Match(Src, @"\.(\w{2,})$").Groups[1].Value; + } + else + { + return string.Empty; + } + } + set { } + } + + /// + /// ContentType - returns the content type of the file + /// + public string ContentType + { + get + { + if (Regex.IsMatch(Src, @"^FileID=\d+$")) + { + int fileId = int.Parse(Regex.Replace(Src, @"FileID=", string.Empty)); + IFileInfo oFile = FileManager.Instance.GetFile(fileId); + + return oFile.ContentType; + } + else if (Regex.IsMatch(Src, FILE_PATH_PATTERN)) + { + // IMPORTANT NOTE!! + // This code is not thread safe... The portal settings require an active web session + Entities.Portals.PortalSettings settings = Entities.Portals.PortalController.GetCurrentPortalSettings(); + string folderPath = Regex.Match(Src, FILE_PATH_PATTERN).Groups[1].Value; + string fileName = Regex.Match(Src, FILE_PATH_PATTERN).Groups[2].Value; + + IFolderInfo oFolder = FolderManager.Instance.GetFolder(settings.PortalId, folderPath); + MediaController ctlMedia = new MediaController(); + IFileInfo oFile = ctlMedia.GetFileFromProvider(settings.PortalId, oFolder, fileName); + + return oFile.ContentType; + } + else + { + return string.Empty; + } + } + set { } + } + + #endregion + + #region IHydratable Implementation + + public void Fill(System.Data.IDataReader dr) + { + try + { + while (dr.Read()) + { + if (dr[MediaInfoMembers.AltField] != null) + { + this.p_Alt = dr[MediaInfoMembers.AltField].ToString(); + } + if (dr[MediaInfoMembers.HeightField] != null) + { + if (RegExUtility.IsNumber(dr[MediaInfoMembers.HeightField])) + { + this.p_Height = int.Parse(dr[MediaInfoMembers.HeightField].ToString(), System.Globalization.NumberStyles.Integer); + } + } + if (dr[MediaInfoMembers.MediaAlignmentField] != null) + { + if (RegExUtility.IsNumber(dr[MediaInfoMembers.MediaAlignmentField])) + { + this.p_MediaAlignment = int.Parse(dr[MediaInfoMembers.MediaAlignmentField].ToString(), System.Globalization.NumberStyles.Integer); + } + } + if (dr[MediaInfoMembers.ModuleIdField] != null) + { + if (RegExUtility.IsNumber(dr[MediaInfoMembers.ModuleIdField])) + { + this.p_ModuleID = int.Parse(dr[MediaInfoMembers.ModuleIdField].ToString(), System.Globalization.NumberStyles.Integer); + } + } + if (dr[MediaInfoMembers.NavigateUrlField] != null) + { + this.p_NavigateUrl = dr[MediaInfoMembers.NavigateUrlField].ToString(); + } + if (dr[MediaInfoMembers.NewWindowField] != null) + { + if (RegExUtility.IsBoolean(dr[MediaInfoMembers.NewWindowField])) + { + this.p_NewWindow = bool.Parse(dr[MediaInfoMembers.NewWindowField].ToString()); + } + } + if (dr[MediaInfoMembers.SrcField] != null) + { + this.p_Src = dr[MediaInfoMembers.SrcField].ToString(); + } + if (dr[MediaInfoMembers.TrackClicksField] != null) + { + if (RegExUtility.IsBoolean(dr[MediaInfoMembers.TrackClicksField])) + { + this.p_TrackClicks = bool.Parse(dr[MediaInfoMembers.TrackClicksField].ToString()); + } + } + if (dr[MediaInfoMembers.WidthField] != null) + { + if (RegExUtility.IsNumber(dr[MediaInfoMembers.WidthField])) + { + this.p_Width = int.Parse(dr[MediaInfoMembers.WidthField].ToString(), System.Globalization.NumberStyles.Integer); + } + } + if (dr[MediaInfoMembers.MediaLoopField] != null) + { + if (RegExUtility.IsBoolean(dr[MediaInfoMembers.MediaLoopField])) + { + this.p_MediaLoop = bool.Parse(dr[MediaInfoMembers.MediaLoopField].ToString()); + } + } + if (dr[MediaInfoMembers.AutoStartField] != null) + { + if (RegExUtility.IsBoolean(dr[MediaInfoMembers.AutoStartField])) + { + this.p_AutoStart = bool.Parse(dr[MediaInfoMembers.AutoStartField].ToString()); + } + } + if (dr[MediaInfoMembers.MediaTypeField] != null) + { + if (RegExUtility.IsNumber(dr[MediaInfoMembers.MediaTypeField])) + { + this.p_MediaType = int.Parse(dr[MediaInfoMembers.MediaTypeField].ToString(), System.Globalization.NumberStyles.Integer); + } + } + if (dr[MediaInfoMembers.MediaMessageField] != null) + { + this.p_MediaMessage = dr[MediaInfoMembers.MediaMessageField].ToString(); + } + if (dr[MediaInfoMembers.LastUpdatedByField] != null) + { + if (RegExUtility.IsNumber(dr[MediaInfoMembers.LastUpdatedByField])) + { + this.p_LastUpdatedBy = int.Parse(dr[MediaInfoMembers.LastUpdatedByField].ToString(), System.Globalization.NumberStyles.Integer); + } + } + if (dr[MediaInfoMembers.LastUpdatedDateField] != null) + { + if (SimulateIsDate.IsDate(dr[MediaInfoMembers.LastUpdatedDateField])) + { + DateTime.TryParse(dr[MediaInfoMembers.LastUpdatedDateField].ToString(), out this.p_LastUpdatedDate); + } + } + } + } + catch (Exception ex) + { + Exceptions.LogException(ex); + } + finally + { + if (!dr.IsClosed) + { + dr.Close(); + } + } + } + + public int KeyID + { + get + { + return this.p_ModuleID; + } + set + { + this.p_ModuleID = value; + } + } + + #endregion + + } + +} diff --git a/Modules/Media/Entities/MediaInfoMembers.cs b/Modules/Media/Entities/MediaInfoMembers.cs new file mode 100644 index 0000000..2eb860c --- /dev/null +++ b/Modules/Media/Entities/MediaInfoMembers.cs @@ -0,0 +1,60 @@ +// +// DNN Corp - http://www.dnnsoftware.com +// Copyright (c) 2002-2014 +// by DNN Corp +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + +//INSTANT C# NOTE: Formerly VB project-level imports: +using DotNetNuke; +using DotNetNuke.Common; +using DotNetNuke.Common.Utilities; +using DotNetNuke.Services.Exceptions; +using DotNetNuke.Services.Localization; +using System; +using System.Collections; +using System.Data; +using System.Diagnostics; + +namespace DotNetNuke.Modules.Media +{ + + public sealed class MediaInfoMembers + { + + public const string ModuleIdField = "ModuleID"; + public const string SrcField = "Src"; + public const string AltField = "alt"; + public const string WidthField = "width"; + public const string HeightField = "height"; + public const string NavigateUrlField = "NavigateUrl"; + public const string MediaAlignmentField = "MediaAlignment"; + // + public const string NewWindowField = "NewWindow"; + public const string TrackClicksField = "TrackClicks"; + // + public const string MediaLoopField = "MediaLoop"; + public const string AutoStartField = "AutoStart"; + // + public const string MediaTypeField = "MediaType"; + // + public const string MediaMessageField = "MediaMessage"; + public const string LastUpdatedByField = "LastUpdatedBy"; + public const string LastUpdatedDateField = "LastUpdatedDate"; + + } + +} \ No newline at end of file diff --git a/Modules/Media/Images/logo/dnnmedia-logo-100x100.png b/Modules/Media/Images/logo/dnnmedia-logo-100x100.png new file mode 100644 index 0000000..99e0fc4 Binary files /dev/null and b/Modules/Media/Images/logo/dnnmedia-logo-100x100.png differ diff --git a/Modules/Media/Images/logo/dnnmedia-logo-150x150.png b/Modules/Media/Images/logo/dnnmedia-logo-150x150.png new file mode 100644 index 0000000..cfabbc7 Binary files /dev/null and b/Modules/Media/Images/logo/dnnmedia-logo-150x150.png differ diff --git a/Modules/Media/Images/logo/dnnmedia-logo-200x200.png b/Modules/Media/Images/logo/dnnmedia-logo-200x200.png new file mode 100644 index 0000000..321c3fb Binary files /dev/null and b/Modules/Media/Images/logo/dnnmedia-logo-200x200.png differ diff --git a/Modules/Media/Images/logo/dnnmedia-logo-250x249.png b/Modules/Media/Images/logo/dnnmedia-logo-250x249.png new file mode 100644 index 0000000..ef50653 Binary files /dev/null and b/Modules/Media/Images/logo/dnnmedia-logo-250x249.png differ diff --git a/Modules/Media/Images/logo/dnnmedia-logo-300x300.png b/Modules/Media/Images/logo/dnnmedia-logo-300x300.png new file mode 100644 index 0000000..eab11fa Binary files /dev/null and b/Modules/Media/Images/logo/dnnmedia-logo-300x300.png differ diff --git a/Modules/Media/Images/logo/dnnmedia-logo-50x50.png b/Modules/Media/Images/logo/dnnmedia-logo-50x50.png new file mode 100644 index 0000000..71ef005 Binary files /dev/null and b/Modules/Media/Images/logo/dnnmedia-logo-50x50.png differ diff --git a/Modules/Media/Images/play-button.png b/Modules/Media/Images/play-button.png new file mode 100644 index 0000000..d5b1279 Binary files /dev/null and b/Modules/Media/Images/play-button.png differ diff --git a/Modules/Media/License.txt b/Modules/Media/License.txt new file mode 100644 index 0000000..355d1b9 --- /dev/null +++ b/Modules/Media/License.txt @@ -0,0 +1,8 @@ +

DNN Corp - http://www.dnnsoftware.com
+Copyright (c) 2002-2018 by DNN Corp

+ +

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

+ +

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

+ +

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

\ No newline at end of file diff --git a/Modules/Media/MediaModule.ascx b/Modules/Media/MediaModule.ascx new file mode 100644 index 0000000..027f149 --- /dev/null +++ b/Modules/Media/MediaModule.ascx @@ -0,0 +1,3 @@ +<%@ Control language="C#" Inherits="DotNetNuke.Modules.Media.MediaModule" CodeBehind="MediaModule.ascx.cs" AutoEventWireup="false" %> + + \ No newline at end of file diff --git a/Modules/Media/MediaModule.ascx.cs b/Modules/Media/MediaModule.ascx.cs new file mode 100644 index 0000000..c55678b --- /dev/null +++ b/Modules/Media/MediaModule.ascx.cs @@ -0,0 +1,148 @@ +// +// DNN Corp - http://www.dnnsoftware.com +// Copyright (c) 2002-2014 +// by DNN Corp +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + +using DotNetNuke.Services.Exceptions; +using System; +using System.Collections.Generic; +using DNNSkins = DotNetNuke.UI.Skins; +using DotNetNuke.UI.Skins.Controls; +using System.Web; + +namespace DotNetNuke.Modules.Media +{ + + /// + /// The MediaModule Class provides the UI for displaying the Media + /// + /// + /// + public partial class MediaModule : MediaModuleBase, DotNetNuke.Entities.Modules.IActionable + { + + #region Constants + + private const string MEDIA_WRAPPER_TAG = "
{0}
"; + private const string NOMEDIA_TAG = "
{0}
"; + private const string MESSAGE_TAG = "
{1}
"; + + #endregion + + #region Event Handlers + + /// + /// OnInit - initialization of the module + /// + /// + override protected void OnInit(EventArgs e) + { + InitializeComponent(); + base.OnInit(e); + } + + private void InitializeComponent() + { + this.Load += new System.EventHandler(Page_Load); + } + + /// + /// Page_Load runs when the control is loaded + /// + /// + /// + /// + /// [lpointer] 31.10.2005 Read from Business Layer + /// [lpointer] 17.10.2006 Updated MediaSrc variable so it reads as lower case variable for Case check. + /// + private void Page_Load(object sender, EventArgs e) + { + try + { + DotNetNuke.Framework.jQuery.RequestRegistration(); + + BindData(); + } + catch (Exception exc) //Module failed to load + { + Exceptions.ProcessModuleLoadException(this, exc, UserInfo.IsSuperUser); + } + + } + + #endregion + + #region Private Methods + + private void BindData() + { + MediaController ctlMedia = new MediaController(); + List lstMedia = ctlMedia.DisplayMedia(ModuleId, TabId, IsEditable, ModuleConfiguration, PortalSettings); + + if (string.IsNullOrEmpty(lstMedia[0])) + { + if (IsEditable) + { + // there is no media yet + DNNSkins.Skin.AddModuleMessage(this, GetLocalizedString("NoMediaMessage.Text"), + ModuleMessage.ModuleMessageType.BlueInfo); + } + else + { + // hide the module + ContainerControl.Visible = false; + } + return; + } + + if (!string.IsNullOrEmpty(lstMedia[2])) + { + // there's an error returned + DNNSkins.Skin.AddModuleMessage(this, GetLocalizedString(lstMedia[1]), ModuleMessage.ModuleMessageType.YellowWarning); + } + else + { + // there's media to display + MediaLiteral.Text = string.Format(MEDIA_WRAPPER_TAG, lstMedia[0]); + + if (!string.IsNullOrEmpty(lstMedia[1])) + { + MessageLiteral.Text = string.Format(MESSAGE_TAG, TabModuleId, HttpUtility.HtmlDecode(lstMedia[1])); + } + } + } + + #endregion + + #region Optional Interfaces + + public DotNetNuke.Entities.Modules.Actions.ModuleActionCollection ModuleActions + { + get + { + DotNetNuke.Entities.Modules.Actions.ModuleActionCollection Actions = new DotNetNuke.Entities.Modules.Actions.ModuleActionCollection(); + Actions.Add(GetNextActionID(), this.GetLocalizedString(DotNetNuke.Entities.Modules.Actions.ModuleActionType.AddContent), DotNetNuke.Entities.Modules.Actions.ModuleActionType.AddContent, string.Empty, string.Empty, EditUrl(), false, DotNetNuke.Security.SecurityAccessLevel.Edit, true, false); + return Actions; + } + } + + #endregion + + } + +} \ No newline at end of file diff --git a/Modules/Media/MediaModule.ascx.designer.cs b/Modules/Media/MediaModule.ascx.designer.cs new file mode 100644 index 0000000..0235284 --- /dev/null +++ b/Modules/Media/MediaModule.ascx.designer.cs @@ -0,0 +1,46 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + +//INSTANT C# NOTE: Formerly VB project-level imports: +using DotNetNuke; +using DotNetNuke.Common; +using DotNetNuke.Common.Utilities; +using DotNetNuke.Services.Exceptions; +using DotNetNuke.Services.Localization; +using System; +using System.Collections; +using System.Data; +using System.Diagnostics; + +namespace DotNetNuke.Modules.Media +{ + + public partial class MediaModule + { + + /// + ///MediaLiteral control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal MediaLiteral; + + /// + ///MessageLiteral control. + /// + /// + ///Auto-generated field. + ///To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal MessageLiteral; + } +} diff --git a/Modules/Media/Module.build b/Modules/Media/Module.build new file mode 100644 index 0000000..458ed5b --- /dev/null +++ b/Modules/Media/Module.build @@ -0,0 +1,55 @@ + + + Media + DNN_Media + DNN_Media + + + zip + $(MSBuildProjectDirectory)\..\..\Build + $(MSBuildProjectDirectory)\..\..\Website + $(WebsitePath)\Install\Module + $(WebsitePath)\DesktopModules\$(ModulePath) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Modules/Media/Module.css b/Modules/Media/Module.css new file mode 100644 index 0000000..2bc670a --- /dev/null +++ b/Modules/Media/Module.css @@ -0,0 +1,48 @@ +/* +Default CSS for the DotNetNuke Media Module +(C) Copyright 2002-2011 by DotNetNuke Corporation +*/ +.dnnmedia_wrapper { width:98%; } +.dnnMedia-Wrapper, .dnnMedia-Wrapper iframe, .dnnMedia-Wrapper object { position: relative; z-index: 899 !important; } +.dnnmedia_image { border:0px solid #ffffff; } +.dnnmedia_left, .dnnmedia_left * { text-align:left; } +.dnnmedia_right, .dnnmedia_right * { text-align:right; } +.dnnmedia_center, .dnnmedia_center * { text-align:center; } +.dnnmedia_wmp, .dnnmedia_wmp * { position:relative !important; z-index:2 !important; } +.dnnmedia_italic { font-style: italic; } + +/* +media options view +*/ +#dnnEditEntry { margin-top:3.2em; } +#dnnmedia-filesupport-wrapper { margin-left:24em; } +div.dnnForm.dnnTextEditor.dnnClear { min-width:570px !important; width:96%; } +.dnnmedia-message { margin-top:0.5em; } +.dnnmedia_textbox { width:275px; margin-right:1em !important; } +.dnnmedia-audit { margin-top:0.5em; } + +fieldset.dnnmedia-fieldset { margin-bottom:1em !important; } + fieldset.dnnmedia-fieldset ol.dnnmedia-list { padding:1em 1em 0 1em; list-style:none; } + fieldset.dnnmedia-fieldset li.dnnmedia-listitem { padding-bottom:1em; list-style:none; line-height:1.6em; } + +#divMediaCommands { margin-top:0.8em; text-align:left; } + ul#ulMediaCommands { list-style-type:none; } + ul#ulMediaCommands li { display:inline; margin-right:10px; } + +#pSupportedFileTypesLegend { margin-left:7em; } + +#tblMediaFileTypes { width:350px; border:1px solid #000000; margin-bottom:0.5em; margin-left:7em; } +#tblMediaFileTypes tr td { border:1px solid #000000; padding:2px 2px 2px 6px; } + .dnnmedia-filetype-headrow td { font-weight:bold; background-color:#c0c0c0; } + .dnnmedia-filetype-altrow { background-color:#f0f0f0; } + .dnnmedia-filetype-filetype { width:150px; } + .dnnmedia-filetype-modulesupport, .dnnmedia-filetype-hostsupport { width: 100px; } + +.dnnmedia-hidden { display:none; } + +.dnnFormItem span label, .dnnFormItem div.urlControl label { width:inherit; } +p.dnnmedia-form-message { margin:0 0 0 19em; } +.dnnFormItem div.urlControl label { float:none !important; text-align:inherit !important; } + +div.dnnssStat { border-top:1px #ccc solid; padding:1em 0 4em; overflow:hidden; } + .dnnssStat p { float:left; padding-right:2em; } \ No newline at end of file diff --git a/Modules/Media/Properties/AssemblyInfo.cs b/Modules/Media/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0615ddb --- /dev/null +++ b/Modules/Media/Properties/AssemblyInfo.cs @@ -0,0 +1,69 @@ +// +// DNN Corp - http://www.dnnsoftware.com +// Copyright (c) 2002-2014 +// by DNN Corp +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + +//INSTANT C# NOTE: Formerly VB project-level imports: +using DotNetNuke; +using DotNetNuke.Common; +using DotNetNuke.Common.Utilities; +using DotNetNuke.Services.Exceptions; +using DotNetNuke.Services.Localization; +using System; +using System.Collections; +using System.Data; +using System.Diagnostics; + +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. + +// Review the values of the assembly attributes + +[assembly: AssemblyTitle("DotNetNuke.Modules.Media")] +[assembly: AssemblyDescription("ASP.NET Open Source Portal Application, Media Module")] +[assembly: AssemblyCompany("DotNetNuke Corporation")] +[assembly: AssemblyProduct("http://www.dotnetnuke.com")] +[assembly: AssemblyCopyright("Portal engine source code is copyright © 2002-YYYY by DotNetNuke. All Rights Reserved")] +[assembly: AssemblyTrademark("DotNetNuke")] +//[assembly: CLSCompliant(true)] + +//The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("BAADD8D9-32E9-4482-B06F-61D50AE2866D")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("04.04.02")] + +[assembly: AssemblyFileVersionAttribute("04.04.02")] + +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff --git a/Modules/Media/Providers/DataProviders/SqlDataProvider/03.02.00.SqlDataProvider b/Modules/Media/Providers/DataProviders/SqlDataProvider/03.02.00.SqlDataProvider new file mode 100644 index 0000000..54b2a01 --- /dev/null +++ b/Modules/Media/Providers/DataProviders/SqlDataProvider/03.02.00.SqlDataProvider @@ -0,0 +1,195 @@ +/************************************************************/ +/***** SqlDataProvider *****/ +/***** *****/ +/***** *****/ +/***** Note: To manually execute this script you must *****/ +/***** perform a search and replace operation *****/ +/***** for {databaseOwner} and {objectQualifier} *****/ +/***** *****/ +/************************************************************/ + +/** Create Table and process Media Information**/ + +if not exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Media]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) + + + BEGIN + CREATE TABLE {databaseOwner}[{objectQualifier}Media] + ( + [ModuleID] [int] NOT NULL, + [Src] nvarchar(250) NOT NULL, + [alt] nvarchar(100) NULL, + [width] [int] NULL, + [height] [int] NULL, + [NavigateUrl] NVARCHAR(250) + ) + + ALTER TABLE {databaseOwner}[{objectQualifier}Media] ADD CONSTRAINT [PK_{objectQualifier}Media] PRIMARY KEY CLUSTERED ([ModuleID]) + + ALTER TABLE {databaseOwner}[{objectQualifier}Media] WITH NOCHECK ADD CONSTRAINT [FK_{objectQualifier}Media_{objectQualifier}Modules] FOREIGN KEY ([ModuleID]) REFERENCES {databaseOwner}[{objectQualifier}Modules] ([ModuleID]) ON DELETE CASCADE + +/** Move existing data from the Module Settings table to the new Table **/ + + DECLARE @Setting varchar(50) + DECLARE @Value varchar(2000) + DECLARE @ModuleID int + DECLARE @tempID int + + DECLARE cur CURSOR FOR + + SELECT + {databaseOwner}{objectQualifier}ModuleSettings.ModuleID, + {databaseOwner}{objectQualifier}ModuleSettings.SettingName, + {databaseOwner}{objectQualifier}ModuleSettings.SettingValue + + FROM + {databaseOwner}{objectQualifier}ModuleSettings + INNER JOIN {databaseOwner}{objectQualifier}Modules + ON {databaseOwner}{objectQualifier}ModuleSettings.ModuleID = {databaseOwner}{objectQualifier}Modules.ModuleID + INNER JOIN {databaseOwner}{objectQualifier}ModuleDefinitions + ON {databaseOwner}{objectQualifier}Modules.ModuleDefID = {databaseOwner}{objectQualifier}ModuleDefinitions.ModuleDefID + INNER JOIN {databaseOwner}{objectQualifier}DesktopModules + ON {databaseOwner}{objectQualifier}ModuleDefinitions.DesktopModuleID = {databaseOwner}{objectQualifier}DesktopModules.DesktopModuleID + WHERE + {databaseOwner}{objectQualifier}DesktopModules.ModuleName = N'DNN_Image' + ORDER BY + {databaseOwner}{objectQualifier}ModuleSettings.ModuleID + + + SET @TempID = 0 + + OPEN cur + FETCH NEXT FROM cur INTO @ModuleID, @Setting, @Value + + WHILE @@fetch_Status = 0 + + BEGIN + + IF @tempID <> @ModuleID + BEGIN + INSERT into {databaseOwner}{objectQualifier}Media (ModuleID,src) + VALUES (@ModuleID,'') + + SET @tempID = @ModuleID + END + + IF @Setting = 'src' + UPDATE Media SET src = @Value WHERE ModuleID = @ModuleID + IF @Setting = 'alt' + UPDATE Media SET alt = CASE WHEN @Value ='' THEN NULL ELSE @value END WHERE ModuleID = @ModuleID + IF @Setting = 'width' + UPDATE Media SET Width = CASE WHEN @Value ='' THEN NULL ELSE @value END WHERE ModuleID = @ModuleID + IF @Setting = 'height' + UPDATE Media SET height = CASE WHEN @Value ='' THEN NULL ELSE @value END WHERE ModuleID = @ModuleID + + FETCH NEXT FROM cur INTO @ModuleID, @Setting, @Value + + END + + CLOSE cur + DEALLOCATE cur + +/** delete Records from Settings **/ + + DELETE {databaseOwner}{objectQualifier}ModuleSettings + FROM + {databaseOwner}{objectQualifier}ModuleSettings + INNER JOIN {databaseOwner}{objectQualifier}Modules + ON {databaseOwner}{objectQualifier}ModuleSettings.ModuleID = {databaseOwner}{objectQualifier}Modules.ModuleID + INNER JOIN {databaseOwner}{objectQualifier}ModuleDefinitions + ON {databaseOwner}{objectQualifier}Modules.ModuleDefID = {databaseOwner}{objectQualifier}ModuleDefinitions.ModuleDefID + INNER JOIN {databaseOwner}{objectQualifier}DesktopModules + ON {databaseOwner}{objectQualifier}ModuleDefinitions.DesktopModuleID = {databaseOwner}{objectQualifier}DesktopModules.DesktopModuleID + WHERE + {databaseOwner}{objectQualifier}DesktopModules.ModuleName = N'DNN_Image' + + END + +GO + + +/** Drop Existing Stored Procedures **/ + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}AddMedia]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) + drop procedure {databaseOwner}{objectQualifier}AddMedia +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}GetMedia]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) + drop procedure {databaseOwner}{objectQualifier}GetMedia +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}UpdateMedia]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) + drop procedure {databaseOwner}{objectQualifier}UpdateMedia +GO + + +/** Create Stored Procedures **/ + +CREATE PROCEDURE {databaseOwner}{objectQualifier}AddMedia + @ModuleID INT, + @Src NVARCHAR(250), + @Alt NVARCHAR(100), + @Width INT, + @Height INT, + @NavigateUrl NVARCHAR(250) +AS + +INSERT INTO {objectQualifier}Media (ModuleID, Src, Alt, Width, Height, NavigateUrl) +VALUES (@ModuleId, @Src, @Alt, @Width, @Height, @NavigateUrl) +GO + + +CREATE PROCEDURE {databaseOwner}{objectQualifier}GetMedia + @ModuleId INT +AS + +SELECT m.ModuleID, + [Src] = CASE WHEN srcf.FileName IS NULL THEN m.Src ELSE srcf.Folder + srcf.FileName END, + m.Alt, + m.Width, + m.Height, + [NavigateUrl] = CASE WHEN navf.FileName IS NULL THEN m.NavigateUrl ELSE navf.Folder + navf.FileName END, + {objectQualifier}UrlTracking.NewWindow, + {objectQualifier}UrlTracking.TrackClicks +FROM {objectQualifier}Media AS m + LEFT OUTER JOIN {objectQualifier}Files AS srcf ON m.Src = 'fileid=' + CONVERT(VARCHAR, srcf.FileID) + LEFT OUTER JOIN {objectQualifier}Files AS navf ON m.NavigateUrl = 'fileid=' + CONVERT(VARCHAR, navf.FileID) + LEFT OUTER JOIN {objectQualifier}UrlTracking ON m.NavigateUrl = {objectQualifier}UrlTracking.Url and {objectQualifier}UrlTracking.ModuleId = @ModuleID +WHERE m.ModuleId = @ModuleId +GO + + +CREATE PROCEDURE {databaseOwner}{objectQualifier}UpdateMedia + @ModuleID INT, + @Src NVARCHAR(250), + @Alt NVARCHAR(100), + @Width INT, + @Height INT, + @NavigateUrl NVARCHAR(250) +AS + +UPDATE {objectQualifier}Media +SET Src = @Src, + Alt = @Alt, + Width = @Width, + Height = @Height, + NavigateUrl = @NavigateUrl +WHERE ModuleID = @ModuleID +GO + + +/***** Used only once during Upgrade *****/ +CREATE PROCEDURE {databaseOwner}{objectQualifier}UpgradeMedia + @OldModuleDefID INT, + @NewModuleDefID INT +AS + +UPDATE {objectQualifier}Modules +SET ModuleDefID = @NewModuleDefID +WHERE ModuleDefID = @OldModuleDefID +GO + + +/************************************************************/ +/***** SqlDataProvider *****/ +/************************************************************/ \ No newline at end of file diff --git a/Modules/Media/Providers/DataProviders/SqlDataProvider/03.02.03.SqlDataProvider b/Modules/Media/Providers/DataProviders/SqlDataProvider/03.02.03.SqlDataProvider new file mode 100644 index 0000000..46d5114 --- /dev/null +++ b/Modules/Media/Providers/DataProviders/SqlDataProvider/03.02.03.SqlDataProvider @@ -0,0 +1,90 @@ +ALTER TABLE {databaseOwner}{objectQualifier}Media ADD + MediaAlignment int NULL +GO +ALTER TABLE {databaseOwner}{objectQualifier}Media ADD CONSTRAINT + DF_{objectQualifier}Media_MediaAlignment DEFAULT 0 FOR MediaAlignment +GO + +/** Update with default values **/ +UPDATE {databaseOwner}{objectQualifier}Media +SET MediaAlignment = 0 +GO + +/** Drop Existing Stored Procedures **/ + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}AddMedia]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) + drop procedure {databaseOwner}{objectQualifier}AddMedia +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}GetMedia]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) + drop procedure {databaseOwner}{objectQualifier}GetMedia +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}UpdateMedia]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) + drop procedure {databaseOwner}{objectQualifier}UpdateMedia +GO + + +/** Create Stored Procedures **/ + +CREATE PROCEDURE {databaseOwner}{objectQualifier}AddMedia + @ModuleID INT, + @Src NVARCHAR(250), + @Alt NVARCHAR(100), + @Width INT, + @Height INT, + @NavigateUrl NVARCHAR(250), + @MediaAlignment INT +AS + +INSERT INTO {objectQualifier}Media (ModuleID, Src, Alt, Width, Height, NavigateUrl,MediaAlignment) +VALUES (@ModuleId, @Src, @Alt, @Width, @Height, @NavigateUrl, @MediaAlignment) +GO + + +CREATE PROCEDURE {databaseOwner}{objectQualifier}GetMedia + @ModuleId INT +AS + +SELECT m.ModuleID, + [Src] = CASE WHEN srcf.FileName IS NULL THEN m.Src ELSE srcf.Folder + srcf.FileName END, + m.Alt, + m.Width, + m.Height, + [NavigateUrl] = CASE WHEN navf.FileName IS NULL THEN m.NavigateUrl ELSE navf.Folder + navf.FileName END, + {objectQualifier}UrlTracking.NewWindow, + {objectQualifier}UrlTracking.TrackClicks, + m.MediaAlignment +FROM {objectQualifier}Media AS m + LEFT OUTER JOIN {objectQualifier}Files AS srcf ON m.Src = 'fileid=' + CONVERT(VARCHAR, srcf.FileID) + LEFT OUTER JOIN {objectQualifier}Files AS navf ON m.NavigateUrl = 'fileid=' + CONVERT(VARCHAR, navf.FileID) + LEFT OUTER JOIN {objectQualifier}UrlTracking ON m.NavigateUrl = {objectQualifier}UrlTracking.Url and {objectQualifier}UrlTracking.ModuleId = @ModuleID +WHERE m.ModuleId = @ModuleId +GO + + +CREATE PROCEDURE {databaseOwner}{objectQualifier}UpdateMedia + @ModuleID INT, + @Src NVARCHAR(250), + @Alt NVARCHAR(100), + @Width INT, + @Height INT, + @NavigateUrl NVARCHAR(250), + @MediaAlignment INT +AS + +UPDATE {objectQualifier}Media +SET Src = @Src, + Alt = @Alt, + Width = @Width, + Height = @Height, + NavigateUrl = @NavigateUrl, + MediaAlignment = @MediaAlignment +WHERE ModuleID = @ModuleID +GO + + + +/************************************************************/ +/***** SqlDataProvider *****/ +/************************************************************/ \ No newline at end of file diff --git a/Modules/Media/Providers/DataProviders/SqlDataProvider/03.03.00.SqlDataProvider b/Modules/Media/Providers/DataProviders/SqlDataProvider/03.03.00.SqlDataProvider new file mode 100644 index 0000000..475a694 --- /dev/null +++ b/Modules/Media/Providers/DataProviders/SqlDataProvider/03.03.00.SqlDataProvider @@ -0,0 +1,138 @@ +/************************************************************/ +/***** SqlDataProvider *****/ +/***** *****/ +/***** *****/ +/***** Note: To manually execute this script you must *****/ +/***** perform a search and replace operation *****/ +/***** for {databaseOwner} and {objectQualifier} *****/ +/***** *****/ +/************************************************************/ + +/* + +ADD NEW COLUMNS TO THE TABLE + +*/ + +IF NOT EXISTS (SELECT 1 FROM [dbo].[syscolumns] c JOIN [dbo].[sysobjects] o ON c.[id] = o.[id] WHERE c.[name] = N'MediaLoop' AND o.[name] LIKE N'%Media') + ALTER TABLE {databaseOwner}[{objectQualifier}Media] + ADD [MediaLoop] BIT NOT NULL CONSTRAINT [DF_{objectQualifier}Media_MediaLoop] DEFAULT ((0)) +GO + +IF NOT EXISTS (SELECT 1 FROM [dbo].[syscolumns] c JOIN [dbo].[sysobjects] o ON c.[id] = o.[id] WHERE c.[name] = N'AutoStart' AND o.[name] LIKE N'%Media') + ALTER TABLE {databaseOwner}[{objectQualifier}Media] + ADD [AutoStart] BIT NOT NULL CONSTRAINT [DF_{objectQualifier}Media_AutoStart] DEFAULT ((0)) +GO + +/* + +UPDATE TABLE TO REFLECT THE NEW DEFAULT VALUES + +*/ + +UPDATE {databaseOwner}[{objectQualifier}Media] +SET [AutoStart] = 0, [MediaLoop] = 0 +GO + +/* + +UPDATE THE STORED PROCEDURES + +*/ + +IF NOT OBJECT_ID(N'{databaseOwner}[{objectQualifier}AddMedia]') IS NULL + DROP PROCEDURE {databaseOwner}[{objectQualifier}AddMedia] +GO + +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_NULLS ON +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}AddMedia] + @ModuleID INT, @Src NVARCHAR(250), @Alt NVARCHAR(100), @Width INT, @Height INT, @NavigateUrl NVARCHAR(250), @MediaAlignment INT, @AutoStart BIT, @MediaLoop BIT +AS +BEGIN + SET NOCOUNT ON + INSERT INTO {databaseOwner}[{objectQualifier}Media] ([ModuleID],[Src],[Alt],[Width],[Height],[NavigateUrl],[MediaAlignment],[AutoStart],[MediaLoop]) + VALUES (@ModuleId, @Src, @Alt, @Width, @Height, @NavigateUrl, @MediaAlignment, @AutoStart, @MediaLoop) +END +GO + +IF NOT OBJECT_ID(N'{databaseOwner}[{objectQualifier}UpdateMedia]') IS NULL + DROP PROCEDURE {databaseOwner}[{objectQualifier}UpdateMedia] +GO + +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_NULLS ON +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}UpdateMedia] + @ModuleID INT, @Src NVARCHAR(250), @Alt NVARCHAR(100), @Width INT, @Height INT, @NavigateUrl NVARCHAR(250), @MediaAlignment INT, @AutoStart BIT, @MediaLoop BIT +AS +BEGIN + SET NOCOUNT ON + UPDATE {databaseOwner}[{objectQualifier}Media] + SET [Src] = @Src, + [Alt] = @Alt, + [Width] = @Width, + [Height] = @Height, + [NavigateUrl] = @NavigateUrl, + [MediaAlignment] = @MediaAlignment, + [AutoStart] = @AutoStart, + [MediaLoop] = @MediaLoop + WHERE [ModuleID] = @ModuleID +END +GO + +IF NOT OBJECT_ID(N'{databaseOwner}[{objectQualifier}GetMedia]') IS NULL + DROP PROCEDURE {databaseOwner}[{objectQualifier}GetMedia] +GO + +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_NULLS ON +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}GetMedia] + @ModuleID INT +AS +BEGIN + SET NOCOUNT ON + SELECT m.[ModuleID],m.[Alt],m.[Width],m.[Height], + [Src] = CASE WHEN srcf.[FileName] IS NULL THEN m.[Src] ELSE srcf.[Folder] + srcf.[FileName] END, + [NavigateUrl] = CASE WHEN navf.[FileName] IS NULL THEN m.[NavigateUrl] ELSE navf.[Folder] + navf.[FileName] END, + ut.[NewWindow],ut.[TrackClicks],m.[MediaAlignment],m.[AutoStart],m.[MediaLoop] + FROM {databaseOwner}[{objectQualifier}Media] AS m + LEFT OUTER JOIN {databaseOwner}[{objectQualifier}Files] AS srcf ON m.Src = 'fileid=' + CONVERT(VARCHAR, srcf.FileID) + LEFT OUTER JOIN {databaseOwner}[{objectQualifier}Files] AS navf ON m.NavigateUrl = 'fileid=' + CONVERT(VARCHAR, navf.FileID) + LEFT OUTER JOIN {databaseOwner}[{objectQualifier}UrlTracking] ut ON m.[NavigateUrl] = ut.[Url] and ut.[ModuleId] = @ModuleID + WHERE m.[ModuleId] = @ModuleId +END +GO + +IF NOT OBJECT_ID(N'{databaseOwner}[{objectQualifier}DeleteMedia]') IS NULL + DROP PROCEDURE {databaseOwner}[{objectQualifier}DeleteMedia] +GO + +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_NULLS ON +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}DeleteMedia] + @ModuleID INT +AS +BEGIN + SET NOCOUNT ON + DELETE FROM {databaseOwner}[{objectQualifier}Media] WHERE [ModuleID] = @ModuleId +END +GO + + + + +/************************************************************/ +/***** SqlDataProvider *****/ +/************************************************************/ \ No newline at end of file diff --git a/Modules/Media/Providers/DataProviders/SqlDataProvider/04.00.00.SqlDataProvider b/Modules/Media/Providers/DataProviders/SqlDataProvider/04.00.00.SqlDataProvider new file mode 100644 index 0000000..419b04c --- /dev/null +++ b/Modules/Media/Providers/DataProviders/SqlDataProvider/04.00.00.SqlDataProvider @@ -0,0 +1,135 @@ +/************************************************************/ +/***** SqlDataProvider *****/ +/***** *****/ +/***** *****/ +/***** Note: To manually execute this script you must *****/ +/***** perform a search and replace operation *****/ +/***** for {databaseOwner} and {objectQualifier} *****/ +/***** *****/ +/************************************************************/ + +/* + +ADD NEW COLUMNS TO THE TABLE + +*/ + +IF EXISTS (SELECT * FROM [dbo].[sysobjects] WHERE [id] = OBJECT_ID(N'PK_{objectQualifier}Media') AND OBJECTPROPERTY([id], N'IsConstraint') = 1) + ALTER TABLE {databaseOwner}[{objectQualifier}Media] DROP CONSTRAINT [PK_{objectQualifier}Media]; +GO + +ALTER TABLE {databaseOwner}[{objectQualifier}Media] ADD CONSTRAINT [PK_{objectQualifier}Media] PRIMARY KEY CLUSTERED ([ModuleID] ASC); +GO + +IF NOT EXISTS (SELECT 1 FROM [dbo].[syscolumns] c JOIN [dbo].[sysobjects] o ON c.[id] = o.[id] WHERE c.[name] = N'NewWindow' AND o.[name] LIKE N'%{objectQualifier}Media') + ALTER TABLE {databaseOwner}[{objectQualifier}Media] + ADD [NewWindow] BIT NOT NULL CONSTRAINT [DF_{objectQualifier}Media_NewWindow] DEFAULT ((0)); +GO + +IF NOT EXISTS (SELECT 1 FROM [dbo].[syscolumns] c JOIN [dbo].[sysobjects] o ON c.[id] = o.[id] WHERE c.[name] = N'TrackClicks' AND o.[name] LIKE N'%{objectQualifier}Media') + ALTER TABLE {databaseOwner}[{objectQualifier}Media] + ADD [TrackClicks] BIT NOT NULL CONSTRAINT [DF_{objectQualifier}Media_TrackClicks] DEFAULT ((0)); +GO + +IF NOT EXISTS (SELECT 1 FROM [dbo].[syscolumns] c JOIN [dbo].[sysobjects] o ON c.[id] = o.[id] WHERE c.[name] = N'MediaType' AND o.[name] LIKE N'%{objectQualifier}Media') + ALTER TABLE {databaseOwner}[{objectQualifier}Media] + ADD [MediaType] INT NOT NULL CONSTRAINT [DF_{objectQualifier}Media_MediaType] DEFAULT ((0)); +GO + +ALTER TABLE {databaseOwner}[{objectQualifier}Media] ALTER COLUMN [Src] NVARCHAR(1000) NOT NULL; + +/* + +UPDATE TABLE TO REFLECT THE NEW DEFAULT VALUES + +*/ + +UPDATE {databaseOwner}[{objectQualifier}Media] +SET [NewWindow] = 0, [TrackClicks] = 0, [MediaType] = 0; +GO + +/* + +UPDATE THE STORED PROCEDURES + +*/ + +IF NOT OBJECT_ID(N'{databaseOwner}[{objectQualifier}AddMedia]') IS NULL + DROP PROCEDURE {databaseOwner}[{objectQualifier}AddMedia]; +GO + +SET QUOTED_IDENTIFIER ON; +GO +SET ANSI_NULLS ON; +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}AddMedia] + @ModuleID INT, @Src NVARCHAR(250), @Alt NVARCHAR(100), @Width INT, @Height INT, @NavigateUrl NVARCHAR(250), @MediaAlignment INT, @AutoStart BIT, @MediaLoop BIT, @NewWindow BIT, @TrackClicks BIT, @MediaType INT +AS +BEGIN + SET NOCOUNT ON; + INSERT INTO {databaseOwner}[{objectQualifier}Media] ([ModuleID],[Src],[Alt],[Width],[Height],[NavigateUrl],[MediaAlignment],[AutoStart],[MediaLoop],[NewWindow],[TrackClicks],[MediaType]) + VALUES (@ModuleId, @Src, @Alt, @Width, @Height, @NavigateUrl, @MediaAlignment, @AutoStart, @MediaLoop, @NewWindow, @TrackClicks, @MediaType); +END +GO + +IF NOT OBJECT_ID(N'{databaseOwner}[{objectQualifier}UpdateMedia]') IS NULL + DROP PROCEDURE {databaseOwner}[{objectQualifier}UpdateMedia]; +GO + +SET QUOTED_IDENTIFIER ON; +GO +SET ANSI_NULLS ON; +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}UpdateMedia] + @ModuleID INT, @Src NVARCHAR(250), @Alt NVARCHAR(100), @Width INT, @Height INT, @NavigateUrl NVARCHAR(250), @MediaAlignment INT, @AutoStart BIT, @MediaLoop BIT, @NewWindow BIT, @TrackClicks BIT, @MediaType INT +AS +BEGIN + SET NOCOUNT ON + UPDATE {databaseOwner}[{objectQualifier}Media] + SET [Src] = @Src, + [Alt] = @Alt, + [Width] = @Width, + [Height] = @Height, + [NavigateUrl] = @NavigateUrl, + [MediaAlignment] = @MediaAlignment, + [AutoStart] = @AutoStart, + [MediaLoop] = @MediaLoop, + [NewWindow] = @NewWindow, + [TrackClicks] = @TrackClicks, + [MediaType] = @MediaType + WHERE [ModuleID] = @ModuleID; +END +GO + +IF NOT OBJECT_ID(N'{databaseOwner}[{objectQualifier}GetMedia]') IS NULL + DROP PROCEDURE {databaseOwner}[{objectQualifier}GetMedia]; +GO + +SET QUOTED_IDENTIFIER ON; +GO +SET ANSI_NULLS ON; +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}GetMedia] + @ModuleID INT +AS +BEGIN + SET NOCOUNT ON + SELECT m.[ModuleID],m.[Alt],m.[Width],m.[Height], + [Src] = CASE WHEN srcf.[FileName] IS NULL THEN m.[Src] ELSE srcf.[Folder] + srcf.[FileName] END, + [NavigateUrl] = CASE WHEN navf.[FileName] IS NULL THEN m.[NavigateUrl] ELSE navf.[Folder] + navf.[FileName] END, + ut.[NewWindow],ut.[TrackClicks],m.[MediaAlignment],m.[AutoStart],m.[MediaLoop],m.[NewWindow],m.[TrackClicks], + m.[MediaType] + FROM {databaseOwner}[{objectQualifier}Media] AS m + LEFT OUTER JOIN {databaseOwner}[{objectQualifier}Files] AS srcf ON m.Src = 'fileid=' + CONVERT(VARCHAR, srcf.FileID) + LEFT OUTER JOIN {databaseOwner}[{objectQualifier}Files] AS navf ON m.NavigateUrl = 'fileid=' + CONVERT(VARCHAR, navf.FileID) + LEFT OUTER JOIN {databaseOwner}[{objectQualifier}UrlTracking] ut ON m.[NavigateUrl] = ut.[Url] and ut.[ModuleId] = @ModuleID + WHERE m.[ModuleId] = @ModuleId; +END +GO + +/************************************************************/ +/***** SqlDataProvider *****/ +/************************************************************/ \ No newline at end of file diff --git a/Modules/Media/Providers/DataProviders/SqlDataProvider/04.01.00.SqlDataProvider b/Modules/Media/Providers/DataProviders/SqlDataProvider/04.01.00.SqlDataProvider new file mode 100644 index 0000000..c2d213e --- /dev/null +++ b/Modules/Media/Providers/DataProviders/SqlDataProvider/04.01.00.SqlDataProvider @@ -0,0 +1,157 @@ +/************************************************************/ +/***** SqlDataProvider *****/ +/***** *****/ +/***** *****/ +/***** Note: To manually execute this script you must *****/ +/***** perform a search and replace operation *****/ +/***** for {databaseOwner} and {objectQualifier} *****/ +/***** *****/ +/************************************************************/ + +/* +Issue 21110 - Increase the Embed Field Data Length +*/ +ALTER TABLE {databaseOwner}[{objectQualifier}Media] ALTER COLUMN [Src] NVARCHAR(1500) NOT NULL; + +/* +Issue 20089 - Adding a text footer to the module +*/ +IF NOT EXISTS (SELECT 1 FROM [dbo].[syscolumns] c JOIN [dbo].[sysobjects] o ON c.[id] = o.[id] WHERE c.[name] = N'MediaMessage' AND o.[name] LIKE N'%{objectQualifier}Media') + ALTER TABLE {databaseOwner}[{objectQualifier}Media] + ADD [MediaMessage] NVARCHAR(2000) NULL; +GO + +/* +Adding auditing information to the module +(ammended POST RELEASE for Issue 22139) +*/ +IF NOT EXISTS (SELECT 1 FROM [dbo].[syscolumns] c JOIN [dbo].[sysobjects] o ON c.[id] = o.[id] WHERE c.[name] = N'LastUpdatedBy' AND o.[name] LIKE N'%{objectQualifier}Media') + ALTER TABLE {databaseOwner}[{objectQualifier}Media] + ADD [LastUpdatedBy] INT DEFAULT((1)); +GO + +/* +POST RELEASE: Issue 22139 +*/ +DECLARE @SuperUser INT; +SELECT TOP 1 @SuperUser = u.[UserId] +FROM {databaseOwner}[{objectQualifier}Users] u +WHERE u.[IsSuperUser] = 1 AND u.[IsDeleted] = 0 +ORDER BY u.[CreatedOnDate] ASC; + +UPDATE {databaseOwner}[{objectQualifier}Media] +SET [LastUpdatedBy] = @SuperUser +WHERE [LastUpdatedBy] IS NULL OR NOT [LastUpdatedBy] IN ( + SELECT u.[UserId] FROM {databaseOwner}[{objectQualifier}Users] u WHERE u.[IsSuperUser] = 1 AND u.[IsDeleted] = 0 +); +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[sysobjects] WHERE [id] = OBJECT_ID(N'FK_{objectQualifier}Media_LastUpdatedBy') AND OBJECTPROPERTY([id], N'IsConstraint') = 1) + ALTER TABLE {databaseOwner}[{objectQualifier}Media] + ADD CONSTRAINT [FK_{objectQualifier}Media_LastUpdatedBy] FOREIGN KEY ([LastUpdatedBy]) + REFERENCES {databaseOwner}[{objectQualifier}Users] ([UserId]); +GO + +IF NOT EXISTS (SELECT 1 FROM [dbo].[syscolumns] c JOIN [dbo].[sysobjects] o ON c.[id] = o.[id] WHERE c.[name] = N'LastUpdatedDate' AND o.[name] LIKE N'%{objectQualifier}Media') + ALTER TABLE {databaseOwner}[{objectQualifier}Media] + ADD [LastUpdatedDate] DATETIME NULL; +GO + +UPDATE {databaseOwner}[{objectQualifier}Media] SET [LastUpdatedDate] = GETDATE(); +GO + +ALTER TABLE {databaseOwner}[{objectQualifier}Media] ALTER COLUMN [LastUpdatedDate] DATETIME NOT NULL; +GO + +ALTER TABLE {databaseOwner}[{objectQualifier}Media] ALTER COLUMN [LastUpdatedBy] INT NOT NULL; +GO + +/* + +UPDATE THE STORED PROCEDURES + +*/ + +IF NOT OBJECT_ID(N'{databaseOwner}[{objectQualifier}AddMedia]') IS NULL + DROP PROCEDURE {databaseOwner}[{objectQualifier}AddMedia]; +GO + +SET QUOTED_IDENTIFIER ON; +GO +SET ANSI_NULLS ON; +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}AddMedia] + @ModuleID INT, @Src NVARCHAR(1500), @Alt NVARCHAR(100), @Width INT, @Height INT, @NavigateUrl NVARCHAR(250), @MediaAlignment INT, @AutoStart BIT, @MediaLoop BIT, @NewWindow BIT, @TrackClicks BIT, @MediaType INT, @MediaMessage NVARCHAR(2000), @LastUpdatedBy INT +AS +BEGIN + SET NOCOUNT ON; + INSERT INTO {databaseOwner}[{objectQualifier}Media] ([ModuleID],[Src],[Alt],[Width],[Height],[NavigateUrl],[MediaAlignment],[AutoStart],[MediaLoop],[NewWindow],[TrackClicks],[MediaType],[MediaMessage],[LastUpdatedBy],[LastUpdatedDate]) + VALUES (@ModuleId, @Src, @Alt, @Width, @Height, @NavigateUrl, @MediaAlignment, @AutoStart, @MediaLoop, @NewWindow, @TrackClicks, @MediaType, @MediaMessage,@LastUpdatedBy,GETDATE()); +END +GO + +IF NOT OBJECT_ID(N'{databaseOwner}[{objectQualifier}UpdateMedia]') IS NULL + DROP PROCEDURE {databaseOwner}[{objectQualifier}UpdateMedia]; +GO + +SET QUOTED_IDENTIFIER ON; +GO +SET ANSI_NULLS ON; +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}UpdateMedia] + @ModuleID INT, @Src NVARCHAR(1500), @Alt NVARCHAR(100), @Width INT, @Height INT, @NavigateUrl NVARCHAR(250), @MediaAlignment INT, @AutoStart BIT, @MediaLoop BIT, @NewWindow BIT, @TrackClicks BIT, @MediaType INT, @MediaMessage NVARCHAR(2000), @LastUpdatedBy INT +AS +BEGIN + SET NOCOUNT ON + UPDATE {databaseOwner}[{objectQualifier}Media] + SET [Src] = @Src, + [Alt] = @Alt, + [Width] = @Width, + [Height] = @Height, + [NavigateUrl] = @NavigateUrl, + [MediaAlignment] = @MediaAlignment, + [AutoStart] = @AutoStart, + [MediaLoop] = @MediaLoop, + [NewWindow] = @NewWindow, + [TrackClicks] = @TrackClicks, + [MediaType] = @MediaType, + [MediaMessage] = @MediaMessage, + [LastUpdatedBy] = @LastUpdatedBy, + [LastUpdatedDate] = GETDATE() + WHERE [ModuleID] = @ModuleID; +END +GO + +IF NOT OBJECT_ID(N'{databaseOwner}[{objectQualifier}GetMedia]') IS NULL + DROP PROCEDURE {databaseOwner}[{objectQualifier}GetMedia]; +GO + +SET QUOTED_IDENTIFIER ON; +GO +SET ANSI_NULLS ON; +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}GetMedia] + @ModuleID INT +AS +BEGIN + SET NOCOUNT ON + SELECT m.[ModuleID],m.[Alt],m.[Width],m.[Height], + [Src] = CASE WHEN srcf.[FileName] IS NULL THEN m.[Src] ELSE srcf.[Folder] + srcf.[FileName] END, + [NavigateUrl] = CASE WHEN navf.[FileName] IS NULL THEN m.[NavigateUrl] ELSE navf.[Folder] + navf.[FileName] END, + ut.[NewWindow],ut.[TrackClicks],m.[MediaAlignment],m.[AutoStart],m.[MediaLoop],m.[NewWindow],m.[TrackClicks], + m.[MediaType], m.[MediaMessage], m.[LastUpdatedBy], m.[LastUpdatedDate] + FROM {databaseOwner}[{objectQualifier}Media] AS m + LEFT OUTER JOIN {databaseOwner}[{objectQualifier}Files] AS srcf ON m.Src = 'fileid=' + CONVERT(VARCHAR, srcf.FileID) + LEFT OUTER JOIN {databaseOwner}[{objectQualifier}Files] AS navf ON m.NavigateUrl = 'fileid=' + CONVERT(VARCHAR, navf.FileID) + LEFT OUTER JOIN {databaseOwner}[{objectQualifier}UrlTracking] ut ON m.[NavigateUrl] = ut.[Url] and ut.[ModuleId] = @ModuleID + WHERE m.[ModuleId] = @ModuleId; +END +GO + + +/************************************************************/ +/***** SqlDataProvider *****/ +/************************************************************/ \ No newline at end of file diff --git a/Modules/Media/Providers/DataProviders/SqlDataProvider/04.02.00.SqlDataProvider b/Modules/Media/Providers/DataProviders/SqlDataProvider/04.02.00.SqlDataProvider new file mode 100644 index 0000000..1112a01 --- /dev/null +++ b/Modules/Media/Providers/DataProviders/SqlDataProvider/04.02.00.SqlDataProvider @@ -0,0 +1,16 @@ +/************************************************************/ +/***** SqlDataProvider *****/ +/***** *****/ +/***** *****/ +/***** Note: To manually execute this script you must *****/ +/***** perform a search and replace operation *****/ +/***** for {databaseOwner} and {objectQualifier} *****/ +/***** *****/ +/************************************************************/ + + + + +/************************************************************/ +/***** SqlDataProvider *****/ +/************************************************************/ \ No newline at end of file diff --git a/Modules/Media/Providers/DataProviders/SqlDataProvider/04.03.00.SqlDataProvider b/Modules/Media/Providers/DataProviders/SqlDataProvider/04.03.00.SqlDataProvider new file mode 100644 index 0000000..90d1cb7 --- /dev/null +++ b/Modules/Media/Providers/DataProviders/SqlDataProvider/04.03.00.SqlDataProvider @@ -0,0 +1,20 @@ +/************************************************************/ +/***** SqlDataProvider *****/ +/***** *****/ +/***** *****/ +/***** Note: To manually execute this script you must *****/ +/***** perform a search and replace operation *****/ +/***** for {databaseOwner} and {objectQualifier} *****/ +/***** *****/ +/************************************************************/ + +/* + Remove this constraint. It is no longer necessary. +*/ +IF EXISTS (SELECT * FROM [dbo].[sysobjects] WHERE [id] = OBJECT_ID(N'DF_{objectQualifier}Media_LastUpdatedBy') AND OBJECTPROPERTY([id], N'IsConstraint') = 1) + ALTER TABLE {databaseOwner}[{objectQualifier}Media] DROP CONSTRAINT [DF_{objectQualifier}Media_LastUpdatedBy] +GO + +/************************************************************/ +/***** SqlDataProvider *****/ +/************************************************************/ \ No newline at end of file diff --git a/Modules/Media/Providers/DataProviders/SqlDataProvider/04.04.00.SqlDataProvider b/Modules/Media/Providers/DataProviders/SqlDataProvider/04.04.00.SqlDataProvider new file mode 100644 index 0000000..f1234bc --- /dev/null +++ b/Modules/Media/Providers/DataProviders/SqlDataProvider/04.04.00.SqlDataProvider @@ -0,0 +1,15 @@ +/************************************************************/ +/***** SqlDataProvider *****/ +/***** *****/ +/***** *****/ +/***** Note: To manually execute this script you must *****/ +/***** perform a search and replace operation *****/ +/***** for {databaseOwner} and {objectQualifier} *****/ +/***** *****/ +/************************************************************/ + + + +/************************************************************/ +/***** SqlDataProvider *****/ +/************************************************************/ \ No newline at end of file diff --git a/Modules/Media/Providers/DataProviders/SqlDataProvider/04.04.01.SqlDataProvider b/Modules/Media/Providers/DataProviders/SqlDataProvider/04.04.01.SqlDataProvider new file mode 100644 index 0000000..f1234bc --- /dev/null +++ b/Modules/Media/Providers/DataProviders/SqlDataProvider/04.04.01.SqlDataProvider @@ -0,0 +1,15 @@ +/************************************************************/ +/***** SqlDataProvider *****/ +/***** *****/ +/***** *****/ +/***** Note: To manually execute this script you must *****/ +/***** perform a search and replace operation *****/ +/***** for {databaseOwner} and {objectQualifier} *****/ +/***** *****/ +/************************************************************/ + + + +/************************************************************/ +/***** SqlDataProvider *****/ +/************************************************************/ \ No newline at end of file diff --git a/Modules/Media/Providers/DataProviders/SqlDataProvider/04.04.02.SqlDataProvider b/Modules/Media/Providers/DataProviders/SqlDataProvider/04.04.02.SqlDataProvider new file mode 100644 index 0000000..f1234bc --- /dev/null +++ b/Modules/Media/Providers/DataProviders/SqlDataProvider/04.04.02.SqlDataProvider @@ -0,0 +1,15 @@ +/************************************************************/ +/***** SqlDataProvider *****/ +/***** *****/ +/***** *****/ +/***** Note: To manually execute this script you must *****/ +/***** perform a search and replace operation *****/ +/***** for {databaseOwner} and {objectQualifier} *****/ +/***** *****/ +/************************************************************/ + + + +/************************************************************/ +/***** SqlDataProvider *****/ +/************************************************************/ \ No newline at end of file diff --git a/Modules/Media/Providers/DataProviders/SqlDataProvider/SqlDataProvider.cs b/Modules/Media/Providers/DataProviders/SqlDataProvider/SqlDataProvider.cs new file mode 100644 index 0000000..1c187b4 --- /dev/null +++ b/Modules/Media/Providers/DataProviders/SqlDataProvider/SqlDataProvider.cs @@ -0,0 +1,173 @@ +// +// DNN Corp - http://www.dnnsoftware.com +// Copyright (c) 2002-2014 +// by DNN Corp +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + +//INSTANT C# NOTE: Formerly VB project-level imports: +using System; +using System.Data; + +using Microsoft.ApplicationBlocks.Data; + +namespace DotNetNuke.Modules.Media +{ + + /// ----------------------------------------------------------------------------- + /// + /// The SqlDataProvider Class is an SQL Server implementation of the DataProvider Abstract + /// class that provides the DataLayer for the HTML Module. + /// + /// + /// + /// + /// [cnurse] 9/21/2004 Moved HTML to a separate Project + /// + /// ----------------------------------------------------------------------------- + public class SqlDataProvider : DataProvider + { + +#region Private Members + + private const string ProviderType = "data"; + + private Framework.Providers.ProviderConfiguration p_providerConfiguration = Framework.Providers.ProviderConfiguration.GetProviderConfiguration(ProviderType); + private string p_connectionString = string.Empty; + private string p_providerPath = string.Empty; + private string p_objectQualifier = string.Empty; + private string p_databaseOwner = string.Empty; + + private const string c_ConnectionStringName = "connectionStringName"; + private const string c_ConnectionString = "connectionString"; + + private const string c_AddMedia = "AddMedia"; + private const string c_GetMedia = "GetMedia"; + private const string c_UpdateMedia = "UpdateMedia"; + private const string c_UpgradeMedia = "UpgradeMedia"; + private const string c_DeleteMedia = "DeleteMedia"; + +#endregion + +#region Constructors + + public SqlDataProvider() + { + + // Read the configuration specific information for this provider + Framework.Providers.Provider objProvider = (Framework.Providers.Provider)(p_providerConfiguration.Providers[p_providerConfiguration.DefaultProvider]); + + // Read the attributes for this provider + if (! (string.IsNullOrEmpty(objProvider.Attributes[c_ConnectionStringName]))) + { + p_connectionString = DotNetNuke.Common.Utilities.Config.GetConnectionString(); + } + else + { + p_connectionString = objProvider.Attributes[c_ConnectionString]; + } + + p_providerPath = objProvider.Attributes["providerPath"]; + + p_objectQualifier = objProvider.Attributes["objectQualifier"]; + if (! (string.IsNullOrEmpty(p_objectQualifier)) && p_objectQualifier.EndsWith("_") == false) + { + p_objectQualifier = string.Concat(p_objectQualifier, "_"); + } + + p_databaseOwner = objProvider.Attributes["databaseOwner"]; + if (! (string.IsNullOrEmpty(p_databaseOwner)) && p_databaseOwner.EndsWith(".") == false) + { + p_databaseOwner = string.Concat(p_databaseOwner, "."); + } + + } + +#endregion + +#region Properties + + public string ConnectionString + { + get + { + return p_connectionString; + } + } + + public string ProviderPath + { + get + { + return p_providerPath; + } + } + + public string ObjectQualifier + { + get + { + return p_objectQualifier; + } + } + + public string DatabaseOwner + { + get + { + return p_databaseOwner; + } + } + +#endregion + +#region Public Methods + + private object GetNull(object Field) + { + return Common.Utilities.Null.GetNull(Field, DBNull.Value); + } + + public override void AddMedia(int ModuleId, string Src, string Alt, int Width, int Height, string NavigateUrl, int MediaAlignment, bool AutoStart, bool MediaLoop, bool NewWindow, bool TrackClicks, int MediaType, string MediaMessage, int LastUpdatedBy) + { + SqlHelper.ExecuteNonQuery(ConnectionString, string.Concat(DatabaseOwner, ObjectQualifier, c_AddMedia), ModuleId, Src, GetNull(Alt), GetNull(Width), GetNull(Height), GetNull(NavigateUrl), MediaAlignment, AutoStart, MediaLoop, NewWindow, TrackClicks, MediaType, MediaMessage, LastUpdatedBy); + } + + public override IDataReader GetMedia(int moduleId) + { + return (IDataReader)(SqlHelper.ExecuteReader(ConnectionString, string.Concat(DatabaseOwner, ObjectQualifier, c_GetMedia), moduleId)); + } + + public override void UpdateMedia(int ModuleId, string Src, string Alt, int Width, int Height, string NavigateUrl, int MediaAlignment, bool AutoStart, bool MediaLoop, bool NewWindow, bool TrackClicks, int MediaType, string MediaMessage, int LastUpdatedBy) + { + SqlHelper.ExecuteNonQuery(ConnectionString, string.Concat(DatabaseOwner, ObjectQualifier, c_UpdateMedia), ModuleId, Src, GetNull(Alt), GetNull(Width), GetNull(Height), GetNull(NavigateUrl), MediaAlignment, AutoStart, MediaLoop, NewWindow, TrackClicks, MediaType, MediaMessage, LastUpdatedBy); + } + + public override void UpgradeMedia(int OldModuleDefID, int NewModuleDefID) + { + SqlHelper.ExecuteNonQuery(ConnectionString, string.Concat(DatabaseOwner, ObjectQualifier, c_UpgradeMedia), OldModuleDefID, NewModuleDefID); + } + + public override void DeleteMedia(int ModuleId) + { + SqlHelper.ExecuteNonQuery(ConnectionString, string.Concat(DatabaseOwner, ObjectQualifier, c_DeleteMedia), ModuleId); + } + +#endregion + + } + +} \ No newline at end of file diff --git a/Modules/Media/Providers/DataProviders/SqlDataProvider/Uninstall.SqlDataProvider b/Modules/Media/Providers/DataProviders/SqlDataProvider/Uninstall.SqlDataProvider new file mode 100644 index 0000000..d4848f3 --- /dev/null +++ b/Modules/Media/Providers/DataProviders/SqlDataProvider/Uninstall.SqlDataProvider @@ -0,0 +1,53 @@ +/************************************************************/ +/***** SqlDataProvider *****/ +/***** *****/ +/***** *****/ +/***** Note: To manually execute this script you must *****/ +/***** perform a search and replace operation *****/ +/***** for {databaseOwner} and {objectQualifier} *****/ +/***** *****/ +/************************************************************/ + +/** Drop Media Table **/ + +IF EXISTS (SELECT * FROM [dbo].[sysobjects] WHERE [id] = OBJECT_ID(N'PK_{objectQualifier}Media_{objectQualifier}Modules') AND OBJECTPROPERTY([id], N'IsConstraint') = 1) + ALTER TABLE {databaseOwner}[{objectQualifier}Media] DROP CONSTRAINT [FK_{objectQualifier}Media_{objectQualifier}Modules] +GO + +IF EXISTS (SELECT * FROM [dbo].[sysobjects] WHERE [id] = OBJECT_ID(N'PK_{objectQualifier}Media') AND OBJECTPROPERTY([id], N'IsConstraint') = 1) + ALTER TABLE {databaseOwner}[{objectQualifier}Media] DROP CONSTRAINT [PK_{objectQualifier}Media] +GO + +IF NOT OBJECT_ID(N'{databaseOwner}[{objectQualifier}Media]') IS NULL + DROP TABLE {databaseOwner}[{objectQualifier}Media] +GO + +/** Drop Stored Procedures **/ + +IF NOT OBJECT_ID(N'{databaseOwner}[{objectQualifier}GetMedia]') IS NULL + DROP PROCEDURE {databaseOwner}[{objectQualifier}GetMedia] +GO + +IF NOT OBJECT_ID(N'{databaseOwner}[{objectQualifier}AddMedia]') IS NULL + DROP PROCEDURE {databaseOwner}[{objectQualifier}AddMedia] +GO + +IF NOT OBJECT_ID(N'{databaseOwner}[{objectQualifier}UpdateMedia]') IS NULL + DROP PROCEDURE {databaseOwner}[{objectQualifier}UpdateMedia] +GO + +IF NOT OBJECT_ID(N'{databaseOwner}[{objectQualifier}UpgradeMedia]') IS NULL + DROP PROCEDURE {databaseOwner}[{objectQualifier}UpgradeMedia] +GO + +IF NOT OBJECT_ID(N'{databaseOwner}[{objectQualifier}AddMedia]') IS NULL + DROP PROCEDURE {databaseOwner}[{objectQualifier}AddMedia] +GO + +IF NOT OBJECT_ID(N'{databaseOwner}[{objectQualifier}DeleteMedia]') IS NULL + DROP PROCEDURE {databaseOwner}[{objectQualifier}DeleteMedia] +GO + +/************************************************************/ +/***** SqlDataProvider *****/ +/************************************************************/ \ No newline at end of file diff --git a/Modules/Media/SimulateIsDate.cs b/Modules/Media/SimulateIsDate.cs new file mode 100644 index 0000000..6d6a7f5 --- /dev/null +++ b/Modules/Media/SimulateIsDate.cs @@ -0,0 +1,17 @@ +//---------------------------------------------------------------------------------------- +// Copyright © 2003 - 2011 Tangible Software Solutions Inc. +// This class can be used by anyone provided that the copyright notice remains intact. +// +// This class simulates the behavior of the classic VB 'IsDate' function. +//---------------------------------------------------------------------------------------- +public static class SimulateIsDate +{ + public static bool IsDate(object expression) + { + if (expression == null) + return false; + + System.DateTime testDate; + return System.DateTime.TryParse(expression.ToString(), out testDate); + } +} \ No newline at end of file diff --git a/Modules/Media/Utilities/MarkUpUtility.cs b/Modules/Media/Utilities/MarkUpUtility.cs new file mode 100644 index 0000000..404299b --- /dev/null +++ b/Modules/Media/Utilities/MarkUpUtility.cs @@ -0,0 +1,665 @@ +// +// DNN Corp - http://www.dnnsoftware.com +// Copyright (c) 2002-2014 +// by DNN Corp +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + + +using DotNetNuke.Common; +using DotNetNuke.Common.Utilities; +using System.Globalization; +using System.Text; +using System.Text.RegularExpressions; +using System.Web; + +namespace DotNetNuke.Modules.Media +{ + + public sealed class MediaMarkUpUtility + { + +#region Constants + + //Private Const OPEN_BRACKET As String = "<" + private const string CLOSE_BRACKET = ">"; + private const string SELF_CLOSE_BRACKET = "/>"; + private const string SPACE = " "; + private const string OPEN_TAG_FORMAT = "<{0} "; + private const string CLOSE_TAG_FORMAT = ""; + private const string PARAM_TAG_FORMAT = ""; + private const string SOURCE_TAG_FORMAT = ""; + private const string SOURCE_TAG_FORMAT_ALT = ""; + + private const string DIV_TAG = "div"; + private const string ANCHOR_TAG = "a"; + private const string IMAGE_TAG = "img"; + //Private Const PARAM_TAG As String = "param" + private const string OBJECT_TAG = "object"; + //Private Const EMBED_TAG As String = "embed" + private const string VIDEO_TAG = "video"; + private const string AUDIO_TAG = "audio"; + + private const string ID_ATTRIBUTE = "id=\"{0}\" "; + private const string CLASS_ATTRIBUTE = "class=\"{0}\" "; + private const string DATA_ATTRIBUTE = "data=\"{0}\" "; + private const string SRC_ATTRIBUTE = "src=\"{0}\" "; + private const string ALT_ATTRIBUTE = "alt=\"{0}\" "; + private const string TITLE_ATTRIBUTE = "title=\"{0}\" "; + //Private Const NAME_ATTRIBUTE As String = "name=""{0}"" " + //Private Const VALUE_ATTRIBUTE As String = "value=""{0}"" " + private const string WIDTH_ATTRIBUTE = "width=\"{0}\" "; + private const string HEIGHT_ATTRIBUTE = "height=\"{0}\" "; + //Private Const LOOP_ATTRIBUTE As String = "loop=""{0}"" " + private const string HREF_ATTRIBUTE = "href=\"{0}\" "; + private const string TARGET_ATTRIBUTE = "target=\"{0}\" "; + //Private Const AUTOSTART_ATTRIBUTE As String = "autostart=""{0}"" " + //Private Const AUTOPLAY_ATTRIBUTE As String = "autoplay=""{0}"" " + private const string STYLE_ATTRIBUTE = "style=\"width:{0}px;height:{1};\" "; + private const string AUTOPLAY_ATTRIBUTE = "autoplay=\"autoplay\" "; + private const string LOOP_ATTRIBUTE = "loop=\"loop\" "; + private const string CONTROLS_ATTRIBUTE = "controls=\"controls\" "; + + private const string DIV_ID_PREFIX = "div_"; + private const string IMAGE_ID_PREFIX = "image_"; + private const string ANCHOR_ID_PREFIX = "a_"; + private const string FLASH_ID_PREFIX = "flash_"; + private const string WINDOWS_MEDIA_ID_PREFIX = "windowsmedia_"; + private const string REAL_PLAYER_ID_PREFIX = "realplayer_"; + private const string QUICKTIME_ID_PREFIX = "quicktime_"; + + private const string AUTOSTART = "autostart"; + private const string SRC = "src"; + //Private Const URL As String = "url" + private const string AUTOPLAY = "autoplay"; + private const string MEDIA_LOOP = "loop"; + private const string BLANK_ATTRIBUTE = "_blank"; + + private const string DIV_CLASS = "dnnmedia_wrapper"; + private const string MEDIA_IMAGE_CLASS = "dnnmedia_image"; + private const string ALIGN_LEFT_CLASS = "dnnmedia_left"; + private const string ALIGN_RIGHT_CLASS = "dnnmedia_right"; + private const string ALIGN_CENTER_CLASS = "dnnmedia_center"; + + private const string DESCRIPTION = "-description"; + private const string DNNCLEAR = "dnnClear"; + +#endregion + + private string p_CurrentDomain = Null.NullString; + private string CurrentDomain + { + get + { + if (! (string.IsNullOrEmpty(p_CurrentDomain))) + { + return p_CurrentDomain; + } + + DotNetNuke.Entities.Portals.PortalSettings pSettings = null; + pSettings = DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings(); + + if (HttpContext.Current.Request.IsSecureConnection) + { + p_CurrentDomain = string.Concat("https://", pSettings.PortalAlias.HTTPAlias); + } + else + { + p_CurrentDomain = string.Concat("http://", pSettings.PortalAlias.HTTPAlias); + } + + return p_CurrentDomain; + } + } + +#region RegEx Patterns + + private const string IMAGE_PATTERN = "\\.(jpg|jpeg?|gif|bmp|png)"; + private const string FLASH_PATTERN = "\\.swf"; + private const string WINDOWS_MEDIA_PATTERN = "\\.(avi|wmv|midi|wav|asx|mp3|mpg|mpeg|asf|wma)"; + private const string REAL_PLAYER_PATTERN = "\\.(ram|rpm|rm)"; + private const string QUICKTIME_PATTERN = "\\.(mov|qt|mp4)"; + + private const string NUMERIC_MATCH_PATTERN = "^\\d+$"; + +#endregion + +#region Get Media Type + + public MediaType GetMediaType(MediaInfo Media) + { + return GetMediaType(Media.Src); + } + + public MediaType GetMediaType(string MediaURL) + { + + if (Regex.IsMatch(MediaURL, IMAGE_PATTERN, RegexOptions.IgnoreCase)) + { + return MediaType.Image; + } + else if (Regex.IsMatch(MediaURL, FLASH_PATTERN, RegexOptions.IgnoreCase)) + { + return MediaType.Flash; + } + else if (Regex.IsMatch(MediaURL, WINDOWS_MEDIA_PATTERN, RegexOptions.IgnoreCase)) + { + return MediaType.WindowsMedia; + } + else if (Regex.IsMatch(MediaURL, QUICKTIME_PATTERN, RegexOptions.IgnoreCase)) + { + return MediaType.Quicktime; + } + else if (Regex.IsMatch(MediaURL, REAL_PLAYER_PATTERN, RegexOptions.IgnoreCase)) + { + return MediaType.RealPlayer; + } + else + { + return MediaType.Unknown; + } + + } + +#endregion + +#region Get Media Mark-Up + + public string GetImageMarkUp(MediaInfo Media, Entities.Modules.ModuleInfo ModuleConfig) + { + + string strTagId = string.Concat(IMAGE_ID_PREFIX, Media.ModuleID.ToString()); + string strAnchorId = string.Concat(ANCHOR_ID_PREFIX, strTagId); + string strDivId = string.Concat(DIV_ID_PREFIX, strTagId); + string strDivCssClass = string.Concat(DIV_CLASS, GetMediaAlignment(Media.MediaAlignment, ModuleConfig)); + + // + // BUILD: + //
+ // + //
+ //
+ //
+ // + + StringBuilder sb = new StringBuilder(10); + + // build open div + sb.AppendFormat(OPEN_TAG_FORMAT, DIV_TAG); + sb.AppendFormat(ID_ATTRIBUTE, strDivId); + sb.AppendFormat(CLASS_ATTRIBUTE.Trim(), strDivCssClass); + sb.Append(CLOSE_BRACKET); + // + + // build open anchor tag + if (! (string.IsNullOrEmpty(Media.NavigateUrl))) + { + sb.AppendFormat(OPEN_TAG_FORMAT, ANCHOR_TAG); + sb.AppendFormat(ID_ATTRIBUTE, strAnchorId); + + if (Regex.IsMatch(Media.NavigateUrl, NUMERIC_MATCH_PATTERN)) + { + Media.NavigateUrl = Globals.NavigateURL(int.Parse(Media.NavigateUrl, NumberStyles.Integer)); + } + + if (Media.TrackClicks) + { + // need to parse the local URL to get the human-friendly one + sb.AppendFormat(HREF_ATTRIBUTE, FormatURL(Media.NavigateUrl, Media.TrackClicks, ModuleConfig.TabID, ModuleConfig.ModuleID)); + } + else + { + // this must be a URL already + sb.AppendFormat(HREF_ATTRIBUTE, FormatURL(Media.NavigateUrl)); + } + + if (Media.NewWindow) + { + sb.AppendFormat(TARGET_ATTRIBUTE, BLANK_ATTRIBUTE); + } + + sb.Append(CLOSE_BRACKET); + } + // + + // begin building the image tag + sb.AppendFormat(OPEN_TAG_FORMAT, IMAGE_TAG); + sb.AppendFormat(ID_ATTRIBUTE, strTagId); + sb.AppendFormat(CLASS_ATTRIBUTE, MEDIA_IMAGE_CLASS); + sb.AppendFormat(SRC_ATTRIBUTE, Media.WebFriendlyUrl); + + if (! (string.IsNullOrEmpty(Media.Alt))) + { + sb.AppendFormat(ALT_ATTRIBUTE, Media.Alt); + sb.AppendFormat(TITLE_ATTRIBUTE, Media.Alt); + } + else + { + // for XHTML compliance + sb.AppendFormat(ALT_ATTRIBUTE, string.Empty); + } + + if (Media.Width > Null.NullInteger & Media.Height > Null.NullInteger) + { + sb.AppendFormat(STYLE_ATTRIBUTE, Media.Width.ToString(), Media.Height.ToString()); + } + + sb.Append(SELF_CLOSE_BRACKET); + // + + // build close anchor + if (! (string.IsNullOrEmpty(Media.NavigateUrl))) + { + sb.AppendFormat(CLOSE_TAG_FORMAT, ANCHOR_TAG); + } + // + + // build close div + sb.AppendFormat(CLOSE_TAG_FORMAT, DIV_TAG); + // + + // add the description, if necessary + if (!string.IsNullOrEmpty(Media.MediaMessage)) + { + + var strDescriptionId = string.Concat(strDivId, DESCRIPTION); + + // build open div for description + sb.AppendFormat(OPEN_TAG_FORMAT, DIV_TAG); + sb.AppendFormat(ID_ATTRIBUTE, strDescriptionId); + sb.AppendFormat(CLASS_ATTRIBUTE.Trim(), DNNCLEAR); + sb.Append(CLOSE_BRACKET); + // + + // add the desciption + sb.Append(HttpUtility.HtmlDecode(Media.MediaMessage)); + // + + // build the close div + sb.AppendFormat(CLOSE_TAG_FORMAT, DIV_TAG); + // + + } + + return sb.ToString(); + + } + + public string GetFlashMarkUp(MediaInfo Media, DotNetNuke.Entities.Modules.ModuleInfo ModuleConfig) + { + + string strFlashId = string.Concat(FLASH_ID_PREFIX, Media.ModuleID.ToString()); + string strDivId = string.Concat(DIV_ID_PREFIX, strFlashId); + string strDivCssClass = string.Concat(DIV_CLASS, GetMediaAlignment(Media.MediaAlignment, ModuleConfig)); + + //Media.Src = String.Concat(CurrentDomain, Media.Src) + + // + // BUILD: + //
+ // + //
+ // + + StringBuilder sb = new StringBuilder(10); + + // build open div + sb.AppendFormat(OPEN_TAG_FORMAT, DIV_TAG); + sb.AppendFormat(ID_ATTRIBUTE, strDivId); + sb.AppendFormat(CLASS_ATTRIBUTE.Trim(), strDivCssClass); + sb.Append(CLOSE_BRACKET); + // + + // build flash object + sb.AppendFormat(OPEN_TAG_FORMAT, OBJECT_TAG); + sb.AppendFormat(ID_ATTRIBUTE, strFlashId); + if (Media.Width > Null.NullInteger) + { + sb.AppendFormat(WIDTH_ATTRIBUTE, Media.Width); + } + if (Media.Height > Null.NullInteger) + { + sb.AppendFormat(HEIGHT_ATTRIBUTE, Media.Height); + } + sb.Append("classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" "); + sb.AppendFormat("codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\""); + sb.Append(CLOSE_BRACKET); + sb.AppendFormat(PARAM_TAG_FORMAT, "movie", Media.WebFriendlyUrl); + sb.AppendFormat(PARAM_TAG_FORMAT, "quality", "high"); + sb.AppendFormat(PARAM_TAG_FORMAT, "bgcolor", "#ffffff"); + sb.AppendFormat(PARAM_TAG_FORMAT, "wmode", "transparent"); + sb.Append(""); + sb.AppendFormat(OPEN_TAG_FORMAT, OBJECT_TAG); + sb.AppendFormat(DATA_ATTRIBUTE, Media.WebFriendlyUrl); + if (Media.Width > Null.NullInteger) + { + sb.AppendFormat(WIDTH_ATTRIBUTE, Media.Width); + } + if (Media.Height > Null.NullInteger) + { + sb.AppendFormat(HEIGHT_ATTRIBUTE, Media.Height); + } + sb.Append("type=\"application/x-shockwave-flash\""); + sb.Append(CLOSE_BRACKET); + sb.AppendFormat(PARAM_TAG_FORMAT, "quality", "high"); + sb.AppendFormat(PARAM_TAG_FORMAT, "bgcolor", "#ffffff"); + sb.AppendFormat(PARAM_TAG_FORMAT, "wmode", "transparent"); + sb.AppendFormat(PARAM_TAG_FORMAT, "pluginurl", "http://www.macromedia.com/go/getflashplayer"); + sb.AppendFormat(PARAM_TAG_FORMAT, "wmode", "transparent"); + sb.AppendFormat(CLOSE_TAG_FORMAT, OBJECT_TAG); + sb.Append(" "); + sb.AppendFormat(CLOSE_TAG_FORMAT, OBJECT_TAG); + // + + // build close div + sb.AppendFormat(CLOSE_TAG_FORMAT, DIV_TAG); + // + + return sb.ToString(); + + } + + public string GetWindowsMediaMarkUp(MediaInfo Media, DotNetNuke.Entities.Modules.ModuleInfo ModuleConfig) + { + + string strWMediaId = string.Concat(WINDOWS_MEDIA_ID_PREFIX, Media.ModuleID.ToString()); + string strDivId = string.Concat(DIV_ID_PREFIX, strWMediaId); + string strDivCssClass = string.Concat(DIV_CLASS, GetMediaAlignment(Media.MediaAlignment, ModuleConfig), " dnnmedia_wmp"); + + // + // BUILD: + //
+ // + //
+ // + + StringBuilder sb = new StringBuilder(10); + + // build open div + sb.AppendFormat(OPEN_TAG_FORMAT, DIV_TAG); + sb.AppendFormat(ID_ATTRIBUTE, strDivId); + sb.AppendFormat(CLASS_ATTRIBUTE.Trim(), strDivCssClass); + sb.Append(CLOSE_BRACKET); + // + + // build windows media object + sb.AppendFormat(OPEN_TAG_FORMAT, OBJECT_TAG); + sb.AppendFormat(ID_ATTRIBUTE, strWMediaId); + if (Media.Width > Null.NullInteger) + { + sb.AppendFormat(WIDTH_ATTRIBUTE, Media.Width); + } + if (Media.Height > Null.NullInteger) + { + sb.AppendFormat(HEIGHT_ATTRIBUTE, Media.Height); + } + sb.Append("classid=\"clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6\""); + sb.Append(CLOSE_BRACKET); + sb.AppendFormat(PARAM_TAG_FORMAT, "url", Media.WebFriendlyUrl); + sb.AppendFormat(PARAM_TAG_FORMAT, "src", Media.WebFriendlyUrl); + sb.AppendFormat(PARAM_TAG_FORMAT, "showcontrols", "true"); + sb.AppendFormat(PARAM_TAG_FORMAT, AUTOSTART, Media.AutoStart.ToString().ToLower()); + sb.AppendFormat(PARAM_TAG_FORMAT, MEDIA_LOOP, Media.MediaLoop.ToString().ToLower()); + sb.Append(""); + sb.AppendFormat(OPEN_TAG_FORMAT, OBJECT_TAG); + sb.AppendFormat(DATA_ATTRIBUTE, Media.WebFriendlyUrl); + if (Media.Width > Null.NullInteger) + { + sb.AppendFormat(WIDTH_ATTRIBUTE, Media.Width); + } + if (Media.Height > Null.NullInteger) + { + sb.AppendFormat(HEIGHT_ATTRIBUTE, Media.Height); + } + sb.Append("type=\"video/x-ms-wmv\""); + sb.Append(CLOSE_BRACKET); + sb.AppendFormat(PARAM_TAG_FORMAT, "src", Media.WebFriendlyUrl); + sb.AppendFormat(PARAM_TAG_FORMAT, "controller", "true"); + sb.AppendFormat(PARAM_TAG_FORMAT, AUTOSTART, Media.AutoStart.ToString().ToLower()); + sb.AppendFormat(PARAM_TAG_FORMAT, MEDIA_LOOP, Media.MediaLoop.ToString().ToLower()); + sb.AppendFormat(CLOSE_TAG_FORMAT, OBJECT_TAG); + sb.Append(" "); + sb.AppendFormat(CLOSE_TAG_FORMAT, OBJECT_TAG); + // + + // build close div + sb.AppendFormat(CLOSE_TAG_FORMAT, DIV_TAG); + // + + return sb.ToString(); + + } + + public string GetRealPlayerMarkUp(MediaInfo Media, DotNetNuke.Entities.Modules.ModuleInfo ModuleConfig) + { + + string strRMediaId = string.Concat(REAL_PLAYER_ID_PREFIX, Media.ModuleID.ToString()); + string strDivId = string.Concat(DIV_ID_PREFIX, strRMediaId); + string strDivCssClass = string.Concat(DIV_CLASS, GetMediaAlignment(Media.MediaAlignment, ModuleConfig), " dnnmedia_wmp"); + + // + // BUILD: + //
+ // + // + // + // + // + // + // + // + //
+ // + + StringBuilder sb = new StringBuilder(10); + + // build open div + sb.AppendFormat(OPEN_TAG_FORMAT, DIV_TAG); + sb.AppendFormat(ID_ATTRIBUTE, strDivId); + sb.AppendFormat(CLASS_ATTRIBUTE.Trim(), strDivCssClass); + sb.Append(CLOSE_BRACKET); + // + + // build real media player object + sb.AppendFormat(OPEN_TAG_FORMAT, OBJECT_TAG); + sb.AppendFormat(ID_ATTRIBUTE, strRMediaId); + if (Media.Width > Null.NullInteger) + { + sb.AppendFormat(WIDTH_ATTRIBUTE, Media.Width); + } + if (Media.Height > Null.NullInteger) + { + sb.AppendFormat(HEIGHT_ATTRIBUTE, Media.Height); + } + sb.Append("classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\""); + sb.Append(CLOSE_BRACKET); + sb.AppendFormat(PARAM_TAG_FORMAT, SRC, Media.WebFriendlyUrl); + sb.AppendFormat(PARAM_TAG_FORMAT, MEDIA_LOOP, Media.MediaLoop); + sb.AppendFormat(PARAM_TAG_FORMAT, "controls", "ImageWindow"); + sb.AppendFormat(PARAM_TAG_FORMAT, "maintainaspect", "true"); + //sb.AppendFormat(PARAM_TAG_FORMAT, "console", "_unique") + sb.AppendFormat(PARAM_TAG_FORMAT, AUTOSTART, Media.AutoStart.ToString().ToLower()); + sb.Append(""); + sb.AppendFormat(OPEN_TAG_FORMAT, OBJECT_TAG); + sb.AppendFormat(DATA_ATTRIBUTE, Media.WebFriendlyUrl); + if (Media.Width > Null.NullInteger) + { + sb.AppendFormat(WIDTH_ATTRIBUTE, Media.Width); + } + if (Media.Height > Null.NullInteger) + { + sb.AppendFormat(HEIGHT_ATTRIBUTE, Media.Height); + } + sb.Append("type=\"audio/x-pn-realaudio-plugin\""); + sb.Append(CLOSE_BRACKET); + sb.AppendFormat(PARAM_TAG_FORMAT, SRC, Media.WebFriendlyUrl); + sb.AppendFormat(PARAM_TAG_FORMAT, MEDIA_LOOP, Media.MediaLoop); + sb.AppendFormat(PARAM_TAG_FORMAT, AUTOSTART, Media.AutoStart.ToString().ToLower()); + sb.AppendFormat(PARAM_TAG_FORMAT, "nojava", "true"); + sb.AppendFormat(PARAM_TAG_FORMAT, "controls", "ImageWindow"); + sb.AppendFormat(PARAM_TAG_FORMAT, "maintainaspect", "true"); + //sb.AppendFormat(PARAM_TAG_FORMAT, "console", "_unique") + sb.AppendFormat(CLOSE_TAG_FORMAT, OBJECT_TAG); + sb.Append(" "); + sb.AppendFormat(CLOSE_TAG_FORMAT, OBJECT_TAG); + // + + // build close div + sb.AppendFormat(CLOSE_TAG_FORMAT, DIV_TAG); + // + + return sb.ToString(); + + } + + public string GetQuicktimeMarkUp(MediaInfo Media, DotNetNuke.Entities.Modules.ModuleInfo ModuleConfig) + { + + string strQMediaId = string.Concat(QUICKTIME_ID_PREFIX, Media.ModuleID.ToString()); + string strDivId = string.Concat(DIV_ID_PREFIX, strQMediaId); + string strDivCssClass = string.Concat(DIV_CLASS, GetMediaAlignment(Media.MediaAlignment, ModuleConfig), " dnnmedia_wmp"); + + // + // BUILD: + //
+ // + // + // + // + // + // + // + // + // + //
+ // + + StringBuilder sb = new StringBuilder(10); + + // build open div + sb.AppendFormat(OPEN_TAG_FORMAT, DIV_TAG); + sb.AppendFormat(ID_ATTRIBUTE, strDivId); + sb.AppendFormat(CLASS_ATTRIBUTE.Trim(), strDivCssClass); + sb.Append(CLOSE_BRACKET); + // + + // build quicktime object + sb.AppendFormat(OPEN_TAG_FORMAT, OBJECT_TAG); + sb.AppendFormat(ID_ATTRIBUTE, strQMediaId); + if (Media.Width > Null.NullInteger) + { + sb.AppendFormat(WIDTH_ATTRIBUTE, Media.Width); + } + if (Media.Height > Null.NullInteger) + { + sb.AppendFormat(HEIGHT_ATTRIBUTE, Media.Height); + } + // ISSUE 18955 - http://dnnmedia.codeplex.com/workitem/18955 + // Changed the clsid to be the correct one + sb.Append("classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" "); + sb.Append("codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\""); + sb.Append(CLOSE_BRACKET); + sb.AppendFormat(PARAM_TAG_FORMAT, "src", Media.WebFriendlyUrl); + sb.AppendFormat(PARAM_TAG_FORMAT, "controller", "true"); + sb.AppendFormat(PARAM_TAG_FORMAT, AUTOPLAY, Media.AutoStart); + sb.AppendFormat(PARAM_TAG_FORMAT, MEDIA_LOOP, Media.MediaLoop); + sb.Append(""); + sb.AppendFormat(OPEN_TAG_FORMAT, OBJECT_TAG); + sb.AppendFormat(DATA_ATTRIBUTE, Media.WebFriendlyUrl); + if (Media.Width > Null.NullInteger) + { + sb.AppendFormat(WIDTH_ATTRIBUTE, Media.Width); + } + if (Media.Height > Null.NullInteger) + { + sb.AppendFormat(HEIGHT_ATTRIBUTE, Media.Height); + } + sb.Append("type=\"video/quicktime\""); + sb.Append(CLOSE_BRACKET); + sb.AppendFormat(PARAM_TAG_FORMAT, "controller", "true"); + sb.AppendFormat(PARAM_TAG_FORMAT, AUTOPLAY, Media.AutoStart); + sb.AppendFormat(PARAM_TAG_FORMAT, MEDIA_LOOP, Media.MediaLoop); + sb.AppendFormat(CLOSE_TAG_FORMAT, OBJECT_TAG); + sb.Append(" "); + sb.AppendFormat(CLOSE_TAG_FORMAT, OBJECT_TAG); + // + + // build close div + sb.AppendFormat(CLOSE_TAG_FORMAT, DIV_TAG); + // + + return sb.ToString(); + + } + +#endregion + +#region Private Methods + + private string GetMediaAlignment(int Alignment, DotNetNuke.Entities.Modules.ModuleInfo ModuleConfig) + { + switch (Alignment) + { + case 0: // Use ModuleSettings values + if (ModuleConfig.Alignment.Trim().Length > 0) + { + switch (ModuleConfig.Alignment.ToLower()) + { + case "left": + return string.Concat(SPACE, ALIGN_LEFT_CLASS); + case "center": + return string.Concat(SPACE, ALIGN_CENTER_CLASS); + case "right": + return string.Concat(SPACE, ALIGN_RIGHT_CLASS); + } + } + + return string.Empty; + case 1: // None + return string.Empty; + case 2: // Left + return string.Concat(SPACE, ALIGN_LEFT_CLASS); + case 3: // Center + return string.Concat(SPACE, ALIGN_CENTER_CLASS); + case 4: // Right + return string.Concat(SPACE, ALIGN_RIGHT_CLASS); + default: + return string.Empty; + } + } + + private string FormatURL(string Link) + { + return FormatURL(Link, false, -1, -1); + } + + private string FormatURL(string Link, bool TrackClicks, int TabId, int ModuleId) + { + if (TrackClicks) + { + return MediaController.EncodeUrl(DotNetNuke.Common.Globals.LinkClick(Link, TabId, ModuleId, TrackClicks)); + } + else + { + return MediaController.EncodeUrl(Link); + } + } + +#endregion + + } + +} \ No newline at end of file diff --git a/Modules/Media/Utilities/RegExUtility.cs b/Modules/Media/Utilities/RegExUtility.cs new file mode 100644 index 0000000..81e7418 --- /dev/null +++ b/Modules/Media/Utilities/RegExUtility.cs @@ -0,0 +1,120 @@ +// +// DNN Corp - http://www.dnnsoftware.com +// Copyright (c) 2002-2014 +// by DNN Corp +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. +// + +//INSTANT C# NOTE: Formerly VB project-level imports: +using DotNetNuke; +using DotNetNuke.Common; +using DotNetNuke.Common.Utilities; +using DotNetNuke.Services.Exceptions; +using DotNetNuke.Services.Localization; +using System; +using System.Collections; +using System.Data; +using System.Diagnostics; + +using System.Text.RegularExpressions; + +namespace DotNetNuke.Modules.Media +{ + + public sealed class RegExUtility + { + +#region Constants + + private const string POSITIVE_ONLY_PATTERN = "^\\d+(\\.\\d+)*?$"; + private const string NEGATIVE_ALLOWED_PATTERN = "^\\-*\\d+(\\.\\d+)*?$"; + private const string BOOLEAN_PATTERN = "^(1|0|true|false)$"; + +#endregion + + /// + /// IsNumber - this method uses a regular expression to determine if the value object is in a valid numeric format. + /// + /// Object - the object to parse to see if it's a number + /// If true, the Value object was in a valid numeric format + /// + /// This method does not consider commas (,) to be a valid character. This overload defaults PositiveOnly to True. + /// + /// + /// [wstrohl] - 20100130 - created + /// + public static bool IsNumber(object Value) + { + return IsNumber(Value, true); + } + + /// + /// IsNumber - this method uses a regular expression to determine if the value object is in a valid numeric format. + /// + /// Object - the object to parse to see if it's a number + /// Boolean - if true, a negative number will be considered valid + /// If true, the Value object was in a valid numeric format + /// + /// This method does not consider commas (,) to be a valid character. + /// + /// + /// [wstrohl] - 20100130 - created + /// + public static bool IsNumber(object Value, bool PositiveOnly) + { + + if (Value == null) + { + return false; + } + + if (PositiveOnly) + { + return Regex.IsMatch(Value.ToString(), POSITIVE_ONLY_PATTERN); + } + else + { + return Regex.IsMatch(Value.ToString(), NEGATIVE_ALLOWED_PATTERN); + } + + } + + /// + /// IsBoolean - this method uses a regular expression to determine if the value object is in a valid boolean format. + /// + /// Object - the object to parse to see if it is in a boolean fomat + /// If true, the Value object was in a valid boolean format + /// + /// This method looks for one of the following: 1, 0, true, false (case insensitive) + /// + /// + /// [wstrohl] - 20100130 - created + /// + public static bool IsBoolean(object Value) + { + + if (Value == null) + { + return false; + } + + return Regex.IsMatch(Value.ToString(), BOOLEAN_PATTERN, RegexOptions.IgnoreCase); + + } + + } + +} \ No newline at end of file diff --git a/Modules/Media/releasenotes.txt b/Modules/Media/releasenotes.txt new file mode 100644 index 0000000..df1cdf8 --- /dev/null +++ b/Modules/Media/releasenotes.txt @@ -0,0 +1,19 @@ +
+ +

Media Module Version 04.04.02

+

Date Released: 02/09/2014

+ +
    +
  • Tested for version 07.02.00 compatibility
  • +
  • Updated oEmbed to version 00.03.00
  • +
  • Added missing description below images
  • +
  • Fixed oEmbed SSL providers (can use https now)
  • +
  • Fixed CSS conflicts with fieldsets
  • +
  • Removed NewtonsoftJSON dependency
  • +
  • Fixed issue with sub-directories being used for local media
  • +
  • Fixed URL that is generated
  • +
+ +
+ +

For more information, see the Media Module project homepage.

\ No newline at end of file diff --git a/README.md b/README.md index 1342c55..1dee35c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,44 @@ -# DNN.Media -A DNN module that makes it simple for content editors to add and manage single media items on the page. +# DNN Media Module + +This is the DNN Media module. It allows an end user to be given the ability to manage a specific piece of content on a page. + +It also is used to display how a DNN solution could be architected to be built outside of a DNN webwite, as a best practice, +which includes several very useful MSBuild scripts. + +--- + +## First... Thank You + +I just want to thank everyone that helps with the project, even if it's just to use the apps being +built or submit issues. However, I'd really like to also thank [JetBrains](https://www.jetbrains.com/). +The things I build wouldn't be built half as fast if it wasn't for your generous support. Specifically, +the following Visual Studio integrations really have saved me TONS of time and headaches over the +years, and gotten me up to speed faster on other people's code more than anything else I've ever +tried (even talking to them about it). + +[![ReSharper by JetBrains](https://github.com/hismightiness/dnnextensions/blob/master/Assets/images/icon_ReSharper.png)](https://www.jetbrains.com/resharper/) +[![dotPeek by JetBrains](https://github.com/hismightiness/dnnextensions/blob/master/Assets/images/icon_dotPeek.png)](https://www.jetbrains.com/decompiler/) + +--- + +## How You Can Help + +* [Install and use the extensions (see below)](https://github.com/DNNCommunity/DNN.Media/wiki/Install-and-Use-the-Extensions) +* [Create Issues (ideas OR bugs)](https://github.com/DNNCommunity/DNN.Media/wiki/Create-Issues-or-Ideas) +* [Write documentation](https://github.com/DNNCommunity/DNN.Media/wiki/Write-Documentation) +* [Test Releases](https://github.com/DNNCommunity/DNN.Media/wiki/Test-Releases) +* Create UI/UX +* [Write Code](https://github.com/DNNCommunity/DNN.Media/wiki/Write-Code) +* Debug Code +* [Create a Pull Request](https://github.com/DNNCommunity/DNN.Media/wiki/Create-a-Pull-Request) + +## Project Distribution Locations + +New releases are going to be posted here, in [the Releases section](https://github.com/dnncommunity/dnn.media/releases). If +you don't see a current release, then you'll find it at the old project location below. + +--- + +### More Information + +For more information about the project, please go to [the project wiki](https://github.com/hismightiness/dnnextensions/wiki). diff --git a/References/DNN/07.02.00/ClientDependency.Core.dll b/References/DNN/07.02.00/ClientDependency.Core.dll new file mode 100644 index 0000000..135ed83 Binary files /dev/null and b/References/DNN/07.02.00/ClientDependency.Core.dll differ diff --git a/References/DNN/07.02.00/CountryListBox.dll b/References/DNN/07.02.00/CountryListBox.dll new file mode 100644 index 0000000..c89ed65 Binary files /dev/null and b/References/DNN/07.02.00/CountryListBox.dll differ diff --git a/References/DNN/07.02.00/DotNetNuke.Authentication.Facebook.dll b/References/DNN/07.02.00/DotNetNuke.Authentication.Facebook.dll new file mode 100644 index 0000000..df8dd89 Binary files /dev/null and b/References/DNN/07.02.00/DotNetNuke.Authentication.Facebook.dll differ diff --git a/References/DNN/07.02.00/DotNetNuke.Authentication.Google.dll b/References/DNN/07.02.00/DotNetNuke.Authentication.Google.dll new file mode 100644 index 0000000..80ed316 Binary files /dev/null and b/References/DNN/07.02.00/DotNetNuke.Authentication.Google.dll differ diff --git a/References/DNN/07.02.00/DotNetNuke.Authentication.LiveConnect.dll b/References/DNN/07.02.00/DotNetNuke.Authentication.LiveConnect.dll new file mode 100644 index 0000000..2139cba Binary files /dev/null and b/References/DNN/07.02.00/DotNetNuke.Authentication.LiveConnect.dll differ diff --git a/References/DNN/07.02.00/DotNetNuke.Authentication.Twitter.dll b/References/DNN/07.02.00/DotNetNuke.Authentication.Twitter.dll new file mode 100644 index 0000000..22ebad2 Binary files /dev/null and b/References/DNN/07.02.00/DotNetNuke.Authentication.Twitter.dll differ diff --git a/References/DNN/07.02.00/DotNetNuke.HttpModules.dll b/References/DNN/07.02.00/DotNetNuke.HttpModules.dll new file mode 100644 index 0000000..53b36d9 Binary files /dev/null and b/References/DNN/07.02.00/DotNetNuke.HttpModules.dll differ diff --git a/References/DNN/07.02.00/DotNetNuke.Instrumentation.dll b/References/DNN/07.02.00/DotNetNuke.Instrumentation.dll new file mode 100644 index 0000000..6ab662f Binary files /dev/null and b/References/DNN/07.02.00/DotNetNuke.Instrumentation.dll differ diff --git a/References/DNN/07.02.00/DotNetNuke.Log4Net.dll b/References/DNN/07.02.00/DotNetNuke.Log4Net.dll new file mode 100644 index 0000000..1e16391 Binary files /dev/null and b/References/DNN/07.02.00/DotNetNuke.Log4Net.dll differ diff --git a/References/DNN/07.02.00/DotNetNuke.RadEditorProvider.dll b/References/DNN/07.02.00/DotNetNuke.RadEditorProvider.dll new file mode 100644 index 0000000..f771964 Binary files /dev/null and b/References/DNN/07.02.00/DotNetNuke.RadEditorProvider.dll differ diff --git a/References/DNN/07.02.00/DotNetNuke.Services.Syndication.dll b/References/DNN/07.02.00/DotNetNuke.Services.Syndication.dll new file mode 100644 index 0000000..93f8e99 Binary files /dev/null and b/References/DNN/07.02.00/DotNetNuke.Services.Syndication.dll differ diff --git a/References/DNN/07.02.00/DotNetNuke.Web.Client.dll b/References/DNN/07.02.00/DotNetNuke.Web.Client.dll new file mode 100644 index 0000000..1744d25 Binary files /dev/null and b/References/DNN/07.02.00/DotNetNuke.Web.Client.dll differ diff --git a/References/DNN/07.02.00/DotNetNuke.Web.Razor.dll b/References/DNN/07.02.00/DotNetNuke.Web.Razor.dll new file mode 100644 index 0000000..441ab3b Binary files /dev/null and b/References/DNN/07.02.00/DotNetNuke.Web.Razor.dll differ diff --git a/References/DNN/07.02.00/DotNetNuke.Web.dll b/References/DNN/07.02.00/DotNetNuke.Web.dll new file mode 100644 index 0000000..b096fee Binary files /dev/null and b/References/DNN/07.02.00/DotNetNuke.Web.dll differ diff --git a/References/DNN/07.02.00/DotNetNuke.WebControls.dll b/References/DNN/07.02.00/DotNetNuke.WebControls.dll new file mode 100644 index 0000000..efd2a7f Binary files /dev/null and b/References/DNN/07.02.00/DotNetNuke.WebControls.dll differ diff --git a/References/DNN/07.02.00/DotNetNuke.WebUtility.dll b/References/DNN/07.02.00/DotNetNuke.WebUtility.dll new file mode 100644 index 0000000..fe89947 Binary files /dev/null and b/References/DNN/07.02.00/DotNetNuke.WebUtility.dll differ diff --git a/References/DNN/07.02.00/DotNetNuke.dll b/References/DNN/07.02.00/DotNetNuke.dll new file mode 100644 index 0000000..e23aac5 Binary files /dev/null and b/References/DNN/07.02.00/DotNetNuke.dll differ diff --git a/References/DNN/07.02.00/Lucene.Net.Contrib.FastVectorHighlighter.dll b/References/DNN/07.02.00/Lucene.Net.Contrib.FastVectorHighlighter.dll new file mode 100644 index 0000000..6b75bce Binary files /dev/null and b/References/DNN/07.02.00/Lucene.Net.Contrib.FastVectorHighlighter.dll differ diff --git a/References/DNN/07.02.00/Lucene.Net.dll b/References/DNN/07.02.00/Lucene.Net.dll new file mode 100644 index 0000000..cbf0220 Binary files /dev/null and b/References/DNN/07.02.00/Lucene.Net.dll differ diff --git a/References/DNN/07.02.00/Microsoft.ApplicationBlocks.Data.dll b/References/DNN/07.02.00/Microsoft.ApplicationBlocks.Data.dll new file mode 100644 index 0000000..8158be3 Binary files /dev/null and b/References/DNN/07.02.00/Microsoft.ApplicationBlocks.Data.dll differ diff --git a/References/DNN/07.02.00/Microsoft.Web.Helpers.dll b/References/DNN/07.02.00/Microsoft.Web.Helpers.dll new file mode 100644 index 0000000..2d852ee Binary files /dev/null and b/References/DNN/07.02.00/Microsoft.Web.Helpers.dll differ diff --git a/References/DNN/07.02.00/Microsoft.Web.Infrastructure.dll b/References/DNN/07.02.00/Microsoft.Web.Infrastructure.dll new file mode 100644 index 0000000..85f1138 Binary files /dev/null and b/References/DNN/07.02.00/Microsoft.Web.Infrastructure.dll differ diff --git a/References/DNN/07.02.00/Newtonsoft.Json.dll b/References/DNN/07.02.00/Newtonsoft.Json.dll new file mode 100644 index 0000000..1c16c11 Binary files /dev/null and b/References/DNN/07.02.00/Newtonsoft.Json.dll differ diff --git a/References/DNN/07.02.00/PetaPoco.dll b/References/DNN/07.02.00/PetaPoco.dll new file mode 100644 index 0000000..d04e182 Binary files /dev/null and b/References/DNN/07.02.00/PetaPoco.dll differ diff --git a/References/DNN/07.02.00/Providers/DotNetNuke.ASP2MenuNavigationProvider.dll b/References/DNN/07.02.00/Providers/DotNetNuke.ASP2MenuNavigationProvider.dll new file mode 100644 index 0000000..7a81c5e Binary files /dev/null and b/References/DNN/07.02.00/Providers/DotNetNuke.ASP2MenuNavigationProvider.dll differ diff --git a/References/DNN/07.02.00/Providers/DotNetNuke.DNNDropDownNavigationProvider.dll b/References/DNN/07.02.00/Providers/DotNetNuke.DNNDropDownNavigationProvider.dll new file mode 100644 index 0000000..b3f968a Binary files /dev/null and b/References/DNN/07.02.00/Providers/DotNetNuke.DNNDropDownNavigationProvider.dll differ diff --git a/References/DNN/07.02.00/Providers/DotNetNuke.DNNMenuNavigationProvider.dll b/References/DNN/07.02.00/Providers/DotNetNuke.DNNMenuNavigationProvider.dll new file mode 100644 index 0000000..e9c4db1 Binary files /dev/null and b/References/DNN/07.02.00/Providers/DotNetNuke.DNNMenuNavigationProvider.dll differ diff --git a/References/DNN/07.02.00/Providers/DotNetNuke.DNNTreeNavigationProvider.dll b/References/DNN/07.02.00/Providers/DotNetNuke.DNNTreeNavigationProvider.dll new file mode 100644 index 0000000..8068b02 Binary files /dev/null and b/References/DNN/07.02.00/Providers/DotNetNuke.DNNTreeNavigationProvider.dll differ diff --git a/References/DNN/07.02.00/Providers/DotNetNuke.Providers.FiftyOneClientCapabilityProvider.dll b/References/DNN/07.02.00/Providers/DotNetNuke.Providers.FiftyOneClientCapabilityProvider.dll new file mode 100644 index 0000000..f905811 Binary files /dev/null and b/References/DNN/07.02.00/Providers/DotNetNuke.Providers.FiftyOneClientCapabilityProvider.dll differ diff --git a/References/DNN/07.02.00/Providers/DotNetNuke.SolpartMenuNavigationProvider.dll b/References/DNN/07.02.00/Providers/DotNetNuke.SolpartMenuNavigationProvider.dll new file mode 100644 index 0000000..21092f6 Binary files /dev/null and b/References/DNN/07.02.00/Providers/DotNetNuke.SolpartMenuNavigationProvider.dll differ diff --git a/References/DNN/07.02.00/Providers/SolpartWebControls.dll b/References/DNN/07.02.00/Providers/SolpartWebControls.dll new file mode 100644 index 0000000..04c2941 Binary files /dev/null and b/References/DNN/07.02.00/Providers/SolpartWebControls.dll differ diff --git a/References/DNN/07.02.00/SharpZipLib.dll b/References/DNN/07.02.00/SharpZipLib.dll new file mode 100644 index 0000000..b7e439f Binary files /dev/null and b/References/DNN/07.02.00/SharpZipLib.dll differ diff --git a/References/DNN/07.02.00/System.Net.Http.Formatting.dll b/References/DNN/07.02.00/System.Net.Http.Formatting.dll new file mode 100644 index 0000000..367d253 Binary files /dev/null and b/References/DNN/07.02.00/System.Net.Http.Formatting.dll differ diff --git a/References/DNN/07.02.00/System.Net.Http.WebRequest.dll b/References/DNN/07.02.00/System.Net.Http.WebRequest.dll new file mode 100644 index 0000000..b26b59a Binary files /dev/null and b/References/DNN/07.02.00/System.Net.Http.WebRequest.dll differ diff --git a/References/DNN/07.02.00/System.Net.Http.dll b/References/DNN/07.02.00/System.Net.Http.dll new file mode 100644 index 0000000..2ee8ff7 Binary files /dev/null and b/References/DNN/07.02.00/System.Net.Http.dll differ diff --git a/References/DNN/07.02.00/System.Web.Helpers.dll b/References/DNN/07.02.00/System.Web.Helpers.dll new file mode 100644 index 0000000..a41bdcc Binary files /dev/null and b/References/DNN/07.02.00/System.Web.Helpers.dll differ diff --git a/References/DNN/07.02.00/System.Web.Http.WebHost.dll b/References/DNN/07.02.00/System.Web.Http.WebHost.dll new file mode 100644 index 0000000..1dfa8d2 Binary files /dev/null and b/References/DNN/07.02.00/System.Web.Http.WebHost.dll differ diff --git a/References/DNN/07.02.00/System.Web.Http.dll b/References/DNN/07.02.00/System.Web.Http.dll new file mode 100644 index 0000000..206c331 Binary files /dev/null and b/References/DNN/07.02.00/System.Web.Http.dll differ diff --git a/References/DNN/07.02.00/System.Web.Razor.dll b/References/DNN/07.02.00/System.Web.Razor.dll new file mode 100644 index 0000000..470f0c7 Binary files /dev/null and b/References/DNN/07.02.00/System.Web.Razor.dll differ diff --git a/References/DNN/07.02.00/System.Web.WebPages.Deployment.dll b/References/DNN/07.02.00/System.Web.WebPages.Deployment.dll new file mode 100644 index 0000000..89e7d27 Binary files /dev/null and b/References/DNN/07.02.00/System.Web.WebPages.Deployment.dll differ diff --git a/References/DNN/07.02.00/System.Web.WebPages.Razor.dll b/References/DNN/07.02.00/System.Web.WebPages.Razor.dll new file mode 100644 index 0000000..f9e71f8 Binary files /dev/null and b/References/DNN/07.02.00/System.Web.WebPages.Razor.dll differ diff --git a/References/DNN/07.02.00/System.Web.WebPages.dll b/References/DNN/07.02.00/System.Web.WebPages.dll new file mode 100644 index 0000000..60e9aba Binary files /dev/null and b/References/DNN/07.02.00/System.Web.WebPages.dll differ diff --git a/References/DNN/07.02.00/Telerik.Web.UI.Skins.dll b/References/DNN/07.02.00/Telerik.Web.UI.Skins.dll new file mode 100644 index 0000000..728faa3 Binary files /dev/null and b/References/DNN/07.02.00/Telerik.Web.UI.Skins.dll differ diff --git a/References/DNN/07.02.00/Telerik.Web.UI.dll b/References/DNN/07.02.00/Telerik.Web.UI.dll new file mode 100644 index 0000000..d865c13 Binary files /dev/null and b/References/DNN/07.02.00/Telerik.Web.UI.dll differ diff --git a/References/DNN/07.02.00/WebFormsMvp.dll b/References/DNN/07.02.00/WebFormsMvp.dll new file mode 100644 index 0000000..3123f84 Binary files /dev/null and b/References/DNN/07.02.00/WebFormsMvp.dll differ diff --git a/References/DNN/07.02.00/WebMatrix.Data.dll b/References/DNN/07.02.00/WebMatrix.Data.dll new file mode 100644 index 0000000..19287ce Binary files /dev/null and b/References/DNN/07.02.00/WebMatrix.Data.dll differ diff --git a/References/DNN/07.02.00/WebMatrix.WebData.dll b/References/DNN/07.02.00/WebMatrix.WebData.dll new file mode 100644 index 0000000..e058ba8 Binary files /dev/null and b/References/DNN/07.02.00/WebMatrix.WebData.dll differ diff --git a/References/DNN/09.01.01/ClientDependency.Core.dll b/References/DNN/09.01.01/ClientDependency.Core.dll new file mode 100644 index 0000000..ffc78da Binary files /dev/null and b/References/DNN/09.01.01/ClientDependency.Core.dll differ diff --git a/References/DNN/09.01.01/CountryListBox.dll b/References/DNN/09.01.01/CountryListBox.dll new file mode 100644 index 0000000..c947800 Binary files /dev/null and b/References/DNN/09.01.01/CountryListBox.dll differ diff --git a/References/DNN/09.01.01/DNNConnect.CKEditorProvider.dll b/References/DNN/09.01.01/DNNConnect.CKEditorProvider.dll new file mode 100644 index 0000000..6dea2f3 Binary files /dev/null and b/References/DNN/09.01.01/DNNConnect.CKEditorProvider.dll differ diff --git a/References/DNN/09.01.01/DotNetNuke.HttpModules.dll b/References/DNN/09.01.01/DotNetNuke.HttpModules.dll new file mode 100644 index 0000000..67b176c Binary files /dev/null and b/References/DNN/09.01.01/DotNetNuke.HttpModules.dll differ diff --git a/References/DNN/09.01.01/DotNetNuke.Instrumentation.dll b/References/DNN/09.01.01/DotNetNuke.Instrumentation.dll new file mode 100644 index 0000000..691e7c4 Binary files /dev/null and b/References/DNN/09.01.01/DotNetNuke.Instrumentation.dll differ diff --git a/References/DNN/09.01.01/DotNetNuke.Log4Net.dll b/References/DNN/09.01.01/DotNetNuke.Log4Net.dll new file mode 100644 index 0000000..ceee8c4 Binary files /dev/null and b/References/DNN/09.01.01/DotNetNuke.Log4Net.dll differ diff --git a/References/DNN/09.01.01/DotNetNuke.Providers.FiftyOneClientCapabilityProvider.dll b/References/DNN/09.01.01/DotNetNuke.Providers.FiftyOneClientCapabilityProvider.dll new file mode 100644 index 0000000..6cf9fb0 Binary files /dev/null and b/References/DNN/09.01.01/DotNetNuke.Providers.FiftyOneClientCapabilityProvider.dll differ diff --git a/References/DNN/09.01.01/DotNetNuke.Services.Syndication.dll b/References/DNN/09.01.01/DotNetNuke.Services.Syndication.dll new file mode 100644 index 0000000..1c12cf3 Binary files /dev/null and b/References/DNN/09.01.01/DotNetNuke.Services.Syndication.dll differ diff --git a/References/DNN/09.01.01/DotNetNuke.SiteExportImport.dll b/References/DNN/09.01.01/DotNetNuke.SiteExportImport.dll new file mode 100644 index 0000000..3571e34 Binary files /dev/null and b/References/DNN/09.01.01/DotNetNuke.SiteExportImport.dll differ diff --git a/References/DNN/09.01.01/DotNetNuke.Web.Client.dll b/References/DNN/09.01.01/DotNetNuke.Web.Client.dll new file mode 100644 index 0000000..b46cee1 Binary files /dev/null and b/References/DNN/09.01.01/DotNetNuke.Web.Client.dll differ diff --git a/References/DNN/09.01.01/DotNetNuke.Web.DDRMenu.dll b/References/DNN/09.01.01/DotNetNuke.Web.DDRMenu.dll new file mode 100644 index 0000000..dfd269e Binary files /dev/null and b/References/DNN/09.01.01/DotNetNuke.Web.DDRMenu.dll differ diff --git a/References/DNN/09.01.01/DotNetNuke.Web.Mvc.dll b/References/DNN/09.01.01/DotNetNuke.Web.Mvc.dll new file mode 100644 index 0000000..91f4adc Binary files /dev/null and b/References/DNN/09.01.01/DotNetNuke.Web.Mvc.dll differ diff --git a/References/DNN/09.01.01/DotNetNuke.Web.Razor.dll b/References/DNN/09.01.01/DotNetNuke.Web.Razor.dll new file mode 100644 index 0000000..0c12d48 Binary files /dev/null and b/References/DNN/09.01.01/DotNetNuke.Web.Razor.dll differ diff --git a/References/DNN/09.01.01/DotNetNuke.Web.dll b/References/DNN/09.01.01/DotNetNuke.Web.dll new file mode 100644 index 0000000..14d9208 Binary files /dev/null and b/References/DNN/09.01.01/DotNetNuke.Web.dll differ diff --git a/References/DNN/09.01.01/DotNetNuke.WebControls.dll b/References/DNN/09.01.01/DotNetNuke.WebControls.dll new file mode 100644 index 0000000..efd2a7f Binary files /dev/null and b/References/DNN/09.01.01/DotNetNuke.WebControls.dll differ diff --git a/References/DNN/09.01.01/DotNetNuke.WebUtility.dll b/References/DNN/09.01.01/DotNetNuke.WebUtility.dll new file mode 100644 index 0000000..4956224 Binary files /dev/null and b/References/DNN/09.01.01/DotNetNuke.WebUtility.dll differ diff --git a/References/DNN/09.01.01/DotNetNuke.Website.dll b/References/DNN/09.01.01/DotNetNuke.Website.dll new file mode 100644 index 0000000..ce01c92 Binary files /dev/null and b/References/DNN/09.01.01/DotNetNuke.Website.dll differ diff --git a/References/DNN/09.01.01/DotNetNuke.dll b/References/DNN/09.01.01/DotNetNuke.dll new file mode 100644 index 0000000..dbefcd6 Binary files /dev/null and b/References/DNN/09.01.01/DotNetNuke.dll differ diff --git a/References/DNN/09.01.01/FiftyOne.Foundation.dll b/References/DNN/09.01.01/FiftyOne.Foundation.dll new file mode 100644 index 0000000..2ed57df Binary files /dev/null and b/References/DNN/09.01.01/FiftyOne.Foundation.dll differ diff --git a/References/DNN/09.01.01/Lucene.Net.Contrib.Analyzers.dll b/References/DNN/09.01.01/Lucene.Net.Contrib.Analyzers.dll new file mode 100644 index 0000000..392894d Binary files /dev/null and b/References/DNN/09.01.01/Lucene.Net.Contrib.Analyzers.dll differ diff --git a/References/DNN/09.01.01/Lucene.Net.Contrib.FastVectorHighlighter.dll b/References/DNN/09.01.01/Lucene.Net.Contrib.FastVectorHighlighter.dll new file mode 100644 index 0000000..6b75bce Binary files /dev/null and b/References/DNN/09.01.01/Lucene.Net.Contrib.FastVectorHighlighter.dll differ diff --git a/References/DNN/09.01.01/Lucene.Net.dll b/References/DNN/09.01.01/Lucene.Net.dll new file mode 100644 index 0000000..cbf0220 Binary files /dev/null and b/References/DNN/09.01.01/Lucene.Net.dll differ diff --git a/References/DNN/09.01.01/Microsoft.ApplicationBlocks.Data.dll b/References/DNN/09.01.01/Microsoft.ApplicationBlocks.Data.dll new file mode 100644 index 0000000..8158be3 Binary files /dev/null and b/References/DNN/09.01.01/Microsoft.ApplicationBlocks.Data.dll differ diff --git a/References/DNN/09.01.01/Microsoft.Web.Helpers.dll b/References/DNN/09.01.01/Microsoft.Web.Helpers.dll new file mode 100644 index 0000000..da8f497 Binary files /dev/null and b/References/DNN/09.01.01/Microsoft.Web.Helpers.dll differ diff --git a/References/DNN/09.01.01/Microsoft.Web.Infrastructure.dll b/References/DNN/09.01.01/Microsoft.Web.Infrastructure.dll new file mode 100644 index 0000000..85f1138 Binary files /dev/null and b/References/DNN/09.01.01/Microsoft.Web.Infrastructure.dll differ diff --git a/References/DNN/09.01.01/Newtonsoft.Json.dll b/References/DNN/09.01.01/Newtonsoft.Json.dll new file mode 100644 index 0000000..d4c9037 Binary files /dev/null and b/References/DNN/09.01.01/Newtonsoft.Json.dll differ diff --git a/References/DNN/09.01.01/PetaPoco.dll b/References/DNN/09.01.01/PetaPoco.dll new file mode 100644 index 0000000..d04e182 Binary files /dev/null and b/References/DNN/09.01.01/PetaPoco.dll differ diff --git a/References/DNN/09.01.01/SchwabenCode.QuickIO.dll b/References/DNN/09.01.01/SchwabenCode.QuickIO.dll new file mode 100644 index 0000000..2428031 Binary files /dev/null and b/References/DNN/09.01.01/SchwabenCode.QuickIO.dll differ diff --git a/References/DNN/09.01.01/SharpZipLib.dll b/References/DNN/09.01.01/SharpZipLib.dll new file mode 100644 index 0000000..b7e439f Binary files /dev/null and b/References/DNN/09.01.01/SharpZipLib.dll differ diff --git a/References/DNN/09.01.01/System.Net.Http.Formatting.dll b/References/DNN/09.01.01/System.Net.Http.Formatting.dll new file mode 100644 index 0000000..3b76acd Binary files /dev/null and b/References/DNN/09.01.01/System.Net.Http.Formatting.dll differ diff --git a/References/DNN/09.01.01/System.Web.Helpers.dll b/References/DNN/09.01.01/System.Web.Helpers.dll new file mode 100644 index 0000000..7e6cd4e Binary files /dev/null and b/References/DNN/09.01.01/System.Web.Helpers.dll differ diff --git a/References/DNN/09.01.01/System.Web.Http.WebHost.dll b/References/DNN/09.01.01/System.Web.Http.WebHost.dll new file mode 100644 index 0000000..4f2b581 Binary files /dev/null and b/References/DNN/09.01.01/System.Web.Http.WebHost.dll differ diff --git a/References/DNN/09.01.01/System.Web.Http.dll b/References/DNN/09.01.01/System.Web.Http.dll new file mode 100644 index 0000000..e1dbdd1 Binary files /dev/null and b/References/DNN/09.01.01/System.Web.Http.dll differ diff --git a/References/DNN/09.01.01/System.Web.Mvc.dll b/References/DNN/09.01.01/System.Web.Mvc.dll new file mode 100644 index 0000000..f52249a Binary files /dev/null and b/References/DNN/09.01.01/System.Web.Mvc.dll differ diff --git a/References/DNN/09.01.01/System.Web.Razor.dll b/References/DNN/09.01.01/System.Web.Razor.dll new file mode 100644 index 0000000..45b7e9f Binary files /dev/null and b/References/DNN/09.01.01/System.Web.Razor.dll differ diff --git a/References/DNN/09.01.01/System.Web.WebPages.Deployment.dll b/References/DNN/09.01.01/System.Web.WebPages.Deployment.dll new file mode 100644 index 0000000..fe224fb Binary files /dev/null and b/References/DNN/09.01.01/System.Web.WebPages.Deployment.dll differ diff --git a/References/DNN/09.01.01/System.Web.WebPages.Razor.dll b/References/DNN/09.01.01/System.Web.WebPages.Razor.dll new file mode 100644 index 0000000..9fcc8e6 Binary files /dev/null and b/References/DNN/09.01.01/System.Web.WebPages.Razor.dll differ diff --git a/References/DNN/09.01.01/System.Web.WebPages.dll b/References/DNN/09.01.01/System.Web.WebPages.dll new file mode 100644 index 0000000..f946454 Binary files /dev/null and b/References/DNN/09.01.01/System.Web.WebPages.dll differ diff --git a/References/DNN/09.01.01/WebFormsMvp.dll b/References/DNN/09.01.01/WebFormsMvp.dll new file mode 100644 index 0000000..3123f84 Binary files /dev/null and b/References/DNN/09.01.01/WebFormsMvp.dll differ diff --git a/References/DNN/09.01.01/WebMatrix.Data.dll b/References/DNN/09.01.01/WebMatrix.Data.dll new file mode 100644 index 0000000..081d54a Binary files /dev/null and b/References/DNN/09.01.01/WebMatrix.Data.dll differ diff --git a/References/DNN/09.01.01/WebMatrix.WebData.dll b/References/DNN/09.01.01/WebMatrix.WebData.dll new file mode 100644 index 0000000..5215b2c Binary files /dev/null and b/References/DNN/09.01.01/WebMatrix.WebData.dll differ diff --git a/References/oEmbed/WillStrohl.API.oEmbed.dll b/References/oEmbed/WillStrohl.API.oEmbed.dll new file mode 100644 index 0000000..d28f0b2 Binary files /dev/null and b/References/oEmbed/WillStrohl.API.oEmbed.dll differ diff --git a/References/oEmbed/WillStrohl.API.oEmbed.xml b/References/oEmbed/WillStrohl.API.oEmbed.xml new file mode 100644 index 0000000..f5b81e9 --- /dev/null +++ b/References/oEmbed/WillStrohl.API.oEmbed.xml @@ -0,0 +1,1120 @@ + + + + +WillStrohl.API.oEmbed + + + + + + DEFAULT_VIDEO_WIDTH - This value is used for videos if a width is not specified + + + + + + DEFAULT_VIDEO_HEIGHT - This value is used for videos if a height is not specified + + + + + + URL EndPoint format for the YouTube oEmbed implementation + + + + + + URL EndPoint format for the Viddler oEmbed implementation + + + + + + URL EndPoint format for the Qik oEmbed implementation + + + + + + URL EndPoint format for the Revision3 oEmbed implementation + + + + + + URL EndPoint format for the Hulu oEmbed implementation + + + + + + URL EndPoint format for the Vimeo oEmbed implementation + + + + + + URL EndPoint format for the Flickr oEmbed implementation + + + + + + URL EndPoint format for the Poll Everywhere oEmbed implementation + + + + + + URL EndPoint format for the oohEmbed oEmbed implementation + + + + + + URL EndPoint format for the MyOpera oEmbed implementation + + + + + + URL EndPoint format for the Clearspring Widgets oEmbed implementation + + + + + + URL EndPoint format for the Embed.ly oEmbed implementation + + + + + + ApplicationError - this class is used to help report errors that occur during oEmbed provider requests + + + + + + GetAppliationErrorObject - this object is used to report errors from oEmbed requests + + String - the error message to relay to the calling function + String - the error object, in the form of a nearly empty oEmbed object + + Look in the "title" parameter of the oEmbed object to see the error. + + + + + This is the request object used to generate generic requests to oEmbed providers that are not included in this API. + + + + + + The required response format. When not specified, the provider can return any valid response format. When specified, the provider must return data in the request format, else return an error. + + + + + ReadOnly. This API only supports JSON requests and responses at this time. + + If there was an error, instead of the specified formatted content, oEmbed providers may return the following errors: 404 Not Found, 501 Not Implemented, 401 Not Authorized + + + + + The maximum height of the embedded resource. For supported resource types, this parameter must be respected by providers. + + + + + Required to be sent for video and photo oEmbed types. + + + + + The maximum width of the embedded resource. For supported resource types, this parameter must be respected by providers. + + + + + Required to be sent for video and photo oEmbed types. + + + + + The URL to retrieve embedding information for. + + + + + + + + This type is used for rich HTML content that does not fall under one of the other categories. + + + + + + The height in pixels required to display the HTML. + + + + + Required to be returned by the oEmbed provider. + + + + + The HTML required to display the resource. The HTML should have no padding or margins. Consumers may wish to load the HTML in an off-domain iframe to avoid XSS vulnerabilities. The markup should be valid XHTML 1.0 Basic. + + + + + Required to be returned by the oEmbed provider. + + + + + The width in pixels required to display the HTML. + + + + + Required to be returned by the oEmbed provider. + + + + + This type is used for representing playable videos. + + + + + + The height in pixels required to display the HTML. + + + + + Required to be returned by the oEmbed provider. + + + + + The HTML required to embed a video player. The HTML should have no padding or margins. Consumers may wish to load the HTML in an off-domain iframe to avoid XSS vulnerabilities. + + + + + Required to be returned by the oEmbed provider. + + + + + The width in pixels required to display the HTML. + + + + + Required to be returned by the oEmbed provider. + + + + + oEmbedInfo - this is the base oEmbed response object that contains all of the universal oEmbed properties + + + + + + The name of the author/owner of the resource. + + + + + Optionally returned by the oEmbed provider + + + + + A URL for the author/owner of the resource. + + + + + Optionally returned by the oEmbed provider + + + + + The suggested cache lifetime for this resource, in seconds. Consumers may choose to use this value or not. + + + + + Optionally returned by the oEmbed provider + + + + + The name of the resource provider. + + + + + Optionally returned by the oEmbed provider + + + + + A URL for the author/owner of the resource. + + + + + Optionally returned by the oEmbed provider + + + + + The height of the optional thumbnail. If this paramater is present, thumbnail_url and thumbnail_width must also be present. + + + + + Optionally returned by the oEmbed provider + + + + + A URL to a thumbnail image representing the resource. The thumbnail must respect any maxwidth and maxheight parameters. If this paramater is present, thumbnail_width and thumbnail_height must also be present. + + + + + Optionally returned by the oEmbed provider + + + + + The width of the optional thumbnail. If this paramater is present, thumbnail_url and thumbnail_height must also be present. + + + + + Optionally returned by the oEmbed provider + + + + + A text title, describing the resource. + + + + + Optionally returned by the oEmbed provider + + + + + The resource type. + + + + + Valid values are photo, video, link, and rich + + + + + The oEmbed version number. This must be 1.0. + + + + + + + + PhotoInfo - This is the oEmbed type used for representing static photos. + + + + + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + + + Required to be returned by the oEmbed provider + + + + + The width in pixels of the image specified in the url parameter. + + + + + Required to be returned by the oEmbed provider + + + + + The height in pixels of the image specified in the url parameter. + + + + + Required to be returned by the oEmbed provider + + + + + RequestController - this class handles all of the remote GET requests centrally for all oEmbed types. + + + This class is not inheritable. + + + + + GetOEmbedContent - this method makes a GET request to the oEmbed provider, and returns their response. + + String - this is the oEmbed formatted URL to call + + + If an error occurs, the error message will be returned in the "title" parameter of the oEmbed object. + + + + + GetOEmbedContent - this method makes a GET request to the oEmbed provider, and returns their response. + + String - this is the oEmbed formatted URL to call + String - this is the URL for the internet proxy to use for the oEmbed request + Integer - this is the http port for the internet proxy to use for the oEmbed request + + + If an error occurs, the error message will be returned in the "title" parameter of the oEmbed object. + + + + + ProviderBase - this is the base class for all oEmbed providers + + + + + + Proxy - the web address for an Internet proxy to use for oEmbed requests + + + + + + + + Port - the http port number for an Internet proxy to use for oEmbed requests + + + + + + + + HasProxy - this property specifies if the proxy information has been properly assigned + + + + + + + + Instantiates the object (without using an internet proxy) + + + + + + Instantiates the object (using an internet proxy) + + String - the URL of a proxy server to use for oEmbed requests + Integer - the http port to use for the proxy server + + + + + UseSSL - this method returns a boolean status telling if the URL is an SSL one or not + + + + + + + + This is the implementation wrapper for the Flickr oEmbed provider + + + + + + Instantiates the object (without using an internet proxy) + + + + + + Instantiates the object (using an internet proxy) + + String - the URL of a proxy server to use for oEmbed requests + Integer - the http port to use for the proxy server + + + + + GetPhotoObject - this method will return the photo URL to embed into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + The width in pixels of the image specified in the url parameter. + The height in pixels of the image specified in the url parameter. + + + + + + GetPhotoObject - this method will return the photo oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + The width in pixels of the image specified in the url parameter. + The height in pixels of the image specified in the url parameter. + + + + + + This is the implementation wrapper for the Clearspring Widget oEmbed provider + + + + + + Instantiates the object (without using an internet proxy) + + + + + + Instantiates the object (using an internet proxy) + + String - the URL of a proxy server to use for oEmbed requests + Integer - the http port to use for the proxy server + + + + + GetRichContentObject - this method will return the rich content to be embedded into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + + + + GetRichContentObject - this method will return the rich content oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + + + + This is the implementation wrapper for the Embed.Ly oEmbed provider + + + + + + Instantiates the object (without using an internet proxy) + + + + + + Instantiates the object (using an internet proxy) + + String - the URL of a proxy server to use for oEmbed requests + Integer - the http port to use for the proxy server + + + + + GetRichContentObject - this method will return the rich content to be embedded into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + + + + GetRichContentObject - this method will return the rich content oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + + + + This is the implementation wrapper for the MyOpera oEmbed provider + + + + + + Instantiates the object (without using an internet proxy) + + + + + + Instantiates the object (using an internet proxy) + + String - the URL of a proxy server to use for oEmbed requests + Integer - the http port to use for the proxy server + + + + + GetRichContentObject - this method will return the rich content to be embedded into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + + + + GetRichContentObject - this method will return the rich content oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + + + + This is the implementation wrapper for the oohEmbed oEmbed provider + + + + + + Instantiates the object (without using an internet proxy) + + + + + + Instantiates the object (using an internet proxy) + + String - the URL of a proxy server to use for oEmbed requests + Integer - the http port to use for the proxy server + + + + + GetRichContentObject - this method will return the rich content to be embedded into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + + + + GetRichContentObject - this method will return the rich content oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + + + + This is the implementation wrapper for the Poll Everywhere oEmbed provider + + + + + + Instantiates the object (without using an internet proxy) + + + + + + Instantiates the object (using an internet proxy) + + String - the URL of a proxy server to use for oEmbed requests + Integer - the http port to use for the proxy server + + + + + GetRichContentObject - this method will return the rich content to be embedded into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + + + + GetRichContentObject - this method will return the rich content oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + + + + This is the implementation wrapper for the Vimeo oEmbed provider + + + + + + Instantiates the object (without using an internet proxy) + + + + + + Instantiates the object (using an internet proxy) + + String - the URL of a proxy server to use for oEmbed requests + Integer - the http port to use for the proxy server + + + + + GetVideo - this method will return the video oEmbed markup to be embedded into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + + + + GetVideo - this method will return the video oEmbed markup to be embedded into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + The width in pixels of the image specified in the url parameter. + The height in pixels of the image specified in the url parameter. + + + + + + GetVideoObject - this method will return the video oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + This method passes the DEFAULT_VIDEO_WIDTH and DEFAULT_VIDEO_HEIGHT parameters to the root method. + + + + + GetVideoObject - this method will return the video oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + The width in pixels of the image specified in the url parameter. + The height in pixels of the image specified in the url parameter. + + + + + + This is the implementation wrapper for the Hulu oEmbed provider + + + + + + Instantiates the object (without using an internet proxy) + + + + + + Instantiates the object (using an internet proxy) + + String - the URL of a proxy server to use for oEmbed requests + Integer - the http port to use for the proxy server + + + + + GetVideo - this method will return the video oEmbed markup to be embedded into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + + + + GetVideo - this method will return the video oEmbed markup to be embedded into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + The width in pixels of the image specified in the url parameter. + The height in pixels of the image specified in the url parameter. + + + + + + GetVideoObject - this method will return the video oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + This method passes the DEFAULT_VIDEO_WIDTH and DEFAULT_VIDEO_HEIGHT parameters to the root method. + + + + + GetVideoObject - this method will return the video oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + The width in pixels of the image specified in the url parameter. + The height in pixels of the image specified in the url parameter. + + + + + + This is the implementation wrapper for the Revision3 oEmbed provider + + + + + + Instantiates the object (without using an internet proxy) + + + + + + Instantiates the object (using an internet proxy) + + String - the URL of a proxy server to use for oEmbed requests + Integer - the http port to use for the proxy server + + + + + GetVideo - this method will return the video oEmbed markup to be embedded into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + + + + GetVideo - this method will return the video oEmbed markup to be embedded into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + The width in pixels of the image specified in the url parameter. + The height in pixels of the image specified in the url parameter. + + + + + + GetVideoObject - this method will return the video oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + This method passes the DEFAULT_VIDEO_WIDTH and DEFAULT_VIDEO_HEIGHT parameters to the root method. + + + + + GetVideoObject - this method will return the video oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + The width in pixels of the image specified in the url parameter. + The height in pixels of the image specified in the url parameter. + + + + + + This is the implementation wrapper for the Qik oEmbed provider + + + + + + Instantiates the object (without using an internet proxy) + + + + + + Instantiates the object (using an internet proxy) + + String - the URL of a proxy server to use for oEmbed requests + Integer - the http port to use for the proxy server + + + + + GetVideo - this method will return the video oEmbed markup to be embedded into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + + + + GetVideo - this method will return the video oEmbed markup to be embedded into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + The width in pixels of the image specified in the url parameter. + The height in pixels of the image specified in the url parameter. + + + + + + GetVideoObject - this method will return the video oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + This method passes the DEFAULT_VIDEO_WIDTH and DEFAULT_VIDEO_HEIGHT parameters to the root method. + + + + + GetVideoObject - this method will return the video oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + The width in pixels of the image specified in the url parameter. + The height in pixels of the image specified in the url parameter. + + + + + + This is the implementation wrapper for the Viddler oEmbed provider + + + + + + Instantiates the object (without using an internet proxy) + + + + + + Instantiates the object (using an internet proxy) + + String - the URL of a proxy server to use for oEmbed requests + Integer - the http port to use for the proxy server + + + + + GetVideo - this method will return the video oEmbed markup to be embedded into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + + + + GetVideo - this method will return the video oEmbed markup to be embedded into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + The width in pixels of the image specified in the url parameter. + The height in pixels of the image specified in the url parameter. + + + + + + GetVideoObject - this method will return the video oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + This method passes the DEFAULT_VIDEO_WIDTH and DEFAULT_VIDEO_HEIGHT parameters to the root method. + + + + + GetVideoObject - this method will return the video oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + The width in pixels of the image specified in the url parameter. + The height in pixels of the image specified in the url parameter. + + + + + + This is the implementation wrapper for the YouTube oEmbed provider + + + + + + Instantiates the object (without using an internet proxy) + + + + + + Instantiates the object (using an internet proxy) + + String - the URL of a proxy server to use for oEmbed requests + Integer - the http port to use for the proxy server + + + + + GetVideo - this method will return the video oEmbed markup to be embedded into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + + + + GetVideo - this method will return the video oEmbed markup to be embedded into your content + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + The width in pixels of the image specified in the url parameter. + The height in pixels of the image specified in the url parameter. + + + + + + GetVideoObject - this method will return the video oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + + + This method passes the DEFAULT_VIDEO_WIDTH and DEFAULT_VIDEO_HEIGHT parameters to the root method. + + + + + GetVideoObject - this method will return the video oEmbed object that is returned from the provider + + The source URL of the image. Consumers should be able to insert this URL into an <img> element. Only HTTP and HTTPS URLs are valid. + The width in pixels of the image specified in the url parameter. + The height in pixels of the image specified in the url parameter. + + + + + + Wrapper - this is the main class to use for any provider that is not provided in this API. + + + + + + GetPhotoContent - this method makes a call to a photo oEmbed provider, and returns the image URL that you request + + String - the endpoint as specified by the oEmbed provider + RequestInfo - the request object required to pass information into the EndPoint URL + String - the image URL to embed into your content + + + + + GetPhotoContent - this method makes a call to a photo oEmbed provider, and returns the image URL that you request + + String - the endpoint as specified by the oEmbed provider + RequestInfo - the request object required to pass information into the EndPoint URL + String() - optional arguments that can be appended to the end of the oEmbed GET request URL + String - the image URL to embed into your content + + + + + GetVideoContent - this method makes a call to a video oEmbed provider, and returns the video markup that you request + + String - the endpoint as specified by the oEmbed provider + RequestInfo - the request object required to pass information into the EndPoint URL + String - the video markup to embed into your content + + + + + GetVideoContent - this method makes a call to a video oEmbed provider, and returns the video markup that you request + + String - the endpoint as specified by the oEmbed provider + RequestInfo - the request object required to pass information into the EndPoint URL + String() - optional arguments that can be appended to the end of the oEmbed GET request URL + String - the video markup to embed into your content + + + + + GetRichContent - this method makes a call to a rich content oEmbed provider, and returns the rich content markup that you request + + String - the endpoint as specified by the oEmbed provider + RequestInfo - the request object required to pass information into the EndPoint URL + String - the rich content markup to embed into your content + + + + + GetRichContent - this method makes a call to a rich content oEmbed provider, and returns the rich content markup that you request + + String - the endpoint as specified by the oEmbed provider + RequestInfo - the request object required to pass information into the EndPoint URL + String() - optional arguments that can be appended to the end of the oEmbed GET request URL + String - the rich content markup to embed into your content + + + + + GetParsedURL - this method parses the URL and makes the necessary updates to the URL to make it oEmbed compatible. + + String - the endpoint as specified by the oEmbed provider + RequestInfo - the request object required to pass information into the EndPoint URL + String() - optional arguments that can be appended to the end of the oEmbed GET request URL + + + If you use the Args() argument, you need to specify it in the following format: + Args = {"&arg1=value1&arg2=value2&arg3=value3"} + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + +