Add message types to distinguish errors

This commit is contained in:
Nikolai Plath 2011-10-12 23:01:15 -05:00
parent a6bad02833
commit fd4bc5ba59
1 changed files with 6 additions and 2 deletions

View File

@ -22,10 +22,12 @@ class PatchtesterControllerPull extends JController
$model = $this->getModel('pull');
if ($model->apply(JRequest::getVar('pull_id'))) {
$msg = 'Patch successfully applied';
$type = 'message';
} else {
$msg = $model->getError();
$type = 'error';
}
$this->setRedirect(JRoute::_('index.php?option=com_patchtester&view=pulls', false), $msg);
$this->setRedirect(JRoute::_('index.php?option=com_patchtester&view=pulls', false), $msg, $type);
}
public function revert()
@ -33,10 +35,12 @@ class PatchtesterControllerPull extends JController
$model = $this->getModel('pull');
if ($model->revert(JRequest::getVar('pull_id'))) {
$msg = 'Patch successfully reverted';
$type = 'message';
} else {
$msg = 'Patch did not revert';
$type = 'error';
}
$this->setRedirect(JRoute::_('index.php?option=com_patchtester&view=pulls', false), $msg);
$this->setRedirect(JRoute::_('index.php?option=com_patchtester&view=pulls', false), $msg, $type);
}
}