OSDN Git Service

CharacterHasProfiles登録
authorCake <cake_67@users.sourceforge.jp>
Thu, 28 Jan 2010 10:05:50 +0000 (19:05 +0900)
committerCake <cake_67@users.sourceforge.jp>
Thu, 28 Jan 2010 10:05:50 +0000 (19:05 +0900)
24 files changed:
app/config/sql/chara-shee.sql
app/config/sql/setup_acl.sql
app/controllers/characters_controller.php
app/controllers/characters_has_profiles_controller.php [deleted file]
app/models/app_model.php
app/models/character.php
app/models/characters_has_profile.php
app/models/profile.php
app/models/profile_select.php
app/models/profile_table.php
app/views/characters/add.ctp
app/views/characters/edit.ctp
app/views/characters_has_profiles/add.ctp [deleted file]
app/views/characters_has_profiles/admin_add.ctp [deleted file]
app/views/characters_has_profiles/admin_edit.ctp [deleted file]
app/views/characters_has_profiles/admin_index.ctp [deleted file]
app/views/characters_has_profiles/admin_view.ctp [deleted file]
app/views/characters_has_profiles/edit.ctp [deleted file]
app/views/characters_has_profiles/index.ctp [deleted file]
app/views/characters_has_profiles/view.ctp [deleted file]
app/views/helpers/profiledisp.php
app/views/systems/admin_view.ctp
app/views/systems/view.ctp
app/webroot/css/base.css

index 37047e6..5bf0a16 100644 (file)
@@ -94,8 +94,8 @@ CREATE TABLE `characters_has_profiles` (
   `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
   `character_id` INTEGER UNSIGNED NOT NULL,
   `profile_id` INTEGER UNSIGNED NOT NULL,
-  `profile_selects_id` INTEGER UNSIGNED NOT NULL,
-  `profile_tables_id` INTEGER UNSIGNED NOT NULL,
+  `profile_select_id` INTEGER UNSIGNED NULL,
+  `profile_table_id` INTEGER UNSIGNED NULL,
   `value` TEXT NOT NULL,
   `public_flag` ENUM('public', 'private') NOT NULL DEFAULT 'public',
   `link_value` TEXT NOT NULL,
@@ -105,9 +105,9 @@ CREATE TABLE `characters_has_profiles` (
   CONSTRAINT `fk_profiles-characters_has_profiles`
     FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`) ON DELETE CASCADE,
   CONSTRAINT `fk_profile_selects-characters_has_profiles`
-    FOREIGN KEY (`profile_selects_id`) REFERENCES `profile_selects` (`id`) ON DELETE CASCADE,
+    FOREIGN KEY (`profile_select_id`) REFERENCES `profile_selects` (`id`) ON DELETE CASCADE,
   CONSTRAINT `fk_profile_tables-characters_has_profiles`
-    FOREIGN KEY (`profile_tables_id`) REFERENCES `profile_tables` (`id`) ON DELETE CASCADE
+    FOREIGN KEY (`profile_table_id`) REFERENCES `profile_tables` (`id`) ON DELETE CASCADE
 ) TYPE=InnoDB DEFAULT CHARSET=utf8;
 
 
