function show_activate_form($timestamp, $data, $errors)
{
    global $l;
    // TODO translations
    $package = get_package_info($timestamp);
    $redistrib_pack = get_redistrib_package_info($timestamp);
    echo '<h3>Package ' . $package['NAME'] . ' (' . $package['FILEID'] . ')</h3>';
    echo '<a href="#" target="_blank">Download</a>';
    if ($redistrib_pack) {
        echo ' - <a href="#" target="_blank">Download redistribution package</a>';
    }
    echo ' - <a href="#" target="_blank">View info file</a>';
    echo open_form('activate_pack');
    echo '<div class="form-frame">';
    show_form_field($data, $errors, 'select', 'METHOD', 'Activation method', array('type' => 'radio', 'options' => array('')));
    echo '</div>';
    echo close_form();
}
function show_profile_create_form()
{
    global $l;
    ?>
	
	<div class="form-frame form-frame-create-profile">
		<h3><?php 
    echo $l->g(1399);
    ?>
</h3>
		
		<?php 
    $field_options = array('field_class' => 'big-label');
    echo open_form('create-profile', '#');
    show_form_field(array(), array(), 'input', 'name', $l->g(1396), $field_options);
    show_form_field(array(), array(), 'input', 'label', $l->g(1397), $field_options);
    show_form_field(array(), array(), 'select', 'duplicate_profile', $l->g(1398), array_merge($field_options, array('options' => get_profile_labels())));
    ?>
		
		<div class="form-buttons">
			<input type="submit" value="<?php 
    echo $l->g(1363);
    ?>
"/>
			<input type="reset" value="<?php 
    echo $l->g(1364);
    ?>
"/>
		</div>
		
		<?php 
    echo close_form();
    ?>
	</div>
	
	<?php 
}
function show_pages_frame($profile, $yes_no)
{
    global $l;
    $urls = $_SESSION['OCS']['url_service']->getUrls();
    asort($urls);
    foreach ($urls as $key => $url) {
        if ($profile->hasPage($key)) {
            show_form_field(array(), array(), 'input', 'pages[' . $key . ']', $url['value'], array('type' => 'checkbox', 'field_class' => 'checkbox-field', 'value' => 'on'));
        } else {
            show_form_field(array(), array(), 'input', 'pages[' . $key . ']', $url['value'], array('type' => 'checkbox', 'field_class' => 'checkbox-field'));
        }
    }
}
function show_user_messages_frame($data, $errors)
{
    global $l;
    if ($data['OS'] != 'WINDOWS') {
        $messages_style = ' style="display: none"';
    } else {
        $messages_style = '';
    }
    echo '<div class="form-frame form-frame-user-messages"' . $messages_style . '>';
    echo '<h4>';
    show_form_input('NOTIFY_USER', array('type' => 'checkbox', 'value' => $data['NOTIFY_USER']));
    show_form_label('NOTIFY_USER', $l->g(448));
    echo '</h4>';
    if ($data['NOTIFY_USER'] != 'on') {
        echo '<div class="notify-fields" style="display: none">';
    } else {
        echo '<div class="notify-fields">';
    }
    show_form_field($data, $errors, 'textarea', 'NOTIFY_TEXT', $l->g(449));
    show_form_field($data, $errors, 'input', 'NOTIFY_COUNTDOWN', $l->g(450));
    show_form_field($data, $errors, 'input', 'NOTIFY_CAN_CANCEL', $l->g(451), array('type' => 'checkbox'));
    show_form_field($data, $errors, 'input', 'NOTIFY_CAN_DELAY', $l->g(452), array('type' => 'checkbox'));
    echo '</div>';
    echo '</div>';
    echo '<div class="form-frame form-frame-user-messages"' . $messages_style . '>';
    echo '<h4>';
    show_form_input('NEED_DONE_ACTION', array('type' => 'checkbox', 'value' => $data['NEED_DONE_ACTION']));
    show_form_label('NEED_DONE_ACTION', 'Post-execution text');
    // TODO translation
    echo '</h4>';
    if ($data['NEED_DONE_ACTION'] != 'on') {
        echo '<div class="done-action-fields" style="display: none">';
    } else {
        echo '<div class="done-action-fields">';
    }
    show_form_field($data, $errors, 'textarea', 'NEED_DONE_ACTION_TEXT', $l->g(449));
    echo '</div>';
    echo '</div>';
}