Changeset 5728
- Timestamp:
- 10/29/07 00:41:12 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_json_list_td.php
r5717 r5728 7 7 $pk = $pks[0]->getPhpName(); 8 8 9 //iterate through all columns of all class 10 $completeColumns= $this->getColumnsGroup($pk); 9 11 10 12 $hs = $this->getParameterValue('list.hide', array()); … … 37 39 else 38 40 { 39 $value = $this->getColumnListTag($column); 41 // set value 42 if (false !== strpos($column->getName(), '/')) 43 { 44 list($relatedClassName, $relatedColumn) = explode('/', $column->getName()); 45 $value = $this->getColumnListTag($completeColumns['related'][$relatedClassName]['pk']); 46 } 47 else 48 { 49 $value = $this->getColumnListTag($column); 50 } 40 51 } 41 echo "\"".$column->getName()."\": \"[?php echo str_replace('\"', '\\\"', ".$value.") ?]\""; 52 53 //set name 54 if (false !== strpos($column->getName(), '/')) 55 { 56 list($relatedClassName, $relatedColumn) = explode('/', $column->getName()); 57 $name = $completeColumns['related'][$relatedClassName]['pk']->getName(); 58 } 59 else 60 { 61 $name = $column->getName(); 62 } 63 64 echo "\"".$name."\": \"[?php echo str_replace('\"', '\\\"', ".$value.") ?]\""; 42 65 43 66 $i++; plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_layout.php
r5717 r5728 32 32 $pk = $pks[0]->getPhpName(); 33 33 $pkn = $this->getAdminColumnForField($pk)->getName(); 34 $prefix = "" ;34 $prefix = ""; 35 35 36 36 $columns['pk'] = $this->getAdminColumnForField($pk); … … 71 71 // create the Data Store 72 72 <?php 73 // TODO: parts of this should be moved to the actions.class one day 73 74 $store = ''; 74 75 $jsCode = ''; … … 77 78 $i = 1; $listDisplay = array(); 78 79 80 // Alwasy add primary key 79 81 $listDisplay[0] = array('name' => $prefix.$columns['pk']->getName(), 80 82 'mapping' => $prefix.$columns['pk']->getName(), … … 90 92 $i++; 91 93 92 foreach ($relatedClasses['columns'] as $relatedColumn => $col) 93 { 94 $listDisplay[$i] = array('name' => $class.'/'.$relatedColumn, 95 'mapping' => $class.'/'.$relatedColumn, 96 'type' => extjs_convert_propel_type($col->getType())); 97 $i++; 98 } 94 // TODO: enable this when it is implemented in the JSON-output! NICE!!! 95 // foreach ($relatedClasses['columns'] as $relatedColumn => $col) 96 // { 97 // $listDisplay[$i] = array('name' => $class.'/'.$relatedColumn, 98 // 'mapping' => $class.'/'.$relatedColumn, 99 // 'type' => extjs_convert_propel_type($col->getType())); 100 // $i++; 101 // } 99 102 } 100 103 } … … 192 195 $listDisplay = array(array('name' => $pk, 'mapping' => $pk), 193 196 array('name' => $relatedColumn, 'mapping' => $relatedColumn)); 194 $options = array('id' => $ column->getName(),197 $options = array('id' => $pk, 195 198 'root' => 'data', 196 199 'totalProperty' => 'totalCount'); … … 291 294 // http://extjs.com/forum/showthread.php?t=13268 292 295 if (value) { 293 return <?= strtolower($relatedClassName) ?>_ds.getById(value).get('name'); 296 <?php 297 //set name 298 if (false !== strpos($column->getName(), '/')) 299 { 300 $name = $relatedColumn; 301 } 302 else 303 { 304 $name = $column->getName(); 305 } 306 ?> 307 return <?php echo strtolower($relatedClassName) ?>_ds.getById(value).get('<?php echo $name ?>'); 294 308 } 295 309 } … … 317 331 $header = str_replace("'", "\\'", $this->getParameterValue('list.fields.'.$column->getName().'.name')); 318 332 list($header) = explode('/', $header); 319 $dataIndex = $column->getName(); 333 334 if (false !== strpos($column->getName(), '/')) 335 { 336 list($relatedClassName, $relatedColumn) = explode('/', $column->getName()); 337 $dataIndex = $completeColumns['related'][$relatedClassName]['pk']->getName(); 338 } 339 else 340 { 341 $dataIndex = $column->getName(); 342 } 343 320 344 ?> 321 345 <?php