Skip to content

Commit

Permalink
Fixed issue #10461: add button Save and close to Add new box
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Mar 9, 2016
1 parent af6c3b0 commit 21e2a55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
14 changes: 8 additions & 6 deletions application/controllers/admin/homepagesettings.php
Expand Up @@ -31,11 +31,9 @@ public function __construct($controller, $id)
*/
public function view($id)
{

$this->_renderWrappedTemplate('homepagesettings', 'view', array(
'model'=>$this->loadModel($id),
));

}

/**
Expand All @@ -45,16 +43,20 @@ public function view($id)
public function create()
{
$model=new Boxes;
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);

if(isset($_POST['Boxes']))
{
$model->attributes=$_POST['Boxes'];
if($model->save())
{
Yii::app()->user->setFlash('success', gT('New box created'));
$this->getController()->redirect(array('admin/homepagesettings'));
if (isset($_POST['saveandclose']))
{
$this->getController()->redirect(array('admin/homepagesettings'));
}
else
{
$this->getController()->redirect(array('admin/homepagesettings/sa/update/id/'.$model->id));
}
}
else
{
Expand Down
1 change: 1 addition & 0 deletions application/views/admin/homepagesettings/create.php
Expand Up @@ -6,6 +6,7 @@

<?php $this->renderPartial('super/fullpagebar_view', array(
'fullpagebar' => array(
'savebutton' => array('form' => 'boxes-form'),
'saveandclosebutton' => array('form' => 'boxes-form'),
'closebutton' => array('url' => Yii::app()->createUrl('admin/homepagesettings'))
)
Expand Down

0 comments on commit 21e2a55

Please sign in to comment.