Skip to content

Commit

Permalink
Merge branch '4.2-dev' into fix_ldap_ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
richard67 committed Nov 10, 2022
2 parents b41b6f9 + c816def commit b71e884
Show file tree
Hide file tree
Showing 119 changed files with 7,262 additions and 7,120 deletions.
224 changes: 112 additions & 112 deletions administrator/components/com_actionlogs/src/View/Actionlogs/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,116 +30,116 @@
*/
class HtmlView extends BaseHtmlView
{
/**
* An array of items.
*
* @var array
* @since 3.9.0
*/
protected $items;

/**
* The model state
*
* @var array
* @since 3.9.0
*/
protected $state;

/**
* The pagination object
*
* @var Pagination
* @since 3.9.0
*/
protected $pagination;

/**
* Form object for search filters
*
* @var Form
* @since 3.9.0
*/
public $filterForm;

/**
* The active search filters
*
* @var array
* @since 3.9.0
*/
public $activeFilters;

/**
* Setting if the IP column should be shown
*
* @var boolean
* @since 3.9.0
*/
protected $showIpColumn = false;

/**
* Setting if the date should be displayed relative to the current date.
*
* @var boolean
* @since 4.1.0
*/
protected $dateRelative = false;

/**
* Method to display the view.
*
* @param string $tpl A template file to load. [optional]
*
* @return void
*
* @since 3.9.0
*
* @throws Exception
*/
public function display($tpl = null)
{
/** @var ActionlogsModel $model */
$model = $this->getModel();
$this->items = $model->getItems();
$this->state = $model->getState();
$this->pagination = $model->getPagination();
$this->filterForm = $model->getFilterForm();
$this->activeFilters = $model->getActiveFilters();
$params = ComponentHelper::getParams('com_actionlogs');
$this->showIpColumn = (bool) $params->get('ip_logging', 0);
$this->dateRelative = (bool) $params->get('date_relative', 1);

if (\count($errors = $model->getErrors()))
{
throw new GenericDataException(implode("\n", $errors), 500);
}

$this->addToolbar();

// Load all actionlog plugins language files
ActionlogsHelper::loadActionLogPluginsLanguage();

parent::display($tpl);
}

/**
* Add the page title and toolbar.
*
* @return void
*
* @since 3.9.0
*/
protected function addToolbar()
{
ToolbarHelper::title(Text::_('COM_ACTIONLOGS_MANAGER_USERLOGS'), 'icon-list-2');

ToolbarHelper::custom('actionlogs.exportSelectedLogs', 'download', '', 'COM_ACTIONLOGS_EXPORT_CSV', true);
ToolbarHelper::custom('actionlogs.exportLogs', 'download', '', 'COM_ACTIONLOGS_EXPORT_ALL_CSV', false);
ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'actionlogs.delete');
$bar = Toolbar::getInstance('toolbar');
$bar->appendButton('Confirm', 'COM_ACTIONLOGS_PURGE_CONFIRM', 'delete', 'COM_ACTIONLOGS_TOOLBAR_PURGE', 'actionlogs.purge', false);
ToolbarHelper::preferences('com_actionlogs');
ToolbarHelper::help('User_Actions_Log');
}
/**
* An array of items.
*
* @var array
* @since 3.9.0
*/
protected $items;

/**
* The model state
*
* @var array
* @since 3.9.0
*/
protected $state;

/**
* The pagination object
*
* @var Pagination
* @since 3.9.0
*/
protected $pagination;

/**
* Form object for search filters
*
* @var Form
* @since 3.9.0
*/
public $filterForm;

/**
* The active search filters
*
* @var array
* @since 3.9.0
*/
public $activeFilters;

/**
* Setting if the IP column should be shown
*
* @var boolean
* @since 3.9.0
*/
protected $showIpColumn = false;

/**
* Setting if the date should be displayed relative to the current date.
*
* @var boolean
* @since 4.1.0
*/
protected $dateRelative = false;

/**
* Method to display the view.
*
* @param string $tpl A template file to load. [optional]
*
* @return void
*
* @since 3.9.0
*
* @throws Exception
*/
public function display($tpl = null)
{
/** @var ActionlogsModel $model */
$model = $this->getModel();
$this->items = $model->getItems();
$this->state = $model->getState();
$this->pagination = $model->getPagination();
$this->filterForm = $model->getFilterForm();
$this->activeFilters = $model->getActiveFilters();
$params = ComponentHelper::getParams('com_actionlogs');
$this->showIpColumn = (bool) $params->get('ip_logging', 0);
$this->dateRelative = (bool) $params->get('date_relative', 1);

if (\count($errors = $model->getErrors()))
{
throw new GenericDataException(implode("\n", $errors), 500);
}

$this->addToolbar();

// Load all actionlog plugins language files
ActionlogsHelper::loadActionLogPluginsLanguage();

parent::display($tpl);
}

/**
* Add the page title and toolbar.
*
* @return void
*
* @since 3.9.0
*/
protected function addToolbar()
{
ToolbarHelper::title(Text::_('COM_ACTIONLOGS_MANAGER_USERLOGS'), 'icon-list-2');

ToolbarHelper::custom('actionlogs.exportSelectedLogs', 'download', '', 'COM_ACTIONLOGS_EXPORT_CSV', true);
ToolbarHelper::custom('actionlogs.exportLogs', 'download', '', 'COM_ACTIONLOGS_EXPORT_ALL_CSV', false);
ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'actionlogs.delete');
$bar = Toolbar::getInstance('toolbar');
$bar->appendButton('Confirm', 'COM_ACTIONLOGS_PURGE_CONFIRM', 'delete', 'COM_ACTIONLOGS_TOOLBAR_PURGE', 'actionlogs.purge', false);
ToolbarHelper::preferences('com_actionlogs');
ToolbarHelper::help('User_Actions_Log');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@
*/
class Configuration
{
/**
* Method to generate a string for a value
*
* @param mixed $value The configuration value
*
* @return string Formatted and escaped string
*
* @since 4.0.0
*/
public function value($value): string
{
if (\is_bool($value))
{
return $value ? 'true' : 'false';
}
/**
* Method to generate a string for a value
*
* @param mixed $value The configuration value
*
* @return string Formatted and escaped string
*
* @since 4.0.0
*/
public function value($value): string
{
if (\is_bool($value))
{
return $value ? 'true' : 'false';
}

if (\is_array($value))
{
$value = implode(', ', $value);
}
if (\is_array($value))
{
$value = implode(', ', $value);
}

return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
}
return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
}
}

0 comments on commit b71e884

Please sign in to comment.