Added feature #10853: New Multimedia CE
authorSteffen Kamper <info@sk-typo3.de>
Mon, 31 Aug 2009 08:03:44 +0000 (08:03 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Mon, 31 Aug 2009 08:03:44 +0000 (08:03 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5851 709f56b5-9817-0410-a4d7-c38de5d9e867

20 files changed:
ChangeLog
t3lib/class.t3lib_div.php
t3lib/class.t3lib_tsparser_ext.php
typo3/contrib/flashmedia/flvplayer.swf [new file with mode: 0644]
typo3/contrib/flashmedia/player.swf [new file with mode: 0644]
typo3/contrib/flashmedia/player.txt [new file with mode: 0644]
typo3/contrib/flashmedia/qtobject/qtobject.js [new file with mode: 0644]
typo3/contrib/flashmedia/swfobject/expressInstall.swf [new file with mode: 0644]
typo3/contrib/flashmedia/swfobject/swfobject.js [new file with mode: 0644]
typo3/sysext/cms/ext_localconf.php
typo3/sysext/cms/ext_tables.php
typo3/sysext/cms/flexform_media.xml [new file with mode: 0644]
typo3/sysext/cms/layout/locallang_db_new_content_el.xml
typo3/sysext/cms/locallang_ttc.xml
typo3/sysext/cms/tbl_tt_content.php
typo3/sysext/cms/tslib/class.tslib_content.php
typo3/sysext/cms/tslib/hooks/class.tx_cms_mediaitems.php [new file with mode: 0644]
typo3/sysext/css_styled_content/pageTSconfig.txt
typo3/sysext/css_styled_content/static/constants.txt
typo3/sysext/css_styled_content/static/setup.txt

index db3184b..f911660 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
 
 2009-08-31  Steffen Kamper  <info@sk-typo3.de>
 
+       * Added feature #10853: New Multimedia CE
        * Added feature #11374: Add Linebreak in Palette of TCEFORMS
 
 2009-08-30  Oliver Hader  <oliver@typo3.org>
index 5b3d8f1..2f5864b 100644 (file)
@@ -1953,6 +1953,23 @@ final class t3lib_div {
        }
 
        /**
+       * Rename Array keys with a given mapping table
+       * @param        array   Array by reference which should be remapped
+       * @param        array   Array with remap information, array/$oldKey => $newKey)
+       */
+       function remapArrayKeys(&$array, $mappingTable) {
+               if (is_array($mappingTable)) {
+                       foreach ($mappingTable as $old => $new) {
+                               if ($new && isset($array[$old])) {
+                                       $array[$new] = $array[$old];
+                                       unset ($array[$old]);
+                               }
+                       }
+               }
+       }
+       
+       
+       /**
         * Merges two arrays recursively and "binary safe" (integer keys are
         * overridden as well), overruling similar values in the first array
         * ($arr0) with the values of the second array ($arr1)
index f524395..aeb0f7b 100644 (file)
@@ -134,6 +134,7 @@ class t3lib_tsparser_ext extends t3lib_TStemplate   {
                'ctable' => Array('Content: \'Table\'', 'mf'),
                'cuploads' => Array('Content: \'Filelinks\'', 'mg'),
                'cmultimedia' => Array('Content: \'Multimedia\'', 'mh'),
+               'cmedia' => Array('Content: \'Media\'', 'mr'),
                'cmailform' => Array('Content: \'Form\'', 'mi'),
                'csearch' => Array('Content: \'Search\'', 'mj'),
                'clogin' => Array('Content: \'Login\'', 'mk'),
diff --git a/typo3/contrib/flashmedia/flvplayer.swf b/typo3/contrib/flashmedia/flvplayer.swf
new file mode 100644 (file)
index 0000000..68d0d63
Binary files /dev/null and b/typo3/contrib/flashmedia/flvplayer.swf differ
diff --git a/typo3/contrib/flashmedia/player.swf b/typo3/contrib/flashmedia/player.swf
new file mode 100644 (file)
index 0000000..135f73b
Binary files /dev/null and b/typo3/contrib/flashmedia/player.swf differ
diff --git a/typo3/contrib/flashmedia/player.txt b/typo3/contrib/flashmedia/player.txt
new file mode 100644 (file)
index 0000000..b8852a9
--- /dev/null
@@ -0,0 +1,25 @@
+File: player.swf\r
+Plugin Name: Audio player\r
+Plugin URI: http://www.1pixelout.net/code/audio-player-wordpress-plugin/\r
+Description: Highly configurable single track mp3 player\r
+Version: 1.2\r
+Author: Martin Laine\r
+Author URI: http://www.1pixelout.net\r
+\r
+License:\r
+\r
+    Copyright 2005-2006  Martin Laine  (email : martin@1pixelout.net)\r
+\r
+    This program is free software; you can redistribute it and/or modify\r
+    it under the terms of the GNU General Public License as published by\r
+    the Free Software Foundation; either version 2 of the License, or\r
+    any later version.\r
+\r
+    This program is distributed in the hope that it will be useful,\r
+    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+    GNU General Public License for more details.\r
+\r
+    You should have received a copy of the GNU General Public License\r
+    along with this program; if not, write to the Free Software\r
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
diff --git a/typo3/contrib/flashmedia/qtobject/qtobject.js b/typo3/contrib/flashmedia/qtobject/qtobject.js
new file mode 100644 (file)
index 0000000..44bc39f
--- /dev/null
@@ -0,0 +1,138 @@
+/*\r
+ * QTObject embed\r
+ * http://blog.deconcept.com/2005/01/26/web-standards-compliant-javascript-quicktime-detect-and-embed/\r
+ *\r
+ * by Geoff Stearns (geoff@deconcept.com, http://www.deconcept.com/)\r
+ *\r
+ * v1.0.2 - 02-16-2005\r
+ *\r
+ * Embeds a quicktime movie to the page, includes plugin detection\r
+ *\r
+ * Usage:\r
+ *\r
+ *     myQTObject = new QTObject("path/to/mov.mov", "movid", "width", "height");\r
+ *     myQTObject.altTxt = "Upgrade your Quicktime Player!";    // optional
\r
+ *  myQTObject.addParam("controller", "false");              // optional\r
+ *     myQTObject.write();\r
+ *\r
+ */\r
+\r
+QTObject = function(mov, id, w, h) {\r
+       this.mov = mov;\r
+       this.id = id;\r
+       this.width = w;\r
+       this.height = h;\r
+       this.redirect = "";\r
+       this.sq = document.location.search.split("?")[1] || "";\r
+       this.altTxt = "This content requires the QuickTime Plugin. <a href='http://www.apple.com/quicktime/download/'>Download QuickTime Player</a>.";\r
+       this.bypassTxt = "<p>Already have QuickTime Player? <a href='?detectqt=false&"+ this.sq +"'>Click here.</a></p>";\r
+       this.params = new Object();\r
+       this.doDetect = getQueryParamValue('detectqt');\r
+}\r
+\r
+QTObject.prototype.addParam = function(name, value) {\r
+       this.params[name] = value;\r
+}\r
+\r
+QTObject.prototype.getParams = function() {\r
+    return this.params;\r
+}\r
+\r
+QTObject.prototype.getParam = function(name) {\r
+    return this.params[name];\r
+}\r
+\r
+QTObject.prototype.getParamTags = function() {\r
+    var paramTags = "";\r
+    for (var param in this.getParams()) {\r
+        paramTags += '<param name="' + param + '" value="' + this.getParam(param) + '" />';\r
+    }\r
+    if (paramTags == "") {\r
+        paramTags = null;\r
+    }\r
+    return paramTags;\r
+}\r
+\r
+QTObject.prototype.getHTML = function() {\r
+    var qtHTML = "";\r
+       if (navigator.plugins && navigator.plugins.length) { // not ie\r
+        qtHTML += '<embed type="video/quicktime" src="' + this.mov + '" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '"';\r
+        for (var param in this.getParams()) {\r
+            qtHTML += ' ' + param + '="' + this.getParam(param) + '"';\r
+        }\r
+        qtHTML += '></embed>';\r
+    }\r
+    else { // pc ie\r
+        qtHTML += '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '">';\r
+        this.addParam("src", this.mov);\r
+        if (this.getParamTags() != null) {\r
+            qtHTML += this.getParamTags();\r
+        }\r
+        qtHTML += '</object>';\r
+    }\r
+    return qtHTML;\r
+}\r
+\r
+\r
+QTObject.prototype.getVariablePairs = function() {\r
+    var variablePairs = new Array();\r
+    for (var name in this.getVariables()) {\r
+        variablePairs.push(name + "=" + escape(this.getVariable(name)));\r
+    }\r
+    if (variablePairs.length > 0) {\r
+        return variablePairs.join("&");\r
+    }\r
+    else {\r
+        return null;\r
+    }\r
+}\r
+\r
+QTObject.prototype.write = function(elementId) {\r
+       if(isQTInstalled() || this.doDetect=='false') {\r
+               if (elementId) {\r
+                       document.getElementById(elementId).innerHTML = this.getHTML();\r
+               } else {\r
+                       document.write(this.getHTML());\r
+               }\r
+       } else {\r
+               if (this.redirect != "") {\r
+                       document.location.replace(this.redirect);\r
+               } else {\r
+                       if (elementId) {\r
+                               document.getElementById(elementId).innerHTML = this.altTxt +""+ this.bypassTxt;\r
+                       } else {\r
+                               document.write(this.altTxt +""+ this.bypassTxt);\r
+                       }\r
+               }\r
+       }               \r
+}\r
+\r
+function isQTInstalled() {\r
+       var qtInstalled = false;\r
+       qtObj = false;\r
+       if (navigator.plugins && navigator.plugins.length) {\r
+               for (var i=0; i < navigator.plugins.length; i++ ) {\r
+         var plugin = navigator.plugins[i];\r
+         if (plugin.name.indexOf("QuickTime") > -1) {\r
+                       qtInstalled = true;\r
+         }\r
+      }\r
+       } else {\r
+               execScript('on error resume next: qtObj = IsObject(CreateObject("QuickTimeCheckObject.QuickTimeCheck.1"))','VBScript');\r
+               qtInstalled = qtObj;\r
+       }\r
+       return qtInstalled;\r
+}\r
+\r
+/* get value of querystring param */\r
+function getQueryParamValue(param) {\r
+       var q = document.location.search;\r
+       var detectIndex = q.indexOf(param);\r
+       var endIndex = (q.indexOf("&", detectIndex) != -1) ? q.indexOf("&", detectIndex) : q.length;\r
+       if(q.length > 1 && detectIndex != -1) {\r
+               return q.substring(q.indexOf("=", detectIndex)+1, endIndex);\r
+       } else {\r
+               return "";\r
+       }\r
+}\r
diff --git a/typo3/contrib/flashmedia/swfobject/expressInstall.swf b/typo3/contrib/flashmedia/swfobject/expressInstall.swf
new file mode 100644 (file)
index 0000000..86958bf
Binary files /dev/null and b/typo3/contrib/flashmedia/swfobject/expressInstall.swf differ
diff --git a/typo3/contrib/flashmedia/swfobject/swfobject.js b/typo3/contrib/flashmedia/swfobject/swfobject.js
new file mode 100644 (file)
index 0000000..08fb270
--- /dev/null
@@ -0,0 +1,5 @@
+/* SWFObject v2.1 <http://code.google.com/p/swfobject/>
+       Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
+       This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
+*/
+var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return }var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();
\ No newline at end of file
index c99d638..0b9d02c 100755 (executable)
@@ -75,6 +75,14 @@ mod.wizards.newContentElement.wizardItems {
                                CType = multimedia
                        }
                }
+               media {
+                       icon = gfx/c_wiz/multimedia.gif
+                       title = LLL:EXT:cms/layout/locallang_db_new_content_el.xml:special_media_title
+                       description = LLL:EXT:cms/layout/locallang_db_new_content_el.xml:special_media_description
+                       tt_content_defValues {
+                               CType = media
+                       }
+               }
                menu {
                        icon = gfx/c_wiz/sitemap2.gif
                        title = LLL:EXT:cms/layout/locallang_db_new_content_el.xml:special_sitemap_title
@@ -102,7 +110,7 @@ mod.wizards.newContentElement.wizardItems {
                }
 
        }
-       special.show = uploads,multimedia,menu,html,div
+       special.show = uploads,media,menu,html,div
 
        forms.header = LLL:EXT:cms/layout/locallang_db_new_content_el.xml:forms
        forms.elements {
index 72ba7a0..f7f3dd1 100755 (executable)
@@ -2,6 +2,8 @@
 # TYPO3 SVN ID: $Id$
 if (!defined ('TYPO3_MODE'))   die ('Access denied.');
 
+include_once(t3lib_extMgm::extPath($_EXTKEY) . 'tslib/hooks/class.tx_cms_mediaitems.php');
+
 if (TYPO3_MODE == 'BE') {
        t3lib_extMgm::addModule('web','layout','top',t3lib_extMgm::extPath($_EXTKEY).'layout/');
        t3lib_extMgm::addLLrefForTCAdescr('_MOD_web_layout','EXT:cms/locallang_csh_weblayout.xml');
diff --git a/typo3/sysext/cms/flexform_media.xml b/typo3/sysext/cms/flexform_media.xml
new file mode 100644 (file)
index 0000000..b5ef5e8
--- /dev/null
@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<T3DataStructure>\r
+       <meta>\r
+               <langDisable>1</langDisable>\r
+       </meta>\r
+       <sheets>\r
+               <sDEF>\r
+                       <ROOT>\r
+                               <TCEforms>\r
+                                       <sheetTitle>LLL:EXT:cms/locallang_ttc.xml:media.options</sheetTitle>\r
+                               </TCEforms>\r
+                               <type>array</type>\r
+                               <el>\r
+                                       <mmFile>\r
+                                               <TCEforms>\r
+                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.url</label>\r
+                                                       <config>\r
+                                                               <type>input</type>\r
+                                                               <size>60</size>\r
+                                                               <eval>trim</eval>\r
+                                                               <default></default>\r
+                                                               <wizards type="array">\r
+                                                                       <_PADDING>2</_PADDING>\r
+                                                                       <link type="array">\r
+                                                                               <type>popup</type>\r
+                                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.browseUrlTitle</title>\r
+                                                                               <icon>link_popup.gif</icon>\r
+                                                                               <script>browse_links.php?mode=wizard&amp;act=file|url</script>\r
+                                                                               <params type="array">\r
+                                                                                       <blindLinkOptions>page,folder,mail,spec</blindLinkOptions>\r
+                                                                                       <allowedExtensions>class,swf,swa,dcr,wav,avi,au,mov,asf,mpg,wmv,mp3,mp4,m4v,flv</allowedExtensions>\r
+                                                                               </params>\r
+                                                                               <JSopenParams>height=300,width=500,status=0,menubar=0,scrollbars=1</JSopenParams>\r
+                                                                       </link>\r
+                                                               </wizards>\r
+                                                       </config>\r
+                                               </TCEforms>\r
+                                       </mmFile>\r
+                                       <mmforcePlayer>\r
+                                               <TCEforms>\r
+                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.forcePlayer</label>\r
+                                                       <config>\r
+                                                               <type>check</type>\r
+                                                       </config>\r
+                                               </TCEforms>\r
+                                       </mmforcePlayer>\r
+                                       <mmType>\r
+                                               <TCEforms>\r
+                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.type</label>\r
+                                                       <config>\r
+                                                               <type>select</type>\r
+                                                               <items>\r
+                                                                       <numIndex index="0">\r
+                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.type.video</numIndex>\r
+                                                                               <numIndex index="1">video</numIndex>\r
+                                                                       </numIndex>\r
+                                                                       <numIndex index="1">\r
+                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.type.audio</numIndex>\r
+                                                                               <numIndex index="1">audio</numIndex>\r
+                                                                       </numIndex>\r
+                                                               </items>\r
+                                                       </config>\r
+                                               </TCEforms>\r
+                                       </mmType>\r
+                                       <mmWidth>\r
+                                               <TCEforms>\r
+                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.width</label>\r
+                                                       <config>\r
+                                                               <type>input</type>\r
+                                                               <size>8</size>\r
+                                                               <max>5</max>\r
+                                                               <eval>trim</eval>\r
+                                                       </config>\r
+                                               </TCEforms>\r
+                                       </mmWidth>\r
+                                       <mmHeight>\r
+                                               <TCEforms>\r
+                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.height</label>\r
+                                                       <config>\r
+                                                               <type>input</type>\r
+                                                               <size>8</size>\r
+                                                               <max>5</max>\r
+                                                               <eval>trim</eval>\r
+                                                       </config>\r
+                                               </TCEforms>\r
+                                       </mmHeight>\r
+                                       <mmRenderType>\r
+                                               <TCEforms>\r
+                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.renderType</label>\r
+                                                       <config>\r
+                                                               <type>select</type>\r
+                                                               <items>\r
+                                                                       <numIndex index="0">\r
+                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.renderType.auto</numIndex>\r
+                                                                               <numIndex index="1">auto</numIndex>\r
+                                                                       </numIndex>\r
+                                                                       <numIndex index="1">\r
+                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.renderType.swf</numIndex>\r
+                                                                               <numIndex index="1">swf</numIndex>\r
+                                                                       </numIndex>\r
+                                                                       <numIndex index="2">\r
+                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.renderType.qt</numIndex>\r
+                                                                               <numIndex index="1">qt</numIndex>\r
+                                                                       </numIndex>\r
+                                                                       <numIndex index="3">\r
+                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.renderType.embed</numIndex>\r
+                                                                               <numIndex index="1">embed</numIndex>\r
+                                                                       </numIndex>\r
+                                                               </items>\r
+                                                               <itemsProcFunc>tx_cms_mediaItems->customMediaRenderTypes</itemsProcFunc> \r
+                                                       </config>\r
+                                               </TCEforms>     \r
+                                       </mmRenderType>\r
+                                       <mmMediaOptions>\r
+                                       <tx_templavoila>\r
+                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.additionalOptions</title>\r
+                                       </tx_templavoila>\r
+                                               <type>array</type>\r
+                                               <section>1</section>\r
+                                               <el>\r
+                                                       <mmMediaOptionsContainer>\r
+                                                       <type>array</type>\r
+                                                       <tx_templavoila>\r
+                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.params</title>\r
+                                                       </tx_templavoila>\r
+                                                       <el>\r
+                                                               <mmParamName>\r
+                                                                       <TCEforms>\r
+                                                                               <label>LLL:EXT:cms/locallang_ttc.xml:media.params.option</label>\r
+                                                                               <config>\r
+                                                                                       <type>select</type>\r
+                                                                                       <items>\r
+                                                                                               <numIndex index="0">\r
+                                                                                                       <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.autoPlay</numIndex>\r
+                                                                                                       <numIndex index="1">autoplay</numIndex>\r
+                                                                                               </numIndex>\r
+                                                                                               <numIndex index="1">\r
+                                                                                                       <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.loop</numIndex>\r
+                                                                                                       <numIndex index="1">loop</numIndex>\r
+                                                                                               </numIndex>\r
+                                                                                               <numIndex index="2">    \r
+                                                                                                       <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.quality</numIndex>\r
+                                                                                                       <numIndex index="1">quality</numIndex>\r
+                                                                                               </numIndex>\r
+                                                                                               <numIndex index="3">    \r
+                                                                                                       <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.preview</numIndex>\r
+                                                                                                       <numIndex index="1">preview</numIndex>\r
+                                                                                               </numIndex>\r
+                                                                                               <numIndex index="4">\r
+                                                                                                       <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.allowScriptAccess</numIndex>\r
+                                                                                                       <numIndex index="1">allowscriptaccess</numIndex>                     \r
+                                                                                               </numIndex>\r
+                                                                                               <numIndex index="5">\r
+                                                                                                       <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.allowFullScreen</numIndex>\r
+                                                                                                       <numIndex index="1">allowFullScreen</numIndex>                     \r
+                                                                                               </numIndex>\r
+                                                                                       </items>\r
+                                                                                       <itemsProcFunc>tx_cms_mediaItems->customMediaParams</itemsProcFunc> \r
+                                                                               </config>\r
+                                                                       </TCEforms>     \r
+                                                               </mmParamName>\r
+                                                               <mmParamSet>\r
+                                                                       <TCEforms>\r
+                                                                               <label>LLL:EXT:cms/locallang_ttc.xml:media.params.setTo</label>\r
+                                                                               <config>\r
+                                                                                       <type>select</type>\r
+                                                                                       <items>\r
+                                                                                               <numIndex index="0">\r
+                                                                                                       <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.on</numIndex>\r
+                                                                                                       <numIndex index="1">1</numIndex>\r
+                                                                                               </numIndex>\r
+                                                                                               <numIndex index="1">\r
+                                                                                                       <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.off</numIndex>\r
+                                                                                                       <numIndex index="1">0</numIndex>\r
+                                                                                               </numIndex>\r
+                                                                                               <numIndex index="2">\r
+                                                                                                       <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.valueEntry</numIndex>\r
+                                                                                                       <numIndex index="1">2</numIndex>                     \r
+                                                                                               </numIndex>\r
+                                                                                       </items>\r
+                                                                               </config>\r
+                                                                       </TCEforms>     \r
+                                                               </mmParamSet>\r
+                                                               <mmParamValue>\r
+                                                                       <TCEforms>\r
+                                                                               <label>LLL:EXT:cms/locallang_ttc.xml:media.params.value</label>\r
+                                                                               <config>\r
+                                                                                       <type>input</type>\r
+                                                                                       <size>16</size>\r
+                                                                                       <default></default>\r
+                                                                               </config>\r
+                                                                       </TCEforms>\r
+                                                               </mmParamValue>\r
+                                                       </el>\r
+                                                       \r
+                                                       </mmMediaOptionsContainer>\r
+                                                       <mmMediaCustomParameterContainer>\r
+                                                               <type>array</type>\r
+                                                               <tx_templavoila>\r
+                                                                       <title>LLL:EXT:cms/locallang_ttc.xml:media.params.customEntry</title>\r
+                                                               </tx_templavoila>\r
+                                                               <el>\r
+                                                                       <mmParamCustomEntry>\r
+                                                                               <TCEforms>\r
+                                                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.params.customEntryLabel</label>\r
+                                                                                       <config>\r
+                                                                                               <type>text</type>\r
+                                                                                               <rows>6</rows>\r
+                                                                                               <cols>60</cols>\r
+                                                                                       </config>\r
+                                                                               </TCEforms>\r
+                                                                       </mmParamCustomEntry>   \r
+                                                               </el>\r
+                                                       </mmMediaCustomParameterContainer>\r
+                                               </el>\r
+                                       </mmMediaOptions>\r
+                               </el>\r
+                       </ROOT>\r
+               </sDEF> \r
+       </sheets>\r
+</T3DataStructure>\r
index da51984..13630ad 100755 (executable)
                        <label index="special_filelinks_description">Makes a list of files for download.</label>
                        <label index="special_multimedia_title">Multimedia</label>
                        <label index="special_multimedia_description">Inserts a media element like a Flash animation, audio file or video clip.</label>
+                       <label index="special_media_title">Media</label>
+                       <label index="special_media_description">Inserts a media element like a Flash animation, audio file or video clip.</label>
+                       <label index="special_swfobject_title">Inserts a Flash media element.</label>
+                       <label index="special_swfobject_description">Inserts Flash media element, audio file or video clip.</label>
+                       <label index="special_qtobject_title">Inserts a Quicktime element.</label>
+                       <label index="special_qtobject_description">Inserts a Quicktime element like a Quicktime audio file or video clip (*.mov).</label>
                        <label index="special_sitemap_title">Sitemap</label>
                        <label index="special_sitemap_description">Creates a sitemap of the website.</label>
                        <label index="special_plainHTML_title">Plain HTML</label>
index 35d3211..5c45928 100755 (executable)
@@ -24,6 +24,7 @@
                        <label index="CType.I.15">Script</label>
                        <label index="CType.I.16">Divider</label>
                        <label index="CType.I.17">HTML</label>
+                       <label index="CType.I.18">Media</label>
                        <label index="CType.div.standard">Standard</label>
                        <label index="CType.div.lists">Lists</label>
                        <label index="CType.div.forms">Forms</label>
             <label index="tabs.text">Text</label>
             <label index="tabs.media">Media</label>
                        <label index="tabs.plugin">Plugin</label>
+                       <label index="media.options">Media Options</label>
+                       <label index="media.url">relative Path of Media File or URL</label>
+                       <label index="media.browseUrlTitle">Select File or URL</label>
+                       <label index="media.width">Media Width</label>
+                       <label index="media.height">Media Height</label>
+                       <label index="media.forcePlayer">Use Player</label>
+                       <label index="media.type">Media Type</label>
+                       <label index="media.type.video">Video</label>
+                       <label index="media.type.audio">Audio</label>
+                       <label index="media.renderType">Render Type</label>
+                       <label index="media.renderType.auto">Auto</label>
+                       <label index="media.renderType.swf">Shockwave Flash Browser Plugin</label>
+                       <label index="media.renderType.qt">QuickTime Browser Plugin</label>
+                       <label index="media.renderType.embed">HTML Embed Element</label>
+                       <label index="media.additionalOptions">Additional Parameters</label>
+                       <label index="media.params">Media Parameter</label>
+                       <label index="media.params.option">Option</label>
+                       <label index="media.params.setTo">Set to</label>
+                       <label index="media.params.on">On</label>
+                       <label index="media.params.off">Off</label>
+                       <label index="media.params.valueEntry">Value Entry</label>
+                       <label index="media.params.value">Value</label>
+                       <label index="media.params.autoPlay">AutoPlay</label>
+                       <label index="media.params.loop">Loop</label>
+                       <label index="media.params.quality">Quality</label>
+                       <label index="media.params.preview">Preview Video</label>
+                       <label index="media.params.bgColor">Background Color</label>
+                       <label index="media.params.allowScriptAccess">Allow ScriptAccess</label>
+                       <label index="media.params.allowFullScreen">Allow Fullscreen</label>
+                       <label index="media.alternativeContent">Alternative Content</label>
+                       <label index="media.params.customEntry">Custom Parameters</label>
+                       <label index="media.params.customEntryLabel">Enter flashvars, params or attributes</label>
+                       <label index="media.noFile">ERROR: Missing URL or File!</label>
                </languageKey>
        </data>
 </T3locallang>
index 2750e0a..dfad18e 100755 (executable)
@@ -62,6 +62,7 @@ $TCA['tt_content'] = Array (
                                        array('LLL:EXT:cms/locallang_ttc.xml:CType.I.10', 'login', 'i/tt_content_login.gif'),
                                        array('LLL:EXT:cms/locallang_ttc.xml:CType.div.special', '--div--'),
                                        array('LLL:EXT:cms/locallang_ttc.xml:CType.I.7', 'multimedia', 'i/tt_content_mm.gif'),
+                                       array('LLL:EXT:cms/locallang_ttc.xml:CType.I.18', 'media', 'i/tt_content_mm.gif'),
                                        array('LLL:EXT:cms/locallang_ttc.xml:CType.I.11', 'splash', 'i/tt_content_news.gif'),
                                        array('LLL:EXT:cms/locallang_ttc.xml:CType.I.12', 'menu', 'i/tt_content_menu.gif'),
                                        array('LLL:EXT:cms/locallang_ttc.xml:CType.I.13', 'shortcut', 'i/tt_content_shortcut.gif'),
@@ -814,7 +815,7 @@ $TCA['tt_content'] = Array (
                        'config' => Array (
                                'type' => 'group',
                                'internal_type' => 'file',
-                               'allowed' => 'txt,html,htm,class,swf,swa,dcr,wav,avi,au,mov,asf,mpg,wmv,mp3',
+                               'allowed' => 'txt,html,htm,class,swf,swa,dcr,wav,avi,au,mov,asf,mpg,wmv,mp3,mp4,m4v',
                                'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
                                'uploadfolder' => 'uploads/media',
                                'size' => '2',
@@ -956,6 +957,7 @@ $TCA['tt_content'] = Array (
                                                  </ROOT>
                                                </T3DataStructure>
                                        ',
+                                       ',media' => file_get_contents(t3lib_extMgm::extPath('cms') . 'flexform_media.xml'),
                                )
                        )
                ),
@@ -1033,6 +1035,12 @@ $TCA['tt_content'] = Array (
                                                        --div--;LLL:EXT:cms/locallang_ttc.xml:CType.I.7, multimedia;;;;3-3-3, bodytext;LLL:EXT:lang/locallang_general.php:LGL.parameters;;nowrap,
                                                        --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime'
                ),
+               'media' =>      Array(
+                       'showitem' => 'CType;;4;;1-1-1, hidden, header;;3;;2-2-2, linkToTop;;;;3-3-3,
+                                                       --div--;LLL:EXT:cms/locallang_ttc.xml:CType.I.18, pi_flexform;;;;3-3-3,
+                                                       bodytext;LLL:EXT:cms/locallang_ttc.xml:media.alternativeContent;9;richtext:rte_transform[flag=rte_enabled|mode=ts_css];4-4-4,   
+                                                       --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime'
+               ),
                'script' =>             Array(
                        'showitem' => 'CType;;4;;1-1-1, hidden, header;LLL:EXT:lang/locallang_general.php:LGL.name;;;2-2-2,
                                                        --div--;LLL:EXT:cms/locallang_ttc.xml:CType.I.15, select_key;;;;3-3-3, pages;;12, bodytext;LLL:EXT:lang/locallang_general.php:LGL.parameters;;nowrap,
index 55dd295..b546795 100644 (file)
@@ -630,6 +630,15 @@ class tslib_cObj {
                                                case 'MULTIMEDIA':
                                                        $content.=$this->MULTIMEDIA($conf);
                                                break;
+                                               case 'MEDIA':
+                                                       $content.=$this->MEDIA($conf);
+                                               break;
+                                               case 'SWFOBJECT':
+                                                       $content.=$this->SWFOBJECT($conf);
+                                               break;
+                                               case 'QTOBJECT':
+                                                       $content.=$this->QTOBJECT($conf);
+                                               break;
                                                default:
                                                                // call hook functions for extra processing
                                                        if($name && is_array($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClassDefault']))    {
@@ -2594,15 +2603,15 @@ class tslib_cObj {
                                if (t3lib_div::inList('au,wav,mp3',$fileinfo['fileext']))       {
                                }
                                if (t3lib_div::inList('avi,mov,mpg,asf,wmv',$fileinfo['fileext']))      {
-                                       $parArray['width'] = 'width="200"';
-                                       $parArray['height'] = 'height="200"';
+                                       $parArray['width'] = 'width="' . ($conf['width'] ? $conf['width'] : 200) . '"';
+                                       $parArray['height'] = 'height="' . ($conf['height'] ? $conf['height'] : 200) . '"';
                                }
                                if (t3lib_div::inList('swf,swa,dcr',$fileinfo['fileext']))      {
                                        $parArray['quality'] = 'quality="high"';
                                }
                                if (t3lib_div::inList('class',$fileinfo['fileext']))    {
-                                       $parArray['width'] = 'width="200"';
-                                       $parArray['height'] = 'height="200"';
+                                       $parArray['width'] = 'width="' . ($conf['width'] ? $conf['width'] : 200) . '"';
+                                       $parArray['height'] = 'height="' . ($conf['height'] ? $conf['height'] : 200) . '"';
                                }
 
                                        // fetching params
@@ -2635,13 +2644,303 @@ class tslib_cObj {
                return $content;
        }
 
+       /**
+        * Rendering the cObject, SWFOBJECT
+        *
+        * @param       array           Array of TypoScript properties
+        * @return      string          Output
+        */
+       function MEDIA($conf) {
+               $content = '';  
+               $flexParams = $this->stdWrap($conf['flexParams'], $conf['flexParams.']);
+               if (substr($flexParams, 0, 1) === '<') {
+                       // it is a content element
+                       $this->readFlexformIntoConf($flexParams, $conf['parameter.']);
+                       $url = $conf['parameter.']['mmFile'];
+               } else {
+                       // it is a TS object
+                       $url = $this->stdWrap($conf['file'], $conf['file.']);
+               }
 
 
+               $mode = @file_exists(PATH_site . $url) ? 'file' : 'url';
+               if ($mode === 'file') {
+                       $filename = $GLOBALS['TSFE']->tmpl->getFileName($url);
+                       $fileinfo = t3lib_div::split_fileref($filename);
+                       $conf['file'] = $url;
+               } else {
+                       $conf['file'] = $url;
+                       if ($conf['parameter.']['mmforcePlayer'] || $conf['forcePlayer']) {
+                               $mode = 'file';
+                       }
+               }
 
+               $conf['type'] = isset($conf['parameter.']['mmType']) ? $conf['parameter.']['mmType'] : $conf['type'];
+               $typeConf = $conf['mimeConf.'][$conf['type'] . '.'] ? $conf['mimeConf.'][$conf['type'] . '.'] : array();
+               $conf['predefined'] = array();  
 
+               $renderType = 'auto';
+               if (isset($conf['parameter.']['mmRenderType'])) {
+                       $renderType = $conf['parameter.']['mmRenderType'];      
+               }
+               $width = intval($conf['parameter.']['mmWidth']);
+               $height = intval($conf['parameter.']['mmHeight']);
+               if ($width) {
+                       $conf['width'] = $width;
+               } else {
+                       $conf['width'] = intval($conf['width']) ? $conf['width'] : $typeConf['defaultWidth'];
+               }
+               if ($height) {
+                       $conf['height'] = $height;
+               } else {
+                       $conf['height'] = intval($conf['height']) ? $conf['height'] : $typeConf['defaultHeight'];
+               }
+
+               if (is_array($conf['parameter.']['mmMediaOptions'])) { 
+                       $params = array();
+                       foreach ($conf['parameter.']['mmMediaOptions'] as $key => $value) {
+                               if ($key == 'mmMediaCustomParameterContainer') {
+                                       foreach ($value as $val) {
+                                               //custom parameter entry
+                                               $rawTS = $val['mmParamCustomEntry'];
+                                               //read and merge
+                                               $tmp = t3lib_div::trimExplode(chr(10), $rawTS);
+                                               if (count($tmp)) {
+                                                       foreach ($tmp as $tsLine) {
+                                                               if (substr($tsLine, 0, 1) != '#' && $pos = strpos($tsLine, '.')) { 
+                                                                       $parts[0] = substr($tsLine, 0, $pos);
+                                                                       $parts[1] = substr($tsLine, $pos + 1);
+                                                                       $valueParts = t3lib_div::trimExplode('=', $parts[1], true);
+
+                                                                       switch (strtolower($parts[0])) {
+                                                                               case 'flashvars':
+                                                                                       $conf['flashvars.'][$valueParts[0]] = $valueParts[1];
+                                                                               break;
+                                                                               case 'params':          
+                                                                                       $conf['params.'][$valueParts[0]] = $valueParts[1];
+                                                                               break;
+                                                                               case 'attributes':
+                                                                                       $conf['attributes.'][$valueParts[0]] = $valueParts[1];
+                                                                               break;
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+                                       } 
+                               } elseif ($key == 'mmMediaOptionsContainer') {
+                                       foreach ($value as $val) {
+                                               if (isset($val['mmParamSet'])) {
+                                                       $pName = $val['mmParamName'];
+                                                       $pSet = $val['mmParamSet'];
+                                                       $pValue = $pSet == 2 ? $val['mmParamValue'] : ($pSet == 0 ? 'false' : 'true');
+                                                       $conf['predefined'][$pName] = $pValue;
+                                               }
+                                       }
+                               }
+                       }
+               }
 
+               // render MEDIA 
+               if ($mode == 'url' && $url != '') {
+                               // url is called direct, not with player
+                       $conf = array_merge($conf['mimeConf.']['swfobject.'], $conf);
+                       $conf[$conf['type'] . '.']['player'] = strpos($url, '://') === false ? 'http://' . $url : $url;
+                       $conf['file'] = '';
+                       $conf['installUrl'] = 'null';
+                       $conf['flashvars'] = array_merge((array) $conf['flashvars'], $conf['predefined']);
+                       $content = $this->SWFOBJECT($conf);
+               } else {
+                       if ($mode == 'url' && $url == '' && !$conf['allowEmptyUrl']) {
+                               return '<p style="background-color: yellow;">' . $GLOBALS['TSFE']->sL('LLL:EXT:cms/locallang_ttc.xml:media.noFile', true) . '</p>';
+                       }
+                       if ($renderType === 'auto') {
+                               $handler = array_keys($conf['fileExtHandler.']);
+                               if (in_array($fileinfo['fileext'], $handler)) {
+                                       $renderType = strtolower($conf['fileExtHandler.'][$fileinfo['fileext']]);
+                               } 
+                       }     
+                       switch ($renderType) {  
+                               case 'swf':
+                                       $conf[$conf['type'] . '.'] = array_merge($conf['mimeConf.']['swfobject.'][$conf['type'] . '.'], $typeConf);
+                                       $conf = array_merge($conf['mimeConf.']['swfobject.'], $conf);
+                                       unset($conf['mimeConf.']);
+                                       $conf['flashvars.'] = array_merge((array) $conf['flashvars.'], $conf['predefined']);
+                                       $content = $this->SWFOBJECT($conf);
+                               break;
+                               case 'qt':
+                                       $conf[$conf['type'] . '.'] = array_merge($conf['mimeConf.']['swfobject.'][$conf['type'] . '.'], $typeConf);
+                                       $conf = array_merge($conf['mimeConf.']['qtobject.'], $conf);
+                                       unset($conf['mimeConf.']);
+                                       $conf['params.'] = array_merge((array) $conf['params.'], $conf['predefined']);
+                                       $content = $this->QTOBJECT($conf);
+                               break;
+                               case 'media':
+                                       $paramsArray = array_merge((array) $typeConf['default.']['params.'], (array) $conf['params.'], $conf['predefined']);
+                                       $conf['params']= '';
+                                       foreach ($paramsArray as $key => $value) {
+                                               $conf['params'] .= $key . '=' . $value . chr(10);
+                                       }
+                                       $content = $this->MULTIMEDIA($conf);
+                               break; 
+                               default:
+                                       if (is_array ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRender'])) {
+                                               foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRender'] as $classRef) {
+                                                       $hookObj = &t3lib_div::getUserObj($classRef);
+                                                       $conf['file'] = $url;
+                                                       $conf['mode'] = $mode;
+                                                       $content = $hookObj->customMediaRender($renderType, $conf);
+                                               }
+                                       }
+                               }
+               }
+               return $content;
+       }
 
 
+       /**
+        * Rendering the cObject, SWFOBJECT
+        *
+        * @param       array           Array of TypoScript properties
+        * @return      string          Output
+        */
+       function SWFOBJECT($conf) {
+               $content = '';
+               $flashvars = $params = $attributes = '';
+
+               $filename = $this->stdWrap($conf['file'], $conf['file.']);
+
+               $typeConf = $conf[$conf['type'] . '.'];
+
+               //add SWFobject js-file
+               $GLOBALS['TSFE']->additionalHeaderData['SWFobject'] = '<script src="' . $GLOBALS['TSFE']->absRefPrefix . 'typo3/contrib/flashmedia/swfobject/swfobject.js"></script>';
+
+               if ($filename) {
+                       $conf['flashvars.']['file'] = strpos($filename, '://') !== FALSE ? $filename : $GLOBALS['TSFE']->absRefPrefix . $filename;
+               } 
+
+               // merge with default parameters
+               $conf['flashvars.'] = array_merge((array) $typeConf['default.']['flashvars.'], (array) $conf['flashvars.']);
+               $conf['params.'] = array_merge((array) $typeConf['default.']['params.'], (array) $conf['params.']);
+               $conf['attributes.'] = array_merge((array) $typeConf['default.']['attributes.'], (array) $conf['attributes.']);
+
+               if (is_array($conf['flashvars.'])) {
+                       t3lib_div::remapArrayKeys($conf['flashvars.'], $typeConf['mapping.']['flashvars.']);
+                       foreach ($conf['flashvars.'] as $key => $value) {
+                               $flashvars .= $key . ': "' . $value . '",';
+                       }
+               }
+               $flashvars = 'var flashvars = {' . ($flashvars ? (substr($flashvars, -1) == ',' ? substr(trim($flashvars), 0, -1) : $flashvars) : '') . '};';
+
+               if (is_array($conf['params.'])) {
+                       t3lib_div::remapArrayKeys($conf['params.'], $typeConf['mapping.']['params.']);
+                       foreach ($conf['params.'] as $key => $value) {
+                               $params .= $key . ': "' . $value . '",';
+                       }
+                       $params = substr(trim($params), 0, -1);
+               } 
+               $params = 'var params = {' . ($params ? $params : '') . '};';
+
+               if (is_array($conf['attributes.'])) {
+                       t3lib_div::remapArrayKeys($conf['attributes.'], $typeConf['attributes.']['params.']);
+                       foreach ($conf['attributes.'] as $key => $value) {
+                               $attributes .= $key . ': "' . $value . '",';
+                       }
+               } 
+               $attributes = 'var attributes = {' . ($attributes ? (substr($attributes, -1 === ',' ? substr($attributes, 0, -1) : $attributes)) : '') . '};';
+
+               $flashVersion = $this->stdWrap($conf['flashVersion'], $conf['flashVersion.']);
+               if (!$flashVersion) {
+                       $flashVersion = '9';
+               }
+
+               $replaceElementIdString = uniqid('mmswf');
+               $GLOBALS['TSFE']->register['MMSWFID'] = $replaceElementIdString;
+
+               $alternativeContent = $this->stdWrap($conf['alternativeContent'], $conf['alternativeContent.']);
+
+               $layout = $this->stdWrap($conf['layout'], $conf['layout.']);
+               $layout = str_replace('###ID###', $replaceElementIdString, $layout);
+               $layout = str_replace('###SWFOBJECT###', '<div id="' . $replaceElementIdString . '">' . $alternativeContent . '</div>', $layout);
+
+               $width = $this->stdWrap($conf['width'], $conf['width.']);
+               $height = $this->stdWrap($conf['height'], $conf['height.']);
+
+               $width = $width ? $width : $conf[$conf['type'] . '.']['defaultWidth'];
+               $height = $height ? $height : $conf[$conf['type'] . '.']['defaultHeight']; 
+
+               $player = $this->stdWrap($conf[$conf['type'] . '.']['player'], $conf[$conf['type'] . '.']['player.']);
+               $installUrl = $conf['installUrl'] ? $conf['installUrl'] : $GLOBALS['TSFE']->absRefPrefix . 'typo3/contrib/flashmedia/swfobject/expressInstall.swf';
+
+               $embed = 'swfobject.embedSWF("' . $player . '", "' . $replaceElementIdString . '", "' . $width . '", "' . $height . '",
+                               "' . $flashVersion . '", "' . $installUrl . '", flashvars, params, attributes);';
+
+               $content = $layout . '
+                       <script type="text/javascript">
+                               ' . $flashvars . '
+                               ' . $params . '
+                               ' . $attributes . '
+                               ' . $embed . '
+                       </script>';
+
+               return $content;
+       }
+
+       /**
+        * Rendering the cObject, QTOBJECT
+        *
+        * @param       array           Array of TypoScript properties
+        * @return      string          Output
+        */
+       function QTOBJECT($conf) {
+               $content = '';  
+               $params = '';
+
+               $filename = $this->stdWrap($conf['file'],$conf['file.']);
+               $incFile = $GLOBALS['TSFE']->tmpl->getFileName($filename);
+               if ($incFile)   {
+                       $filename = $incFile;
+                       $fileinfo = t3lib_div::split_fileref($filename);
+               }
+                
+               $typeConf = $conf[$conf['type'] . '.'];
+               
+               //add QTobject js-file
+               $GLOBALS['TSFE']->additionalHeaderData['qtobject'] = '<script src="' . $GLOBALS['TSFE']->absRefPrefix . 'typo3/contrib/flashmedia/qtobject/qtobject.js"></script>';
+               $replaceElementIdString = uniqid('mmqt');
+               $GLOBALS['TSFE']->register['MMQTID'] = $replaceElementIdString;
+               $qtObject = 'QTObject' . $replaceElementIdString;
+
+               // merge with default parameters
+               $conf['params.'] = array_merge((array) $typeConf['default.']['params.'], (array) $conf['params.']);
+
+               if (is_array($conf['params.'])) {
+                       t3lib_div::remapArrayKeys($conf['params.'], $typeConf['mapping.']['params.']);
+                       foreach ($conf['params.'] as $key => $value) {
+                               $params .= $qtObject . '.addParam("' .$key . '", "' . $value . '");' . chr(10);
+                       }
+               } 
+               $params = ($params ? substr($params, 0, -2) : '') . chr(10) . $qtObject . '.write("' . $replaceElementIdString . '");';
+
+               $alternativeContent = $this->stdWrap($conf['alternativeContent'], $conf['alternativeContent.']);
+               $layout = $this->stdWrap($conf['layout'], $conf['layout.']);
+               $layout = str_replace('###ID###', $replaceElementIdString, $layout);
+               $layout = str_replace('###QTOBJECT###', '<div id="' . $replaceElementIdString . '">' . $alternativeContent . '</div>', $layout);
+
+               $width = $this->stdWrap($conf['width'], $conf['width.']);
+               $height = $this->stdWrap($conf['height'], $conf['height.']);
+               $width = $width ? $width : $conf[$conf['type'] . '.']['defaultWidth'];
+               $height = $height ? $height : $conf[$conf['type'] . '.']['defaultHeight'];
+
+               $embed = 'var ' . $qtObject . ' = new QTObject("' . $GLOBALS['TSFE']->absRefPrefix . $filename . '", "' . $replaceElementIdString . '", "' . $width . '", "' . $height . '");';
+
+               $content = $layout . '
+                       <script type="text/javascript">
+                               ' . $embed . '
+                               ' . $params . '
+                       </script>';
+
+               return $content;
+       }
 
 
 
@@ -2657,6 +2956,49 @@ class tslib_cObj {
         *
         ************************************/
 
+        
+       /**
+        * Converts a given config in Flexform to a conf-Array 
+        * @param       string          Flexform data
+        * @param       array           Array to write the data into, by reference
+        * @param       boolean         is set if called recursive. Don't call function with this parameter, it's used inside the function only
+        * @access      public
+        * 
+        */
+       function readFlexformIntoConf($flexData, &$conf, $recursive=FALSE) {
+               if ($recursive === FALSE) {
+                       $flexData = t3lib_div::xml2array($flexData, 'T3');
+               } 
+
+               if (is_array($flexData)) {
+                       if (isset($flexData['data']['sDEF']['lDEF'])) {
+                               $flexData = $flexData['data']['sDEF']['lDEF'];
+                       }
+                       
+                       foreach ($flexData as $key => $value) {
+                               if (is_array($value['el']) && count($value['el']) > 0) {
+                                       foreach ($value['el'] as $ekey => $element) {
+                                               if (isset($element['vDEF'])) {
+                                                       $conf[$ekey] =  $element['vDEF'];
+                                               } else {
+                                                       if(is_array($element)) {
+                                                               $this->readFlexformIntoConf($element, $conf[$key][key($element)][$ekey], TRUE);                                                 
+                                                       } else {
+                                                               $this->readFlexformIntoConf($element, $conf[$key][$ekey], TRUE);
+                                                       }
+                                               }
+                                       }
+                               } else {
+                                       $this->readFlexformIntoConf($value['el'], $conf[$key], TRUE);
+                               }
+                               if ($value['vDEF']) {
+                                       $conf[$key] = $value['vDEF'];
+                               }
+                       }
+               }
+       }
+
+       
        /**
         * Returns all parents of the given PID (Page UID) list
         *
diff --git a/typo3/sysext/cms/tslib/hooks/class.tx_cms_mediaitems.php b/typo3/sysext/cms/tslib/hooks/class.tx_cms_mediaitems.php
new file mode 100644 (file)
index 0000000..913c351
--- /dev/null
@@ -0,0 +1,76 @@
+<?php\r
+/***************************************************************\r
+*  Copyright notice\r
+*\r
+*  (c) 1999-2009 Kasper Skaarhoj (kasperYYYY@typo3.com)\r
+*  All rights reserved\r
+*\r
+*  This script is part of the TYPO3 project. The TYPO3 project is\r
+*  free software; you can redistribute it and/or modify\r
+*  it under the terms of the GNU General Public License as published by\r
+*  the Free Software Foundation; either version 2 of the License, or\r
+*  (at your option) any later version.\r
+*\r
+*  The GNU General Public License can be found at\r
+*  http://www.gnu.org/copyleft/gpl.html.\r
+*  A copy is found in the textfile GPL.txt and important notices to the license\r
+*  from the author is found in LICENSE.txt distributed with these scripts.\r
+*\r
+*\r
+*  This script is distributed in the hope that it will be useful,\r
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+*  GNU General Public License for more details.\r
+*\r
+*  This copyright notice MUST APPEAR in all copies of the script!\r
+***************************************************************/\r
+\r
+/**\r
+ * Adds extra fields into 'media' flexform\r
+ * \r
+ * @package TYPO3\r
+ * @subpackage cms \r
+ */\r
\r
+class tx_cms_mediaItems {\r
+\r
+       /**\r
+        * Load extra render types if they exist\r
+        *\r
+        * @param       array           $params: Existing types by reference\r
+        * @param       array           $conf: config array\r
+        */\r
+       public function customMediaRenderTypes(&$params, $conf) {\r
+               if (is_array ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRenderTypes'])) {\r
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRenderTypes'] as $classRef) {\r
+                               $hookObj = &t3lib_div::getUserObj($classRef);\r
+                               $hookObj->customMediaRenderTypes($params, $conf);\r
+                       }\r
+               }\r
+               \r
+               \r
+       }\r
+       \r
+       /**\r
+        * Load extra predefined media params if they exist\r
+        *\r
+        * @param       array           $params: Existing types by reference\r
+        * @param       array           $conf: config array\r
+        */\r
+       public function customMediaParams(&$params, $conf) {\r
+               \r
+               if (is_array ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaParams'])) {\r
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaParams'] as $classRef) {\r
+                               $hookObj = &t3lib_div::getUserObj($classRef);\r
+                               $hookObj->customMediaParams($params, $conf);\r
+                       }\r
+               }\r
+               \r
+               \r
+       }\r
+} \r
\r
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/hooks/class.tx_cms_mediaitems.php']) {\r
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/hooks/class.tx_cms_mediaitems.php']);\r
+}\r
+?>\r
index fb3b813..257392d 100755 (executable)
@@ -15,7 +15,7 @@ TCEFORM.tt_content {
        text_size.disabled=1
        image_frames.disabled = 1
 
-       CType.removeItems = rte,script,splash
+       CType.removeItems = rte,script,splash,swfobject,qtobject,multimedia
 }
 
 
index cf9236e..5ed5be3 100644 (file)
@@ -106,6 +106,21 @@ styles.content.searchresult {
   target = {$PAGE_TARGET}
 }
 
+styles.content.media {
+    # cat=content/cMedia; type=int+; label= Video Media Width: define the default width for the media-object
+  videoPlayer = typo3/contrib/flashmedia/flvplayer.swf
+    # cat=content/cMedia; type=int+; label= Video Media Width: define the default width for the media-object
+  defaultVideoWidth = 600
+       # cat=content/cMedia; type=int+; label= Video Media Height: define the default height for the media-object
+  defaultVideoHeight = 400
+    # cat=content/cMedia; type=int+; label= Audio Media Width: define the default width for the media-object
+  audioPlayer = typo3/contrib/flashmedia/player.swf    
+       # cat=content/cMedia; type=int+; label= Video Media Width: define the default width for the media-object
+  defaultAudioWidth = 300
+    # cat=content/cMedia; type=int+; label= Audio Media Height: define the default height for the media-object
+  defaultAudioHeight = 30
+}
+
  # cat=advanced/links; type=small; label= Target for internal links: Should match the name of the content PAGE-object in TypoScript when used with frames. Most cases: set to "" (empty). If you have frames in the template set to "page"
 PAGE_TARGET =
 
index 0662976..9287898 100644 (file)
@@ -897,6 +897,171 @@ tt_content.multimedia {
        }
 }
 
+# *****************
+# CType: swfobject
+# *****************
+tt_content.swfobject = COA
+tt_content.swfobject {
+       10 = < lib.stdheader
+
+       20 = SWFOBJECT
+       20 {
+               file = 
+               width = 
+               height =
+               
+               flexParams.field = pi_flexform
+               
+               alternativeContent.field = bodytext
+               
+               layout = ###SWFOBJECT###
+               
+               video {
+                       player = {$styles.content.media.videoPlayer}
+                       
+                       defaultWidth  = {$styles.content.media.defaultVideoWidth}
+                       defaultHeight  = {$styles.content.media.defaultVideoHeight}
+                       
+                       default {
+                               params.quality = high
+                               params.menu = false
+                               params.allowScriptAccess = sameDomain
+                               params.allowFullScreen = true
+                       }
+                       mapping {
+                               
+                       }
+               }
+               
+               audio {
+                       player = {$styles.content.media.audioPlayer}
+                       
+                       defaultWidth = {$styles.content.media.defaultAudioWidth}
+                       defaultHeight = {$styles.content.media.defaultAudioHeight}
+                       
+                       default {
+                               params.quality = high
+                               params.allowScriptAccess = sameDomain
+                               params.menu = false
+                       }
+                       mapping {
+                               flashvars.file = soundFile
+                       }
+               }
+               
+       }
+       20.stdWrap {
+               editIcons = tt_content: multimedia, imagewidth, imageheight, pi_flexform, bodytext
+               editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.multimedia
+
+               prefixComment = 2 | SWFobject element:
+       }       
+}
+
+# *****************
+# CType: qtobject
+# *****************
+tt_content.qtobject = COA
+tt_content.qtobject {
+       10 = < lib.stdheader
+
+       20 = QTOBJECT
+       20 {
+               file = 
+               width = 
+               height =
+               
+               flexParams.field = pi_flexform 
+               
+               alternativeContent.field = bodytext
+               
+               layout = ###QTOBJECT###
+               
+               video {
+                       player = {$styles.content.media.videoPlayer}
+                       
+                       defaultWidth  = {$styles.content.media.defaultVideoWidth}
+                       defaultHeight  = {$styles.content.media.defaultVideoHeight}
+                       
+                       default {
+                               params.quality = high
+                               params.menu = false
+                               params.allowScriptAccess = sameDomain
+                               params.allowFullScreen = true
+                       }
+                       mapping {
+                               
+                       }
+               }
+               
+               audio {
+                       player = {$styles.content.media.audioPlayer}
+                       
+                       defaultWidth = {$styles.content.media.defaultAudioWidth}
+                       defaultHeight = {$styles.content.media.defaultAudioHeight}
+                       
+                       default {
+                               params.quality = high
+                               params.allowScriptAccess = sameDomain
+                               params.menu = false
+                       }
+                       mapping {
+                               flashvars.file = soundFile
+                       }
+               }
+       }
+       20.stdWrap {
+               editIcons = tt_content: multimedia, imagewidth, imageheight, pi_flexform, bodytext
+               editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.multimedia
+
+               prefixComment = 2 | QTobject element:
+       }       
+}
+
+# *****************
+# CType: media
+# *****************
+tt_content.media = COA
+tt_content.media {
+       10 = < lib.stdheader
+
+       20 = MEDIA
+       20 {
+               
+               flexParams.field = pi_flexform
+               alternativeContent < tt_content.text.20
+               alternativeContent.field = bodytext
+               
+               type = video
+               renderType = auto
+               allowEmptyUrl = 0
+               
+               fileExtHandler {
+                       default = MEDIA
+                       avi = MEDIA
+                       asf = MEDIA
+                       class = MEDIA
+                       wmv = MEDIA
+                       mp3 = SWF
+                       mp4 = SWF
+                       m4v = SWF
+                       swa = SWF
+                       flv = SWF
+                       swf = SWF
+                       mov = QT
+               }
+               
+               mimeConf.swfobject < tt_content.swfobject.20
+               mimeConf.qtobject < tt_content.qtobject.20
+               
+       }
+       20.stdWrap {
+               editIcons = tt_content: pi_flexform, bodytext
+               editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.multimedia
+
+               prefixComment = 2 | Media element:
+       }       
+}
 
 # ******************
 # CType: mailform