OSDN Git Service

管理用SimpleViewList導入
authorCake <cake_67@users.sourceforge.jp>
Thu, 24 Feb 2011 16:46:46 +0000 (01:46 +0900)
committerCake <cake_67@users.sourceforge.jp>
Thu, 24 Feb 2011 16:46:46 +0000 (01:46 +0900)
app/plugins/links/views/elements/link_listview.ctp [new file with mode: 0644]
app/plugins/links/views/elements/link_simplelist.ctp [new file with mode: 0644]
app/plugins/links/views/elements/link_sort_header.ctp [new file with mode: 0644]
app/plugins/links/views/links/admin_listview.ctp
app/plugins/links/views/links/admin_view.ctp
app/plugins/links/views/links/listview.ctp
app/plugins/links/webroot/css/link.css

diff --git a/app/plugins/links/views/elements/link_listview.ctp b/app/plugins/links/views/elements/link_listview.ctp
new file mode 100644 (file)
index 0000000..0dac616
--- /dev/null
@@ -0,0 +1,83 @@
+<?php 
+/*
+ * Link Plugin for TRPG Databank
+ * 
+ * PHP version 5
+ *
+ * @copyright Copyright 2010, Cake. (http://trpgtools-onweb.sourceforge.jp/)
+ * @category Element
+ * @package  plugin for TRPG Data Bank
+ * @version  beta
+ * @author   Cake <cake_67@users.sourceforge.jp>
+ * @license  http://www.opensource.org/licenses/mit-license.php The MIT License
+ * @link     http://trpgtools-onweb.sourceforge.jp/
+ */
+
+echo $this->Html->css('/links/css/link.css');
+
+?>
+<script language="JavaScript">
+<!--
+       var thumbnailweb_jump = '<?php echo $thumbnail['options']['thumbnailweb_']['jump']; ?>';
+       var thumbnailweb_target = '<?php echo $thumbnail['options']['thumbnailweb_']['target']; ?>';
+       var thumbnailweb_lpos = '<?php echo $thumbnail['options']['thumbnailweb_']['lpos']; ?>';
+       var thumbnailweb_lposv = '<?php echo $thumbnail['options']['thumbnailweb_']['lposv']; ?>';
+
+//-->
+</script>
+<div class="links index">
+<?php 
+$pagenator_options = array();
+$this->Paginator->options(array('url' => $this->passedArgs));
+
+?>
+<div class="box full">
+<?php
+echo $this->element('link_sort_header', array(
+       'pagenator_options' => $pagenator_options,
+       'isSimple' => false,
+));
+?>
+<div class="boxBody">
+
+<p>
+<?php
+echo $this->Paginator->counter(array(
+'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
+));
+?>
+</p>
+
+<div class="paging">
+       <?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
+ |     <?php echo $this->Paginator->numbers();?>
+ |
+       <?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
+</div>
+
+<?php foreach ($links as $link): ?>
+<?php
+echo $this->element('link_view', array(
+       'link' => $link,
+       'isDelete' => false,
+       'isAdmin' => $isAdmin,
+));
+?>
+<?php endforeach; ?>
+
+<div class="paging">
+       <?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
+ |     <?php echo $this->Paginator->numbers();?>
+ |
+       <?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
+</div>
+
+<p>
+<?php
+       echo $this->Paginator->counter(array(
+       'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
+       ));
+?>
+</p>
+
+</div>
diff --git a/app/plugins/links/views/elements/link_simplelist.ctp b/app/plugins/links/views/elements/link_simplelist.ctp
new file mode 100644 (file)
index 0000000..0907dda
--- /dev/null
@@ -0,0 +1,113 @@
+<?php 
+/*
+ * Link Plugin for TRPG Databank
+ * 
+ * PHP version 5
+ *
+ * @copyright Copyright 2010, Cake. (http://trpgtools-onweb.sourceforge.jp/)
+ * @category Element
+ * @package  plugin for TRPG Data Bank
+ * @version  beta
+ * @author   Cake <cake_67@users.sourceforge.jp>
+ * @license  http://www.opensource.org/licenses/mit-license.php The MIT License
+ * @link     http://trpgtools-onweb.sourceforge.jp/
+ */
+
+echo $this->Html->css('/links/css/link.css');
+
+?>
+
+<div class="links listview">
+<?php 
+$pagenator_options = array();
+$this->Paginator->options(array('url' => $this->passedArgs));
+
+?>
+<div class="box full">
+<?php
+echo $this->element('link_sort_header', array(
+       'pagenator_options' => $pagenator_options,
+       'isSimple' => true,
+));
+?>
+<div class="boxBody">
+
+<p>
+<?php
+echo $this->Paginator->counter(array(
+'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
+));
+?>
+</p>
+
+<div class="paging">
+       <?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
+ |     <?php echo $this->Paginator->numbers();?>
+ |
+       <?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
+</div>
+
+<table cellpadding="0" cellspacing="0"<?php if ($isAdmin): ?> class="2rows"<?php endif ?>>
+<tr>
+       <th><?php echo $paginatorEx->sortAllow(__('Id', true), 'id', $pagenator_options);?></th>
+       <th>
+<?php
+       echo $paginatorEx->sortAllow(__('Title', true), 'title', $pagenator_options);
+       //echo $this->PaginatorEx->sortAllow('type');
+       //echo $this->PaginatorEx->sortAllow('pickup');
+       //echo $this->PaginatorEx->sortAllow('not_found');
+       ?>
+</th>
+       <th><?php echo $paginatorEx->sortAllow(__('URL', true), 'url', $pagenator_options);?></th>
+       <th><?php echo $paginatorEx->sortAllow(__('User Name', true), 'user_id', $pagenator_options);?></th>
+       <th><?php echo $this->PaginatorEx->sortAllow('modified');?></th>
+</tr>
+<?php
+$i = 0;
+foreach ($links as $link):
+       $class = null;
+       if ($i++ % 2 == 0) {
+               $class = ' class="altrow"';
+       }
+?>
+<tr<?php echo $class;?>>
+       <td<?php if ($isAdmin): ?> rowspan="2"<?php endif ?>><?php echo $link['Link']['id']; ?>&nbsp;</td>
+       <td>
+<?php 
+               echo $this->Html->link($link['Link']['title'], array('action' => 'view', $link['Link']['id']));
+               //echo $link['Link']['type'];
+               //echo $link['Link']['pickup'];
+               //echo $link['Link']['not_found'];
+?>
+       </td>
+       <td><?php echo $link['Link']['url']; ?>&nbsp;</td>
+       <td><?php echo $link['User']['name']; ?>&nbsp;</td>
+       <td><?php echo $link['Link']['modified']; ?>&nbsp;</td>
+</tr>
+<?php if ($isAdmin): ?>
+<tr>
+<td class="notes"<?php if ($isAdmin): ?> colspan="5"<?php endif; ?>>
+       <div><?php echo $link['Link']['notes']; ?></div>
+</td>
+</tr>
+<?php endif; ?>
+<?php endforeach; ?>
+</table>
+</div>
+
+<div class="paging">
+       <?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
+ |     <?php echo $this->Paginator->numbers();?>
+ |
+       <?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
+</div>
+
+<p>
+<?php
+       echo $this->Paginator->counter(array(
+       'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
+       ));
+?>
+</p>
+
+</div>
diff --git a/app/plugins/links/views/elements/link_sort_header.ctp b/app/plugins/links/views/elements/link_sort_header.ctp
new file mode 100644 (file)
index 0000000..03d7270
--- /dev/null
@@ -0,0 +1,34 @@
+<?php 
+/*
+ * Link Plugin for TRPG Databank
+ * 
+ * PHP version 5
+ *
+ * @copyright Copyright 2010, Cake. (http://trpgtools-onweb.sourceforge.jp/)
+ * @category Element
+ * @package  plugin for TRPG Data Bank
+ * @version  beta
+ * @author   Cake <cake_67@users.sourceforge.jp>
+ * @license  http://www.opensource.org/licenses/mit-license.php The MIT License
+ * @link     http://trpgtools-onweb.sourceforge.jp/
+ */
+
+$header = __('Links', true);
+
+$header .= $this->Html->tag('span',  
+       '['.$this->Html->link(__('Add Link', true), array(
+               'action' => 'add'
+       ), array(
+               'class' => 'edit'
+       )).']'
+);
+
+if (!$isSimple) {
+       $header .= '<span class="linkSort">'. __('Sort', true). ' : ';
+       $header .= $this->PaginatorEx->sortAllow(__('Title', true), 'title', $pagenator_options);
+       $header .= $this->PaginatorEx->sortAllow(__('Owner', true), 'user_id', $pagenator_options);
+       $header .= $this->PaginatorEx->sortAllow(__('Modified', true), 'modified', $pagenator_options);
+$header .= '</span>';
+}
+?>
+<div class="boxHeader"><h2><span><?php echo $header; ?></h2></span></div>
index 0f1576f..40830db 100644 (file)
@@ -13,7 +13,7 @@
  * @link     http://trpgtools-onweb.sourceforge.jp/
  */
 
