mirror of https://github.com/MISP/MISP
fix: News View add, index and Controller (flash messages i18n bug
parent
f79a18040b
commit
e7a66859e8
|
@ -48,10 +48,10 @@ class NewsController extends AppController
|
|||
$this->request->data['News']['user_id'] = 0;
|
||||
}
|
||||
if ($this->News->save($this->request->data)) {
|
||||
$this->Flash->success('News item added.');
|
||||
$this->Flash->success(__('News item added.'));
|
||||
$this->redirect(array('action' => 'index'));
|
||||
} else {
|
||||
$this->Flash->error('The news item could not be added.');
|
||||
$this->Flash->error(__('The news item could not be added.'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,10 +65,10 @@ class NewsController extends AppController
|
|||
if ($this->request->is('post') || $this->request->is('put')) {
|
||||
$this->request->data['News']['id'] = $id;
|
||||
if ($this->News->save($this->request->data)) {
|
||||
$this->Flash->success('News item updated.');
|
||||
$this->Flash->success(__('News item updated.'));
|
||||
$this->redirect(array('action' => 'index'));
|
||||
} else {
|
||||
$this->Flash->error('Could not update news item.');
|
||||
$this->Flash->error(__('Could not update news item.'));
|
||||
}
|
||||
} else {
|
||||
$this->request->data = $this->News->read(null, $id);
|
||||
|
@ -86,10 +86,10 @@ class NewsController extends AppController
|
|||
throw new NotFoundException('Invalid news item');
|
||||
}
|
||||
if ($this->News->delete()) {
|
||||
$this->Flash->success('News item deleted.');
|
||||
$this->Flash->success(__('News item deleted.'));
|
||||
$this->redirect(array('action' => 'index'));
|
||||
}
|
||||
$this->Flash->error('News item could not be deleted.');
|
||||
$this->Flash->error(__('News item could not be deleted.'));
|
||||
$this->redirect(array('action' => 'index'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
?>
|
||||
</fieldset>
|
||||
<?php
|
||||
echo $this->Form->button('Submit', array('class' => 'btn btn-primary'));
|
||||
echo $this->Form->button(__('Submit'), array('class' => 'btn btn-primary'));
|
||||
echo $this->Form->end();
|
||||
?>
|
||||
</div>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
?>
|
||||
<br /><a href="<?php echo $baseurl; ?>/news/edit/<?php echo h($newsItem['News']['id']);?>" class="icon-edit" title="<?php echo __('Edit news message');?>"></a>
|
||||
<?php
|
||||
echo $this->Form->postLink('', array('action' => 'delete', $newsItem['News']['id']), array('class' => 'icon-trash', 'title' => 'Delete'), __('Are you sure you want to delete news item # %s?', $newsItem['News']['id']));
|
||||
echo $this->Form->postLink('', array('action' => 'delete', $newsItem['News']['id']), array('class' => 'icon-trash', 'title' => __('Delete')), __('Are you sure you want to delete news item # %s?', $newsItem['News']['id']));
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue