Forums / Extensions / Integration of ezmultiupload in the Front with ezjscore and Ajax call

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

eZ debug

Timing: Jan 17 2025 23:43:26
Script start
Timing: Jan 17 2025 23:43:26
Module start 'content'
Timing: Jan 17 2025 23:43:27
Module end 'content'
Timing: Jan 17 2025 23:43:27
Script end

Main resources:

Total runtime0.9294 sec
Peak memory usage4,096.0000 KB
Database Queries183

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.1797180.8047
Module start 'content' 0.00560.7738 769.9844417.2500
Module end 'content' 0.77940.1500 1,187.2344333.7813
Script end 0.9294  1,521.0156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.4513210.0002
Check MTime0.00150.1645210.0001
Mysql Total
Database connection0.00080.082410.0008
Mysqli_queries0.859092.42791830.0047
Looping result0.00250.27081810.0000
Template Total0.900996.920.4505
Template load0.00210.223420.0010
Template processing0.898896.707220.4494
Template load and register function0.00020.023610.0002
states
state_id_array0.00060.060610.0006
state_identifier_array0.00300.327620.0015
Override
Cache load0.00170.1815140.0001
Sytem overhead
Fetch class attribute can translate value0.00210.226020.0011
Fetch class attribute name0.00080.083210.0008
XML
Image XML parsing0.00040.047520.0002
class_abstraction
Instantiating content class attribute0.00000.000510.0000
General
dbfile0.01001.0801210.0005
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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