Integration of ezmultiupload in the Front with ezjscore and Ajax call

Author Message

cimo aichouni

Tuesday 03 May 2011 1:42:38 am

Hello,

I am newbie in ez publish, and I do not know if the appropriate place to ask these questions..

I discovered the module ezmultiupload and I would like to use it for my website without toolbar ezwebin but directly on the site by overriding the template: extension/ezmultiupload/design/standard/templates/parts/websitetoolbar/ezmultiupload.tpl . in my website design.

And an ajax call for ezmultiupload module using /ezjscore/run/ezmultiupload/upload/',$parent_node.node_id .

But it does not work. I just see the titles and buttons of the ezmultiupload interface But no actions of ezmultiupload.js.

Here is my new ezmultiupload.tpl in my desing extension:

{ezscript_require( 'ezjsc::yui2' )}

{ezcss_require( 'ezmultiupload.css' )}

<div id="ezmultiupload" class="ezmultiupload"> 

 Waiting for ezjscore ajax call... (See FAQ if you get script error and / or nothing happens! hint: permissions )</div>

<script type="text/javascript">

{literal}

<!-- // This function is executed when all YUI 2.x components are available

YUILoader.onSuccess = function() { {/literal}   

// A ezjscore server call   

   var serverCall = "{concat('/ezjscore/run/ezmultiupload/upload/',68)|ezurl( 'no' )}"; 

   var ezmultiuploadpath = "{'javascript/ezmultiupload.js'|ezdesign( 'no' )}";

{literal}   

// POST parameters send along with XHR request   

var data = "arg1=hi!";

 

    YAHOO.util.Connect.asyncRequest( "POST", serverCall,  { 

      success: function (o)         {       YUILoader.addModule({     

              name: 'ezmultiupload',                 

              type: 'js',                   

              fullpath: 'ezmultiuploadpath',     

              requires: ["utilities", "json", "uploader"],                   

              after: ["uploader"],                   

              skinnable: false                });               

if ( o.responseText !== undefined )          

  { YAHOO.util.Dom.get("ezmultiupload").innerHTML = o.responseText; }}}, data );}
// Load DOM and Connection components

YUILoader.require(["dom","connection"]);
// Insert YUI 2.x components on page

YUILoader.insert();{/literal}//-->

</script>

I do the inlude of this template in some div.
I think that it will be helpful for a lot of developers whom want to use this extension in front office.

Thanks for your help.

Regards

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:13:33
Script start
Timing: Jan 18 2025 02:13:33
Module start 'layout'
Timing: Jan 18 2025 02:13:33
Module start 'content'
Timing: Jan 18 2025 02:13:33
Module end 'content'
Timing: Jan 18 2025 02:13:33
Script end

Main resources:

Total runtime0.5552 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 589.5078152.6875
Module start 'layout' 0.00520.0030 742.195339.5156
Module start 'content' 0.00810.5457 781.7109412.1250
Module end 'content' 0.55380.0013 1,193.83598.0938
Script end 0.5551  1,201.9297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.5397160.0002
Check MTime0.00130.2339160.0001
Mysql Total
Database connection0.00080.136010.0008
Mysqli_queries0.516693.0507460.0112
Looping result0.00040.0806440.0000
Template Total0.528695.220.2643
Template load0.00190.342020.0009
Template processing0.526794.870120.2633
Template load and register function0.00010.026310.0001
states
state_id_array0.00040.069710.0004
state_identifier_array0.00100.186620.0005
Override
Cache load0.00140.2600140.0001
Sytem overhead
Fetch class attribute can translate value0.00070.126410.0007
Fetch class attribute name0.00060.104510.0006
XML
Image XML parsing0.00010.020410.0001
class_abstraction
Instantiating content class attribute0.00000.000610.0000
General
dbfile0.00410.7415100.0004
String conversion0.00000.002040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 7
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs