<?php
if (!defined('IN_CONTEXT')) die('access violation error!');
?>
<div class="content_title">
	<h3><?php _e($friendlink_title); ?></h3>
</div>
<div class="space"></div>
<div class="content_toolbar">
	<a href="index.php?<?php echo Html::xuriquery('mod_friendlink', 'admin_list'); ?>" title=""><?php _e('Back'); ?></a>
</div>
<div class="space"></div>
<div class="status_bar">
<?php if (Notice::get('mod_friendlink/msg')) { ?>
	<span id="adminflfrm_stat" class="status"><?php echo Notice::get('mod_friendlink/msg'); ?></span>
<?php } ?>
</div>
<div class="space"></div>
<?php
$friendlink_form = new Form('index.php', 'friendlinkform', 'check_fl_info');
$friendlink_form->setEncType('multipart/form-data');
$friendlink_form->p_open('mod_friendlink', $next_action);
?>
<table id="friendlinkform_table" class="form_table" cellspacing="1">
    <tfoot>
        <tr>
            <td colspan="2">
            <?php
            echo Html::input('reset', 'reset', __('Reset'));
            echo Html::input('button', 'cancel', __('Cancel'), 'onclick="window.history.go(-1);"');
            echo Html::input('submit', 'submit', __('Save'));
            echo Html::input('hidden', 'friendlink[id]', $curr_friendlink->id);
            ?>
            </td>
        </tr>
    </tfoot>
    <tbody>
        <tr>
            <td class="label"><?php _e('Link Image'); ?></td>
            <td class="entry">
            <?php
            echo Html::input('file', 'fl_file', '', 
                '', $friendlink_form, 'RequiredTextbox', 
                __('Please select a link image to upload!'));
            ?>
			<BR />
			<?php _e('Supported file format'); ?>:<?php echo PIC_ALLOW_EXT;?>
			<BR />
			<?php _e('Upload size limit'); ?>:<?php echo ini_get('upload_max_filesize');?>
            </td>
        </tr>
        <tr>
            <td class="label"><?php _e('Name'); ?></td>
            <td class="entry">
            <?php
            echo Html::input('text', 'friendlink[fl_name]', $curr_friendlink->fl_name, 
                '', $friendlink_form, 'RequiredTextbox', 
                __('Please input friendlink name!'));
            ?>
            </td>
        </tr>
        <tr>
            <td class="label"><?php _e('Link Addr'); ?></td>
            <td class="entry">
            <?php
            echo Html::input('text', 'friendlink[fl_addr]', $curr_friendlink->fl_addr, 
                '', $friendlink_form, 'RequiredTextbox', 
                __('Please input friendlink address!'));
            ?>
            </td>
        </tr>
        <tr>
            <td class="label"><?php _e('Language'); ?></td>
            <td class="entry">
            <?php
            echo Toolkit::switchText($curr_friendlink->s_locale?$curr_friendlink->s_locale:$mod_locale, 
                Toolkit::toSelectArray($langs, 'locale', 'name'));
            echo Html::input('hidden', 'friendlink[s_locale]', 
           		$curr_friendlink->s_locale?$curr_friendlink->s_locale:$mod_locale);
            ?>
            </td>
        </tr>
        <tr>
            <td class="label"></td>
            <td class="entry">
            <?php
            echo Html::input('checkbox', 'friendlink[published]', '1', 
                Toolkit::switchText($curr_friendlink->published, 
                    array('0' => '', '1' => 'checked="checked"')));
            ?>
            &nbsp;<?php _e('Publish'); ?>
            </td>
        </tr>
        <tr>
            <td class="label"></td>
            <td class="entry">
            <?php
            echo Html::input('checkbox', 'ismemonly', '1');
            ?>
            &nbsp;<?php _e('Member only access'); ?>
            </td>
        </tr>
    </tbody>
</table>
<?php
$friendlink_form->close();
$friendlink_form->writeValidateJs();
?>