Skip to content

Commit

Permalink
Merge branch '4.0-dev' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
infograf768 committed May 16, 2019
2 parents 67cfd27 + f701a28 commit c3b7232
Show file tree
Hide file tree
Showing 16 changed files with 194 additions and 226 deletions.
30 changes: 28 additions & 2 deletions administrator/components/com_menus/presets/joomla.xml
Expand Up @@ -217,9 +217,35 @@
title="MOD_MENU_COM_PRIVACY"
type="component"
element="com_privacy"
link="index.php?option=com_privacy&view=dashboard"
link="index.php?option=com_privacy"
class="class:privacy"
/>
>
<menuitem
title="MOD_MENU_COM_PRIVACY_DASHBOARD"
type="component"
element="com_privacy"
link="index.php?option=com_privacy&amp;view=dashboard"
/>
<menuitem
title="MOD_MENU_COM_PRIVACY_REQUESTS"
type="component"
element="com_privacy"
link="index.php?option=com_privacy&amp;view=requests"
/>
<menuitem
title="MOD_MENU_COM_PRIVACY_CAPABILITIES"
type="component"
element="com_privacy"
link="index.php?option=com_privacy&amp;view=capabilities"
/>

<menuitem
title="MOD_MENU_COM_PRIVACY_CONSENTS"
type="component"
element="com_privacy"
link="index.php?option=com_privacy&amp;view=consents"
/>
</menuitem>
<menuitem
title="MOD_MENU_COM_ACTIONLOGS"
type="component"
Expand Down
37 changes: 0 additions & 37 deletions administrator/components/com_privacy/Helper/PrivacyHelper.php
Expand Up @@ -13,7 +13,6 @@

use Joomla\CMS\Factory;
use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\Language\Text;
use Joomla\Component\Privacy\Administrator\Export\Domain;

/**
Expand All @@ -23,42 +22,6 @@
*/
class PrivacyHelper extends ContentHelper
{
/**
* Configure the Linkbar.
*
* @param string $vName The name of the active view.
*
* @return void
*
* @since 3.9.0
*/
public static function addSubmenu($vName)
{
\JHtmlSidebar::addEntry(
Text::_('COM_PRIVACY_SUBMENU_DASHBOARD'),
'index.php?option=com_privacy&view=dashboard',
$vName === 'dashboard'
);

\JHtmlSidebar::addEntry(
Text::_('COM_PRIVACY_SUBMENU_REQUESTS'),
'index.php?option=com_privacy&view=requests',
$vName === 'requests'
);

\JHtmlSidebar::addEntry(
Text::_('COM_PRIVACY_SUBMENU_CAPABILITIES'),
'index.php?option=com_privacy&view=capabilities',
$vName === 'capabilities'
);

\JHtmlSidebar::addEntry(
Text::_('COM_PRIVACY_SUBMENU_CONSENTS'),
'index.php?option=com_privacy&view=consents',
$vName === 'consents'
);
}

/**
* Render the data request as a XML document.
*
Expand Down
Expand Up @@ -12,6 +12,7 @@
defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Toolbar\ToolbarHelper;
Expand All @@ -31,14 +32,6 @@ class HtmlView extends BaseHtmlView
*/
protected $capabilities;

/**
* The HTML markup for the sidebar
*
* @var string
* @since 3.9.0
*/
protected $sidebar;

/**
* The state information
*
Expand All @@ -52,11 +45,11 @@ class HtmlView extends BaseHtmlView
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
* @return void
*
* @see BaseHtmlView::loadTemplate()
* @since 3.9.0
* @throws Exception
* @throws \Exception
*/
public function display($tpl = null)
{
Expand All @@ -67,14 +60,12 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new \JViewGenericdataexception(implode("\n", $errors), 500);
throw new Genericdataexception(implode("\n", $errors), 500);
}

$this->addToolbar();

$this->sidebar = \JHtmlSidebar::render();

return parent::display($tpl);
parent::display($tpl);
}

/**
Expand Down
33 changes: 13 additions & 20 deletions administrator/components/com_privacy/View/Consents/HtmlView.php
Expand Up @@ -13,11 +13,13 @@

use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Pagination\Pagination;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Privacy\Administrator\Model\ConsentsModel;

/**
* Consents view class
Expand Down Expand Up @@ -60,14 +62,6 @@ class HtmlView extends BaseHtmlView
*/
protected $pagination;

