Changeset 11173
- Timestamp:
- 08/26/08 22:41:28 (5 years ago)
- Files:
-
- branches/1.2/lib/generator/sfAdminGenerator.class.php (modified) (9 diffs)
- branches/1.2/lib/generator/sfCrudGenerator.class.php (modified) (3 diffs)
- branches/1.2/lib/i18n/sfMessageSource.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.2/lib/generator/sfAdminGenerator.class.php
r9862 r11173 283 283 284 284 // default parameter values 285 $type = $column->get CreoleType();286 if ($type == CreoleTypes::DATE)285 $type = $column->getType(); 286 if ($type == PropelColumnTypes::DATE) 287 287 { 288 288 $params = array_merge(array('rich' => true, 'calendar_button_img' => sfConfig::get('sf_admin_web_dir').'/images/date.png'), $params); 289 289 } 290 else if ($type == CreoleTypes::TIMESTAMP)290 else if ($type == PropelColumnTypes::TIMESTAMP) 291 291 { 292 292 $params = array_merge(array('rich' => true, 'withtime' => true, 'calendar_button_img' => sfConfig::get('sf_admin_web_dir').'/images/date.png'), $params); … … 600 600 $params = $user_params ? array_merge($params, $user_params) : $params; 601 601 602 $type = $column->get CreoleType();602 $type = $column->getType(); 603 603 604 604 $columnGetter = $this->getColumnGetter($column, true); … … 612 612 return "get_partial('".$column->getName()."', array('type' => 'list', '{$this->getSingularName()}' => \${$this->getSingularName()}))"; 613 613 } 614 else if ($type == CreoleTypes::DATE || $type == CreoleTypes::TIMESTAMP)615 { 616 $format = isset($params['date_format']) ? $params['date_format'] : ($type == CreoleTypes::DATE ? 'D' : 'f');614 else if ($type == PropelColumnTypes::DATE || $type == PropelColumnTypes::TIMESTAMP) 615 { 616 $format = isset($params['date_format']) ? $params['date_format'] : ($type == PropelColumnTypes::DATE ? 'D' : 'f'); 617 617 return "($columnGetter !== null && $columnGetter !== '') ? format_date($columnGetter, \"$format\") : ''"; 618 618 } 619 elseif ($type == CreoleTypes::BOOLEAN)619 elseif ($type == PropelColumnTypes::BOOLEAN) 620 620 { 621 621 return "$columnGetter ? image_tag(sfConfig::get('sf_admin_web_dir').'/images/tick.png') : ' '"; … … 650 650 } 651 651 652 $type = $column->get CreoleType();652 $type = $column->getType(); 653 653 654 654 $default_value = "isset(\$filters['".$column->getName()."']) ? \$filters['".$column->getName()."'] : null"; … … 662 662 663 663 } 664 else if ($type == CreoleTypes::DATE)664 else if ($type == PropelColumnTypes::DATE) 665 665 { 666 666 // rich=false not yet implemented … … 668 668 return "input_date_range_tag($name, $default_value, $params)"; 669 669 } 670 else if ($type == CreoleTypes::TIMESTAMP)670 else if ($type == PropelColumnTypes::TIMESTAMP) 671 671 { 672 672 // rich=false not yet implemented … … 674 674 return "input_date_range_tag($name, $default_value, $params)"; 675 675 } 676 else if ($type == CreoleTypes::BOOLEAN)676 else if ($type == PropelColumnTypes::BOOLEAN) 677 677 { 678 678 $defaultIncludeCustom = '__("yes or no")'; … … 688 688 return "select_tag($name, $options, $params)"; 689 689 } 690 else if ($type == CreoleTypes::CHAR || $type == CreoleTypes::VARCHAR || $type == CreoleTypes::TEXT || $type == CreoleTypes::LONGVARCHAR)690 else if ($type == PropelColumnTypes::CHAR || $type == PropelColumnTypes::VARCHAR || $type == PropelColumnTypes::LONGVARCHAR) 691 691 { 692 692 $size = ($column->getSize() < 15 ? $column->getSize() : 15); … … 694 694 return "input_tag($name, $default_value, $params)"; 695 695 } 696 else if ($type == CreoleTypes::INTEGER || $type == CreoleTypes::TINYINT || $type == CreoleTypes::SMALLINT || $type == CreoleTypes::BIGINT)696 else if ($type == PropelColumnTypes::INTEGER || $type == PropelColumnTypes::TINYINT || $type == PropelColumnTypes::SMALLINT || $type == PropelColumnTypes::BIGINT) 697 697 { 698 698 $params = $this->getObjectTagParams($params, array('size' => 7)); 699 699 return "input_tag($name, $default_value, $params)"; 700 700 } 701 else if ($type == CreoleTypes::FLOAT || $type == CreoleTypes::DOUBLE || $type == CreoleTypes::DECIMAL || $type == CreoleTypes::NUMERIC || $type == CreoleTypes::REAL)701 else if ($type == PropelColumnTypes::FLOAT || $type == PropelColumnTypes::DOUBLE || $type == PropelColumnTypes::DECIMAL || $type == PropelColumnTypes::NUMERIC || $type == PropelColumnTypes::REAL) 702 702 { 703 703 $params = $this->getObjectTagParams($params, array('size' => 7)); branches/1.2/lib/generator/sfCrudGenerator.class.php
r9123 r11173 328 328 public function getColumnListTag($column, $params = array()) 329 329 { 330 $type = $column->get CreoleType();330 $type = $column->getType(); 331 331 332 332 $columnGetter = $this->getColumnGetter($column, true); 333 333 334 if ($type == CreoleTypes::TIMESTAMP)334 if ($type == PropelColumnTypes::TIMESTAMP) 335 335 { 336 336 return "format_date($columnGetter, 'f')"; 337 337 } 338 elseif ($type == CreoleTypes::DATE)338 elseif ($type == PropelColumnTypes::DATE) 339 339 { 340 340 return "format_date($columnGetter, 'D')"; … … 356 356 public function getCrudColumnEditTag($column, $params = array()) 357 357 { 358 $type = $column->get CreoleType();358 $type = $column->getType(); 359 359 360 360 if ($column->isForeignKey()) … … 367 367 return $this->getPHPObjectHelper('select_tag', $column, $params, array('related_class' => $this->getRelatedClassName($column))); 368 368 } 369 else if ($type == CreoleTypes::DATE)369 else if ($type == PropelColumnTypes::DATE) 370 370 { 371 371 // rich=false not yet implemented 372 372 return $this->getPHPObjectHelper('input_date_tag', $column, $params, array('rich' => true)); 373 373 } 374 else if ($type == CreoleTypes::TIMESTAMP)374 else if ($type == PropelColumnTypes::TIMESTAMP) 375 375 { 376 376 // rich=false not yet implemented 377 377 return $this->getPHPObjectHelper('input_date_tag', $column, $params, array('rich' => true, 'withtime' => true)); 378 378 } 379 else if ($type == CreoleTypes::BOOLEAN)379 else if ($type == PropelColumnTypes::BOOLEAN) 380 380 { 381 381 return $this->getPHPObjectHelper('checkbox_tag', $column, $params); 382 382 } 383 else if ($type == CreoleTypes::CHAR || $type == CreoleTypes::VARCHAR)383 else if ($type == PropelColumnTypes::CHAR || $type == PropelColumnTypes::VARCHAR) 384 384 { 385 385 $size = ($column->getSize() > 20 ? ($column->getSize() < 80 ? $column->getSize() : 80) : 20); 386 386 return $this->getPHPObjectHelper('input_tag', $column, $params, array('size' => $size)); 387 387 } 388 else if ($type == CreoleTypes::INTEGER || $type == CreoleTypes::TINYINT || $type == CreoleTypes::SMALLINT || $type == CreoleTypes::BIGINT)388 else if ($type == PropelColumnTypes::INTEGER || $type == PropelColumnTypes::TINYINT || $type == PropelColumnTypes::SMALLINT || $type == PropelColumnTypes::BIGINT) 389 389 { 390 390 return $this->getPHPObjectHelper('input_tag', $column, $params, array('size' => 7)); 391 391 } 392 else if ($type == CreoleTypes::FLOAT || $type == CreoleTypes::DOUBLE || $type == CreoleTypes::DECIMAL || $type == CreoleTypes::NUMERIC || $type == CreoleTypes::REAL)392 else if ($type == PropelColumnTypes::FLOAT || $type == PropelColumnTypes::DOUBLE || $type == PropelColumnTypes::DECIMAL || $type == PropelColumnTypes::NUMERIC || $type == PropelColumnTypes::REAL) 393 393 { 394 394 return $this->getPHPObjectHelper('input_tag', $column, $params, array('size' => 7)); 395 395 } 396 else if ($type == CreoleTypes::TEXT || $type == CreoleTypes::LONGVARCHAR)396 else if ($type == PropelColumnTypes::LONGVARCHAR) 397 397 { 398 398 return $this->getPHPObjectHelper('textarea_tag', $column, $params, array('size' => '30x3')); branches/1.2/lib/i18n/sfMessageSource.class.php
r9128 r11173 102 102 * Factory method to instantiate a new sfMessageSource depending on the 103 103 * source type. The built-in source types are 'XLIFF', 'SQLite', 104 * 'MySQL', 'gettext', 'Creole'and 'Aggregate'.104 * 'MySQL', 'gettext', and 'Aggregate'. 105 105 * The source parameter is dependent on the source type. 106 106 * For 'gettext' and 'XLIFF', it should point to the directory