Development

Changeset 20350

You must first sign up to be able to contribute.

Changeset 20350

Show
Ignore:
Timestamp:
07/20/09 17:33:24 (4 years ago)
Author:
KRavEN
Message:

added json header for json responses and changed url's to have .json extension for json content

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfExtjsThemePlugin/branches/1_2/ExtjsGeneratorPlugin/lib/BaseExtjsGeneratorPluginActions.class.php

    r20224 r20350  
    4040    $result = json_encode($data); 
    4141 
    42     $this->getRequest()->setRequestFormat('json'); 
    43  
     42    //TODO: figure out why I have to do this when the route should set the sf_format from the extension 
     43    $this->getResponse()->setHttpHeader('Content-Type', 'application/json'); 
     44     
    4445    return $this->renderText($result); 
    4546  } 
     
    7778    } 
    7879    sfConfig::set('sf_web_debug', false); 
    79     $this->getRequest()->setRequestFormat('json'); 
     80    //TODO: figure out why I have to do this when the route should set the sf_format from the extension 
     81    $this->getResponse()->setHttpHeader('Content-Type', 'application/json'); 
    8082    return $this->renderText($json); 
    8183  } 
  • plugins/sfExtjsThemePlugin/branches/1_2/ExtjsGeneratorPlugin/lib/ExtjsDbFinderAdminGenerator.class.php

    r19079 r20350  
    7373        if($column->isLink()) 
    7474        { 
    75           $vars[] = '\'%%' . $matches[1][$i] . '%%\' => link_to(' . $this->getColumnListTag($column) . ', \'' . $this->getModuleName() . '/edit?' . $this->getPrimaryKeyUrlParams() . ')'; 
     75          $vars[] = '\'%%' . $matches[1][$i] . '%%\' => link_to(' . $this->getColumnListTag($column) . ', \'' . $this->getModuleName() . '/edit.json?' . $this->getPrimaryKeyUrlParams() . ')'; 
    7676        } 
    7777        elseif($column->isPartial()) 
     
    236236    ); 
    237237    $httpProxy = array( 
    238       'url' => $this->generator->controller->genUrl($this->getModuleName() . '/list'), 'method' => 'POST' 
     238      'url' => $this->generator->controller->genUrl($this->getModuleName() . '/list.json'), 'method' => 'POST' 
    239239    ); 
    240240    $options = array(); 
     
    16821682    { 
    16831683      $definition['xtype'] = 'filtertwincombobox'; 
    1684       $definition['url'] = $this->generator->controller->genUrl($this->getModuleName() . '/jsonCombo'); 
     1684      $definition['url'] = $this->generator->controller->genUrl($this->getModuleName() . '/jsonCombo.json'); 
    16851685      $definition['valueField'] = $key; 
    16861686      $definition['hiddenName'] = $key; 
     
    18051805      $relatedFKColumn = $this->getColumnForFieldName($fields[0]); 
    18061806      $ffcolumn['xtype'] = 'foreignfieldcolumn'; 
    1807       $ffcolumn['url'] = $this->generator->controller->genUrl($this->getModuleName() . '/jsonAutocomplete?class=' . $relatedTableName); 
     1807      $ffcolumn['url'] = $this->generator->controller->genUrl($this->getModuleName() . '/jsonAutocomplete.json?class=' . $relatedTableName); 
    18081808      $ffcolumn['valueField'] = $this->getRelatedFieldName($relatedTablePK); 
    18091809      $ffcolumn['displayField'] = $this->getRelatedFieldName($column); 
     
    18741874      $ffcolumn['name'] = strtolower($tableName) . '[' . $relatedTableFKs . ']';       
    18751875      $ffcolumn['xtype'] = 'comboboxautoload'; 
    1876       $ffcolumn['url'] = $this->generator->controller->genUrl($this->getModuleName() . '/jsonAutocomplete?class=' . $relatedTableName); 
     1876      $ffcolumn['url'] = $this->generator->controller->genUrl($this->getModuleName() . '/jsonAutocomplete.json?class=' . $relatedTableName); 
    18771877      $ffcolumn['valueField'] = $relatedTableFKs.$this->generator->tableDelimiter.$relatedTablePK->getName(); 
    18781878      $ffcolumn['displayField'] = $relatedTableFKs.$this->generator->tableDelimiter.$columnname;