|
58 | 58 | $this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> has been saved')); |
59 | 59 | return $this->redirect(array('action' => 'index')); |
60 | 60 | <?php else: ?> |
61 | | - $this->flash(__('<?php echo ucfirst(strtolower($currentModelName)); ?> saved.'), array('action' => 'index')); |
| 61 | + return $this->flash(__('<?php echo ucfirst(strtolower($currentModelName)); ?> saved.'), array('action' => 'index')); |
62 | 62 | <?php endif; ?> |
63 | | - } else { |
| 63 | + } |
64 | 64 | <?php if ($wannaUseSession): ?> |
65 | | - $this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> could not be saved. Please, try again.')); |
| 65 | + $this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> could not be saved. Please, try again.')); |
66 | 66 | <?php endif; ?> |
67 | | - } |
68 | 67 | } |
69 | 68 | <?php |
70 | 69 | foreach (array('belongsTo', 'hasAndBelongsToMany') as $assoc): |
|
101 | 100 | $this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> has been saved')); |
102 | 101 | return $this->redirect(array('action' => 'index')); |
103 | 102 | <?php else: ?> |
104 | | - $this->flash(__('The <?php echo strtolower($singularHumanName); ?> has been saved.'), array('action' => 'index')); |
| 103 | + return $this->flash(__('The <?php echo strtolower($singularHumanName); ?> has been saved.'), array('action' => 'index')); |
105 | 104 | <?php endif; ?> |
106 | | - } else { |
| 105 | + } |
107 | 106 | <?php if ($wannaUseSession): ?> |
108 | | - $this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> could not be saved. Please, try again.')); |
| 107 | + $this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> could not be saved. Please, try again.')); |
109 | 108 | <?php endif; ?> |
110 | | - } |
111 | 109 | } else { |
112 | 110 | $options = array('conditions' => array('<?php echo $currentModelName; ?>.' . $this-><?php echo $currentModelName; ?>->primaryKey => $id)); |
113 | 111 | $this->request->data = $this-><?php echo $currentModelName; ?>->find('first', $options); |
|
147 | 145 | $this->Session->setFlash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted')); |
148 | 146 | return $this->redirect(array('action' => 'index')); |
149 | 147 | <?php else: ?> |
150 | | - $this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted'), array('action' => 'index')); |
| 148 | + return $this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted'), array('action' => 'index')); |
151 | 149 | <?php endif; ?> |
152 | 150 | } |
153 | 151 | <?php if ($wannaUseSession): ?> |
154 | 152 | $this->Session->setFlash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> was not deleted')); |
155 | 153 | <?php else: ?> |
156 | | - $this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> was not deleted'), array('action' => 'index')); |
| 154 | + return $this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> was not deleted'), array('action' => 'index')); |
157 | 155 | <?php endif; ?> |
158 | 156 | return $this->redirect(array('action' => 'index')); |
159 | 157 | } |
0 commit comments