include_partial('documents/language_field', array('document' => $document, 'new_document' => $new_document)); echo object_group_tag($document, 'name', array('class' => 'long_input')); echo form_section_title('Information', 'form_info', 'preview_info'); echo object_group_tag($document, 'elevation', array('suffix' => 'meters', 'class' => 'short_input', 'type' => 'number', 'min' => '0', 'max' => '8900')); echo object_group_tag($document, 'lowest_elevation', array('suffix' => 'meters', 'class' => 'short_input', 'type' => 'number', 'min' => '0', 'max' => '8900')); include_partial('documents/oam_coords', array('document' => $document)); echo object_group_dropdown_tag($document, 'public_transportation_rating', 'app_parkings_public_transportation_ratings', array('onchange' => 'C2C.hide_parkings_unrelated_fields()')); ?> <div id="tp_types"> <?php // special handling for public_transportation_types. Cablecar (9) should be presented separately echo object_group_dropdown_tag($document, 'public_transportation_types', 'app_parkings_public_transportation_types', array('multiple' => true, 'na' => array('cable_car' => 9))); ?> </div> <?php echo start_group_tag(), label_tag('cable_car_access'), ' <span>', checkbox_tag('public_transportation_types[]', 9, in_array(9, $document->getRaw('public_transportation_types')), array('id' => 'cable_car_access')), '</span>', end_group_tag(); echo object_group_dropdown_tag($document, 'snow_clearance_rating', 'mod_parkings_snow_clearance_ratings_list', array('onchange' => 'C2C.hide_parkings_unrelated_fields()')); echo form_section_title('Description', 'form_desc', 'preview_desc'); echo object_group_bbcode_tag($document, 'description', __('road access')); ?> <div id="tp_desc"> <?php echo object_group_bbcode_tag($document, 'public_transportation_description', null, array('placeholder' => __('public_transportation_description_default'))); ?> </div> <div id="snow_desc"> <?php echo object_group_tag($document, 'snow_clearance_comment', array('callback' => 'object_textarea_tag', 'class' => 'smalltext')); ?> </div> <?php
<?php use_helper('Object', 'Language'); ?> <?php echo start_group_tag(); ?> <?php echo label_tag('culture', 'lang'); ?> <?php if ($new_document) { echo select_language_c2c_tag(); } else { echo format_language_c2c($document->getCulture()) . ' (' . link_to(__('choose an other language'), '@document_by_id_lang?module=' . $sf_context->getModuleName() . '&id=' . $sf_params->get('id') . '&lang=' . $sf_params->get('lang')) . ')' . '<input type="text" name="culture" id="culture" style="display: none;"/>'; // last line is useful to prevent an XHTML validation error (lacking 'culture' id field). } ?> <?php echo end_group_tag();
function object_datetime_tag($document, $fieldname) { $date = $document->get('date_time'); if ($date == null) { $date = ''; } $out = start_group_tag(); $out .= label_tag($fieldname, ''); $out .= form_error($fieldname) . ' <div style="display:inline">' . select_datetime_tag('date_time', $date, array('include_second' => true, 'include_blank' => true, 'year_start' => date('Y'), 'year_end' => sfConfig::get('app_date_year_min'))) . '</div>'; $out .= end_group_tag(); return $out; }