OSDN Git Service

Profilesの表示デザイン変更
authorCake <cake_67@users.sourceforge.jp>
Mon, 25 Jan 2010 15:56:30 +0000 (00:56 +0900)
committerCake <cake_67@users.sourceforge.jp>
Mon, 25 Jan 2010 15:56:30 +0000 (00:56 +0900)
app/controllers/app_controller.php
app/views/helpers/select.php
app/views/systems/admin_view.ctp
app/views/systems/view.ctp
app/webroot/css/base.css

index 24c3173..4356372 100644 (file)
@@ -42,8 +42,6 @@ class AppController extends Controller
                'Token'
        );
 
-       var $onReady = '';
-
        /* ACL */
        // 追加アクション用 crudMap
        var $actionMapPlus = array();
index 1a7cf11..1d5288a 100644 (file)
@@ -28,6 +28,8 @@ class SelectHelper extends Helper {
        );
        var $i18n_profile_types = array();
 
+       var $profile_type = array();
+
        /**
         * public_flagの設定をview表示形式に変換
         *
@@ -238,5 +240,26 @@ class SelectHelper extends Helper {
 
                echo $this->Form->input('profile_type', $option);
        }
+
+       /* Profile種類を判断 */
+       function set_profile_type4view($profile)
+       {
+               $this->profile_type = array(
+                       'is_select' => false,
+                       'is_table' => false,
+                       'is_multi' => false,
+               );
+
+               if ($profile['profile_type'] == 'select' || $profile['profile_type'] == 'm-select') {
+                       $this->profile_type['is_select'] = true;
+               }
+               if ($profile['profile_type'] == 'm-table') {
+                       $this->profile_type['is_table'] = true;
+               }
+               if ($profile['profile_type'] == 'm-select' || $profile['profile_type'] == 'm-table') {
+                       $this->profile_type['is_multi'] = true;
+               }
+       }
+
 }
 
index 24565b2..14ecc9e 100644 (file)
@@ -1,41 +1,60 @@
 <div class="systems view">
