OSDN Git Service

Systems等でプロフィール表示の調整
authorCake <cake_67@users.sourceforge.jp>
Wed, 3 Feb 2010 14:03:40 +0000 (23:03 +0900)
committerCake <cake_67@users.sourceforge.jp>
Wed, 3 Feb 2010 14:03:40 +0000 (23:03 +0900)
app/views/characters/edit.ctp
app/views/helpers/profiledisp.php
app/views/profile_selects/admin_listview.ctp
app/views/systems/admin_view.ctp
app/views/systems/view.ctp
app/webroot/css/base.css

index d8e6f32..5249991 100644 (file)
 </th>
 <td colspan="3"<?php if ($profiledisp->profile_type['is_table']): ?> class="table"<?php endif; ?>>
 <?php 
-       $profiledisp->disp_forms4profile_type($profile, false, 2, 0);
+       $profiledisp->disp_forms4profile_type($profile, 0, 0);
  ?>
 </td>
 </tr>
index 9cbbf45..b9a26cc 100644 (file)
@@ -387,9 +387,13 @@ class ProfiledispHelper extends Helper {
        /* profile_typeの設定に応じてフォーム表示
         * set_profile_type4view($profile)チェック済み前提。
         */
-       function disp_forms4profile_type($profile, $admin = false, $form_num = 2, $table_blank = 2)
+       function disp_forms4profile_type($profile, $form_num = 2, $table_blank = 2)
        {
 
+               if (!isset($profile['CharactersHasProfile'])) {
+                       $profile['CharactersHasProfile'] = array();
+               }
+
                if ($this->profile_type['is_select'] || $this->profile_type['is_radio'] || $this->profile_type['is_checkbox']) {
                        if ($this->profile_type['is_select']) {
                                $this->disp_select4profile_selects($profile['ProfileSelect'], $profile['CharactersHasProfile']);
@@ -398,9 +402,6 @@ class ProfiledispHelper extends Helper {
                        } elseif ($this->profile_type['is_checkbox']) {
                                $this->disp_checkbox4profile_selects($profile['ProfileSelect'], $profile['CharactersHasProfile']);
                        }
-                       if ($admin === true) {
-                               echo '<span class="edit_link">'.$this->Html->link(__('Edit Items', true), array('controller' => 'profile_selects', 'action' => 'admin_listview', $profile['id'])).'</span>';
-                       }
                } elseif ($this->profile_type['is_table']) {
                        echo '<table>';
                        $this->disp_th4profile_tables($profile['ProfileTable'], $profile['CharactersHasProfile']);
@@ -421,9 +422,6 @@ class ProfiledispHelper extends Helper {
                        }
                        echo '</tbody>';
                        echo '</table>';
-                       if ($admin === true) {
-                               echo '<div class="edit_link">'.$this->Html->link(__('Edit Table', true), array('controller' => 'profile_tables', 'action' => 'admin_listview', $profile['id'])).'</div>';
-                       }
                } else {
                        $this->disp_form4profile($profile);
                }
index 0bdcbe8..bed0e93 100644 (file)
@@ -1,5 +1,6 @@
 <div class="profileSelects lisview">
 <h2><?php echo $html->link($profile['System']['name'], array('controller' => 'systems', 'action' => 'admin_view', $profile['System']['id'])). ' '. $profile['Profile']['name']. ' '. __('ProfileSelects', true);?></h2>
+
 <p>
 <div class="actions">
        <ul>
@@ -8,12 +9,13 @@
 </div>
 </p>
 
+<p>
 <table class="ProfileSelect listview">
 <thead>
 <tr>
        <th><?php echo __('id', true);?></th>
        <th><?php echo __('value', true);?></th>
-       <th><?php echo __('Sort Order', true);?></th>
+       <th><?php echo __('Order', true);?></th>
        <th class="actions"><?php echo __('Actions', true);?></th>
 </tr>
 </thead>
@@ -46,4 +48,5 @@ foreach ($profile['ProfileSelect'] as $profileSelect):
 </tbody>
 <?php endif; ?>
 </table>
+</p>
 </div>
index cae1dcd..1a407be 100644 (file)
 $i = 0;
 foreach ($system['Profile'] as $profile):
        $class = null;
-       if ($i++ % 2 == 0) {
-               $class .= 'altrow';
-       }
        $profiledisp->set_profile_type4view($profile);
 ?>
-<tr class="<?php echo $class;?>">
+<tr>
 <td rowspan="<?php if ($profiledisp->profile_type['is_subsetting']): ?>4<?php else: ?>3<?php endif; ?>">
        <?php echo $profile['id']; ?>
 </td>
@@ -161,15 +158,39 @@ foreach ($system['Profile'] as $profile):
 <tr>
 <td colspan="6"<?php if($profiledisp->profile_type['is_table']): ?> class="table"<?php endif; ?>>
 <?php 
-       $profiledisp->disp_forms4profile_type($profile, true, 1, 0);
+       $profiledisp->disp_forms4profile_type($profile, 2, 0);
 ?>
 </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'])); ?>
+<?php if ($profiledisp->profile_type['is_select']): ?> 
+<?php 
+       echo $html->link(
+               __('Edit Items', true), 
+               array('controller' => 'profile_selects', 'action' => 'admin_listview', $profile['id'])
+       );
+?>
+<?php endif; ?>
+<?php if ($profiledisp->profile_type['is_table']): ?> 
+<?php
+       echo $html->link(
+               __('Edit Table', true), 
+               array('controller' => 'profile_tables', 'action' => 'admin_listview', $profile['id'])
+       );
+?>
+<?php endif; ?>
+<?php
+       echo $html->link(
+               __('Edit', true), 
+               array('controller' => 'profiles', 'action' => 'edit', $profile['id'])
+       );
+       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; ?>
index c61e19b..9294397 100644 (file)
@@ -55,9 +55,6 @@
        <?php echo __('Name');?>
 </th>
 <th>
-       <?php echo __('Profile_type');?>
-</th>
-<th>
        <?php echo __('Sample');?>
 </th>
 </tr>
 $i = 0;
 foreach ($system['Profile'] as $profile):
        $class = null;
-       if ($i++ % 2 == 0) {
-               $class .= 'altrow';
-       }
        $profiledisp->set_profile_type4view($profile);
 ?>
-<tr class="<?php echo $class;?>">
+<tr>
 <td>
        <?php echo $profile['name']; ?>
 </td>
-<td>
-<?php 
-       $profile_type = $profiledisp->get_i18n_profile_type($profile['profile_type'], $profile_types);
-       echo $html->div('profile_type', $profile_type);
-?>
-</td>
 <td<?php if($profiledisp->profile_type['is_table']): ?> class="table"<?php endif; ?>>
 <?php 
-       $profiledisp->disp_forms4profile_type($profile, false, 1, 0);
+       $profiledisp->disp_forms4profile_type($profile, 2, 0);
 ?>
 </td>
 </tr>
index fc5ed93..06ce873 100644 (file)
@@ -261,10 +261,14 @@ table tr.altrow td {
        background: #f5f5f5;
 }
 td.actions {
-       text-align: center;
+       text-align: left;
        white-space: nowrap;
 }
 td.actions a {
+       padding-right: 5px;
+}
+div.actions a {
+       padding-right: 5px;
 }
 
 /* Paging */
@@ -479,7 +483,11 @@ td.table table {
 }
 td.table th,
 td.table td
- {
+{
+}
+td.table td
+{
+       background: #fff;
 }
 .blank {
        min-height: 1em;