- md5
- 3faf0a34950f619156fca3e8f5755386
- sha1
- cc20b66c8328e4b28069e4a7434cfd45d35af464
- sha256
- 375cc36818d2527da56b837ffd119994bfb85d6b8d88b16c203215e93a3741cf
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
<?php
/**
* @package Joomla.Administrator
* @subpackage com_postinstall
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Postinstall\Administrator\Controller;
defined('_JEXEC') or die;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\Component\Postinstall\Administrator\Helper\PostinstallHelper;
use Joomla\Component\Postinstall\Administrator\Model\MessagesModel;
/**
* Postinstall message controller.
*
* @since 3.2
*/
class MessageController extends BaseController
{
/**
* Resets all post-installation messages of the specified extension.
*
* @return void
*
* @since 3.2
*/
public function reset()
{
/** @var Messages $model */
$model = $this->getModel('Messages', '', array('ignore_request' => true));
$eid = (int) $model->getState('eid', '700');
if (empty($eid))
{
$eid = 700;
}
$model->resetMessages($eid);
$this->setRedirect('index.php?option=com_postinstall&eid=' . $eid);
}
/**
* Unpublishes post-installation message of the specified extension.
*
* @return void
*
* @since 3.2
*/
public function unpublish()
{
$model = $this->getModel('Messages', '', array('ignore_request' => true));
$id = $this->input->get('id');
$eid = (int) $model->getState('eid', '700');
if (empty($eid))
{
$eid = 700;
}
$model->setState('published', 0);
$model->unpublishMessage($id);
$this->setRedirect('index.php?option=com_postinstall&eid=' . $eid);
}
/**
* Executes the action associated with an item.
*
* @return void
*
* @since 3.2
*/
public function action()
{
$model = $this->getModel('Messages', '', array('ignore_request' => true));
$id = $this->input->get('id');
$item = $model->getItem($id);
switch ($item->type)
{
case 'link':
$this->setRedirect($item->action);
return;
break;
case 'action':
jimport('joomla.filesystem.file');
$helper = new PostinstallHelper;
$file = $helper->parsePath($item->action_file);
if (\JFile::exists($file))
{
require_once $file;
call_user_func($item->action);
}
break;
case 'message':
default:
break;
}
$this->setRedirect('index.php?option=com_postinstall');
}
}
No other release has this exact content. See every version of this file.