Ticket #210: FCKEditor_ConnectorSubject.patch

File FCKEditor_ConnectorSubject.patch, 4.4 KB (added by Rafael Teixeira, 16 years ago)
  • editor/dialog/common/fck_dialog_common.js

     
    110110        return replaced ;
    111111}
    112112
    113 function OpenFileBrowser( url, width, height )
     113function OpenFileBrowser( url, width, height, subject )
    114114{
    115115        // oEditor must be defined.
    116116
     
    122122        sOptions += ",height=" + height ;
    123123        sOptions += ",left=" + iLeft ;
    124124        sOptions += ",top=" + iTop ;
    125 
     125       
     126        if (subject && subject.length > 0)
     127                url += ((url.indexOf('?') < 0)?'?':'&') + 'Subject=' + subject;
     128               
    126129        // The "PreserveSessionOnFileBrowser" because the above code could be
    127130        // blocked by popup blockers.
    128131        if ( oEditor.FCKConfig.PreserveSessionOnFileBrowser && oEditor.FCKBrowserInfo.IsIE )
  • editor/dialog/fck_image/fck_image.js

     
    2929
    3030var bImageButton = ( document.location.search.length > 0 && document.location.search.substr(1) == 'ImageButton' ) ;
    3131
     32var sSubject    = oEditor.FCKConfig.ConnectorSubject;
     33
    3234//#### Dialog Tabs
    3335
    3436// Set the dialog tabs.
     
    109111
    110112        // Set the actual uploader URL.
    111113        if ( FCKConfig.ImageUpload )
    112                 GetE('frmUpload').action = FCKConfig.ImageUploadURL ;
     114                GetE('frmUpload').action = AddSubjectParam(FCKConfig.ImageUploadURL);
    113115
    114116        window.parent.SetAutoSize( true ) ;
    115117
     
    117119        window.parent.SetOkButton( true ) ;
    118120}
    119121
     122function AddSubjectParam(url)
     123{
     124        if (sSubject && sSubject.length > 0)
     125        {
     126                return url + ((url.indexOf('?') < 0)?'?':'&') + 'Subject=' + sSubject;
     127        }
     128        return url;
     129}
     130
    120131function LoadSelection()
    121132{
    122133        if ( ! oImage ) return ;
     
    402413function OpenServerBrowser( type, url, width, height )
    403414{
    404415        sActualBrowser = type ;
    405         OpenFileBrowser( url, width, height ) ;
     416        OpenFileBrowser( url , width, height, sSubject ) ;
    406417}
    407418
    408419var sActualBrowser ;
  • editor/filemanager/browser/default/browser.html

     
    5454if ( sServerPath.length > 0 )
    5555        oConnector.ConnectorUrl += 'ServerPath=' + encodeURIComponent( sServerPath ) + '&' ;
    5656
     57oConnector.Subject = GetUrlParam( 'Subject' ) ;
     58
    5759oConnector.ResourceType         = GetUrlParam( 'Type' ) ;
    5860oConnector.ShowAllTypes         = ( oConnector.ResourceType.length == 0 ) ;
    5961
     
    6567        var sUrl = this.ConnectorUrl + 'Command=' + command ;
    6668        sUrl += '&Type=' + this.ResourceType ;
    6769        sUrl += '&CurrentFolder=' + encodeURIComponent( this.CurrentFolder ) ;
     70        if (this.Subject.length > 0)
     71                sUrl += '&Subject=' + this.Subject;
    6872
    6973        if ( params ) sUrl += '&' + params ;
    7074
  • editor/filemanager/browser/default/frmupload.html

     
    3232        var sUrl = oConnector.ConnectorUrl + 'Command=FileUpload' ;
    3333        sUrl += '&Type=' + resourceType ;
    3434        sUrl += '&CurrentFolder=' + encodeURIComponent( folderPath ) ;
     35        if (oConnector.Subject.length > 0)
     36                sUrl += '&Subject=' + oConnector.Subject;
    3537
    3638        document.getElementById('frmUpload').action = sUrl ;
    3739}
  • fckeditor.js

     
    2626 */
    2727
    2828// FCKeditor Class
    29 var FCKeditor = function( instanceName, width, height, toolbarSet, value )
     29var FCKeditor = function( instanceName, width, height, toolbarSet, value, connectorSubject )
    3030{
    3131        // Properties
    3232        this.InstanceName       = instanceName ;
     
    4444
    4545        // Events
    4646        this.OnError            = null ;        // function( source, errorNumber, errorDescription )
     47       
     48        this.ConnectorSubject = connectorSubject;
    4749}
    4850
    4951FCKeditor.prototype.Version                     = '2.4.2' ;
     
    126128FCKeditor.prototype._GetConfigHtml = function()
    127129{
    128130        var sConfig = '' ;
     131       
     132        if (this.ConnectorSubject) sConfig += '&amp;ConnectorSubject=' + encodeURIComponent( this.ConnectorSubject ) ;
     133       
    129134        for ( var o in this.Config )
    130135        {
    131136                if ( sConfig.length > 0 ) sConfig += '&amp;' ;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy