| Current Path : /home/w/u/e/wuectly/www/03cbe/ |
| Current File : /home/w/u/e/wuectly/www/03cbe/consents.tar |
consents.php 0000604 00000002761 15245561456 0007130 0 ustar 00 <?php
/**
* @package Joomla.Plugin
* @subpackage Privacy.consents
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::register('PrivacyPlugin', JPATH_ADMINISTRATOR . '/components/com_privacy/helpers/plugin.php');
/**
* Privacy plugin managing Joomla user consent data
*
* @since 3.9.0
*/
class PlgPrivacyConsents extends PrivacyPlugin
{
/**
* Processes an export request for Joomla core user consent data
*
* This event will collect data for the core `#__privacy_consents` table
*
* @param PrivacyTableRequest $request The request record being processed
* @param JUser $user The user account associated with this request if available
*
* @return PrivacyExportDomain[]
*
* @since 3.9.0
*/
public function onPrivacyExportRequest(PrivacyTableRequest $request, JUser $user = null)
{
if (!$user)
{
return array();
}
$domain = $this->createDomain('consents', 'joomla_consent_data');
$query = $this->db->getQuery(true)
->select('*')
->from($this->db->quoteName('#__privacy_consents'))
->where($this->db->quoteName('user_id') . ' = ' . (int) $user->id)
->order($this->db->quoteName('created') . ' ASC');
$items = $this->db->setQuery($query)->loadAssocList();
foreach ($items as $item)
{
$domain->addItem($this->createItemFromArray($item));
}
return array($domain);
}
}
consents.xml 0000604 00000001423 15245561456 0007133 0 ustar 00 <?xml version="1.0" encoding="utf-8"?>
<extension version="3.9" type="plugin" group="privacy" method="upgrade">
<name>plg_privacy_consents</name>
<author>Joomla! Project</author>
<creationDate>July 2018</creationDate>
<copyright>(C) 2018 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>3.9.0</version>
<description>PLG_PRIVACY_CONSENTS_XML_DESCRIPTION</description>
<files>
<filename plugin="consents">consents.php</filename>
</files>
<languages>
<language tag="en-GB">en-GB.plg_privacy_consents.ini</language>
<language tag="en-GB">en-GB.plg_privacy_consents.sys.ini</language>
</languages>
</extension>
tmpl/default.php 0000604 00000010172 15245663161 0007663 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_privacy
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/** @var PrivacyViewConsent $this */
// Load the tooltip behavior.
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('formbehavior.chosen', 'select');
$user = JFactory::getUser();
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$now = JFactory::getDate();
$stateIcons = array(-1 => 'trash', 0 => 'archive', 1 => 'publish');
$stateMsgs = array(-1 => JText::_('COM_PRIVACY_CONSENTS_STATE_INVALIDATED'), 0 => JText::_('COM_PRIVACY_CONSENTS_STATE_OBSOLETE'), 1 => JText::_('COM_PRIVACY_CONSENTS_STATE_VALID'));
?>
<form action="<?php echo JRoute::_('index.php?option=com_privacy&view=consents'); ?>" method="post" name="adminForm" id="adminForm">
<?php if (!empty($this->sidebar)) : ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
<div class="clearfix"> </div>
<?php if (empty($this->items)) : ?>
<div class="alert alert-no-items">
<?php echo JText::_('COM_PRIVACY_MSG_CONSENTS_NO_CONSENTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="consentList">
<thead>
<tr>
<th width="1%" class="center">
<?php echo JHtml::_('grid.checkall'); ?>
</th>
<th width="1%" class="nowrap center">
<?php echo JHtml::_('searchtools.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
</th>
<th width="10%" class="nowrap">
<?php echo JHtml::_('searchtools.sort', 'JGLOBAL_USERNAME', 'u.username', $listDirn, $listOrder); ?>
</th>
<th width="1%" class="nowrap">
<?php echo JHtml::_('searchtools.sort', 'COM_PRIVACY_HEADING_USERID', 'a.user_id', $listDirn, $listOrder); ?>
</th>
<th width="10%" class="nowrap">
<?php echo JHtml::_('searchtools.sort', 'COM_PRIVACY_HEADING_CONSENTS_SUBJECT', 'a.subject', $listDirn, $listOrder); ?>
</th>
<th class="nowrap">
<?php echo JText::_('COM_PRIVACY_HEADING_CONSENTS_BODY'); ?>
</th>
<th width="15%" class="nowrap">
<?php echo JHtml::_('searchtools.sort', 'COM_PRIVACY_HEADING_CONSENTS_CREATED', 'a.created', $listDirn, $listOrder); ?>
</th>
<th width="1%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="9">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php foreach ($this->items as $i => $item) : ?>
<tr class="row<?php echo $i % 2; ?>">
<td class="center">
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td>
<span class="icon icon-<?php echo $stateIcons[$item->state]; ?>" title="<?php echo $stateMsgs[$item->state]; ?>"></span>
</td>
<td>
<?php echo $item->username; ?>
</td>
<td>
<?php echo $item->user_id; ?>
</td>
<td>
<?php echo JText::_($item->subject); ?>
</td>
<td>
<?php echo $item->body; ?>
</td>
<td class="break-word">
<span class="hasTooltip" title="<?php echo JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC6')); ?>">
<?php echo JHtml::_('date.relative', new JDate($item->created), null, $now); ?>
</span>
</td>
<td class="hidden-phone">
<?php echo (int) $item->id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
tmpl/default.xml 0000604 00000000322 15245663161 0007670 0 ustar 00 <?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PRIVACY_CONSENTS_VIEW_DEFAULT_TITLE">
<message>
<![CDATA[COM_PRIVACY_CONSENTS_VIEW_DEFAULT_DESC]]>
</message>
</layout>
</metadata>
view.html.php 0000604 00000005661 15245663161 0007207 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_privacy
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Consents view class
*
* @since 3.9.0
*/
class PrivacyViewConsents extends JViewLegacy
{
/**
* The active search tools filters
*
* @var array
* @since 3.9.0
* @note Must be public to be accessed from the search tools layout
*/
public $activeFilters;
/**
* Form instance containing the search tools filter form
*
* @var JForm
* @since 3.9.0
* @note Must be public to be accessed from the search tools layout
*/
public $filterForm;
/**
* The items to display
*
* @var array
* @since 3.9.0
*/
protected $items;
/**
* The pagination object
*
* @var JPagination
* @since 3.9.0
*/
protected $pagination;
/**
* The HTML markup for the sidebar
*
* @var string
* @since 3.9.0
*/
protected $sidebar;
/**
* The state information
*
* @var JObject
* @since 3.9.0
*/
protected $state;
/**
* Execute and display a template script.
*
* @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.
*
* @see JViewLegacy::loadTemplate()
* @since 3.9.0
* @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');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new Exception(implode("\n", $errors), 500);
}
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render();
return parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 3.9.0
*/
protected function addToolbar()
{
JToolbarHelper::title(JText::_('COM_PRIVACY_VIEW_CONSENTS'), 'lock');
$bar = JToolbar::getInstance('toolbar');
// Add a button to invalidate a consent
$bar->appendButton(
'Confirm',
'COM_PRIVACY_CONSENTS_TOOLBAR_INVALIDATE_CONFIRM_MSG',
'trash',
'COM_PRIVACY_CONSENTS_TOOLBAR_INVALIDATE',
'consents.invalidate',
true
);
// If the filter is restricted to a specific subject, show the "Invalidate all" button
if ($this->state->get('filter.subject') != '')
{
$bar->appendButton(
'Confirm',
'COM_PRIVACY_CONSENTS_TOOLBAR_INVALIDATE_ALL_CONFIRM_MSG',
'cancel',
'COM_PRIVACY_CONSENTS_TOOLBAR_INVALIDATE_ALL',
'consents.invalidateAll',
false
);
}
JToolbarHelper::preferences('com_privacy');
JToolbarHelper::help('JHELP_COMPONENTS_PRIVACY_CONSENTS');
}
}