index 87f716c..f3dc0b8 100644 (file)
@@ -25,18 +25,19 @@ CREATE TABLE `acos` (
 LOCK TABLES `acos` WRITE;
 /*!40000 ALTER TABLE `acos` DISABLE KEYS */;
 INSERT INTO `acos` VALUES 
-(1,NULL,'',NULL,'controllers',1,16),
+(1,NULL,'',NULL,'controllers',1,18),
 (2,1,'',NULL,'Users',2,3),
 (3,1,'',NULL,'Groups',4,5),
-(4,NULL,'',NULL,'prefix',17,24),
-(5,4,'',NULL,'admin',18,19),
-(6,4,'',NULL,'pc',20,21),
-(7,4,'',NULL,'m',22,23),
+(4,NULL,'',NULL,'prefix',19,26),
+(5,4,'',NULL,'admin',20,21),
+(6,4,'',NULL,'pc',22,23),
+(7,4,'',NULL,'m',24,25),
 (8,1,'',NULL,'Systems',6,7),
 (9,1,'',NULL,'Characters',8,9),
 (10,1,'',NULL,'Profiles',10,11),
 (11,1,'',NULL,'ProfileSelects',12,13),
-(12,1,'',NULL,'ProfileTables',14,15);
+(12,1,'',NULL,'ProfileTables',14,15),
+(13,1,'',NULL,'CharactersHasProfile',16,17);
 /*!40000 ALTER TABLE `acos` ENABLE KEYS */;
 UNLOCK TABLES;
 
@@ -92,6 +93,8 @@ INSERT INTO `aros_acos` VALUES
 (26,3,11,'0','1','0','0'),
 (27,4,11,'0','1','0','0'),
 (28,3,12,'0','1','0','0'),
-(29,4,12,'0','1','0','0');
+(29,4,12,'0','1','0','0'),
+(30,3,13,'1','1','1','1'),
+(31,4,13,'1','1','1','1');
 /*!40000 ALTER TABLE `aros_acos` ENABLE KEYS */;
 UNLOCK TABLES;
index 0cf955a..ed92a31 100644 (file)
@@ -79,7 +79,7 @@ class CharactersController extends AppController {
                        'conditions' => $conditions,
                        'contain' => array(
                                'User',
-                               'CharactersHasProfiles',
+                               'CharactersHasProfile',
                                'System' => array(
                                        'Profile' => array(
                                                'ProfileSelect',
@@ -99,21 +99,61 @@ class CharactersController extends AppController {
                        $this->redirect(array('action'=>'index'));
                }
 
+               $this->unsetData('edit', false);
+
                if (!empty($this->data)) {
-                       if ($this->Character->save($this->data)) {
-                               $this->Session->setFlash(__('The Character has been saved', true));
-                               $this->redirect(array('action'=>'index'));
-                       } else {
-                               $this->Session->setFlash(__('The Character could not be saved. Please, try again.', true));
+
+                       /* validate */
+                       $this->Character->CharactersHasProfile->validate['profile_id']['validProfileId'] = array(
+                               'rule' => array('validProfileId', $character['System']['id']),
+                       );
+                       $this->Character->CharactersHasProfile->validate['profile_select_id']['validProfileSelectId'] = array(
+                               'rule' => array('validProfileSelectId', $character['System']['id']),
+                               'allowEmpty' => true,
+                       );
+                       $this->Character->CharactersHasProfile->validate['profile_table_id']['validProfiletableId'] = array(
+                               'rule' => array('validProfiletableId', $character['System']['id']),
+                               'allowEmpty' => true,
+                       );
+
+                       if ($this->Character->saveAll($this->data, array('validate' => 'only'))) {
+
+                               /* 空のProfile設定削除 */
+                               if (isset($this->data['CharactersHasProfile'])) {
+                                       foreach ($this->data['CharactersHasProfile'] as $k => $v) {
+                                               if (empty($v['value'])) {
+                                                       unset($this->data['CharactersHasProfile'][$k]);
+                                                       continue;
+                                               }
+                                               if (isset($v['profile_select_id'])) {
+                                                       $this->data['CharactersHasProfile'][$k]['value'] = null;
+                                               }
+
+                                       }
+                               }
+
+                               // 現在のhas_profiles削除
+                               $this->Character->CharactersHasProfile->deleteAll(array(
+                                       'CharactersHasProfile.character_id' => $id
+                               ));
+
+
+                               /* 保存 */
                                $this->data['Character']['id'] = $id;
+                               if ($this->Character->saveAll($this->data, array('validate' => false, 'atomic' => true))) {
+                                       $this->Session->setFlash(__('The Character has been saved', true));
+                                       $this->redirect(array('action'=>'view', $id));
+                               } else {
+                                       $this->Session->setFlash(__('The Character could not be saved. Please, try again.', true));
+                               }
                        }
+                       $this->data['Character']['id'] = $id;
                }
+
                if (empty($this->data)) {
                        $this->data = $character;
                        $this->data['Character'] = $this->_restore_html_character($this->data['Character']);
                }
-               $systems = $this->Character->System->find('list');
-               $this->set('systems', $systems);
        }
 
        function delete($id = null) {
@@ -188,7 +228,7 @@ class CharactersController extends AppController {
                                        )
                                ),
 */
-                               'CharactersHasProfiles',
+                               'CharactersHasProfile',
                                'CharacterProfileArchive',
                        ),
                ));
diff --git a/app/controllers/characters_has_profiles_controller.php b/app/controllers/characters_has_profiles_controller.php
deleted file mode 100644 (file)
index d79b561..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-<?php
-class CharactersHasProfilesController extends AppController {
-
-       var $name = 'CharactersHasProfiles';
-       var $helpers = array('Html', 'Form');
-
-       function index() {
-               $this->CharactersHasProfile->recursive = 0;
-               $this->set('charactersHasProfiles', $this->paginate());
-       }
-
-       function view($id = null) {
-               if (!$id) {
-                       $this->Session->setFlash(__('Invalid CharactersHasProfile.', true));
-                       $this->redirect(array('action'=>'index'));
-               }
-               $this->set('charactersHasProfile', $this->CharactersHasProfile->read(null, $id));
-       }
-
-       function add() {
-               if (!empty($this->data)) {
-                       $this->CharactersHasProfile->create();
-                       if ($this->CharactersHasProfile->save($this->data)) {
-                               $this->Session->setFlash(__('The CharactersHasProfile has been saved', true));
-                               $this->redirect(array('action'=>'index'));
-                       } else {
-                               $this->Session->setFlash(__('The CharactersHasProfile could not be saved. Please, try again.', true));
-                       }
-               }
-               $characters = $this->CharactersHasProfile->Character->find('list');
-               $profiles = $this->CharactersHasProfile->Profile->find('list');
-               $profileSelects = $this->CharactersHasProfile->ProfileSelect->find('list');
-               $profileTables = $this->CharactersHasProfile->ProfileTable->find('list');
-               $this->set(compact('characters', 'profiles', 'profileSelects', 'profileTables'));
-       }
-
-       function edit($id = null) {
-               if (!$id && empty($this->data)) {
-                       $this->Session->setFlash(__('Invalid CharactersHasProfile', true));
-                       $this->redirect(array('action'=>'index'));
-               }
-               if (!empty($this->data)) {
-                       if ($this->CharactersHasProfile->save($this->data)) {
-                               $this->Session->setFlash(__('The CharactersHasProfile has been saved', true));
-                               $this->redirect(array('action'=>'index'));
-                       } else {
-                               $this->Session->setFlash(__('The CharactersHasProfile could not be saved. Please, try again.', true));
-                       }
-               }
-               if (empty($this->data)) {
-                       $this->data = $this->CharactersHasProfile->read(null, $id);
-               }
-               $characters = $this->CharactersHasProfile->Character->find('list');
-               $profiles = $this->CharactersHasProfile->Profile->find('list');
-               $profileSelects = $this->CharactersHasProfile->ProfileSelect->find('list');
-               $profileTables = $this->CharactersHasProfile->ProfileTable->find('list');
-               $this->set(compact('characters','profiles','profileSelects','profileTables'));
-       }
-
-       function delete($id = null) {
-               if (!$id) {
-                       $this->Session->setFlash(__('Invalid id for CharactersHasProfile', true));
-                       $this->redirect(array('action'=>'index'));
-               }
-               if ($this->CharactersHasProfile->del($id)) {
-                       $this->Session->setFlash(__('CharactersHasProfile deleted', true));
-                       $this->redirect(array('action'=>'index'));
-               }
-       }
-
-
-       function admin_index() {
-               $this->CharactersHasProfile->recursive = 0;
-               $this->set('charactersHasProfiles', $this->paginate());
-       }
-
-       function admin_view($id = null) {
-               if (!$id) {
-                       $this->Session->setFlash(__('Invalid CharactersHasProfile.', true));
-                       $this->redirect(array('action'=>'index'));
-               }
-               $this->set('charactersHasProfile', $this->CharactersHasProfile->read(null, $id));
-       }
-
-       function admin_add() {
-               if (!empty($this->data)) {
-                       $this->CharactersHasProfile->create();
-                       if ($this->CharactersHasProfile->save($this->data)) {
-                               $this->Session->setFlash(__('The CharactersHasProfile has been saved', true));
-                               $this->redirect(array('action'=>'index'));
-                       } else {
-                               $this->Session->setFlash(__('The CharactersHasProfile could not be saved. Please, try again.', true));
-                       }
-               }
-               $characters = $this->CharactersHasProfile->Character->find('list');
-               $profiles = $this->CharactersHasProfile->Profile->find('list');
-               $profileSelects = $this->CharactersHasProfile->ProfileSelect->find('list');
-               $profileTables = $this->CharactersHasProfile->ProfileTable->find('list');
-               $this->set(compact('characters', 'profiles', 'profileSelects', 'profileTables'));
-       }
-
-       function admin_edit($id = null) {
-               if (!$id && empty($this->data)) {
-                       $this->Session->setFlash(__('Invalid CharactersHasProfile', true));
-                       $this->redirect(array('action'=>'index'));
-               }
-               if (!empty($this->data)) {
-                       if ($this->CharactersHasProfile->save($this->data)) {
-                               $this->Session->setFlash(__('The CharactersHasProfile has been saved', true));
-                               $this->redirect(array('action'=>'index'));
-                       } else {
-                               $this->Session->setFlash(__('The CharactersHasProfile could not be saved. Please, try again.', true));
-                       }
-               }
-               if (empty($this->data)) {
-                       $this->data = $this->CharactersHasProfile->read(null, $id);
-               }
-               $characters = $this->CharactersHasProfile->Character->find('list');
-               $profiles = $this->CharactersHasProfile->Profile->find('list');
-               $profileSelects = $this->CharactersHasProfile->ProfileSelect->find('list');
-               $profileTables = $this->CharactersHasProfile->ProfileTable->find('list');
-               $this->set(compact('characters','profiles','profileSelects','profileTables'));
-       }
-
-       function admin_delete($id = null) {
-               if (!$id) {
-                       $this->Session->setFlash(__('Invalid id for CharactersHasProfile', true));
-                       $this->redirect(array('action'=>'index'));
-               }
-               if ($this->CharactersHasProfile->del($id)) {
-                       $this->Session->setFlash(__('CharactersHasProfile deleted', true));
-                       $this->redirect(array('action'=>'index'));
-               }
-       }
-
-}
-?>
\ No newline at end of file
index 8dc2106..0399253 100644 (file)
@@ -56,6 +56,9 @@ class AppModel extends Model {
                        'profileType' => __('Invalid Type.', true),
                        'publicFlag' => __('Incorrect value.', true),
                        'url' => __('Please input URL.', true),
+                       'validProfileId' => __('Invalid Profile.', true),
+                       'validProfileSelectId' => __('Invalid ProfileSelect.', true),
+                       'validProfiletableId' => __('Invalid ProfileTable.', true),
                        'validSystemId' => __('Invalid System.', true),
                        'validStatus' => __('Invalid Status.', true),
                );
index dabed8b..cccc1ba 100644 (file)
@@ -144,24 +144,19 @@ class Character extends AppModel {
                        'exclusive' => '',
                        'finderQuery' => '',
                        'counterQuery' => ''
-               )
-       );
-
-       var $hasAndBelongsToMany = array(
-               'CharactersHasProfiles' => array(
-                       'className' => 'CharactersHasProfiles',
-                       'joinTable' => 'characters_has_profiles',
+               ),
+               'CharactersHasProfile' => array(
+                       'className' => 'CharactersHasProfile',
                        'foreignKey' => 'character_id',
-                       'associationForeignKey' => 'profile_id',
-                       'unique' => false,
-                       'conditions' => array('CharactersHasProfiles.public_flag' => 'public'),
+                       'dependent' => false,
+                       'conditions' => '',
                        'fields' => '',
                        'order' => '',
                        'limit' => '',
                        'offset' => '',
+                       'exclusive' => '',
                        'finderQuery' => '',
-                       'deleteQuery' => '',
-                       'insertQuery' => ''
+                       'counterQuery' => ''
                )
        );
 
index 6af775e..6a532ad 100644 (file)
@@ -3,6 +3,73 @@ class CharactersHasProfile extends AppModel {
 
        var $name = 'CharactersHasProfile';
 
+       var $fields = array(
+               'id' => array(
+                       'auto' => true,
+               ),
+               'profile_id' => array(
+                       'auto' => true,
+               ),
+               'profile_select_id' => array(
+                       'auto' => true,
+               ),
+               'profile_table_id' => array(
+                       'auto' => true,
+               ),
+               'value' => array(
+                       'auto' => false,
+                       'add' => true,
+                       'edit' => true,
+                       'escape' => array(
+                               'html' => true,
+                               'all' => true, 
+                       ),
+               ),
+               'public_flag' => array(
+                       'auto' => false,
+                       'add' => true,
+                       'edit' => true,
+               ),
+               'link_value' => array(
+                       'auto' => false,
+                       'add' => true,
+                       'edit' => true,
+               ),
+       );
+
+       var $validate = array(
+/*             'profile_id' => array(
+                       'validProfileId' => array(
+                               'rule' => 'validProfileId'
+                       ),
+               ),
+               'profile_select_id' => array(
+                       'validProfileSelectId' => array(
+                               'rule' => 'validProfileSelectId',
+                               'allowEmpty' => true,
+                       ),
+               ),
+               'profile_table_id' => array(
+                       'validProfiletableId' => array(
+                               'rule' => 'validProfiletableId',
+                               'allowEmpty' => true,
+                       ),
+               ),*/
+               'public_flag' => array(
+                       'publicFlag' => array(
+                               'rule' => 'publicFlag',
+                               'allowEmpty' => true,
+                       ),
+               ),
+               'link_value' => array(
+                       'url' => array(
+                               'rule' => 'url',
+                               'allowEmpty' => true,
+                       ),
+               ),
+       );
+
+
        //The Associations below have been created with all possible keys, those that are not needed can be removed
        var $belongsTo = array(
                'Character' => array(
@@ -21,19 +88,51 @@ class CharactersHasProfile extends AppModel {
                ),
                'ProfileSelects' => array(
                        'className' => 'ProfileSelects',
-                       'foreignKey' => 'profile_selects_id',
+                       'foreignKey' => 'profile_select_id',
                        'conditions' => '',
                        'fields' => '',
                        'order' => ''
                ),
                'ProfileTables' => array(
                        'className' => 'ProfileTables',
-                       'foreignKey' => 'profile_tables_id',
+                       'foreignKey' => 'profile_table_id',
                        'conditions' => '',
                        'fields' => '',
                        'order' => ''
                )
        );
 
+       /* Validation */
+       function validProfileId($data, $system_id)
+       {
+               return (bool)$this->Profile->find('count', array(
+                       'conditions' => array(
+                               'Profile.id'  => $data['profile_id'],
+                               'Profile.system_id'  => $system_id,
+                       ),
+                       'recursive' => -1,
+               ));
+       }
+
+       function validProfileSelectId($data, $system_id)
+       {
+               return $this->Profile->ProfileSelect->find('count', array(
+                       'conditions' => array(
+                               'ProfileSelect.id'  => $data['profile_select_id'],
+                               'Profile.system_id'  => $system_id,
+                       ),
+               ));
+       }
+
+       function validProfiletableId($data, $system_id)
+       {
+               return $this->Profile->ProfileTable->find('count', array(
+                       'conditions' => array(
+                               'ProfileTable.id'  => $data['profile_table_id'],
+                               'Profile.system_id'  => $system_id,
+                       ),
+               ));
+       }
+
 }
 ?>
\ No newline at end of file
index 0d82b6d..55364e5 100644 (file)
@@ -149,8 +149,8 @@ class Profile extends AppModel {
                        'finderQuery' => '',
                        'counterQuery' => ''
                ),
-               'CharactersHasProfiles' => array(
-                       'className' => 'CharactersHasProfiles',
+               'CharactersHasProfile' => array(
+                       'className' => 'CharactersHasProfile',
                        'foreignKey' => 'profile_id',
                        'associationForeignKey' => 'id',
                        'dependent' => true,
index 2d9991f..8fadc16 100644 (file)
@@ -54,6 +54,23 @@ class ProfileSelect extends AppModel {
                )
        );
 
+       var $hasMany = array(
+               'CharactersHasProfile' => array(
+                       'className' => 'CharactersHasProfile',
+                       'foreignKey' => 'profile_select_id',
+                       'associationForeignKey' => 'id',
+                       'dependent' => true,
+                       'conditions' => '',
+                       'fields' => array('id', 'value', 'public_flag'),
+                       'order' => '',
+                       'limit' => 10,
+                       'offset' => '',
+                       'finderQuery' => '',
+                       'deleteQuery' => '',
+                       'insertQuery' => ''
+               )
+       );
+
        /* コールバックメソッド */
        function beforeSave($options = array())
        {
index b2b140e..d85604c 100644 (file)
@@ -70,6 +70,23 @@ class ProfileTable extends AppModel {
                )
        );
 
+       var $hasMany = array(
+               'CharactersHasProfile' => array(
+                       'className' => 'CharactersHasProfile',
+                       'foreignKey' => 'profile_table_id',
+                       'associationForeignKey' => 'id',
+                       'dependent' => true,
+                       'conditions' => '',
+                       'fields' => array('id', 'value', 'public_flag'),
+                       'order' => '',
+                       'limit' => 10,
+                       'offset' => '',
+                       'finderQuery' => '',
+                       'deleteQuery' => '',
+                       'insertQuery' => ''
+               )
+       );
+
        /* validation Rule */
 
        /* 同じProfileに同tablekey_nameは不可 */
index 7589547..96730c4 100644 (file)
        );
        echo $form->input('system_id', array(
                        'label' => __('System', true),
+                       'after' => $html->tag(
+                               'div',
+                               __('No Editable', true),
+                               array('class' => 'required')
+                       )
                )
        );
        echo $form->input('sort_order', array(
-                       'label' => __('Sort Order', true)
+                       'label' => __('Order', true)
                )
        );
        echo $select->create_status_select($status, 'status', array(
index 58911d8..e29feef 100644 (file)
 </tr>
 
 <!-- Profiles -->
-<?php foreach($this->data['System']['Profile'] as $profile): ?>
+<?php
+//if (!empty($this->data['CharactersHasProfile'])) {
+//     $profiles = $this->data['CharactersHasProfile'];
+//} else {
+       $profiles = $this->data['System']['Profile'];
+//}
+?>
+<?php foreach($profiles as $profile): ?>
 <?php 
        $profiledisp->set_profile_type4view($profile);
  ?>
 </th>
 <td colspan="3"<?php if ($profiledisp->profile_type['is_table']): ?> class="table"<?php endif; ?>>
 <?php 
-       $profiledisp->disp_forms4profile_type($profile, false, 0);
+       $profiledisp->disp_forms4profile_type($profile, false, 2, 0);
  ?>
 </td>
 </tr>
diff --git a/app/views/characters_has_profiles/add.ctp b/app/views/characters_has_profiles/add.ctp
deleted file mode 100644 (file)
index 1d4ddd4..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<div class="charactersHasProfiles form">
-<?php echo $form->create('CharactersHasProfile');?>
-       <fieldset>
-               <legend><?php __('Add CharactersHasProfile');?></legend>
-       <?php
-               echo $form->input('character_id');
-               echo $form->input('profile_id');
-               echo $form->input('profile_selects_id');
-               echo $form->input('profile_tables_id');
-               echo $form->input('value');
-               echo $select->create_publicflag_select($public_flags, 'public_flag', array(
-                       'label' => __('Public Flag', true)
-               )
-       );
-               echo $form->input('link_value');
-       ?>
-       </fieldset>
-<?php echo $form->end('Submit');?>
-</div>
-<div class="actions">
-       <ul>
-               <li><?php echo $html->link(__('List CharactersHasProfiles', true), array('action' => 'index'));?></li>
-               <li><?php echo $html->link(__('List Characters', true), array('controller' => 'characters', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Character', true), array('controller' => 'characters', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profiles', true), array('controller' => 'profiles', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile', true), array('controller' => 'profiles', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profile Selects', true), array('controller' => 'profile_selects', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile Selects', true), array('controller' => 'profile_selects', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profile Tables', true), array('controller' => 'profile_tables', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile Tables', true), array('controller' => 'profile_tables', 'action' => 'add')); ?> </li>
-       </ul>
-</div>
diff --git a/app/views/characters_has_profiles/admin_add.ctp b/app/views/characters_has_profiles/admin_add.ctp
deleted file mode 100644 (file)
index 1d4ddd4..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<div class="charactersHasProfiles form">
-<?php echo $form->create('CharactersHasProfile');?>
-       <fieldset>
-               <legend><?php __('Add CharactersHasProfile');?></legend>
-       <?php
-               echo $form->input('character_id');
-               echo $form->input('profile_id');
-               echo $form->input('profile_selects_id');
-               echo $form->input('profile_tables_id');
-               echo $form->input('value');
-               echo $select->create_publicflag_select($public_flags, 'public_flag', array(
-                       'label' => __('Public Flag', true)
-               )
-       );
-               echo $form->input('link_value');
-       ?>
-       </fieldset>
-<?php echo $form->end('Submit');?>
-</div>
-<div class="actions">
-       <ul>
-               <li><?php echo $html->link(__('List CharactersHasProfiles', true), array('action' => 'index'));?></li>
-               <li><?php echo $html->link(__('List Characters', true), array('controller' => 'characters', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Character', true), array('controller' => 'characters', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profiles', true), array('controller' => 'profiles', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile', true), array('controller' => 'profiles', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profile Selects', true), array('controller' => 'profile_selects', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile Selects', true), array('controller' => 'profile_selects', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profile Tables', true), array('controller' => 'profile_tables', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile Tables', true), array('controller' => 'profile_tables', 'action' => 'add')); ?> </li>
-       </ul>
-</div>
diff --git a/app/views/characters_has_profiles/admin_edit.ctp b/app/views/characters_has_profiles/admin_edit.ctp
deleted file mode 100644 (file)
index 4906ded..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<div class="charactersHasProfiles form">
-<?php echo $form->create('CharactersHasProfile');?>
-       <fieldset>
-               <legend><?php __('Edit CharactersHasProfile');?></legend>
-       <?php
-               echo $form->input('id');
-               echo $form->input('character_id');
-               echo $form->input('profile_id');
-               echo $form->input('profile_selects_id');
-               echo $form->input('profile_tables_id');
-               echo $form->input('value');
-               echo $select->create_publicflag_select($public_flags, 'public_flag', array(
-                       'label' => __('Public Flag', true)
-               )
-       );
-               echo $form->input('link_value');
-       ?>
-       </fieldset>
-<?php echo $form->end('Submit');?>
-</div>
-<div class="actions">
-       <ul>
-               <li><?php echo $html->link(__('Delete', true), array('action' => 'delete', $form->value('CharactersHasProfile.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('CharactersHasProfile.id'))); ?></li>
-               <li><?php echo $html->link(__('List CharactersHasProfiles', true), array('action' => 'index'));?></li>
-               <li><?php echo $html->link(__('List Characters', true), array('controller' => 'characters', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Character', true), array('controller' => 'characters', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profiles', true), array('controller' => 'profiles', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile', true), array('controller' => 'profiles', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profile Selects', true), array('controller' => 'profile_selects', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile Selects', true), array('controller' => 'profile_selects', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profile Tables', true), array('controller' => 'profile_tables', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile Tables', true), array('controller' => 'profile_tables', 'action' => 'add')); ?> </li>
-       </ul>
-</div>
diff --git a/app/views/characters_has_profiles/admin_index.ctp b/app/views/characters_has_profiles/admin_index.ctp
deleted file mode 100644 (file)
index 057d7a3..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<div class="charactersHasProfiles index">
-<h2><?php __('CharactersHasProfiles');?></h2>
-<p>
-<?php
-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 cellpadding="0" cellspacing="0">
-<tr>
-       <th><?php echo $paginator->sort('id');?></th>
-       <th><?php echo $paginator->sort('character_id');?></th>
-       <th><?php echo $paginator->sort('profile_id');?></th>
-       <th><?php echo $paginator->sort('profile_selects_id');?></th>
-       <th><?php echo $paginator->sort('profile_tables_id');?></th>
-       <th><?php echo $paginator->sort('value');?></th>
-       <th><?php echo $paginator->sort('public_flag');?></th>
-       <th><?php echo $paginator->sort('link_value');?></th>
-       <th class="actions"><?php __('Actions');?></th>
-</tr>
-<?php
-$i = 0;
-foreach ($charactersHasProfiles as $charactersHasProfile):
-       $class = null;
-       if ($i++ % 2 == 0) {
-               $class = ' class="altrow"';
-       }
-?>
-       <tr<?php echo $class;?>>
-               <td>
-                       <?php echo $charactersHasProfile['CharactersHasProfile']['id']; ?>
-               </td>
-               <td>
-                       <?php echo $html->link($charactersHasProfile['Character']['name'], array('controller' => 'characters', 'action' => 'view', $charactersHasProfile['Character']['id'])); ?>
-               </td>
-               <td>
-                       <?php echo $html->link($charactersHasProfile['Profile']['name'], array('controller' => 'profiles', 'action' => 'view', $charactersHasProfile['Profile']['id'])); ?>
-               </td>
-               <td>
-                       <?php echo $html->link($charactersHasProfile['ProfileSelects']['id'], array('controller' => 'profile_selects', 'action' => 'view', $charactersHasProfile['ProfileSelects']['id'])); ?>
-               </td>
-               <td>
-                       <?php echo $html->link($charactersHasProfile['ProfileTables']['title'], array('controller' => 'profile_tables', 'action' => 'view', $charactersHasProfile['ProfileTables']['id'])); ?>
-               </td>
-               <td>
-                       <?php echo $charactersHasProfile['CharactersHasProfile']['value']; ?>
-               </td>
-               <td>
-                       <?php echo $charactersHasProfile['CharactersHasProfile']['public_flag']; ?>
-               </td>
-               <td>
-                       <?php echo $charactersHasProfile['CharactersHasProfile']['link_value']; ?>
-               </td>
-               <td class="actions">
-                       <?php echo $html->link(__('View', true), array('action' => 'view', $charactersHasProfile['CharactersHasProfile']['id'])); ?>
-                       <?php echo $html->link(__('Edit', true), array('action' => 'edit', $charactersHasProfile['CharactersHasProfile']['id'])); ?>
-                       <?php echo $html->link(__('Delete', true), array('action' => 'delete', $charactersHasProfile['CharactersHasProfile']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $charactersHasProfile['CharactersHasProfile']['id'])); ?>
-               </td>
-       </tr>
-<?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->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
-</div>
-<div class="actions">
-       <ul>
-               <li><?php echo $html->link(__('New CharactersHasProfile', true), array('action' => 'add')); ?></li>
-               <li><?php echo $html->link(__('List Characters', true), array('controller' => 'characters', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Character', true), array('controller' => 'characters', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profiles', true), array('controller' => 'profiles', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile', true), array('controller' => 'profiles', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profile Selects', true), array('controller' => 'profile_selects', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile Selects', true), array('controller' => 'profile_selects', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profile Tables', true), array('controller' => 'profile_tables', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile Tables', true), array('controller' => 'profile_tables', 'action' => 'add')); ?> </li>
-       </ul>
-</div>
diff --git a/app/views/characters_has_profiles/admin_view.ctp b/app/views/characters_has_profiles/admin_view.ctp
deleted file mode 100644 (file)
index 1fb52aa..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<div class="charactersHasProfiles view">
-<h2><?php  __('CharactersHasProfile');?></h2>
-       <dl><?php $i = 0; $class = ' class="altrow"';?>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $charactersHasProfile['CharactersHasProfile']['id']; ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Character'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $html->link($charactersHasProfile['Character']['name'], array('controller' => 'characters', 'action' => 'view', $charactersHasProfile['Character']['id'])); ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Profile'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $html->link($charactersHasProfile['Profile']['name'], array('controller' => 'profiles', 'action' => 'view', $charactersHasProfile['Profile']['id'])); ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Profile Selects'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $html->link($charactersHasProfile['ProfileSelects']['id'], array('controller' => 'profile_selects', 'action' => 'view', $charactersHasProfile['ProfileSelects']['id'])); ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Profile Tables'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $html->link($charactersHasProfile['ProfileTables']['title'], array('controller' => 'profile_tables', 'action' => 'view', $charactersHasProfile['ProfileTables']['id'])); ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Value'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $charactersHasProfile['CharactersHasProfile']['value']; ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Public Flag'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $charactersHasProfile['CharactersHasProfile']['public_flag']; ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Link Value'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $charactersHasProfile['CharactersHasProfile']['link_value']; ?>
-                       &nbsp;
-               </dd>
-       </dl>
-</div>
-<div class="actions">
-       <ul>
-               <li><?php echo $html->link(__('Edit CharactersHasProfile', true), array('action' => 'edit', $charactersHasProfile['CharactersHasProfile']['id'])); ?> </li>
-               <li><?php echo $html->link(__('Delete CharactersHasProfile', true), array('action' => 'delete', $charactersHasProfile['CharactersHasProfile']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $charactersHasProfile['CharactersHasProfile']['id'])); ?> </li>
-               <li><?php echo $html->link(__('List CharactersHasProfiles', true), array('action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New CharactersHasProfile', true), array('action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Characters', true), array('controller' => 'characters', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Character', true), array('controller' => 'characters', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profiles', true), array('controller' => 'profiles', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile', true), array('controller' => 'profiles', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profile Selects', true), array('controller' => 'profile_selects', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile Selects', true), array('controller' => 'profile_selects', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profile Tables', true), array('controller' => 'profile_tables', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile Tables', true), array('controller' => 'profile_tables', 'action' => 'add')); ?> </li>
-       </ul>
-</div>
diff --git a/app/views/characters_has_profiles/edit.ctp b/app/views/characters_has_profiles/edit.ctp
deleted file mode 100644 (file)
index 4906ded..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<div class="charactersHasProfiles form">
-<?php echo $form->create('CharactersHasProfile');?>
-       <fieldset>
-               <legend><?php __('Edit CharactersHasProfile');?></legend>
-       <?php
-               echo $form->input('id');
-               echo $form->input('character_id');
-               echo $form->input('profile_id');
-               echo $form->input('profile_selects_id');
-               echo $form->input('profile_tables_id');
-               echo $form->input('value');
-               echo $select->create_publicflag_select($public_flags, 'public_flag', array(
-                       'label' => __('Public Flag', true)
-               )
-       );
-               echo $form->input('link_value');
-       ?>
-       </fieldset>
-<?php echo $form->end('Submit');?>
-</div>
-<div class="actions">
-       <ul>
-               <li><?php echo $html->link(__('Delete', true), array('action' => 'delete', $form->value('CharactersHasProfile.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('CharactersHasProfile.id'))); ?></li>
-               <li><?php echo $html->link(__('List CharactersHasProfiles', true), array('action' => 'index'));?></li>
-               <li><?php echo $html->link(__('List Characters', true), array('controller' => 'characters', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Character', true), array('controller' => 'characters', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profiles', true), array('controller' => 'profiles', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile', true), array('controller' => 'profiles', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profile Selects', true), array('controller' => 'profile_selects', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile Selects', true), array('controller' => 'profile_selects', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profile Tables', true), array('controller' => 'profile_tables', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile Tables', true), array('controller' => 'profile_tables', 'action' => 'add')); ?> </li>
-       </ul>
-</div>
diff --git a/app/views/characters_has_profiles/index.ctp b/app/views/characters_has_profiles/index.ctp
deleted file mode 100644 (file)
index 057d7a3..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<div class="charactersHasProfiles index">
-<h2><?php __('CharactersHasProfiles');?></h2>
-<p>
-<?php
-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 cellpadding="0" cellspacing="0">
-<tr>
-       <th><?php echo $paginator->sort('id');?></th>
-       <th><?php echo $paginator->sort('character_id');?></th>
-       <th><?php echo $paginator->sort('profile_id');?></th>
-       <th><?php echo $paginator->sort('profile_selects_id');?></th>
-       <th><?php echo $paginator->sort('profile_tables_id');?></th>
-       <th><?php echo $paginator->sort('value');?></th>
-       <th><?php echo $paginator->sort('public_flag');?></th>
-       <th><?php echo $paginator->sort('link_value');?></th>
-       <th class="actions"><?php __('Actions');?></th>
-</tr>
-<?php
-$i = 0;
-foreach ($charactersHasProfiles as $charactersHasProfile):
-       $class = null;
-       if ($i++ % 2 == 0) {
-               $class = ' class="altrow"';
-       }
-?>
-       <tr<?php echo $class;?>>
-               <td>
-                       <?php echo $charactersHasProfile['CharactersHasProfile']['id']; ?>
-               </td>
-               <td>
-                       <?php echo $html->link($charactersHasProfile['Character']['name'], array('controller' => 'characters', 'action' => 'view', $charactersHasProfile['Character']['id'])); ?>
-               </td>
-               <td>
-                       <?php echo $html->link($charactersHasProfile['Profile']['name'], array('controller' => 'profiles', 'action' => 'view', $charactersHasProfile['Profile']['id'])); ?>
-               </td>
-               <td>
-                       <?php echo $html->link($charactersHasProfile['ProfileSelects']['id'], array('controller' => 'profile_selects', 'action' => 'view', $charactersHasProfile['ProfileSelects']['id'])); ?>
-               </td>
-               <td>
-                       <?php echo $html->link($charactersHasProfile['ProfileTables']['title'], array('controller' => 'profile_tables', 'action' => 'view', $charactersHasProfile['ProfileTables']['id'])); ?>
-               </td>
-               <td>
-                       <?php echo $charactersHasProfile['CharactersHasProfile']['value']; ?>
-               </td>
-               <td>
-                       <?php echo $charactersHasProfile['CharactersHasProfile']['public_flag']; ?>
-               </td>
-               <td>
-                       <?php echo $charactersHasProfile['CharactersHasProfile']['link_value']; ?>
-               </td>
-               <td class="actions">
-                       <?php echo $html->link(__('View', true), array('action' => 'view', $charactersHasProfile['CharactersHasProfile']['id'])); ?>
-                       <?php echo $html->link(__('Edit', true), array('action' => 'edit', $charactersHasProfile['CharactersHasProfile']['id'])); ?>
-                       <?php echo $html->link(__('Delete', true), array('action' => 'delete', $charactersHasProfile['CharactersHasProfile']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $charactersHasProfile['CharactersHasProfile']['id'])); ?>
-               </td>
-       </tr>
-<?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->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
-</div>
-<div class="actions">
-       <ul>
-               <li><?php echo $html->link(__('New CharactersHasProfile', true), array('action' => 'add')); ?></li>
-               <li><?php echo $html->link(__('List Characters', true), array('controller' => 'characters', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Character', true), array('controller' => 'characters', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profiles', true), array('controller' => 'profiles', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile', true), array('controller' => 'profiles', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profile Selects', true), array('controller' => 'profile_selects', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile Selects', true), array('controller' => 'profile_selects', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profile Tables', true), array('controller' => 'profile_tables', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile Tables', true), array('controller' => 'profile_tables', 'action' => 'add')); ?> </li>
-       </ul>
-</div>
diff --git a/app/views/characters_has_profiles/view.ctp b/app/views/characters_has_profiles/view.ctp
deleted file mode 100644 (file)
index 1fb52aa..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<div class="charactersHasProfiles view">
-<h2><?php  __('CharactersHasProfile');?></h2>
-       <dl><?php $i = 0; $class = ' class="altrow"';?>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $charactersHasProfile['CharactersHasProfile']['id']; ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Character'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $html->link($charactersHasProfile['Character']['name'], array('controller' => 'characters', 'action' => 'view', $charactersHasProfile['Character']['id'])); ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Profile'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $html->link($charactersHasProfile['Profile']['name'], array('controller' => 'profiles', 'action' => 'view', $charactersHasProfile['Profile']['id'])); ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Profile Selects'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $html->link($charactersHasProfile['ProfileSelects']['id'], array('controller' => 'profile_selects', 'action' => 'view', $charactersHasProfile['ProfileSelects']['id'])); ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Profile Tables'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $html->link($charactersHasProfile['ProfileTables']['title'], array('controller' => 'profile_tables', 'action' => 'view', $charactersHasProfile['ProfileTables']['id'])); ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Value'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $charactersHasProfile['CharactersHasProfile']['value']; ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Public Flag'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $charactersHasProfile['CharactersHasProfile']['public_flag']; ?>
-                       &nbsp;
-               </dd>
-               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Link Value'); ?></dt>
-               <dd<?php if ($i++ % 2 == 0) echo $class;?>>
-                       <?php echo $charactersHasProfile['CharactersHasProfile']['link_value']; ?>
-                       &nbsp;
-               </dd>
-       </dl>
-</div>
-<div class="actions">
-       <ul>
-               <li><?php echo $html->link(__('Edit CharactersHasProfile', true), array('action' => 'edit', $charactersHasProfile['CharactersHasProfile']['id'])); ?> </li>
-               <li><?php echo $html->link(__('Delete CharactersHasProfile', true), array('action' => 'delete', $charactersHasProfile['CharactersHasProfile']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $charactersHasProfile['CharactersHasProfile']['id'])); ?> </li>
-               <li><?php echo $html->link(__('List CharactersHasProfiles', true), array('action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New CharactersHasProfile', true), array('action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Characters', true), array('controller' => 'characters', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Character', true), array('controller' => 'characters', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profiles', true), array('controller' => 'profiles', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile', true), array('controller' => 'profiles', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profile Selects', true), array('controller' => 'profile_selects', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile Selects', true), array('controller' => 'profile_selects', 'action' => 'add')); ?> </li>
-               <li><?php echo $html->link(__('List Profile Tables', true), array('controller' => 'profile_tables', 'action' => 'index')); ?> </li>
-               <li><?php echo $html->link(__('New Profile Tables', true), array('controller' => 'profile_tables', 'action' => 'add')); ?> </li>
-       </ul>
-</div>
index 86196c6..e67e2bd 100644 (file)
@@ -13,6 +13,8 @@ class ProfiledispHelper extends Helper {
 
        var $profile_type = array();
 
+       var $character_has_profile_num = 0;
+
        /**
         * profile_typeの設定をview表示形式に変換
         */
@@ -93,6 +95,8 @@ class ProfiledispHelper extends Helper {
 
                if ($profile['profile_type'] == 'textarea') {
                        $option['type'] = 'textarea';
+               } else {
+                       $option['type'] = 'text';
                }
 
                $option = array_merge(array(
@@ -100,7 +104,15 @@ class ProfiledispHelper extends Helper {
                        ), $option
                );
 
-               echo $this->Form->input($profile['key_name'], $option);
+               $profile_tag = 
+                       $this->Form->input('CharactersHasProfile.'.$this->character_has_profile_num.'.value', $option).
+                       $this->Form->input('CharactersHasProfile.'.$this->character_has_profile_num.'.profile_id', array(
+                               'type' => 'hidden',
+                               'value' => $profile['id'],
+                       ));
+
+               echo $profile_tag;
+               $this->character_has_profile_num++;
        }
 
        /* profile_selectsの設定をプルダウンで出力 */
@@ -123,7 +135,18 @@ class ProfiledispHelper extends Helper {
                        $option
                );
 
-               echo $this->Form->input('ProfileSelect.'.$profile_selects[0]['profile_id'].'.profile_type', $option);
+               $profile_select_tag = 
+                        $this->Form->input('CharactersHasProfile.'.$this->character_has_profile_num.'.value', $option).
+                        $this->Form->input('CharactersHasProfile.'.$this->character_has_profile_num.'.profile_id', array(
+                               'type' => 'hidden',
+                               'value' => $profile_selects[0]['profile_id'],
+                       )).
+                        $this->Form->input('CharactersHasProfile.'.$this->character_has_profile_num.'.profile_select_id', array(
+                               'type' => 'hidden',
+                               'value' => $profile_selects[0]['id'],
+                       ));
+               echo $profile_select_tag;
+               $this->character_has_profile_num++;
        }
 
        /* profile_selectsの設定をラジオボタンで出力 */
@@ -152,17 +175,24 @@ class ProfiledispHelper extends Helper {
        /* profile_selectsの設定をチェックボックスで出力 */
        function disp_checkbox4profile_selects($profile_selects, $label = false, $legend = false)
        {
-               $this->disp_select4profile_selects(
-                       $profile_selects, 
-                       array(
-                               'multiple' =>  'checkbox',
-                               'label' => $label,
-                               'legend' => $legend,
-                               'div' => array(
-                                       'class' => 'input checkbox inline'
-                               ),
-                       )
-               );
+               if (empty($profile_selects)) {
+                       return null;
+               }
+
+               foreach($profile_selects as $v) {
+                       $profile_select[0] = $v;
+                       $this->disp_select4profile_selects(
+                               $profile_select, 
+                               array(
+                                       'multiple' => 'checkbox',
+                                       'label' => $label,
+                                       'legend' => $legend,
+                                       'div' => array(
+                                               'class' => 'input checkbox inline'
+                                       ),
+                               )
+                       );
+               }
        }
 
        /* profile_tablesの設定からtableHeadersを出力 */
@@ -223,12 +253,21 @@ class ProfiledispHelper extends Helper {
                }
 
                $forms = array();
-               foreach ($profile_tables as $v) {
-                       $forms[] = $this->Form->input('ProfileTable.'.$v['id'], array(
-                               'type' => 'text',
-                               'label' => false,
-                               'class' => array($v['tablekey_name'])
-                       ));
+               foreach ($profile_tables as $k => $v) {
+                       $forms[] = 
+                               $this->Form->input('CharactersHasProfile.'.$this->character_has_profile_num.'.value', array(
+                                       'type' => 'text',
+                                       'label' => false,
+                               )).
+                               $this->Form->input('CharactersHasProfile.'.$this->character_has_profile_num.'.profile_id', array(
+                                       'type' => 'hidden',
+                                       'value' => $v['profile_id'],
+                               )).
+                               $this->Form->input('CharactersHasProfile.'.$this->character_has_profile_num.'.profile_table_id', array(
+                                       'type' => 'hidden',
+                                       'value' => $v['id'],
+                               ));
+                       $this->character_has_profile_num++;
                }
 
                $this->disp_td4characters_has_profiles($forms, $tr_options, $td_options);
@@ -283,7 +322,7 @@ class ProfiledispHelper extends Helper {
        /* profile_typeの設定に応じてフォーム表示
         * set_profile_type4view($profile)チェック済み前提。
         */
-       function disp_forms4profile_type($profile, $admin = false, $table_blank = 2)
+       function disp_forms4profile_type($profile, $admin = false, $form_num = 2, $table_blank = 2)
        {
                if ($this->profile_type['is_select'] || $this->profile_type['is_radio'] || $this->profile_type['is_checkbox']) {
                        if ($this->profile_type['is_select']) {
@@ -299,13 +338,18 @@ class ProfiledispHelper extends Helper {
                } elseif ($this->profile_type['is_table']) {
                        echo '<table>';
                        $this->disp_th4profile_tables($profile['ProfileTable']);
-                       $this->disp_form4profile_tables($profile['ProfileTable']);
-                       if (intval($table_blank) && empty($profile['CharacterHasProfile'])) {
+                       if (empty($profile['CharacterHasProfile'])) {
                                echo '<tbody>';
-                               $this->disp_blank_td4profile_tables($profile['ProfileTable'], intval($table_blank));
+                               if (intval($form_num) > 0) {
+                                       for ($i=0; $i<$form_num; $i++) {
+                                               $this->disp_form4profile_tables($profile['ProfileTable']);
+                                       }
+                               }
+                               if (intval($table_blank) > 0) {
+                                       $this->disp_blank_td4profile_tables($profile['ProfileTable'], intval($table_blank));
+                               }
                                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>';
index 1fcb5c6..cae1dcd 100644 (file)
@@ -82,7 +82,7 @@
        <?php echo __('ID', true);?>
 </th>
 <th>
-       <?php echo __('Sort Order');?>
+       <?php echo __('Order');?>
 </th>
 <th colspan="6">
        <?php echo __('Detail');?>
@@ -161,7 +161,7 @@ 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, 0);
+       $profiledisp->disp_forms4profile_type($profile, true, 1, 0);
 ?>
 </td>
 </tr>
index b32f0b2..c61e19b 100644 (file)
@@ -82,7 +82,7 @@ foreach ($system['Profile'] as $profile):
 </td>
 <td<?php if($profiledisp->profile_type['is_table']): ?> class="table"<?php endif; ?>>
 <?php 
-       $profiledisp->disp_forms4profile_type($profile, false, 0);
+       $profiledisp->disp_forms4profile_type($profile, false, 1, 0);
 ?>
 </td>
 </tr>
index 69609fd..fc5ed93 100644 (file)
@@ -474,12 +474,12 @@ td.table {
 td.table table {
        padding: 0;
        margin: 0;
+       border-top: 0 none;
        border-bottom: 0 none;
 }
 td.table th,
 td.table td
  {
-       border-top: 0 none;
 }
 .blank {
        min-height: 1em;