OSDN Git Service

テーマ機能基本導入
authorCake <cake_67@users.sourceforge.jp>
Fri, 2 Apr 2010 07:13:47 +0000 (16:13 +0900)
committerCake <cake_67@users.sourceforge.jp>
Fri, 2 Apr 2010 07:13:47 +0000 (16:13 +0900)
app/controllers/characters_controller.php
app/views/themed/empty [new file with mode: 0644]
app/views/themed/example/characters/view.ctp [new file with mode: 0644]
app/webroot/themed/empty [new file with mode: 0644]

index 9a699fa..92b6771 100644 (file)
@@ -8,6 +8,10 @@ class CharactersController extends AppController {
                'Profiledisp',
        );
 
+       /* テーマ */
+       var $view = 'View';
+       var $theme = null;
+
        /* ACL */
        // 追加アクション用 crudMap
        var $actionMapPlus = array(
@@ -46,6 +50,9 @@ class CharactersController extends AppController {
        }
 
        function view($id = null) {
+                $this->view = 'Theme';
+                $this->theme = 'example';
+
                if (!$id) {
                        $this->Session->setFlash(__('Invalid Character.', true));
                        $this->redirect(array('action'=>'index'));
diff --git a/app/views/themed/empty b/app/views/themed/empty
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/app/views/themed/example/characters/view.ctp b/app/views/themed/example/characters/view.ctp
new file mode 100644 (file)
index 0000000..7fe1c68
--- /dev/null
@@ -0,0 +1,277 @@
+<?php 
+echo $this->renderElement('character_picture_full', array(
+       'basename' => $character['Character']['full_length'],
+       'options' => array(
+               'previewVersion' => 'orig',
+               'class' => '',
+               'nodata' => '',
+       )
+));
+?>
+<div class="characters view fullLength fullLength-rightTop">
+
+<div class="box">
+<div class="boxHeader"><h3>
+テーマビュー
+
+<?php echo $character['Character']['name'];?>
+
+<?php if ($isOwner && $systemValid == 'public'): ?>
+<?php
+       echo $html->tag(
+               'span',
+               $html->link(__('Edit', true), array('action' => 'edit', $character['Character']['id'])),
+               array('class' => 'link')
+       ); 
+?>
+<?php endif; ?>
+</h3></div>
+<div class="boxBody">
+
+<table class="CharacterSheet">
+<tbody>
+<!-- Header -->
+<tr id="CharacterStatusRow">
+<td colspan="2" class="SystemRow">
+<!-- System -->
+<table class="System">
+<tbody>
+<tr>
+<td>
+<lavel><?php __('System') ?></label>
+<?php if (isset($character['System'])): ?>
+<?php if ($systemValid == 'public'): ?>
+<?php
+       echo $html->div(
+               'CharacterSheetHeader',
+               $html->link(
+                       $character['System']['name'], 
+                       array('controller' => 'systems', 'action' => 'view', $character['System']['id'])
+               )
+       );
+?>
+<?php else: ?>
+<?php if ($systemValid == 'unpublic'): ?>
+<?php
+       echo $html->div(
+               'publicFlag', 
+               $select->get_i18n_unpublic_flag($character['System']['public_flag'], $public_flags)
+       );
+
+?>
+<?php endif; ?>
+<?php if ($isOwner): ?>
+<?php
+       echo $html->div(
+               'CharacterSheetHeader',
+               $html->link(
+                       __('Select New System', true), 
+                       array('controller' => 'characters', 'action' => 'change_system', $character['Character']['id'])
+               )
+       );
+?>
+<?php endif; ?>
+<?php endif; ?>
+<?php endif; ?>
+</td>
+<td>
+<lavel><?php __('Status') ?></label>
+<?php 
+       echo $html->div(
+               'CharacterSheetHeader',
+               $select->get_i18n_status($character['Character']['status'], $status)
+       );
+ ?>
+</td>
+<?php if ($isOwner || $is_admin): ?>
+<td>
+<lavel><?php __('Public Flag') ?></label>
+<?php 
+       echo $html->div(
+               'CharacterSheetHeader publicFlag',
+               $select->get_i18n_public_flag($character['Character']['public_flag'], $public_flags)
+       );
+ ?>
+</td>
+<?php endif; ?>
+<td>
+<lavel><?php __('Modified') ?></label>
+<?php
+       echo $html->div(
+               'CharacterSheetHeader date',
+               $time->niceshort(
+                       $character['Character']['modified'],
+                       array(
+                               'format' => 'Y/m/d H:i',
+                       )
+               )
+       );
+?>
+</td>
+</tr>
+</table>
+</td>
+<!-- キャラ画像 -->
+<td class="image160" rowspan="4">
+<div class="image150" id="CharacterMainPicture">
+<?php 
+       $url = array('controller' => 'character_pictures', 'action' => 'index', $character['Character']['id']);
+
+       echo $this->renderElement('character_picture_image', array(
+               'basename' => $character['Character']['main_picture'],
+               'options' => array(
+                       'class' => 'mainImage',
+                       'url' => $url,
+                       'alt' => $text->truncate($character['Character']['name'], 64),
+               )
+       ));
+ ?>
+</div>
+<?php
+       if ($isOwner) {
+               echo $html->div('editImageLink', 
+                       $html->link(__('Edit Image', true), $url)
+               );
+       }
+?>
+</td>
+</tr>
+<!-- Characters -->
+<tr>
+<th class="profileName">
+<?php
+       __('Charater Name');
+?>
+</th>
+<td class="CharacterBasicData">
+<div id="CharacterName">
+<?php 
+       echo $character['Character']['name'];
+?>
+</div>
+</td>
+</tr>
+<tr>
+<th class="profileName">
+<?php
+       __('Player Name');
+?>
+</th>
+<td class="CharacterBasicData">
+<div id="UserName">
+<?php 
+       echo $html->link(
+               $character['User']['name'], 
+               array(
+                       'controller' => 'users', 
+                       'action' => 'view', 
+                       $character['User']['id']
+               ), 
+               array(), 
+               false, 
+               false
+       );
+?>
+</div>
+</td>
+</tr>
+<!-- キャラ画像:サムネイル -->
+<tr>
+<th class="profileName">
+       <?php __('Pictures'); ?>
+</th>
+<td class="CharacterBasicData">
+<div id="CharacterPictures">
+<?php
+       $num = 0;
+       foreach ($character['CharacterPicture'] as  $k => $v) {
+               if ($num > 4) {
+                       break;
+               }
+               $picture = $this->renderElement('character_picture_image', array(
+                       'attachment' => $v['Attachment'][0],
+                       'options' => array(
+                               'previewVersion' => 's',
+                               'class' => 'shadow',
+                               'url' => array('controller' => 'character_pictures', 'action' => 'view', $v['id']),
+                               'alternative' => $v['Attachment'][0]['alternative'],
+                       )
+               ));
+
+               echo $html->div('attachments', $picture);
+
+               $num++;
+       }
+
+       if (count($character['CharacterPicture']) > 0) {
+               echo $html->link(
+                       __(' ...More', true),
+                       $url = array('controller' => 'character_pictures', 'action' => 'index', $character['Character']['id'])
+               );
+       } elseif ($isOwner) {
+               echo $html->link(
+                       __('Add Pictures', true),
+                       $url = array('controller' => 'character_pictures', 'action' => 'index', $character['Character']['id'])
+               );
+       }
+?>
+</div>
+</td>
+</tr>
+
+<!-- Profiles -->
+<?php if (isset($character['System']['Profile'])): ?>
+<?php
+// profile設定の表示
+$profiles = $character['System']['Profile'];
+
+foreach($profiles as $key =>$profile):
+       $profiledisp->set_profile_type4view($profile);
+ ?>
+<tr>
+<th class="profileName">
+       <?php echo $profile['name']; ?>
+</th>
+<td colspan="3" class="CharacterProfileData<?php if ($profiledisp->profile_type['is_table']): ?> table<?php endif; ?>">
+<div id="<?php echo $key; ?>">
+<?php 
+       $profiledisp->disp_values4characters_has_profiles($profile, 2, $isOwner, $character['Character']['id']);
+ ?>
+</div>
+</td>
+</tr>
+<?php endforeach; ?>
+<?php endif; ?>
+
+<!-- Notes -->
+<tr>
+<th class="profileName">
+       <?php __('Notes'); ?>
+</th>
+<td colspan="3" class="CharacterProfileData">
+<div id="Notes">
+<?php 
+       echo $character['Character']['notes'];
+ ?>
+</div>
+</td>
+</tr>
+</tbody>
+</table>
+
+</div>
+<div class="boxFooter">
+<?php if ($isOwner && $systemValid == 'public'): ?>
+<?php
+       echo $html->tag(
+               'span',
+               $html->link(__('Edit Character', true), array('action' => 'edit', $character['Character']['id'])),
+               array('class' => 'link')
+       ); 
+?>
+<?php endif; ?>
+
+</div>
+</div>
+
+</div>
diff --git a/app/webroot/themed/empty b/app/webroot/themed/empty
new file mode 100644 (file)
index 0000000..e69de29