Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unflexible filebrowser.php in GS 3.1
#1
@GS Developers:
In the GS 3.1 filebrowser.php there is the following code:
Code:
<script type='text/javascript'>
    function submitLink($funcNum, $url) {
        if ($funcNum=="2"){
            if(window.opener){
                window.opener.CKEDITOR.tools.callFunction($funcNum, $url);
            }
        }
        <?php if (isset($_GET['returnid'])){ ?>
            if(window.opener){
                window.opener.document.getElementById('<?php echo $returnid; ?>').value=$url;
            }
        <?php } ?>    
        window.close();
    }
    </script>
The check for "2" (as opposed to GS 3.0) prevents other instances of CKEditor (e.g. for I18N Custom Fields) from selecting an image, as they will be called with another function number.
I'm not sure what should be achieved with this weird code, but either remove the =="2" or use a code like this:
Code:
<script type='text/javascript'>
    function submitLink($funcNum, $url) {
        <?php if (isset($_GET['returnid'])){ ?>
            if(window.opener){
                window.opener.document.getElementById('<?php echo $returnid; ?>').value=$url;
            }
        <?php } else { ?>
            if(window.opener){
                window.opener.CKEDITOR.tools.callFunction($funcNum, $url);
            }
        <?php } ?>
        window.close();
    }
    </script>
(Not sure if this is what was intended)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#2
This has already been dealt with in GS3.1.1.

Also added a new option 'func' for a callback function on the opening window.
My Github Repos: Github
Website: DigiMute
Reply
#3
@mvlcek, Thanks, I've ammended your script and added it to the SVN for 3.1.2
My Github Repos: Github
Website: DigiMute
Reply




Users browsing this thread: 1 Guest(s)