$this->redirect(array('controller' => 'systems', 'action'=>'admin_index'));
}
- if ($profile['Profile']['profile_type'] != 'select' && $profile['Profile']['profile_type'] != 'm-select') {
+ App::import('Helper', 'Profiledisp');
+ $Profiledisp = new ProfiledispHelper;
+ $Profiledisp->set_profile_type4view($profile['Profile']);
+
+ if (!$Profiledisp->profile_type['is_select'] && !$Profiledisp->profile_type['is_checkbox']) {
$this->Session->setFlash(__('Profile type is not valid.', true));
$this->redirect(array('controller' => 'profiles', 'action'=>'admin_edit', $profile['Profile']['id']));
}
$this->Session->setFlash(__('The Profile has been saved', true));
// profile_tablesの削除
- if ($profile['Profile']['profile_type'] == 'table') {
+ App::import('Helper', 'Profiledisp');
+ $Profiledisp = new ProfiledispHelper;
+ $Profiledisp->set_profile_type4view($profile['Profile']);
+ if ($Profiledisp->profile_type['is_table']) {
$this->Profile->ProfileTable->deleteAll(array('ProfileTable.profile_id' => $id), true);
}
// profile_selectsの削除
- if (in_array($profile['Profile']['profile_type'], array('select', 'm-select')) && !in_array($this->data['Profile']['profile_type'], array('select', 'm-select'))) {
- $this->Profile->ProfileSelect->deleteAll(array('ProfileSelect.profile_id' => $id), true);
+ if ($Profiledisp->profile_type['is_select']) {
+ $Profiledisp->set_profile_type4view($this->data['Profile']);
+ if (!$Profiledisp->profile_type['is_select']) {
+ $this->Profile->ProfileSelect->deleteAll(array('ProfileSelect.profile_id' => $id), true);
+ }
}
$this->redirect(array('controller' => 'systems', 'action'=>'admin_view', $profile['Profile']['system_id']));
} else {