|
|
@@ -58,13 +58,12 @@
|
|
|
$this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> has been saved'));
|
|
|
return $this->redirect(array('action' => 'index'));
|
|
|
<?php else: ?>
|
|
|
- $this->flash(__('<?php echo ucfirst(strtolower($currentModelName)); ?> saved.'), array('action' => 'index'));
|
|
|
+ return $this->flash(__('<?php echo ucfirst(strtolower($currentModelName)); ?> saved.'), array('action' => 'index'));
|
|
|
<?php endif; ?>
|
|
|
- } else {
|
|
|
+ }
|
|
|
<?php if ($wannaUseSession): ?>
|
|
|
- $this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> could not be saved. Please, try again.'));
|
|
|
+ $this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> could not be saved. Please, try again.'));
|
|
|
<?php endif; ?>
|
|
|
- }
|
|
|
}
|
|
|
<?php
|
|
|
foreach (array('belongsTo', 'hasAndBelongsToMany') as $assoc):
|
|
|
@@ -101,13 +100,12 @@
|
|
|
$this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> has been saved'));
|
|
|
return $this->redirect(array('action' => 'index'));
|
|
|
<?php else: ?>
|
|
|
- $this->flash(__('The <?php echo strtolower($singularHumanName); ?> has been saved.'), array('action' => 'index'));
|
|
|
+ return $this->flash(__('The <?php echo strtolower($singularHumanName); ?> has been saved.'), array('action' => 'index'));
|
|
|
<?php endif; ?>
|
|
|
- } else {
|
|
|
+ }
|
|
|
<?php if ($wannaUseSession): ?>
|
|
|
- $this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> could not be saved. Please, try again.'));
|
|
|
+ $this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> could not be saved. Please, try again.'));
|
|
|
<?php endif; ?>
|
|
|
- }
|
|
|
} else {
|
|
|
$options = array('conditions' => array('<?php echo $currentModelName; ?>.' . $this-><?php echo $currentModelName; ?>->primaryKey => $id));
|
|
|
$this->request->data = $this-><?php echo $currentModelName; ?>->find('first', $options);
|
|
|
@@ -147,13 +145,13 @@
|
|
|
$this->Session->setFlash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted'));
|
|
|
return $this->redirect(array('action' => 'index'));
|
|
|
<?php else: ?>
|
|
|
- $this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted'), array('action' => 'index'));
|
|
|
+ return $this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted'), array('action' => 'index'));
|
|
|
<?php endif; ?>
|
|
|
}
|
|
|
<?php if ($wannaUseSession): ?>
|
|
|
$this->Session->setFlash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> was not deleted'));
|
|
|
<?php else: ?>
|
|
|
- $this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> was not deleted'), array('action' => 'index'));
|
|
|
+ return $this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> was not deleted'), array('action' => 'index'));
|
|
|
<?php endif; ?>
|
|
|
return $this->redirect(array('action' => 'index'));
|
|
|
}
|