-<h2><?php  __('System');?></h2>
-       <dl><?php $i = 0; $class = ' class="altrow"';?>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Name'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $system['System']['name']; ?><br>
-                       <?php if ($system['System']['url']): ?>
-                               <?php echo $html->link('<img src="'.$system['System']['image_filename'].'" alt="system imagefile">', $system['System']['url'], array('target'=>'_blank'), false, false); ?>
-                       <?php else: ?>
-                               <?php echo '<img src="'.$system['System']['image_filename'].'" alt="system imagefile">'; ?>
-                       <?php endif; ?>
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('URL'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php if ($system['System']['url']): ?>
-                               <?php echo $html->link($system['System']['url'], $system['System']['url'], array('target'=>'_blank'), false, false); ?>
-                       <?php else: ?>
-                       &nbsp;
-                       <?php endif; ?>
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Use NPC Setting'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php if ($system['System']['set_npc']): ?>
-                               <?php echo __('Use', true) ?>
-                       <?php else: ?>
-                               <?php echo __('No Use', true) ?>
-                       <?php endif; ?>
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Public'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $select->get_i18n_public_flag($system['System']['public_flag'], $public_flags) ?>
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Detail'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $system['System']['detail']; ?>
-                       &nbsp;
-               </dd>
-       </dl>
+<h2><?php echo $system['System']['name']; ?></h2>
+<table cellpadding="0" cellspacing="0">
+<tbody>
+<tr>
+<th>
+       <?php __('Image'); ?>
+</th>
+<td colspan="3" class="photo">
+       <?php if ($system['System']['url']): ?>
+               <?php echo $html->link('<img src="'.$system['System']['image_filename'].'" alt="system imagefile">', $system['System']['url'], array('target'=>'_blank'), false, false); ?>
+       <?php else: ?>
+               <?php echo '<img src="'.$system['System']['image_filename'].'" alt="system imagefile">'; ?>
+       <?php endif; ?>
+</td>
+</tr>
+<tr>
+<th>
+       <?php __('URL'); ?>
+</th>
+<td colspan="3">
+       <?php if ($system['System']['url']): ?>
+               <?php echo $html->link($system['System']['url'], $system['System']['url'], array('target'=>'_blank'), false, false); ?>
+       <?php else: ?>
+               &nbsp;
+       <?php endif; ?>
+</td>
+</tr>
+<tr>
+<th>
+       <?php __('Public'); ?>
+</th>
+<td>
+       <?php echo $select->get_i18n_public_flag($system['System']['public_flag'], $public_flags) ?>
+</td>
+<th>
+       <?php __('Use NPC Setting'); ?>
+</th>
+<td>
+       <?php if ($system['System']['set_npc']): ?>
+               <?php echo __('Use', true) ?>
+       <?php else: ?>
+               <?php echo __('No Use', true) ?>
+       <?php endif; ?>
+</td>
+</tr>
+<tr>
+<th>
+       <?php __('Detail'); ?>
+</th>
+<td colspan="3">
+       <?php echo $system['System']['detail']; ?>
+       &nbsp;
+</td>
+</tr>
+</tbody>
+</table>
 </div>
 <div class="actions">
        <ul>
@@ -47,7 +66,7 @@
 
 <hr>
 
-<div class="profiles index">
+<div class="profiles view">
 <h2><?php __('Profiles');?></h2>
 <p>
 <div class="actions">
 <p>
 <table cellpadding="0" cellspacing="0">
 <tr>
-       <th><?php echo __('ID', true);?></th>
-       <th><?php echo __('Item Name', true);?></th>
-       <th class="actions"><?php echo __('Action', true);?></th>
-       <th><?php echo __('Key Name', true);?></th>
-       <th><?php echo __('Sort Order');?></th>
-       <th><?php echo __('Input Type', true);?></th>
-       <th><?php echo __('Required', true);?></th>
-       <th><?php echo __('Editable', true);?></th>
-       <th><?php echo __('Default Public Flag', true);?></th>
+<th>
+       <?php echo __('ID', true);?>
+</th>
+<th>
+       <?php echo __('Sort Order');?>
+</th>
+<th colspan="6">
+       <?php echo __('Detail');?>
+</th>
 </tr>
 <?php
 $i = 0;
 foreach ($system['Profile'] as $profile):
        $class = null;
        if ($i++ % 2 == 0) {
-               $class = ' class="altrow"';
+               $class .= 'altrow';
        }
+       $select->set_profile_type4view($profile);
 ?>
-       <tr<?php echo $class;?>>
-               <td>
-                       <?php echo $profile['id']; ?>
-               </td>
-               <td>
-                       <?php echo $profile['name']; ?>
-               </td>
-               <td class="actions">
-                       <?php echo $html->link(__('Edit', true), array('controller' => 'profiles', 'action' => 'edit', $profile['id'])); ?>
-                       <?php echo $html->link(__('Delete', true), array('controller' => 'profiles', 'action' => 'delete', $profile['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $profile['id'])); ?>
-               </td>
-               <td>
-                       <?php echo $profile['key_name']; ?>
-               </td>
-               <td>
-                       <?php echo $profile['sort_order']; ?>
-               </td>
-               <td>
-                       <?php 
-                               $profile_type = $select->get_i18n_profile_type($profile['profile_type'], $profile_types);
-                               echo $profile_type;
+<tr class="<?php echo $class;?>">
+<td rowspan="<?php if ($select->profile_type['is_select'] || $select->profile_type['is_table']): ?>4<?php else: ?>3<?php endif; ?>">
+       <?php echo $profile['id']; ?>
+</td>
+<td rowspan="<?php if ($select->profile_type['is_select'] || $select->profile_type['is_table']): ?>4<?php else: ?>3<?php endif; ?>">
+       <?php echo $profile['sort_order']; ?>
+</td>
 
-                               if ($profile['profile_type'] == 'select' || $profile['profile_type'] == 'm-select') {
-                                       $select->disp_select4profile_selects($profile['ProfileSelect']);
-                                       echo '<div class="edit_link">'.$html->link(__('Edit Items', true), array('controller' => 'profile_selects', 'action' => 'admin_listview', $profile['id'])).'</div>';
-                               } elseif ($profile['profile_type'] == 'table') {
-                                       echo '<div class="edit_link">'.$html->link(__('Edit Table', true), array('controller' => 'profile_tables', 'action' => 'admin_listview', $profile['id'])).'</div>';
-                               }
-                       ?>
-               </td>
-               <td>
-                       <?php if ($profile['required']) {
-                               echo __('true' ,true);
-                       } else {
-                               echo __('false' ,true);
-                       }
-                       ?>
-               </td>
-               <td>
-                       <?php if ($profile['editable']) {
-                               echo __('true' ,true);
-                       } else {
-                               echo __('false' ,true);
-                       }
-                       ?>
-               </td>
-               <td>
-                       <?php echo $select->get_i18n_public_flag($profile['public_flag_default'], $public_flags); ?>
-               </td>
-       </tr>
+<th>
+       <?php echo __('Item Name', true);?>
+</th>
+<th>
+       <?php echo __('Key Name', true);?>
+</th>
+<th>
+       <?php echo __('Input Type', true);?>
+</th>
+<th>
+       <?php echo __('Required', true);?>
+</th>
+<th>
+       <?php echo __('Editable', true);?>
+</th>
+<th>
+       <?php echo __('Default Public Flag', true);?>
+</th>
+</tr>
+<tr>
+<td>
+       <?php echo $profile['name']; ?>
+</td>
+<td>
+       <?php echo $profile['key_name']; ?>
+</td>
+<td>
+<?php 
+       $profile_type = $select->get_i18n_profile_type($profile['profile_type'], $profile_types);
+       echo $profile_type;
+?>
+</td>
+<td>
+<?php if ($profile['required']) {
+               echo __('true' ,true);
+       } else {
+               echo __('false' ,true);
+       }
+?>
+</td>
+<td>
+<?php if ($profile['editable']) {
+               echo __('true' ,true);
+       } else {
+               echo __('false' ,true);
+       }
+?>
+</td>
+<td>
+       <?php echo $select->get_i18n_public_flag($profile['public_flag_default'], $public_flags); ?>
+</td>
+</tr>
+<?php if ($select->profile_type['is_select'] || $select->profile_type['is_table']): ?> 
+<tr>
+<td colspan="6">
+<?php 
+       if ($select->profile_type['is_select']) {
+               $select->disp_select4profile_selects($profile['ProfileSelect']);
+               echo '<span class="edit_link">'.$html->link(__('Edit Select Items', true), array('controller' => 'profile_selects', 'action' => 'admin_listview', $profile['id'])).'</span>';
+       } elseif ($select->profile_type['is_table']) {
+               echo '<div class="edit_link">'.$html->link(__('Edit Table', true), array('controller' => 'profile_tables', 'action' => 'admin_listview', $profile['id'])).'</div>';
+       }
+?>
+</td>
+</tr>
+<?php endif; ?>
+<tr>
+<td colspan="6" class="actions">
+       <?php echo $html->link(__('Edit', true), array('controller' => 'profiles', 'action' => 'edit', $profile['id'])); ?>
+       <?php echo $html->link(__('Delete', true), array('controller' => 'profiles', 'action' => 'delete', $profile['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $profile['id'])); ?>
+</td>
+</tr>
 <?php endforeach; ?>
 </table>
 </div>
index 2a4c58c..62c259f 100644 (file)
@@ -1,21 +1,42 @@
 <div class="systems view">
-<h2><?php  __('System');?></h2>
-       <dl><?php $i = 0; $class = ' class="altrow"';?>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Name'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $system['System']['name']; ?><br>
-                       <?php if ($system['System']['url']): ?>
-                               <?php echo $html->link('<img src="'.$system['System']['image_filename'].'" alt="system imagefile">', $system['System']['url'], array('target'=>'_blank'), false, false); ?>
-                       <?php else: ?>
-                               <?php echo '<img src="'.$system['System']['image_filename'].'" alt="system imagefile">'; ?>
-                       <?php endif; ?>
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Detail'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $system['System']['detail']; ?>
-                       &nbsp;
-               </dd>
-       </dl>
+<h2><?php echo $system['System']['name']; ?></h2>
+<table cellpadding="0" cellspacing="0">
+<tbody>
+<tr>
+<th>
+       <?php __('Image'); ?>
+</th>
+<td colspan="3" class="photo">
+       <?php if ($system['System']['url']): ?>
+               <?php echo $html->link('<img src="'.$system['System']['image_filename'].'" alt="system imagefile">', $system['System']['url'], array('target'=>'_blank'), false, false); ?>
+       <?php else: ?>
+               <?php echo '<img src="'.$system['System']['image_filename'].'" alt="system imagefile">'; ?>
+       <?php endif; ?>
+</td>
+</tr>
+<tr>
+<th>
+       <?php __('URL'); ?>
+</th>
+<td colspan="3">
+       <?php if ($system['System']['url']): ?>
+               <?php echo $html->link($system['System']['url'], $system['System']['url'], array('target'=>'_blank'), false, false); ?>
+       <?php else: ?>
+               &nbsp;
+       <?php endif; ?>
+</td>
+</tr>
+<tr>
+<th>
+       <?php __('Detail'); ?>
+</th>
+<td colspan="3">
+       <?php echo $system['System']['detail']; ?>
+       &nbsp;
+</td>
+</tr>
+</tbody>
+</table>
 </div>
 <div class="actions">
        <ul>
index 68aae4f..5389746 100644 (file)
@@ -1,3 +1,4 @@
+@charset "UTF-8";
 <?php 
 /* copyright */
  ?>
@@ -293,9 +294,8 @@ dt {
 }
 dd {
        margin-left: 10em;
-       margin-top: -1.8em;
+       margin-top: -2em;
        vertical-align: top;
-       line-height: 1.4em;
 }
 
 /* Forms */
@@ -338,7 +338,8 @@ form div {
 form div.input {
        color: #444;
 }
-form div label {
+form div.required {
+       color: #333;
        font-weight: bold;
 }
 form div.submit {
@@ -347,11 +348,6 @@ form div.submit {
        margin-top: 10px;
        margin-left: 140px;
 }
-form div.attention {
-       font-weight: bold;
-       margin-bottom: 0;
-       padding: 0.5em 0.5em 0;
-}
 label {
        display: block;
        font-size: 110%;
@@ -438,11 +434,6 @@ p.error em {
        background: green;
        color: #fff;
 }
-span.required {
-       color: #ff3300;
-       font-weight: bold;
-       padding-left: 0.5em;
-}
 
 /* Related */
 div.related {
@@ -450,3 +441,26 @@ div.related {
        display: block;
 }
 
+
+/* パーツ */
+#content div.view {
+}
+#content div.view table {
+       width: auto;
+       border-bottom: 1px solid #ccc;
+}
+#content div.view th, td {
+       border: 1px solid #ccc;
+       border-bottom: 0 none;
+       padding: 3px;
+}
+#content div.view th {
+       background-color: #ddd;
+}
+#content div.view td {
+       text-align: left;
+}
+#content div.view .select {
+       display: inline;
+       padding-right: 5px;
+}
\ No newline at end of file