if ($attachment_File) {
             // checkbox should be checked only if the corresponding file id is in the final attachments array
             $checked = in_array($attachment_ID, $final_attachments);
             $list_options[] = array('preview_attachment' . $attachment_ID, 1, '', $checked, false, $attachment_File->get('name'));
         }
     }
     if (!empty($list_options)) {
         // display list
         $Form->checklist($list_options, 'comment_attachments', T_('Attached files'));
     }
     // memorize all attachments ids
     $Form->hidden('preview_attachments', $comment_attachments);
 }
 if ($Item->can_attach()) {
     // Display attach file input field
     $Form->input_field(array('label' => T_('Attach files'), 'note' => $params['comment_attach_info'], 'name' => 'uploadfile[]', 'type' => 'file'));
 }
 $comment_options = array();
 if (!is_logged_in(false)) {
     // User is not logged in:
     $comment_options[] = '<label><input type="checkbox" class="checkbox" name="comment_cookies" tabindex="7"' . ($comment_cookies ? ' checked="checked"' : '') . ' value="1" /> ' . T_('Remember me') . '</label>' . ' <span class="note">(' . T_('For my next comment on this site') . ')</span>';
     // TODO: If we got info from cookies, Add a link called "Forget me now!" (without posting a comment).
     $msgform_class_start = '';
     $msgform_class_end = '';
     if ($email_is_detected) {
         // Set a class when comment contains a email
         $msgform_class_start = '<div class="comment_recommended_option">';
         $msgform_class_end = '</div>';
     }
     $comment_options[] = $msgform_class_start . '<label><input type="checkbox" class="checkbox" name="comment_allow_msgform" tabindex="8"' . ($comment_allow_msgform ? ' checked="checked"' : '') . ' value="1" /> ' . T_('Allow message form') . '</label>' . ' <span class="note">(' . T_('Allow users to contact me through a message form -- Your email will <strong>not</strong> be revealed!') . ')</span>' . $msgform_class_end;
     // TODO: If we have an email in a cookie, Add links called "Add a contact icon to all my previous comments" and "Remove contact icon from all my previous comments".
         if ($attachment_File) {
             // checkbox should be checked only if the corresponding file id is in the final attachments array
             $checked = in_array($attachment_ID, $final_attachments);
             $list_options[] = array('preview_attachment' . $attachment_ID, 1, '', $checked, false, $attachment_File->get('name'));
         }
     }
     if (!empty($list_options)) {
         // display list
         $Form->checklist($list_options, 'comment_attachments', T_('Attached files'));
     }
     // memorize all attachments ids
     $Form->hidden('preview_attachments', $comment_attachments);
 }
 if ($Item->can_attach()) {
     // Display attach file input field
     $Form->input_field(array('label' => T_('Attach files'), 'note' => '<br />' . get_upload_restriction(), 'name' => 'uploadfile[]', 'type' => 'file', 'size' => '30'));
 }
 $comment_options = array();
 if (!is_logged_in(false)) {
     // User is not logged in:
     $comment_options[] = '<label><input type="checkbox" class="checkbox" name="comment_cookies" tabindex="7"' . ($comment_cookies ? ' checked="checked"' : '') . ' value="1" /> ' . T_('Remember me') . '</label>' . ' <span class="note">(' . T_('For my next comment on this site') . ')</span>';
     // TODO: If we got info from cookies, Add a link called "Forget me now!" (without posting a comment).
     $msgform_class_start = '';
     $msgform_class_end = '';
     if ($email_is_detected) {
         // Set a class when comment contains a email
         $msgform_class_start = '<div class="comment_recommended_option">';
         $msgform_class_end = '</div>';
     }
     $comment_options[] = $msgform_class_start . '<label><input type="checkbox" class="checkbox" name="comment_allow_msgform" tabindex="8"' . ($comment_allow_msgform ? ' checked="checked"' : '') . ' value="1" /> ' . T_('Allow message form') . '</label>' . ' <span class="note">(' . T_('Allow users to contact me through a message form -- Your email will <strong>not</strong> be revealed!') . ')</span>' . $msgform_class_end;
     // TODO: If we have an email in a cookie, Add links called "Add a contact icon to all my previous comments" and "Remove contact icon from all my previous comments".
/**
 * This file is part of the evoCore framework - {@link http://evocore.net/}
 * See also {@link https://github.com/b2evolution/b2evolution}.
 *
 * @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license}
 *
 * @copyright (c)2009-2015 by Francois Planque - {@link http://fplanque.com/}
 * Parts of this file are copyright (c)2009 by The Evo Factory - {@link http://www.evofactory.com/}.
 *
 * @package evocore
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
load_class('regional/model/_country.class.php', 'Country');
$Form = new Form(NULL, 'city_checkchanges', 'post', 'compact', 'multipart/form-data');
$Form->global_icon(T_('Cancel importing!'), 'close', regenerate_url('action'));
$Form->begin_form('fform', T_('Import cities') . get_manual_link('cities-import'));
echo T_('Select a country and upload a CSV file with the following columns:');
echo '<div style="padding:10px 0 10px 40px">';
echo T_('1. Postcode') . '<br />';
echo T_('2. City name') . '<br />';
echo T_('3. Optional: sub region code');
echo '</div>';
$Form->add_crumb('city');
$Form->hiddens_by_key(get_memorized('action'));
// (this allows to come back to the right list order & page)
$CountryCache =& get_CountryCache();
$Form->select_country('ctry_ID', get_param('ctry_ID'), $CountryCache, T_('Country'), array('allow_none' => true, 'required' => true));
$Form->input_field(array('label' => T_('CSV File'), 'name' => 'csv', 'type' => 'file', 'required' => true));
$Form->end_form(array(array('submit', 'actionArray[import]', T_('Import'), 'SaveButton')));