PageRenderTime 74ms CodeModel.GetById 31ms RepoModel.GetById 0ms app.codeStats 0ms

/baser/views/elements/admin/pages/index_row.php

https://github.com/hashing/basercms
PHP | 82 lines | 60 code | 4 blank | 18 comment | 12 complexity | 734db79f285a87fdb1a48a09be263877 MD5 | raw file
Possible License(s): MIT
  1. <?php
  2. /* SVN FILE: $Id$ */
  3. /**
  4. * [ADMIN] ページ一覧 行
  5. *
  6. * PHP versions 4 and 5
  7. *
  8. * baserCMS : Based Website Development Project <http://basercms.net>
  9. * Copyright 2008 - 2012, baserCMS Users Community <http://sites.google.com/site/baserusers/>
  10. *
  11. * @copyright Copyright 2008 - 2012, baserCMS Users Community
  12. * @link http://basercms.net baserCMS Project
  13. * @package baser.views
  14. * @since baserCMS v 2.0.0
  15. * @version $Revision$
  16. * @modifiedby $LastChangedBy$
  17. * @lastmodified $Date$
  18. * @license http://basercms.net/license/index.html
  19. */
  20. ?>
  21. <?php if (!$bcPage->allowPublish($data)): ?>
  22. <?php $class=' class="unpublish disablerow sortable"'; ?>
  23. <?php else: ?>
  24. <?php $class=' class="publish sortable"'; ?>
  25. <?php endif; ?>
  26. <?php if(empty($data['PageCategory']['id']) || $data['PageCategory']['name'] == 'mobile'): ?>
  27. <?php $ownerId = $bcBaser->siteConfig['root_owner_id'] ?>
  28. <?php else: ?>
  29. <?php $ownerId = $data['PageCategory']['owner_id'] ?>
  30. <?php endif ?>
  31. <tr id="Row<?php echo $count ?>" <?php echo $class; ?>>
  32. <td class="row-tools" style="width:15%">
  33. <?php if($sortmode): ?>
  34. <span class="sort-handle"><?php $bcBaser->img('sort.png', array('alt' => '並び替え', 'class' => 'sort-handle')) ?></span>
  35. <?php echo $bcForm->input('Sort.id'.$data['Page']['id'], array('type' => 'hidden', 'class' => 'id', 'value' => $data['Page']['id'])) ?>
  36. <?php endif ?>
  37. <?php if($bcBaser->isAdminUser()): ?>
  38. <?php echo $bcForm->checkbox('ListTool.batch_targets.'.$data['Page']['id'], array('type' => 'checkbox', 'class' => 'batch-targets', 'value' => $data['Page']['id'])) ?>
  39. <?php endif ?>
  40. <?php $url = preg_replace('/index$/', '', $data['Page']['url']) ?>
  41. <?php $bcBaser->link($bcBaser->getImg('admin/icn_tool_unpublish.png', array('width' => 24, 'height' => 24, 'alt' => '非公開', 'class' => 'btn')), array('action' => 'ajax_unpublish', $data['Page']['id']), array('title' => '非公開', 'class' => 'btn-unpublish')) ?>
  42. <?php $bcBaser->link($bcBaser->getImg('admin/icn_tool_publish.png', array('width' => 24, 'height' => 24, 'alt' => '公開', 'class' => 'btn')), array('action' => 'ajax_publish', $data['Page']['id']), array('title' => '公開', 'class' => 'btn-publish')) ?>
  43. <?php if(!preg_match('/^\/'.Configure::read('BcAgent.mobile.prefix').'\//is', $url) && !preg_match('/^\/'.Configure::read('BcAgent.smartphone.prefix').'\//is', $url)): ?>
  44. <?php $bcBaser->link($bcBaser->getImg('admin/icn_tool_check.png', array('width' => 24, 'height' => 24, 'alt' => '確認', 'class' => 'btn')), $url, array('title' => '確認', 'target' => '_blank')) ?>
  45. <?php elseif(preg_match('/^\/'.Configure::read('BcAgent.mobile.prefix').'\//is', $url)): ?>
  46. <?php $bcBaser->link($bcBaser->getImg('admin/icn_tool_check.png', array('width' => 24, 'height' => 24, 'alt' => '確認', 'class' => 'btn')), $bcBaser->changePrefixToAlias($url, 'mobile'), array('title' => '確認', 'target' => '_blank')) ?>
  47. <?php elseif(preg_match('/^\/'.Configure::read('BcAgent.smartphone.prefix').'\//is', $url)): ?>
  48. <?php $bcBaser->link($bcBaser->getImg('admin/icn_tool_check.png', array('width' => 24, 'height' => 24, 'alt' => '確認', 'class' => 'btn')), $bcBaser->changePrefixToAlias($url, 'smartphone'), array('title' => '確認', 'target' => '_blank')) ?>
  49. <?php endif ?>
  50. <?php $bcBaser->link($bcBaser->getImg('admin/icn_tool_edit.png', array('width' => 24, 'height' => 24, 'alt' => '編集', 'class' => 'btn')), array('action' => 'edit', $data['Page']['id']), array('title' => '編集')) ?>
  51. <?php $bcBaser->link($bcBaser->getImg('admin/icn_tool_copy.png', array('width' => 24, 'height' => 24, 'alt' => 'コピー', 'class' => 'btn')), array('action' => 'ajax_copy', $data['Page']['id']), array('title' => 'コピー', 'class' => 'btn-copy')) ?>
  52. <?php if(in_array($ownerId, $allowOwners)||(!empty($user) && $user['user_group_id']==1)): ?>
  53. <?php $bcBaser->link($bcBaser->getImg('admin/icn_tool_delete.png', array('width' => 24, 'height' => 24, 'alt' => '削除', 'class' => 'btn')), array('action' => 'ajax_delete', $data['Page']['id']), array('title' => '削除', 'class' => 'btn-delete')) ?>
  54. <?php endif ?>
  55. </td>
  56. <td style="width:5%"><?php echo $data['Page']['id']; ?></td>
  57. <td style="width:15%">
  58. <?php if(!empty($data['PageCategory']['title'])): ?>
  59. <?php echo $data['PageCategory']['title']; ?>
  60. <?php endif; ?>
  61. </td>
  62. <td style="width:35%">
  63. <?php $bcBaser->link($data['Page']['name'], array('action' => 'edit', $data['Page']['id'])); ?><br />
  64. <?php echo $data['Page']['title']; ?>
  65. </td>
  66. <td style="width:5%;" class="align-center status">
  67. <?php echo $bcText->booleanMark($data['Page']['status']); ?><br />
  68. </td>
  69. <td style="width:15%">
  70. <?php if(isset($users[$data['Page']['author_id']])) : ?>
  71. <?php echo $users[$data['Page']['author_id']] ?>
  72. <?php endif ?>
  73. </td>
  74. <td style="width:10%;white-space: nowrap">
  75. <?php echo $bcTime->format('Y-m-d',$data['Page']['created']) ?><br />
  76. <?php echo $bcTime->format('Y-m-d',$data['Page']['modified']) ?>
  77. </td>
  78. </tr>