field.combine.php
Комбинированное поле
Вызывается из:
Смотрите описание Cms\Root\Form\Field\Combine
Исходный код
<?php
if ($Field->hidden) {
return include('cms/html/input.hidden.php');
}
$attributes = $Field->getFieldAttributes(array(
'grid-margin' => $Field->getFieldMargin(),
'grid-width' => $Field->getFieldWidth(),
'class' => 'field',
'id' => $Field->id('-field'),
));
print '<div';
foreach ($attributes as $attributeName => $attributeValue) if ($attributeValue !== null) print ' ' . $attributeName . '="' . $attributeValue . '"';
print '>';
if ($Field->hasLabel()) {
print "\n";
$attributes = $Field->getLabelAttributes(array(
'grid-margin' => $Field->getLabelMargin(),
'grid-width' => $Field->getLabelWidth(),
'for' => !in_array($Field->type, array('multiple', 'radio')) ? $Field->id('-input') : null,
'class' => 'field-label',
));
print '<label';
foreach ($attributes as $attributeName => $attributeValue) if ($attributeValue !== null) print ' ' . $attributeName . '="' . $attributeValue . '"';
print '>';
if (strval($Field->label) !== '') {
print '<span class="label-text">' . $Field->label . ':</span> ';
if ($Field->required && $Field->getAttribute('asterisk') !== 'N') {
print '<span class="required">*</span>';
}
}
if (strval($Field->info) !== '') {
print '<br><span class="label-info">' . $Field->info . '</span>';
}
print '</label>';
print "\n";
}
print $Field->displayInput();
print "\n";
print '</div>';
?>