33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2025-02-13 17:28:25 +00:00

57 lines
1.1 KiB
PHP
Raw Normal View History

2011-10-11 09:02:57 -04:00
<?php
/**
2012-06-12 13:42:45 -05:00
* @package PatchTester
* @copyright Copyright (C) 2011 Ian MacLennan, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
2011-10-11 09:02:57 -04:00
*/
// No direct access
defined('_JEXEC') or die;
/**
* Pull controller class
*
2012-06-12 13:42:45 -05:00
* @package PatchTester
2011-10-11 09:02:57 -04:00
*/
2012-09-08 20:53:44 -05:00
class PatchtesterControllerPull extends JControllerLegacy
2011-10-11 09:02:57 -04:00
{
public function apply()
{
2012-06-12 13:42:45 -05:00
try
{
$this->getModel('pull')
2012-09-08 20:53:44 -05:00
->apply(JFactory::getApplication()->input->getInt('pull_id'));
2012-06-12 15:07:26 -05:00
$msg = JText::_('COM_PATCHTESTER_APPLY_OK');
2013-07-11 20:49:58 -05:00
$type = 'message';
2012-06-12 13:42:45 -05:00
}
catch (Exception $e)
{
$msg = $e->getMessage();
$type = 'error';
2011-10-11 09:02:57 -04:00
}
$this->setRedirect(JRoute::_('index.php?option=com_patchtester&view=pulls', false), $msg, $type);
2011-10-11 09:02:57 -04:00
}
public function revert()
{
2012-06-12 13:42:45 -05:00
try
{
$this->getModel('pull')
2012-09-08 20:53:44 -05:00
->revert(JFactory::getApplication()->input->getInt('pull_id'));
2012-06-12 13:42:45 -05:00
2012-06-12 15:07:26 -05:00
$msg = JText::_('COM_PATCHTESTER_REVERT_OK');
2013-07-11 20:49:58 -05:00
$type = 'message';
2012-06-12 13:42:45 -05:00
}
catch (Exception $e)
{
2012-06-12 15:07:26 -05:00
$msg = $e->getMessage();
$type = 'error';
2011-10-11 09:02:57 -04:00
}
2012-06-12 13:42:45 -05:00
$this->setRedirect(JRoute::_('index.php?option=com_patchtester&view=pulls', false), $msg, $type);
2011-10-11 09:02:57 -04:00
}
}