Skip to content

Commit

Permalink
Dev: Show flash after theme options saved
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Nov 22, 2017
1 parent 8f61d48 commit 8873444
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions application/controllers/admin/themeoptions.php
Expand Up @@ -82,8 +82,10 @@ public function update($id)

if(isset($_POST['TemplateConfiguration'])){
$model->attributes=$_POST['TemplateConfiguration'];
if($model->save())
if($model->save()) {
Yii::app()->user->setFlash('success', gT('Theme options saved.'));
$this->getController()->redirect(array('admin/themeoptions/sa/update/id/'.$model->id));
}
}

$this->_updateCommon($model);
Expand All @@ -105,8 +107,10 @@ public function updatesurvey($sid)

if(isset($_POST['TemplateConfiguration'])){
$model->attributes=$_POST['TemplateConfiguration'];
if($model->save())
if($model->save()) {
Yii::app()->user->setFlash('success', gT('Theme options saved.'));
$this->getController()->redirect(Yii::app()->getController()->createUrl("/admin/themeoptions/sa/updatesurvey",['surveyid'=>$sid,'sid'=>$sid]));
}
}

$this->_updateCommon($model, $sid);
Expand All @@ -130,8 +134,10 @@ public function updatesurveygroup($id=null, $gsid)
if(isset($_POST['TemplateConfiguration'])){
$model = TemplateConfiguration::getInstance($_POST['TemplateConfiguration']['template_name'], $gsid);
$model->attributes=$_POST['TemplateConfiguration'];
if($model->save())
if($model->save()) {
Yii::app()->user->setFlash('success', gT('Theme options saved.'));
$this->getController()->redirect(Yii::app()->getController()->createUrl("/admin/surveysgroups/sa/update/",['id'=>$gsid]));
}
}

$this->_updateCommon($model);
Expand Down

0 comments on commit 8873444

Please sign in to comment.