Giter VIP home page Giter VIP logo

Comments (2)

dawidpjoubert avatar dawidpjoubert commented on August 22, 2024

To fix this change the following file cms/widgets/views/resource/resource_upload_iframe_return.php with this:

<script type="text/javascript"> window.parent.afterUploadResource(resource_id) ?>,getFullPath()) ?>,,resource_type) ?>) window.parent.afterUploadResourceWithEditor(resource_id) ?>,getFullPath()) ?>,resource_type) ?>,,, ,) </script>

To fix the edit button (so that it goes to the correct URL) you need to fix the generated URL in widgets/views/object/object_resource_form_widget.php by replacing the entire buildResourceList function with this:

function buildResourceList(id,link,key,file_type){
var current_resource_count=parseInt($('#resource_upload_'+key+'current_upload_count').val());
var current_resource_max=parseInt($('#resource_upload
'+key+'_current_upload_max').val());
var next_resource_count=current_resource_count+1;

    <?php
         $backend_asset=bu();
    ?>                              
    var link_resource_icon='<?php echo $backend_asset;?>/images/content_icons/'+file_type+'.png';
    if(file_type=='image'){
        link_resource_icon=link;
    }
        $('#resource_upload_'+key+'_current_upload_count').val(next_resource_count);
        var resource_string=
        '<li id="list_id_resource_upload_'+key+'_'+next_resource_count+'" align="left" style="background: transparent; float:left" >'+
            '<input type="hidden" id="upload_id_resource_upload_'+key+'_link_'+next_resource_count+'" name="upload_id_resource_upload_'+key+'_link[]" value="'+link+'" />'+
            '<input type="hidden" id="upload_id_resource_upload_'+key+'_resid_'+next_resource_count+'" name="upload_id_resource_upload_'+key+'_resid[]" value="'+id+'" />'+
            '<input type="hidden" id="upload_id_resource_upload_'+key+'_type_'+next_resource_count+'" name="upload_id_resource_upload_'+key+'_type[]" value="'+file_type+'" />'+                                                                                   
            '<div class="item_div_wrapper">'+                                                             
                '<span class="item_name"><img style="background:#fff;padding:5px; border:1px dotted #CCC" src="'+link_resource_icon+'" width="50" /></span>'+                                                                                                                                                       
                '<div class="item_buttons" style="margin-top:3px; margin-left:5px">'+
                '<a href="<?php echo bu();?>/resource/update/id/'+id+'" target="_blank"  name="editItem"><img alt="<?php echo  t('cms','Edit'); ?>" src="<?php echo $backend_asset; ?>/images/edit.png" /></a>&nbsp;'+                                                                      
                '<a href="javascript:void(0)" onclick="fnRemoveResourceItem(\'list_id_resource_upload_'+key+'_'+next_resource_count+'\',\''+key+'\');" name="removeItem"><img alt="<?php echo  t('cms','Delete'); ?>" src="<?php echo $backend_asset;?>/images/disabled.png" /></a>'+  
                '</div>'+                                
            '</div>'+                                                                                                            
        '</li><li class="clear"></li>';
        $('#'+key+'_resource_list li.clear').remove();
        $('#'+key+'_resource_list').append(resource_string);                        
        $('#resource_upload_'+key+'_current_upload_count').val(next_resource_count.toString());
        $('#resource_upload_modified').val(1);              

}

from gxc-cms-2.

aliakbari avatar aliakbari commented on August 22, 2024

thanks for answer.
موفق باشید

from gxc-cms-2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.