<?php
/**
 * ページの編集・削除画面内のページ情報表示部分
 *
 * Copyright (c) 2010-2011 SetucoCMS Project.(http://sourceforge.jp/projects/setucocms)
 * All Rights Reserved.
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * @category   Setuco
 * @package    Admin
 * @subpackage View_Partial
 * @license    http://www.opensource.org/licenses/gpl-2.0.php GNU General Public License, version 2
 * @copyright  Copyright (c) 2010 SetucoCMS Project.(http://sourceforge.jp/projects/setucocms)
 * @link
 * @version
 * @since      File available since Release 0.1.0
 * @param      array $page ページ情報の配列
 * @param      int   $index インデックス番号
 * @param      Setuco_Form $categoryForm カテゴリー編集フォーム
 * @param      Setuco_Form $statusForm   状態編集フォーム
 * @author     charlesvineyard
 */
?>
<?php
    $categoryForm = clone($this->categoryForm);
    $categoryForm->addAllIdSuffix($this->index);
    $statusForm = clone($this->statusForm);
    $statusForm->addAllIdSuffix($this->index);
?>
<td>
<?php if ($this->page['status'] == Setuco_Data_Constant_Page::STATUS_RELEASE): ?>
    <a href="<?php echo $this->baseUrl('/page/show/id/' . $this->page['id']) ?>" target='_blank'>
        <img src="<?php echo $this->baseUrl('/images/admin/page/btn_check.png') ?>" alt='表示' width='27' height='27' />
    </a>
<?php else: ?>
    <img src="<?php echo $this->baseUrl('/images/admin/page/btn_check_no.png') ?>" alt='下書きは表示できません' width='27' height='27' />
<?php endif ?>
</td>
<td>
    <a href="<?php echo $this->baseUrl('/admin/page/index/id/' . $this->page['id']) ?>"><?php echo $this->escape($this->page['title']) ?></a>
</td>
<td><?php echo $this->page['create_date'] ?></td>
<td><?php echo $this->escape($this->page['nickname']) ?></td>
<td>
    <form id="page_category_form<?php echo $this->index ?>" enctype="application/x-www-form-urlencoded" method="post" action="<?php echo $categoryForm->getAction() ?>">
        <p>
            <?php echo $categoryForm->getElement('category_id')->setValue($this->page['category_id']) ?>
            <?php echo $categoryForm->getElement('h_page_id_c')->setValue($this->page['id']) ?>
            <?php echo $categoryForm->getElement('h_page_title_c')->setValue($this->page['title']) ?>
            <?php echo $categoryForm->getElement('h_pre_category_id_c') . "\n" ?>
        </p>
        <p class="category_edit">
            <?php echo $categoryForm->getElement('sub_category') ?>
            <?php echo $categoryForm->getElement('cancel_category') ."\n" ?>
        </p>
    </form>
</td>
<td>
    <form id="page_status_form<?php echo $this->index ?>" enctype="application/x-www-form-urlencoded" method="post" action="<?php echo $statusForm->getAction() ?>">
        <p>
            <?php echo $statusForm->getElement('status')->setValue($this->page['status']) ?>
            <?php echo $statusForm->getElement('h_page_id_s')->setValue($this->page['id']) ?>
            <?php echo $statusForm->getElement('h_page_title_s')->setValue($this->page['title']) ?>
            <?php echo $statusForm->getElement('h_pre_category_id_s') . "\n" ?>
        </p>
        <p class="status_edit">
            <?php echo $statusForm->getElement('sub_status') ?>
            <?php echo $statusForm->getElement('cancel_status') ."\n" ?>
        </p>
    </form>
</td>
<td>
    <a href="javascript:void(0)" onclick="confirmDeleteRedirect('<?php echo $this->baseUrl("/admin/page/delete/id/{$this->page['id']}") ?>', '<?php echo $this->escape($this->page['title']) ?>');">
        <img src="<?php echo $this->baseUrl('/images/admin/share/btn_delete.png') ?>" alt="削除" width="27" height="27" />
    </a>
</td>
