OSDN Git Service

プロフィールForm数変更
authorCake <cake_67@users.sourceforge.jp>
Tue, 3 Aug 2010 05:30:39 +0000 (14:30 +0900)
committerCake <cake_67@users.sourceforge.jp>
Tue, 3 Aug 2010 05:30:39 +0000 (14:30 +0900)
app/views/characters/edit.ctp

index 615cac6..f9d5255 100644 (file)
 <td colspan="3" class="CharacterProfileData edit<?php if ($profiledisp->profile_type['is_table']): ?> table<?php endif; ?>">
 <div id="<?php echo $key; ?>">
 <?php 
-       $profiledisp->disp_forms4profile_type($profile, 0, 0, true, $this->data['Character']['id'], true);
+       if (empty($profile['CharactersHasProfile'])) {
+               if ($profile['profile_type'] == 's-table') {
+                       $form_num = count($profile['ProfileTable'][0]['ProfileTableStatic']);
+               } else {
+                       $form_num = 4;
+               }
+               $disp_add_link = false;
+       } else {
+               if ($profile['profile_type'] == 's-table') {
+                       $form_num = count($profile['ProfileTable'][0]['ProfileTableStatic']);
+               } else {
+                       $form_num = 0;
+               }
+               $disp_add_link = true;
+       }
+       $profiledisp->disp_forms4profile_type($profile, $form_num, 0, $disp_add_link, $this->data['Character']['id'], true);
  ?>
 </div>
 </td>