PageRenderTime 48ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/baser/views/elements/admin/page_categories/index_list.php

https://github.com/hashing/basercms
PHP | 81 lines | 59 code | 3 blank | 19 comment | 5 complexity | 7ce7e1c02027f576135c69bf919369cc MD5 | raw file
Possible License(s): MIT
  1. <?php
  2. /* SVN FILE: $Id$ */
  3. /**
  4. * [ADMIN] Ajax 一覧
  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. <table cellpadding="0" cellspacing="0" class="list-table" id="ListTable">
  22. <thead>
  23. <tr>
  24. <th class="list-tool">
  25. <div>
  26. <?php if($newCatAddable): ?>
  27. <?php $bcBaser->link($bcBaser->getImg('admin/btn_add.png', array('width' => 69, 'height' => 18, 'alt' => '新規追加', 'class' => 'btn')), array('action' => 'add')) ?>
  28. <?php endif ?>
  29. </div>
  30. <?php if($bcBaser->isAdminUser()): ?>
  31. <div>
  32. <?php echo $bcForm->checkbox('ListTool.checkall') ?>&nbsp;
  33. <?php echo $bcForm->input('ListTool.batch', array('type' => 'select', 'options' => array('del' => '削除'), 'empty' => '一括処理')) ?>
  34. <?php echo $bcForm->button('適用', array('id' => 'BtnApplyBatch', 'disabled' => 'disabled')) ?>
  35. </div>
  36. <?php endif ?>
  37. </th>
  38. <th>NO</th>
  39. <th>ページカテゴリー名
  40. <?php if($bcBaser->siteConfig['category_permission']): ?>
  41. <br />管理グループ
  42. <?php endif ?>
  43. </th>
  44. <th>ページカテゴリータイトル</th>
  45. <th>登録日<br />更新日</th>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. <?php if(!empty($datas)): ?>
  50. <?php $currentDepth = 0 ?>
  51. <?php foreach($datas as $key => $data): ?>
  52. <?php
  53. $rowIdTmps[$data['PageCategory']['depth']] = $data['PageCategory']['id'];
  54. // 階層が上がったタイミングで同階層よりしたのIDを削除
  55. if($currentDepth > $data['PageCategory']['depth']) {
  56. $i=$data['PageCategory']['depth']+1;
  57. while(isset($rowIdTmps[$i])) {
  58. unset($rowIdTmps[$i]);
  59. $i++;
  60. }
  61. }
  62. $currentDepth = $data['PageCategory']['depth'];
  63. $rowGroupId = array();
  64. foreach($rowIdTmps as $rowIdTmp) {
  65. $rowGroupId[] = 'row-group-'.$rowIdTmp;
  66. }
  67. $rowGroupClass = ' class="depth-'.$data['PageCategory']['depth'].' '.implode(' ', $rowGroupId).'"';
  68. ?>
  69. <?php $currentDepth = $data['PageCategory']['depth'] ?>
  70. <?php $bcBaser->element('page_categories/index_row', array('datas' => $datas, 'data' => $data, 'count' => ($key + 1), 'rowGroupClass' => $rowGroupClass)) ?>
  71. <?php endforeach; ?>
  72. <?php else: ?>
  73. <tr>
  74. <td colspan="5"><p class="no-data">データが見つかりませんでした</p></td>
  75. </tr>
  76. <?php endif; ?>
  77. </tbody>
  78. </table>