/**
* The HTML markup for the sidebar
*
* @var string
* @since 3.9.0
*/
protected $sidebar;

/**
* The state information
*
Expand All @@ -81,32 +75,31 @@ class HtmlView extends BaseHtmlView
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
* @return void
*
* @see BaseHtmlView::loadTemplate()
* @since 3.9.0
* @throws Exception
* @throws \Exception
*/
public function display($tpl = null)
{
// Initialise variables
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
/** @var ConsentsModel $model */
$model = $this->getModel();
$this->items = $model->getItems();
$this->pagination = $model->getPagination();
$this->state = $model->getState();
$this->filterForm = $model->getFilterForm();
$this->activeFilters = $model->getActiveFilters();

// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new \JViewGenericdataexception(implode("\n", $errors), 500);
throw new Genericdataexception(implode("\n", $errors), 500);
}

$this->addToolbar();

$this->sidebar = \JHtmlSidebar::render();

return parent::display($tpl);
parent::display($tpl);
}

/**
Expand Down
22 changes: 11 additions & 11 deletions administrator/components/com_privacy/View/Dashboard/HtmlView.php
Expand Up @@ -18,6 +18,7 @@
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Privacy\Administrator\Helper\PrivacyHelper;
use Joomla\Component\Privacy\Administrator\Model\DashboardModel;
use Joomla\Component\Privacy\Administrator\Model\RequestsModel;

/**
Expand Down Expand Up @@ -68,12 +69,12 @@ class HtmlView extends BaseHtmlView
protected $sendMailEnabled;

/**
* The HTML markup for the sidebar
* Days when a request is considered urgent
*
* @var string
* @var integer
* @since 3.9.0
*/
protected $sidebar;
protected $urgentRequestDays = 14;

/**
* Id of the system privacy consent plugin
Expand All @@ -88,19 +89,20 @@ class HtmlView extends BaseHtmlView
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
* @return void
*
* @see BaseHtmlView::loadTemplate()
* @since 3.9.0
* @throws \Exception
*/
public function display($tpl = null)
{
// Initialise variables
/** @var DashboardModel $model */
$model = $this->getModel();
$this->privacyPolicyInfo = $model->getPrivacyPolicyInfo();
$this->requestCounts = $model->getRequestCounts();
$this->requestFormPublished = $model->getRequestFormPublished();
$this->privacyConsentPluginId = PrivacyHelper::getPrivacyConsentPluginId();
$this->privacyPolicyInfo = $this->get('PrivacyPolicyInfo');
$this->requestCounts = $this->get('RequestCounts');
$this->requestFormPublished = $this->get('RequestFormPublished');
$this->sendMailEnabled = (bool) Factory::getConfig()->get('mailonline', 1);

/** @var RequestsModel $requestsModel */
Expand All @@ -118,9 +120,7 @@ public function display($tpl = null)

$this->addToolbar();

$this->sidebar = \JHtmlSidebar::render();

return parent::display($tpl);
parent::display($tpl);
}

/**
Expand Down
Expand Up @@ -32,7 +32,7 @@ class XmlView extends AbstractView
* @return mixed A string if successful, otherwise an Error object.
*
* @since 3.9.0
* @throws Exception
* @throws \Exception
*/
public function display($tpl = null)
{
Expand Down
14 changes: 8 additions & 6 deletions administrator/components/com_privacy/View/Request/HtmlView.php
Expand Up @@ -19,6 +19,7 @@
use Joomla\CMS\Router\Route;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Privacy\Administrator\Model\RequestsModel;

/**
* Request view class
Expand Down Expand Up @@ -64,17 +65,18 @@ class HtmlView extends BaseHtmlView
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
* @return void
*
* @see BaseHtmlView::loadTemplate()
* @since 3.9.0
* @throws Exception
* @throws \Exception
*/
public function display($tpl = null)
{
// Initialise variables.
$this->item = $this->get('Item');
$this->state = $this->get('State');
/** @var RequestsModel $model */
$model = $this->getModel();
$this->item = $model->getItem();
$this->state = $model->getState();

// Variables only required for the default layout
if ($this->getLayout() === 'default')
Expand Down Expand Up @@ -104,7 +106,7 @@ public function display($tpl = null)

$this->addToolbar();

return parent::display($tpl);
parent::display($tpl);
}

/**
Expand Down

0 comments on commit c3b7232

Please sign in to comment.