mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-19 13:01:12 -07:00
Added preview for country flags while editing (#1448)
This commit is contained in:
parent
0b2246b50b
commit
a43152b421
3 changed files with 16 additions and 1 deletions
|
@ -47,6 +47,11 @@ switch ($mode) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'check_country':
|
||||||
|
$country = (string)$this->request['country'];
|
||||||
|
$html = render_flag($country);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$this->ajax_die('Invalid mode: ' . $mode);
|
$this->ajax_die('Invalid mode: ' . $mode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -437,6 +437,7 @@ foreach ($profile_fields as $field => $can_edit) {
|
||||||
$pr_data['user_from'] = $from;
|
$pr_data['user_from'] = $from;
|
||||||
$db_data['user_from'] = (string)$from;
|
$db_data['user_from'] = (string)$from;
|
||||||
}
|
}
|
||||||
|
$tp_data['COUNTRY_SELECTED'] = render_flag($pr_data['user_from']);
|
||||||
$tp_data['COUNTRY_SELECT'] = build_select('user_from', array_flip($lang['COUNTRIES']), $pr_data['user_from']);
|
$tp_data['COUNTRY_SELECT'] = build_select('user_from', array_flip($lang['COUNTRIES']), $pr_data['user_from']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,16 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="prof-title">{L_LOCATION}:</td>
|
<td class="prof-title">{L_LOCATION}:</td>
|
||||||
<td>{COUNTRY_SELECT}</td>
|
<td>{COUNTRY_SELECT} <span id="check_country">{COUNTRY_SELECTED}</td>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$('#user_from').bind('change', function () {
|
||||||
|
ajax.exec({
|
||||||
|
action: 'user_register',
|
||||||
|
mode: 'check_country',
|
||||||
|
country: $(this).val()
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- IF $bb_cfg['allow_change']['language'] -->
|
<!-- IF $bb_cfg['allow_change']['language'] -->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue