function c2c_auto_complete($module, $update_hidden, $options) { $field_prefix = isset($options['field_prefix']) ? $options['field_prefix'] : ''; $display_button = _option($options, 'display_button', true); // updated field name can be customized so that there is no interference // between different autocomplete forms by using field_prefix $field = $field_prefix . '_' . $module . '_name'; $out = c2c_input_auto_complete($module, $update_hidden, $options); $out .= $display_button ? c2c_submit_tag(__('Link'), array('class' => 'samesize', 'onclick' => "\$('#{$field}').val('');", 'picto' => 'action_create')) : ''; return $out; }
<ul> <li><?php echo label_for('edit_topo_name', __('topoName_desc'), array('class' => 'fieldname', 'id' => '_topo_name')) . ' ' . input_tag('edit_topo_name', $user_private_data->get('topo_name'), array('class' => 'medium_input')); ?> </li> <li><?php echo label_for('edit_nickname', __('nickName_desc'), array('class' => 'fieldname', 'id' => '_nick_name')) . ' ' . input_tag('edit_nickname', $user_private_data->get('username'), array('class' => 'medium_input')); ?> </li> <li><?php echo label_for('login_name', __('LoginName_desc'), array('class' => 'fieldname', 'id' => '_login_name')) . '<strong>' . $user_private_data->getLoginName() . '</strong>'; ?> </li> </ul> <?php echo end_fieldset_tag(); echo fieldset_tag('Manage your profile page'); echo object_group_tag($user_private_data, 'is_profile_public', array('callback' => 'object_checkbox_tag')); echo end_fieldset_tag(); ?> <ul class="action_buttons"> <li><?php echo c2c_submit_tag(__('Save'), array('picto' => 'action_create')); ?> </li> </ul> </div> </div> </form>
<?php echo __('Show the route'); ?> </a> </p> <!-- wizard_route_descr --> <p class="wizard_tip"><?php echo __('No route matching your search?') . ' '; ?> <a href="#" onclick="window.location.href='/routes/edit/link/' + $('#summit_id').val(); return false;"><?php echo __('Add your route'); ?> </a></p> </div> <div id="last_ok" style="display: none;"> <hr /> <h4><?php echo __('Step 3: confirm to create outing'); ?> </h4> <?php echo form_tag('outings/edit', 'method=get'); echo input_hidden_tag('link', '0'); echo c2c_submit_tag(__('New outing'), array('onclick' => 'if ($("#wizard_type") == "summits") $("#link").val($("#routes").val());', 'title' => __('Add your outing'), 'picto' => 'action_create')); ?> </form> </div> <!-- last_ok --> </div> <!-- outing_wizard -->
$elevation_options[$key] = $value . ' (' . str_replace('~', $replace, $elevation_ranges[$key]) . $meters . ')'; } } echo filter_field('cda_elevation', select_tag('elevation', options_for_select($elevation_options))); ?> <br /> <?php if ($lang == 'fr') { ?> <input type="image" value="<?php echo __('Search on c2c'); ?> " name="commit" src="/static/images/cda/bouton.png"> <?php } else { echo c2c_submit_tag(__('Search on c2c'), array('picto' => 'action_filter', 'class' => 'main_button')); } ?> <br /> <?php echo '<a href="/' . $type . '/filter" target="_blank">' . __('Advanced search') . '</a>'; ?> <br /><br /> <?php $cda_config = sfConfig::get('app_portals_cda'); echo link_to(__('cda More'), '@document_by_id?module=portals&id=' . $cda_config['id'], array('target' => '_blank')); ?> </form> <?php } ?>
echo global_form_errors_tag(); //echo form_tag('@user_edit'); echo c2c_form_remote_tag('@signUp'); echo tips_tag('After subscription you will receive an email with a generated password, to confirm, login within %1% days', array('%1%' => sfConfig::get('app_pending_users_lifetime'))); echo group_tag('Username:'******'login_name', 'input_tag', $sf_params->get('login_name'), array('autofocus' => 'autofocus', 'class' => 'long_input')); echo group_tag('Email:', 'email', 'input_tag', $sf_params->get('email'), array('class' => 'long_input', 'type' => 'email')); echo content_tag('div', __('Did you mean %1%?', array('%1%' => '<a class="suggested-email"></a>')), array('class' => 'email-suggestion', 'style' => 'display:none')); echo group_tag('Copy following string:', 'captcha', 'input_tag', null, array('class' => 'long_input')); ?> <img src="<?php echo url_for('@sf_captcha'); ?> " alt="captcha" title="<?php echo __('Copy following string:'); ?> " /> <p class="tips"><?php echo __('captcha test is case-insensitive'); ?> </p> <p style="margin-top:20px"><?php echo c2c_submit_tag(__('Signup')); ?> <?php echo login_link_to(); ?> </p> </form> <?php // load mailcheck, helps users correctly entering their email echo javascript_queue("\$.ajax({ url: '" . minify_get_combined_files_url(array('/static/js/mailcheck.min.js', '/static/js/mailcheck.c2c.js')) . "',\ndataType: 'script', cache: true });");
/** * Executes getautocomplete action. * returns a bit of html and JS to perform autocomplete */ public function executeGetautocomplete() { sfLoader::loadHelpers(array('MyForm')); // retrieve module name on which to perform autocomplete if ($this->hasRequestParameter('module_id')) { $module_id = $this->getRequestParameter('module_id'); $modules = sfConfig::get('app_modules_list'); $module_name = $modules[$module_id]; } elseif ($this->hasRequestParameter('module_name')) { $module_name = $this->getRequestParameter('module_name'); } else { return $this->renderText(''); } $field_prefix = $this->getRequestParameter('field_prefix', ''); $extra_params = $this->getRequestParameter('extra_params'); sfLoader::loadHelpers(array('AutoComplete')); if ($module_name == 'users' && $this->getModuleName() == 'images' && !$this->getUser()->hasCredential('moderator')) { $user = $this->getUser(); $out = input_hidden_tag('document_id', $user->getId(), array('id' => $field_prefix . '_document_id')) . input_hidden_tag('document_module', $module_name, array('id' => $field_prefix . '_document_module')) . $user->getUsername() . ' ' . c2c_submit_tag(__('Link'), array('class' => 'samesize', 'picto' => 'action_create')); } else { if ($module_name != 'routes') { $display_button = $this->getRequestParameter('button') != '0'; $out = input_hidden_tag('document_id', '0', array('id' => $field_prefix . '_document_id')) . input_hidden_tag('document_module', $module_name, array('id' => $field_prefix . '_document_module')) . c2c_auto_complete($module_name, $field_prefix . '_document_id', array('field_prefix' => $field_prefix, 'display_button' => $display_button, 'extra_params' => $extra_params)) . ($display_button ? '</form>' : ''); } else { $summit_id = $field_prefix . '_summit_id'; $div_select = $field_prefix . '_routes_select'; $updated_failure = sfConfig::get('app_ajax_feedback_div_name_failure'); $id = $field_prefix . '_rsummits_name'; $out = input_hidden_tag('document_module', $module_name, array('id' => $field_prefix . '_document_module')) . __('Summit : ') . input_tag('summits_name', '', array('size' => 45, 'id' => $id, 'data-suggest-no-exclude' => 1)) . '<div id="' . $field_prefix . '_associated_routes" name="associated_routes" style="display:none;">' . '<div id="' . $div_select . '" name="' . $div_select . '"></div>' . javascript_queue("var indicator = \$('#indicator');" . "\$('#{$id}').c2cAutocomplete({" . "url: '" . url_for("summits/autocomplete") . "'," . "minChars: " . sfConfig::get('app_autocomplete_min_chars') . (isset($extra_params) ? ", params: '{$extra_params}'" : '') . "}).on('itemselect', function(e, item) {" . "indicator.show();" . "\$.get('" . url_for('summits/getroutes') . "'," . "'summit_id=' + item.id + '&div_prefix={$field_prefix}_&div_name=document_id')" . ".always(function() { indicator.hide(); })" . ".fail(function(data) { C2C.showFailure(data.responseText); })" . ".done(function(data) {" . "\$('#{$div_select}').html(data).parent().show();" . "C2C.getWizardRouteRatings('{$field_prefix}_document_id');" . "});" . "});"); if ($this->getRequestParameter('button') != '0') { $out .= c2c_submit_tag(__('Link'), array('class' => 'samesize', 'picto' => 'action_create')); } $out .= '</div>'; } } return $this->renderText($out); }
<?php use_helper('Form', 'MyForm', 'Link'); ?> <div id="fake_div"> <?php $form_action = sfConfig::get('app_https_login', false) ? str_replace('http://', 'https://', url_for('@login', true)) : '@login'; echo form_tag($form_action, array('id' => 'loginForm')); include_partial('users/loginFields'); if (isset($redirect_param) && !empty($redirect_param)) { echo input_hidden_tag('redirect', $redirect_param); } ?> <p> <?php echo c2c_submit_tag(__('Connect')); ?> <?php echo forgot_link_to(); ?> <?php echo signup_link_to(); ?> </p> </form>
<div id="fake_div"> <?php use_helper('Form', 'Validation', 'Ajax', 'Link', 'MyForm'); // handle non ajax error form echo global_form_errors_tag(); // script => true ... ? echo c2c_form_remote_tag('users/lostPassword'); ?> <div id="reset_password"> <?php echo tips_tag('To receive a new password, enter your username or your email'); ?> <?php echo group_tag('Username or Email', 'loginNameOrEmail', 'input_tag', $sf_params->get('loginNameOrEmail'), array('class' => 'long_input')); ?> <?php echo c2c_submit_tag(__('retrieve')); ?> <?php echo login_link_to(); ?> </div> </form>
<?php use_helper('MyForm', 'Javascript', 'Ajax', 'Url'); ?> <?php $module = $sf_context->getModuleName(); $new = isset($new_document) ? $new_document : false; ?> <ul class="action_buttons"> <li><?php $js = "\$('#indicator').show();\n \$.post('" . url_for("{$module}/preview") . "', \$(this.form).serialize())\n .always(function() { \$('#indicator').hide(); \$('.goto_preview').show(); })\n .done(function(data) {\n var preview = \$('#preview');\n preview.html(data).addClass('highlight').show();\n setTimeout(function() { preview.removeClass('highlight') }, 400);\n \$('#form_buttons_up').show(); });\n return false;"; echo c2c_button(__('Preview'), array('picto' => 'action_filter', 'class' => 'main_button'), tag('input', array('type' => 'button', 'name' => 'ajax_submit', 'value' => __('Preview'), 'class' => 'c2cui_btnr', 'onclick' => $js))); ?> </li> <li><?php echo c2c_submit_tag(__($new ? 'Create' : 'Update'), array('picto' => 'action_create')); ?> </li> <?php $cancel_route = $new ? "@default_index?module={$module}" : "@document_by_id?module={$module}&id=" . $document->get('id'); ?> <li><?php echo c2c_button(__('Cancel'), array('picto' => 'action_cancel'), button_to(__('Cancel'), $cancel_route, array('class' => 'c2cui_btnr'))); ?> </li> </ul>
<?php echo input_tag('switch[]', null, array('type' => 'checkbox', 'value' => "{$image_id}", 'id' => 'switch_' . $image_id)) . link_to(__('Details'), $image_route, array('class' => 'toto')); ?> </div> </div> <?php } ?> <div style="clear:both"><?php echo input_hidden_tag('page', $page); echo $pager_navigation; ?> </div> <ul class="action_buttons"> <li><?php echo c2c_submit_tag(__('Switch license'), array('picto' => 'action_edit')); ?> </li> <li><?php echo button_tag(__('Select all'), array('onclick' => "\$('#editform .manageimages_info input[type=checkbox]').prop('checked', true);", 'picto' => 'action_create', 'title' => __('Select all'))); ?> </li> <li><?php echo button_tag(__('Deselect all'), array('onclick' => "\$('#editform .manageimages_info input[type=checkbox]').prop('checked', false);", 'picto' => 'action_rm', 'title' => __('Deselect all'))); ?> </li> </ul> </form> <?php } echo end_content_tag();
?> <div id="ac_form" style="float: left; margin-left: 10px; height: 250px; width: 300px;"> <?php //FIXME find a way to avoid ugly blank // this div will be updated after page loading, via ajax. ?> </div> <script type="text/javascript"> $('#indicator').show(); $.ajax('<?php echo url_for("/{$module}/getautocomplete?module_name={$module}&button=0"); ?> ') .always(function() { $('#indicator').hide(); }) .done(function(data) { $('#ac_form').html(data); }); </script> <p><?php echo c2c_submit_tag(__('Merge')); ?> </p> </form> <div> <?php echo __('Notice: associations will also be merged'); ?> </div> </div> <!-- merge_wizard -->
function portal_search_box_tag($params, $current_module) { sfLoader::loadHelpers(array('Pagination')); $sf_context = sfContext::getInstance(); if (is_array($params) && count($params)) { $main_filter = $params['main']; unset($params['main']); } else { $main_filter = $params; $params = array(); } $url_params = array(); $criteria = unpackUrlParameters($main_filter, $url_params); $names = array_keys($criteria); $list = array(); foreach (sfConfig::get('app_modules_list') as $module) { switch ($module) { case 'documents': break; default: if ($module != $current_module && !in_array($module, $names)) { $key = $module; if (isset($params[$module])) { $key .= '/' . $params[$module]; } $list[$key] = __($module); } } } $selected = 'routes'; $options = options_with_classes_for_select($list, $selected, array(), 'picto picto_'); $select_js = 'this.setAttribute("class", "picto picto_" + this.options[this.selectedIndex].value.split(\'/\')[0]);'; $html = '<input type="hidden" value="' . $main_filter . '" name="params" />'; $html .= select_tag('wtype', $options, array('onchange' => $select_js, 'class' => 'picto picto_' . $selected, 'placeholder' => __('Search'))); $html .= input_tag('q', $sf_context->getRequest()->getParameter('q'), array('class' => 'searchbox')); $html .= c2c_submit_tag(__('Search'), 'action_filter'); return $html; }
$result_types = sfConfig::get('app_list_result_types'); if ($module == 'outings') { unset($result_types[1]); unset($result_types[2]); } elseif (in_array($module, array('routes', 'sites', 'users'))) { unset($result_types[1]); } $result_type_options = options_for_select(array_map('__', $result_types), 3); $result_type_select = select_tag('result_type', $result_type_options); $result_type_select_2 = select_tag('result_type_2', $result_type_options); $linked_docs = sfConfig::get('app_list_linked_docs'); $linked_doc_options = options_for_select(array_map('__', $linked_docs), 1); $linked_doc_select = select_tag('linked_docs', $linked_doc_options); $linked_doc_select_2 = select_tag('linked_docs_2', $linked_doc_options); $result_types_filter = '<div class="list_form">' . __('Show') . ' ' . $result_type_select . ' ' . $linked_doc_select . ' ' . c2c_submit_tag(__('Send'), array('picto' => 'action_list', 'name' => 'commit', 'class' => 'samesize')) . '</div>'; $result_types_filter_2 = '<div class="list_form">' . __('Show') . ' ' . $result_type_select_2 . ' ' . $linked_doc_select_2 . ' ' . c2c_submit_tag(__('Send'), array('picto' => 'action_list', 'name' => 'commit_2', 'class' => 'samesize')) . '</div>'; $params = packUrlParameters('', array('orderby', 'orderby2', 'orderby3', 'order', 'order2', 'order3', 'page')); echo '<form id="filterform" action="/' . $module . '/listredirect" method="post"><div> <input type="hidden" value="' . $params . '" name="params" />'; foreach ($orderby_params as $key => $orderby_params) { echo '<input type="hidden" value="' . $orderby_list[$key] . '" name="' . $orderby_params . '" />' . '<input type="hidden" value="' . $order_list[$key] . '" name="' . $order_params[$key] . '" />'; } echo '</div>'; echo $pager_navigation; echo $result_types_filter; echo pager_nb_results($pager); } else { echo $pager_navigation; echo pager_nb_results($pager); } if (!$mobile_version) {
var rating = cotometre_rating(slope, height, skiability); $("#cotometre_result").html(\'<div id="cotometre_result">' . __('proposed grade') . '<br /><span class="cotometre_result">\' + rating + " </span></div>"); }'); ?> <div id="fake_div"> <p class="tips"> <?php echo __('cotometre tips'); ?> </p> <div id="toolform" class="cotometre_form"> <p><?php echo label_tag('skiability', __('skiabilite'), false, array('class' => 'fieldname')), '<br />', radiobutton_tag('skiability', '0', true), ' ', label_for('skiability_0', __('skiabilite0')), '<br />', radiobutton_tag('skiability', '0.1', false), ' ', label_for('skiability_0.1', __('skiabilite01')), '<br />', radiobutton_tag('skiability', '0.2', false), ' ', label_for('skiability_0.2', __('skiabilite02')); ?> </p><p> <?php echo label_tag('slope', __('pentemoyenne'), false, array('class' => 'fieldname')), input_tag('coto_slope', '', array('class' => 'short_input')); ?> </p><p> <?php echo label_tag('height', __('denivele'), false, array('class' => 'fieldname')), input_tag('coto_height', '', array('class' => 'short_input')); ?> </p><p> <?php echo c2c_submit_tag(__('compute technical grade'), array('onclick' => 'cotometre_technical_grade(); return false;')); ?> </p> </div> <div id="cotometre_result"><span class="cotometre_result"> </span></div>