Changeset 3269
- Timestamp:
- 01/13/07 22:16:13 (2 years ago)
- Files:
-
- trunk/lib/addon/propel/generator/sfPropelCrudGenerator.class.php (modified) (1 diff)
- trunk/lib/generator/sfAdminGenerator.class.php (modified) (1 diff)
- trunk/lib/generator/sfCrudGenerator.class.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/addon/propel/generator/sfPropelCrudGenerator.class.php
r2995 r3269 72 72 73 73 // generates a PHP call to an object helper 74 function getPHPObjectHelper($helperName, $column, $params )74 function getPHPObjectHelper($helperName, $column, $params, $localParams = array()) 75 75 { 76 $params = $this->getObjectTagParams($params, $localParams); 76 77 return sprintf ('object_%s($%s, \'%s\', %s)', $helperName, $this->getSingularName(), $this->getColumnGetter($column, false), $params); 77 78 } trunk/lib/generator/sfAdminGenerator.class.php
r3162 r3269 227 227 else 228 228 { 229 $params = $this->getObjectTagParams($params);230 231 229 return $this->getPHPObjectHelper($inputType, $column, $params); 232 230 } trunk/lib/generator/sfCrudGenerator.class.php
r3215 r3269 256 256 if ($column->isForeignKey()) 257 257 { 258 $params = $this->getObjectTagParams($params, array('related_class' => $this->getRelatedClassName($column))); 259 return $this->getPHPObjectHelper('select_tag', $column, $params); 258 return $this->getPHPObjectHelper('select_tag', $column, $params, array('related_class' => $this->getRelatedClassName($column))); 260 259 } 261 260 else if ($type == CreoleTypes::DATE) 262 261 { 263 262 // rich=false not yet implemented 264 $params = $this->getObjectTagParams($params, array('rich' => true)); 265 return $this->getPHPObjectHelper('input_date_tag', $column, $params); 263 return $this->getPHPObjectHelper('input_date_tag', $column, $params, array('rich' => true)); 266 264 } 267 265 else if ($type == CreoleTypes::TIMESTAMP) 268 266 { 269 267 // rich=false not yet implemented 270 $params = $this->getObjectTagParams($params, array('rich' => true, 'withtime' => true)); 271 return $this->getPHPObjectHelper('input_date_tag', $column, $params); 268 return $this->getPHPObjectHelper('input_date_tag', $column, $params, array('rich' => true, 'withtime' => true)); 272 269 } 273 270 else if ($type == CreoleTypes::BOOLEAN) 274 271 { 275 $params = $this->getObjectTagParams($params);276 272 return $this->getPHPObjectHelper('checkbox_tag', $column, $params); 277 273 } … … 279 275 { 280 276 $size = ($column->getSize() > 20 ? ($column->getSize() < 80 ? $column->getSize() : 80) : 20); 281 $params = $this->getObjectTagParams($params, array('size' => $size)); 282 return $this->getPHPObjectHelper('input_tag', $column, $params); 277 return $this->getPHPObjectHelper('input_tag', $column, $params, array('size' => $size)); 283 278 } 284 279 else if ($type == CreoleTypes::INTEGER || $type == CreoleTypes::TINYINT || $type == CreoleTypes::SMALLINT || $type == CreoleTypes::BIGINT) 285 280 { 286 $params = $this->getObjectTagParams($params, array('size' => 7)); 287 return $this->getPHPObjectHelper('input_tag', $column, $params); 281 return $this->getPHPObjectHelper('input_tag', $column, $params, array('size' => 7)); 288 282 } 289 283 else if ($type == CreoleTypes::FLOAT || $type == CreoleTypes::DOUBLE || $type == CreoleTypes::DECIMAL || $type == CreoleTypes::NUMERIC || $type == CreoleTypes::REAL) 290 284 { 291 $params = $this->getObjectTagParams($params, array('size' => 7)); 292 return $this->getPHPObjectHelper('input_tag', $column, $params); 285 return $this->getPHPObjectHelper('input_tag', $column, $params, array('size' => 7)); 293 286 } 294 287 else if ($type == CreoleTypes::TEXT || $type == CreoleTypes::LONGVARCHAR) 295 288 { 296 $params = $this->getObjectTagParams($params, array('size' => '30x3')); 297 return $this->getPHPObjectHelper('textarea_tag', $column, $params); 289 return $this->getPHPObjectHelper('textarea_tag', $column, $params, array('size' => '30x3')); 298 290 } 299 291 else 300 292 { 301 $params = $this->getObjectTagParams($params, array('disabled' => true)); 302 return $this->getPHPObjectHelper('input_tag', $column, $params); 293 return $this->getPHPObjectHelper('input_tag', $column, $params, array('disabled' => true)); 303 294 } 304 295 } … … 310 301 311 302 // generates a PHP call to an object helper 312 abstract function getPHPObjectHelper($helperName, $column, $params );303 abstract function getPHPObjectHelper($helperName, $column, $params, $localParams = array()); 313 304 314 305 // returns the getter either non-developped: 'getFoo'