'recursive' => 1,
'contain' => array(
'Attachment',
+ 'Character',
),
- 'limit' => 20,
+ 'limit' => 10,
'order' => array(
'System.sort_order' => 'asc'
),
function index() {
$this->paginate['conditions']['public_flag'] = 'public';
+ $this->System->hasMany['Character']['limit'] = 8;
$this->_index();
}
}
function admin_index() {
+ unset($this->System->hasMany['Character']['conditions']['Character.public_flag']);
$this->_index();
}
$systems = $this->paginate();
if (!empty($systems)) {
+ // 全キャラクター数取得
+ foreach ($systems as $k => $v) {
+ if (empty($v['Character'])) {
+ $systems[$k]['System']['character_num'] = 0;
+ continue;
+ }
+
+ $systems[$k]['System']['character_num'] = $this->System->Character->find('count', array(
+ 'conditions' => array_merge($this->System->hasMany['Character']['conditions'],
+ array('Character.system_id' => $v['System']['id'])),
+ 'recursive' => -1,
+ ));
+ }
+
$systems = $this->HtmlEscape->nl_unescape($systems);
}
),
'fields' => '',
'order' => 'Character.modified DESC',
- 'limit' => '20',
+ 'limit' => '5',
),
'Profile' => array(
'className' => 'Profile',
<?php
$i = 0;
foreach ($characters as $character):
+ if (!isset($character['Character'])) {
+ $character['Character'] = $character;
+ }
if ($i % $colNum == 0) {
echo '<tr>';
}
));
?>
</div>
+<?php if (isset($isCharacter) && $isCharacter === true): ?>
<?php
-// echo $html->div('characterName', $html->link($character['Character']['name'], array('controller' => 'characters', 'action' => 'view', $character['Character']['id'])));
+ echo $html->div('characterName', $html->link($character['Character']['name'], array('controller' => 'characters', 'action' => 'view', $character['Character']['id'])));
?>
+<?php endif; ?>
<?php if ($isUser && isset($character['User'])): ?>
<?php
echo $html->div('userName', $html->link($character['User']['name'], array('controller' => 'users', 'action' => 'view', $character['User']['id'])));
echo $html->div('systemName', $html->link($character['System']['name'], array('controller' => 'systems', 'action' => 'view', $character['System']['id'])));
?>
<?php endif; ?>
+<?php if (!isset($isModified) || $isModified === true): ?>
<?php
echo $html->div('lastModified', $time->niceShort($character['Character']['modified'], array('format' => 'Y/m/d H:i')));
?>
+<?php endif; ?>
</td>
<?php
</tr>
</table>
<?php else: ?>
-<?php if (isset($nodata)): ?>
-<?php echo $nodata; ?>
-<?php else: ?>
-<?php echo $html->div('noData', __('No data', true)); ?>
-<?php endif; ?>
<?php endif; ?>
</div>
<h2><?php __('Systems');?></h2>
<p>
<?php
+$paginator->options(array('url' => $this->passedArgs));
+
echo $paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
<th><?php echo $paginator->sort('id');?></th>
<th><?php echo $paginator->sort(__('Name', true), 'name');?></th>
<th><?php echo $paginator->sort(__('Order', true), 'sort_order');?></th>
- <th><?php echo $paginator->sort(__('Use NPC', true), 'set_npc');?></th>
<th><?php echo $paginator->sort(__('Public', true), 'public_flag');?></th>
</tr>
<?php
$i = 0;
foreach ($systems as $system):
$class = null;
- if ($i++ % 2 == 0) {
- $class = ' class="altrow"';
- }
?>
-<tr<?php echo $class;?>>
+<tr>
<td>
<?php echo $system['System']['id']; ?>
</td>
<td>
<?php
$file = $upfile->file(
- 'filter/xxs',
+ 'filter/xs',
CorePlus::get_value($system, 'Attachment.0'),
array(
'model_name' => 'System',
'nodata' => 'image',
)
);
- echo $upfile->embed(
+ $system_img = $upfile->embed(
$file,
array(
'alt' => CorePlus::get_value($system, 'Attachment.0.alternative'),
),
)
);
+
+ $system_name = $html->link($system['System']['name'], array('action' => 'view', $system['System']['id']));
+
+ $total = $html->tag('span', sprintf(__('Total Characters %d', true), $system['System']['character_num']), array('class' => 'total_chara_num'));
+
+ echo $this->renderElement('character_picture_table', array(
+ 'header' => $system_img. $system_name. $total,
+ 'characters' => $system['Character'],
+ 'previewVersion' => 's',
+ 'colNum' => 5,
+ 'id' => null,
+ 'isUser' => false,
+ 'isCharacter' => true,
+ 'isSystem' => false,
+ 'isModified' => false,
+ 'more_url' => array(
+ 'controller' => 'systems',
+ 'action' => 'view',
+ $system['System']['id'],
+ ),
+ ));
?>
- <?php echo $html->link($system['System']['name'], array('action' => 'view', $system['System']['id'])); ?>
</td>
<td>
<?php echo $system['System']['sort_order']; ?>
</td>
<td>
-<?php if ($system['System']['set_npc']): ?>
- <?php echo __('Use'); ?>
-<?php else: ?>
- <?php echo __('No Use'); ?>
-<?php endif; ?>
-</td>
-<td>
<?php echo $select->get_i18n_public_flag($system['System']['public_flag'], $public_flags) ?>
</td>
</tr>
<div class="paging">
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
- | <?php echo $paginator->numbers();?>
+ | <?php echo $paginator->numbers();?> |
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
</div>
<h2><?php __('Systems');?></h2>
<p>
<?php
+$paginator->options(array('url' => $this->passedArgs));
+
echo $paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
?></p>
-<table>
-<tr>
-<tr>
- <th><?php echo __('Name', true);?></th>
- <th><?php echo __('Characters', true);?></th>
-</tr>
+
<?php
$i = 0;
foreach ($systems as $system):
$class = null;
- if ($i++ % 2 == 0) {
- $class = ' class="altrow"';
- }
?>
-<tr<?php echo $class;?>>
-<td>
+<div class="systemList">
<?php
$file = $upfile->file(
'filter/xs',
'nodata' => 'image',
)
);
- echo $upfile->embed(
+ $system_img = $upfile->embed(
$file,
array(
'alt' => CorePlus::get_value($system, 'Attachment.0.alternative'),
),
)
);
+
+ $system_name = $html->link($system['System']['name'], array('action' => 'view', $system['System']['id']));
+
+ $total = $html->tag('span', sprintf(__('Total Characters %d', true), $system['System']['character_num']), array('class' => 'total_chara_num'));
+
+ echo $this->renderElement('character_picture_table', array(
+ 'header' => $system_img. $system_name. $total,
+ 'characters' => $system['Character'],
+ 'previewVersion' => 's',
+ 'colNum' => 8,
+ 'id' => null,
+ 'isUser' => false,
+ 'isCharacter' => true,
+ 'isSystem' => false,
+ 'isModified' => false,
+ 'more_url' => array(
+ 'controller' => 'systems',
+ 'action' => 'view',
+ $system['System']['id'],
+ ),
+ ));
?>
- <?php echo $html->link($system['System']['name'], array('action' => 'view', $system['System']['id'])); ?>
-</td>
-</tr>
+</div>
<?php endforeach; ?>
-</table>
</div>
<div class="paging">
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
- | <?php echo $paginator->numbers();?>
+ | <?php echo $paginator->numbers();?> |
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
</div>
}
/* 各サイズごとの設定 */
+.CharacterTable_s_5
+{
+ width: 400px;
+ overflow: hidden;
+}
+.CharacterTable_s_8
+{
+ width: 640px;
+ overflow: hidden;
+}
+.CharacterTable_s_5 td,
+.CharacterTable_s_8 td
+{
+ width: 64px;
+ overflow: hidden;
+}
+.CharacterTable_s_5 div.picture,
+.CharacterTable_s_8 div.picture
+{
+ width: 64px;
+ height: 64px;
+ overflow: hidden;
+ padding: 3px;
+}
+.CharacterTable_s_5 div.picture a.characterThmbnail,
+.CharacterTable_s_8 div.picture a.characterThmbnail
+{
+ width: 64px;
+ height: 64px;
+ overflow: hidden;
+}
+.CharacterTable_s_5 div.picture a.characterThmbnail span.image_caption,
+.CharacterTable_s_8 div.picture a.characterThmbnail span.image_caption
+{
+ display: none;
+}
+.CharacterTable_s_5 div.characterName,
+.CharacterTable_s_8 div.characterName
+{
+ height: 0.7em;
+ font-size: 70%;
+ width: 64px;
+}
+.CharacterTable_s_5 .boxFooter .editLink,
+.CharacterTable_s_8 .boxFooter .editLink
+{
+ padding: 2px 32px;
+}
+
+
.CharacterTable_m_5
{
width: 725px;
margin: 10px;
font-size: 120%;
}
+
+/* System一覧 */
+.systemList {
+ padding-top: 10px;
+}
+
+/* キャラクター数表示 */
+.total_chara_num {
+ padding-left: 7px;
+}
+
+.boxHeader .total_chara_num {
+ font-size: 80%;
+ font-weight: normal;
+}
width: 177px;
left: 4px;
}
+
+.CharacterTable_s_5
+{
+ width: 435px;
+}
+.CharacterTable_s_8
+{
+ width: 696px;
+}
+.CharacterTable_s_5 td,
+.CharacterTable_s_8 td
+{
+ width: 70px;
+}
+.CharacterTable_s_5 div.picture,
+.CharacterTable_s_8 div.picture
+{
+ width: 70px;
+ height: 70px;
+}