Replacing labelTag with new label().

Merged changes to bake.php


git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3305 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-07-27 16:52:36 +00:00
parent 1dc6c1128b
commit 5549ddfd75
2 changed files with 9 additions and 9 deletions

View file

@ -200,7 +200,7 @@ class FormHelper extends Helper {
$htmlAttributes = $htmlOptions; $htmlAttributes = $htmlOptions;
$htmlAttributes['size'] = $size; $htmlAttributes['size'] = $size;
$str = $this->Html->input($tagName, $htmlAttributes); $str = $this->Html->input($tagName, $htmlAttributes);
$strLabel = $this->labelTag($tagName, $prompt); $strLabel = $this->label($tagName, $prompt);
$divClass = "optional"; $divClass = "optional";
if ($required) { if ($required) {
$divClass = "required"; $divClass = "required";
@ -228,7 +228,7 @@ class FormHelper extends Helper {
$htmlOptions['class'] = "inputCheckbox"; $htmlOptions['class'] = "inputCheckbox";
$htmlOptions['id'] = strtolower(str_replace('/', '_', $tagName)); $htmlOptions['id'] = strtolower(str_replace('/', '_', $tagName));
$str = $this->Html->checkbox($tagName, null, $htmlOptions); $str = $this->Html->checkbox($tagName, null, $htmlOptions);
$strLabel = $this->labelTag($tagName, $prompt); $strLabel = $this->label($tagName, $prompt);
$divClass = "optional"; $divClass = "optional";
if ($required) { if ($required) {
$divClass = "required"; $divClass = "required";
@ -257,7 +257,7 @@ class FormHelper extends Helper {
function generateDate($tagName, $prompt, $required = false, $errorMsg = null, $size = 20, $htmlOptions = null, $selected = null) { function generateDate($tagName, $prompt, $required = false, $errorMsg = null, $size = 20, $htmlOptions = null, $selected = null) {
$htmlOptions['id']=strtolower(str_replace('/', '_', $tagName)); $htmlOptions['id']=strtolower(str_replace('/', '_', $tagName));
$str = $this->Html->dateTimeOptionTag($tagName, 'MDY', 'NONE', $selected, $htmlOptions); $str = $this->Html->dateTimeOptionTag($tagName, 'MDY', 'NONE', $selected, $htmlOptions);
$strLabel = $this->labelTag($tagName, $prompt); $strLabel = $this->label($tagName, $prompt);
$divClass = "optional"; $divClass = "optional";
if ($required) { if ($required) {
$divClass = "required"; $divClass = "required";
@ -288,7 +288,7 @@ class FormHelper extends Helper {
function generateDateTime($tagName, $prompt, $required = false, $errorMsg = null, $size = 20, $htmlOptions = null, $selected = null) { function generateDateTime($tagName, $prompt, $required = false, $errorMsg = null, $size = 20, $htmlOptions = null, $selected = null) {
$htmlOptions['id']=strtolower(str_replace('/', '_', $tagName)); $htmlOptions['id']=strtolower(str_replace('/', '_', $tagName));
$str = $this->Html->dateTimeOptionTag($tagName, 'MDY', '12', $selected, $htmlOptions); $str = $this->Html->dateTimeOptionTag($tagName, 'MDY', '12', $selected, $htmlOptions);
$strLabel = $this->labelTag($tagName, $prompt); $strLabel = $this->label($tagName, $prompt);
$divClass = "optional"; $divClass = "optional";
if ($required) { if ($required) {
$divClass = "required"; $divClass = "required";
@ -321,7 +321,7 @@ class FormHelper extends Helper {
$htmlAttributes['cols'] = $cols; $htmlAttributes['cols'] = $cols;
$htmlAttributes['rows'] = $rows; $htmlAttributes['rows'] = $rows;
$str = $this->Html->textarea($tagName, $htmlAttributes); $str = $this->Html->textarea($tagName, $htmlAttributes);
$strLabel = $this->labelTag($tagName, $prompt); $strLabel = $this->label($tagName, $prompt);
$divClass = "optional"; $divClass = "optional";
if ($required) { if ($required) {
@ -352,7 +352,7 @@ class FormHelper extends Helper {
function generateSelectDiv($tagName, $prompt, $options, $selected = null, $selectAttr = null, $optionAttr = null, $required = false, $errorMsg = null) { function generateSelectDiv($tagName, $prompt, $options, $selected = null, $selectAttr = null, $optionAttr = null, $required = false, $errorMsg = null) {
$selectAttr['id'] = strtolower(str_replace('/', '_', $tagName)); $selectAttr['id'] = strtolower(str_replace('/', '_', $tagName));
$str = $this->Html->selectTag($tagName, $options, $selected, $selectAttr, $optionAttr); $str = $this->Html->selectTag($tagName, $options, $selected, $selectAttr, $optionAttr);
$strLabel = $this->labelTag($tagName, $prompt); $strLabel = $this->label($tagName, $prompt);
$divClass = "optional"; $divClass = "optional";
if ($required) { if ($required) {

View file

@ -704,7 +704,7 @@ class Bake {
$relations = array_merge($objModel->hasMany, $objModel->hasAndBelongsToMany); $relations = array_merge($objModel->hasMany, $objModel->hasAndBelongsToMany);
foreach($relations as $association => $relation) { foreach($relations as $association => $relation) {
$model = $relation['className']; $model = $relation['className'];
$associationModel = new $model(); $associationModel = new $model();
$count = 0; $count = 0;
$otherModelName = $inflect->singularize($model); $otherModelName = $inflect->singularize($model);
@ -994,7 +994,7 @@ class Bake {
$actions .= "\t\t}\n"; $actions .= "\t\t}\n";
$actions .= "\t}\n"; $actions .= "\t}\n";
$actions .= "\n"; $actions .= "\n";
$actions .= "\tfunction view(\$id) {\n"; $actions .= "\tfunction view(\$id) {\n";
$actions .= "\t\t\$this->set('{$this->lowCtrl}', \$this->{$controllerModel}->read(null, \$id));\n"; $actions .= "\t\t\$this->set('{$this->lowCtrl}', \$this->{$controllerModel}->read(null, \$id));\n";
$actions .= "\t}\n"; $actions .= "\t}\n";
$actions .= "\n"; $actions .= "\n";
@ -1501,7 +1501,7 @@ class Bake {
} }
switch( $field['type'] ) { switch( $field['type'] ) {
case "input" : case "input" :
if(!isset( $field['size'])) { if(!isset( $field['size'])) {
$field['size'] = 60; $field['size'] = 60;
} }