<?php use_helper('Object', 'Language', 'Validation', 'MyForm'); $creator = $document->getCreator(); // do not allow to modify the article type: // * only moderators have all right // * the creator can switch from personal to collaborative // * other users cannot $hide_article_type_edit = !$new_document && (!$sf_user->hasCredential('moderator') && $document->get('article_type') == 1 || !$sf_user->hasCredential('moderator') && $sf_user->getId() != $creator['id']); $hidden_fields = array(); echo '<div>'; if ($hide_article_type_edit) { array_push($hidden_fields, 'article_type'); } display_document_edit_hidden_tags($document, $hidden_fields); echo '</div>'; echo mandatory_fields_warning(array('article form warning')); 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_dropdown_tag($document, 'categories', 'mod_articles_categories_list', array('multiple' => true)); echo object_group_dropdown_tag($document, 'activities', 'app_activities_list', array('multiple' => true), false, null, null, '', '', 'picto_act act_'); if (!$hide_article_type_edit) { echo object_group_dropdown_tag($document, 'article_type', 'mod_articles_article_types_list'); } echo form_section_title('Description', 'form_desc', 'preview_desc'); echo object_group_bbcode_tag($document, 'abstract', null, array('no_img' => true, 'class' => 'smalltext')); echo object_group_bbcode_tag($document, 'description', __('article body'), array('class' => 'largetext')); include_partial('documents/form_history');
<?php use_helper('Object', 'Language', 'Validation', 'MyForm'); // Here document = map echo '<div>'; display_document_edit_hidden_tags($document); echo '</div>'; echo mandatory_fields_warning(); 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_dropdown_tag($document, 'editor', 'mod_maps_editors_list'); echo object_group_dropdown_tag($document, 'scale', 'mod_maps_scales_list'); echo object_group_tag($document, 'code', array('class' => 'long_input')); echo form_section_title('Description', 'form_desc', 'preview_desc'); echo object_group_bbcode_tag($document, 'description', null, array('class' => 'mediumtext', 'abstract' => true)); include_partial('documents/form_history');
// shunt for mw contest $response = sfContext::getInstance()->getResponse(); $response->addJavascript('/static/js/outings_edit.js', 'last'); if ($mw_contest_enabled) { $response->addJavascript('/static/js/mw.js', 'last'); } echo javascript_queue("C2C.confirm_outing_date_message = '" . addslashes(__('Has this outing really been done today?')) . "';\nC2C.confirm_outing_activities_message = '" . addslashes(__('Is really a multi-activity outing?')) . "';\nC2C.alert_outing_paragliding_message = '" . addslashes(__('paragliding can not be selected alone')) . "';\nC2C.confirm_snow_elevation_message = '" . addslashes(__('Snow elevation is correct?')) . "';"); // Here document = outing $link_with = $linked_doc ? $linked_doc->get('id') : 0; echo '<div>'; echo input_hidden_tag('document_id', $link_with); if ($new_document == false && $mw_contest_enabled == true) { echo javascript_queue('C2C.mw_contest_article_id=' . sfConfig::get('app_mw_contest_id')); // for use with MW contest } display_document_edit_hidden_tags($document, array('v4_id', 'v4_app')); echo '</div>'; echo mandatory_fields_warning(array('outing form warning')); 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, 'date', array('callback' => 'object_input_date_tag', 'year_start' => date('Y'), 'year_end' => sfConfig::get('app_date_year_min'))); ?> <div class="article_gauche_5050"> <?php echo object_group_dropdown_tag($document, 'activities', 'app_activities_list', array('multiple' => true, 'na' => array(0)), true, null, null, '', '', 'picto_act act_'); ?> </div> <div class="article_droite_5050"> <?php echo __('select activities according to outing');