Changeset 57058

Show
Ignore:
Timestamp:
29/06/08 14:26:54 (2 months ago)
Author:
ischommer
Message:

BUGFIX Fixed HTMLEditorField and TreeSelectorField? to work with new URL handling (callfieldmethod-syntax is deprecated)
API CHANGE Replacing forward slashes in Form->FormName?() to comply with new URL handling syntax

Location:
modules/sapphire/branches/roa
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • modules/sapphire/branches/roa/forms/Form.php

    r55910 r57058  
    458458        function FormName() { 
    459459                if($this->htmlID) return $this->htmlID; 
    460                 else return $this->class . '_' . str_replace('.','',$this->name); 
     460                else return $this->class . '_' . str_replace(array('.','/'),'',$this->name); 
    461461        } 
    462462 
  • modules/sapphire/branches/roa/forms/HtmlEditorField.php

    r50783 r57058  
    263263 * @subpackage fields-formattedinput 
    264264 */ 
    265 class HtmlEditorField_Toolbar extends ViewableData { 
     265class HtmlEditorField_Toolbar extends RequestHandlingData { 
    266266        protected $controller, $name; 
    267267         
     
    354354                $form = new Form( 
    355355                        $this->controller, 
    356                         "{$this->name}.LinkForm",  
     356                        "{$this->name}/LinkForm",  
    357357                        new FieldSet( 
    358358                                new LiteralField('Heading', '<h2><img src="cms/images/closeicon.gif" alt="'._t('HtmlEditorField.CLOSE', 'close').'" title="'._t('HtmlEditorField.CLOSE', 'close').'" />'._t('HtmlEditorField.LINK', 'Link').'</h2>'), 
     
    386386                $form = new Form( 
    387387                        $this->controller, 
    388                         "{$this->name}.ImageForm",  
     388                        "{$this->name}/ImageForm",  
    389389                        new FieldSet( 
    390390                                new LiteralField('Heading', '<h2><img src="cms/images/closeicon.gif" alt="'._t('HtmlEditorField.CLOSE', 'close').'" title="'._t('HtmlEditorField.CLOSE', 'close').'" />'._t('HtmlEditorField.IMAGE', 'Image').'</h2>'), 
     
    426426                $form = new Form( 
    427427                        $this->controller, 
    428                         "{$this->name}.FlashForm",  
     428                        "{$this->name}/FlashForm",  
    429429                        new FieldSet( 
    430430                                new LiteralField('Heading', '<h2><img src="cms/images/closeicon.gif" alt="'._t('HtmlEditorField.CLOSE', 'close').'" title="'._t('HtmlEditorField.CLOSE', 'close').'" />'._t('HtmlEditorField.FLASH', 'Flash').'</h2>'), 
  • modules/sapphire/branches/roa/javascript/FieldEditor.js

    r44200 r57058  
    496496 
    497497                        urlForFieldMethod: function(methodName) { 
    498                                 return this.ownerForm().action + '&action_callfieldmethod=1&fieldName=' + 'Fields' + '&ajax=1&methodName=' + methodName + '&NewID=' + this.numNewFields;  
     498                                return this.ownerForm().action + '/field/Fields/' + methodName + '?NewID=' + this.numNewFields;  
    499499                        }, 
    500500                        ownerForm: function() { 
  • modules/sapphire/branches/roa/javascript/TreeSelectorField.js

    r43883 r57058  
    3737         
    3838        helperURLBase: function() { 
    39                 return this.ownerForm().action + '&action_callfieldmethod=1&fieldName=' + this.inputTag.name + '&ajax=1' + ($('SecurityID') ? '&SecurityID=' + $('SecurityID').value : ''); 
     39                return this.ownerForm().action + '/field/' + this.inputTag.name + '/'; 
    4040        }, 
    4141        ownerForm: function() { 
     
    130130         
    131131        ajaxGetTree: function(after) { 
    132                 var ajaxURL = this.helperURLBase() + '&methodName=gettree&forceValues=' + this.inputTag.value; 
     132                var ajaxURL = this.helperURLBase() + 'gettree?forceValues=' + this.inputTag.value; 
     133                ajaxURL += $('SecurityID') ? '&SecurityID=' + $('SecurityID').value : ''; 
    133134                new Ajax.Request(ajaxURL, { 
    134135                        method : 'get',  
     
    175176                ul.innerHTML = 'loading...'; 
    176177                 
    177                 new Ajax.Request(this.options.dropdownField.helperURLBase() + '&methodName=getsubtree&SubtreeRootID=' + this.getIdx(), { 
     178                var ajaxURL = this.options.dropdownField.helperURLBase() + 'getsubtree?&SubtreeRootID=' + this.getIdx(); 
     179                ajaxURL += $('SecurityID') ? '&SecurityID=' + $('SecurityID').value : ''; 
     180                 
     181                new Ajax.Request(ajaxURL, { 
    178182                        onSuccess : this.installSubtree.bind(this), 
    179183                        onFailure : function(response) { errorMessage('error loading subtree', response); }