<?php include VIEW_DIR.'mobile/common/menu/blog.tpl'; ?>

<form method="post" action="<?php e($this->_vars['action']['url']); ?>"><?php HTML::requires(); ?>
<?php if ($this->_vars['action']['complete'] || $this->_vars['action']['deleted']): ?>
	<?php e($this->_vars['action']['complete']? _('Updated'):_('Deleted')); ?><br><br>
	<?php loadPlugin::callFunc('hitsuji_banner', POSITION_MOBILE); ?><br>
<?php elseif ($this->_vars['action']['confirm'] || $this->_vars['action']['delete']): ?>
<table border="0" width="<?php Theme::exec()->mainWidth(); ?>">
	<tr><td align="center" bgcolor="<?php Theme::exec()->bgTitleColor(); ?>"><img src="<?php e(BASE_URL); ?>resource/img/icons/script.gif" width="16" height="16" alt="&gt;">&nbsp;<?php e($this->_vars['blg_entry']['subject']); ?></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>"><?php HTML::htmlBody($this->_vars['blg_entry']['body']); ?><br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>">
		<?php eDate($this->_vars['blg_entry']['regist_date'], _('Y-m-d H:i')); ?><br>
		<img src="<?php e(BASE_URL); ?>resource/img/icons/comment.gif" width="16" height="16" alt="&gt;">&nbsp;<?php _e('Comments'); ?><br>
		<img src="<?php e(BASE_URL); ?>resource/img/icons/book_olink.gif" width="16" height="16" alt="&gt;">&nbsp;<?php _e('Trackbacks'); ?><br>
	</td></tr>
</table>
<hr color="<?php Theme::exec()->borderColor(); ?>" noshade="noshade">

<table border="0" width="<?php Theme::exec()->mainWidth(); ?>">
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Visibility'); ?>:<br></td></tr>
	<tr><td><?php e($this->_vars['visibility'][$this->_vars['blg_entry']['visibility']]); ?><br></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Tag'); ?>:<br></td></tr>
	<tr><td><?php e($this->_vars['blg_entry']['tag']); ?><br></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('TrackBack URL'); ?>:<br></td></tr>
	<tr><td><?php e($this->_vars['blg_entry']['tb_url']); ?><br></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>" align="center">
		<input type="submit" name="manip" value="<?php e($this->_vars['action']['confirm']? _('Submit'):_('Delete')); ?>">
		<input type="submit" name="<?php e($this->_vars['action']['goback']); ?>" value="<?php _e('Go back'); ?>">
	<br></td></tr>
</table>
<?php else: ?>
<table border="0" width="<?php Theme::exec()->mainWidth(); ?>">
	<tr><td align="center" bgcolor="<?php Theme::exec()->bgTitleColor(); ?>"><img src="<?php e(BASE_URL); ?>resource/img/icons/book_edit.gif" width="16" height="16" alt="&gt;">&nbsp;<?php _e('Write a Blog'); ?></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Regist Date'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['regist_date'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please choose it in a range until the present.'); ?></font><br><?php endif; ?>
		<?php HTML::dateSelect('regist_date', ifNull($this->_vars['blg_entry']['regist_date'], 'now')); ?>
		<?php HTML::timeHidden('regist_date', $this->_vars['blg_entry']['regist_date']); ?>
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Subject'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['subject'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please enter.'); ?></font><br><?php endif; ?>
		<input type="text" name="subject" value="<?php e($this->_vars['blg_entry']['subject']); ?>">
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Body'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['body'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please enter.'); ?></font><br><?php endif; ?>
		<?php HTML::mobileRichEditor('body', ifNull($this->_vars['blg_entry']['body'], $this->_vars['related']), _('Body')); ?>
		<br><input name="attach" type="submit" value="<?php _e('Attach'); ?>">
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Visibility'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['visibility'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select name="visibility"><?php HTML::options($this->_vars['visibility'], $this->_vars['blg_entry']['visibility']); ?></select>
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Tag'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['tag'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please enter.'); ?></font><br><?php endif; ?>
		<input type="text" name="tag" value="<?php e($this->_vars['blg_entry']['tag']); ?>">
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('TrackBack URL'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['tb_url'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please enter.'); ?></font><br><?php endif; ?>
		<input type="text" name="tb_url" value="<?php e(ifNull($this->_vars['blg_entry']['tb_url'], $this->_vars['tb_url'])); ?>">
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>" align="center"><input type="submit" name="confirm" value="<?php _e('Confirm'); ?>"><br></td></tr>
</table>
<?php endif; ?>

</form>