-echo $this->element('link_index', array(
+echo $this->element('link_simplelist', array(
        'links' => $links,
        'isAdmin' => true,
 ));
index e4617c4..2bd5396 100644 (file)
  * @license  http://www.opensource.org/licenses/mit-license.php The MIT License
  * @link     http://trpgtools-onweb.sourceforge.jp/
  */
+echo $this->Html->css('/links/css/link.css');
+
 ?>
+<script language="JavaScript">
+<!--
+       var thumbnailweb_jump = '<?php echo $thumbnail['options']['thumbnailweb_']['jump']; ?>';
+       var thumbnailweb_target = '<?php echo $thumbnail['options']['thumbnailweb_']['target']; ?>';
+       var thumbnailweb_lpos = '<?php echo $thumbnail['options']['thumbnailweb_']['lpos']; ?>';
+       var thumbnailweb_lposv = '<?php echo $thumbnail['options']['thumbnailweb_']['lposv']; ?>';
+
+//-->
+</script>
 <div class="links view">
-<h2><?php  __('Link');?></h2>
-       <dl><?php $i = 0; $class = ' class="altrow"';?>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $link['Link']['id']; ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Title'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $link['Link']['title']; ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('User'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $this->Html->link($link['User']['name'], array('controller' => 'users', 'action' => 'view', $link['User']['id'])); ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Url'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $link['Link']['url']; ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Type'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $link['Link']['type']; ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Pickup'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $link['Link']['pickup']; ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Not Found'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $link['Link']['not_found']; ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Modified'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $link['Link']['modified']; ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Created'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $link['Link']['created']; ?>
-                       &nbsp;
-               </dd>
-       </dl>
+<?php
+echo $this->element('link_view', array(
+       'link' => $link,
+       'isDelete' => false,
+       'isAdmin' => $isAdmin,
+));
+?>
+
+<div class="backButton">
+<?php
+       echo $form->create('', array('url' => array(
+               'action' => 'index'), 
+               'type' => 'GET', 
+               'id' => 'BacgButton'
+       ));
+       echo $form->end(array('label' => __('Lists', true)));
+?>
 </div>
-<div class="actions">
-       <h3><?php __('Actions'); ?></h3>
-       <ul>
-               <li><?php echo $this->Html->link(__('Edit Link', true), array('action' => 'edit', $link['Link']['id'])); ?> </li>
-               <li><?php echo $this->Html->link(__('Delete Link', true), array('action' => 'delete', $link['Link']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $link['Link']['id'])); ?> </li>
-               <li><?php echo $this->Html->link(__('List Links', true), array('action' => 'index')); ?> </li>
-               <li><?php echo $this->Html->link(__('New Link', true), array('action' => 'add')); ?> </li>
-               <li><?php echo $this->Html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
-               <li><?php echo $this->Html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
-       </ul>
+
 </div>
index 54a8368..f189a6b 100644 (file)
@@ -13,7 +13,7 @@
  * @link     http://trpgtools-onweb.sourceforge.jp/
  */
 
-echo $this->element('link_index', array(
+echo $this->element('link_listview', array(
        'links' => $links,
        'isAdmin' => false,
 ));
index e538088..e74de3d 100644 (file)
@@ -51,3 +51,7 @@ span.linkSort {
        clear: both;
        padding-top: 7px;
 }
+
+#Links_admin_listview table th {
+    white-space: nowrap;
+}