-
-
- - - - - +if (selectToClipboard) { + selectToClipboard.forEach(element => element.addEventListener("click", () => copySelectedText(element))); +}; + +function copySelectedText(element) { + // Get the text content of the clicked element + const text = element.textContent; + + // Create a temporary element to hold the text + const tempElement = document.createElement("textarea"); + tempElement.value = text; + tempElement.style.position = "absolute"; + tempElement.style.left = "-9999px"; + document.body.appendChild(tempElement); + + // Select the text in the temporary element + tempElement.select(); + + // Copy the selected text to the clipboard + const result = document.execCommand("copy"); + + // Remove the temporary element + document.body.removeChild(tempElement); -
-
- filter->TimeStart, 'filter_time_start', 'filter_time_start', '%Y-%m-%d', ['class' => 'filter btn-wrapper', 'placeholder' => Text::_('COM_KUNENA_LOG_CALENDAR_PLACEHOLDER_START_DATE')]); ?> - filter->TimeStop, 'filter_time_stop', 'filter_time_stop', '%Y-%m-%d', ['class' => 'filter wrapper', 'placeholder' => Text::_('COM_KUNENA_LOG_CALENDAR_PLACEHOLDER_END_DATE')]); ?> -
-
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
-
+ // Optionally show a confirmation message + if (result) { + console.log("Text copied to clipboard!"); + } else { + console.log("Text could not be copied. Please try again."); + } +}; +INLINESCRIPT; +$wa->addInlineScript($inlineScript, [], ['type' => 'module']); - - +$app = Factory::getApplication(); +$user = $this->getCurrentUser(); +$userId = $user->get('id'); +$listOrder = $this->escape($this->state->get('list.ordering')); +$listDirn = $this->escape($this->state->get('list.direction')); +?> + +
+
+
+ $this]); + ?> +
+ - - - - - - - - - - group) : - ?> - - - - - - - - - - - - group) : - ?> + + + items as $item) : + $date = new KunenaDate($item->time); + ?> + + - - - - - - - - - - pagination->total > 0) : - foreach ($this->items as $item) : - $date = new KunenaDate($item->time); - $user = KunenaUserHelper::get($item->user_id); - $category = KunenaCategoryHelper::get($item->category_id); - $topic = KunenaTopicHelper::get($item->topic_id); - $target = KunenaUserHelper::get($item->target_user); - - // TODO : move this part of javascript outside of foreach - $this->document->addScriptDeclaration("jQuery( document ).ready(function() { - jQuery('#link_sel_all" . $item->id . "').click(function() { - jQuery('#report_final" . $item->id . "').select(); - try { - var successful = document.execCommand('copy'); - var msg = successful ? 'successful' : 'unsuccessful'; - console.log('Copying text command was ' + msg); - } - catch (err) - { - console.log('Oops, unable to copy'); - } - }); - });"); - ?> - - - - - - - - + + + + + + + + group) : ?> - - group) : ?> - - - + + + + +
- group ? HTMLHelper::_('grid.sort', 'JGRID_HEADING_ID', 'id', $this->list->Direction, $this->list->Ordering) : 'Count'; ?> + + group ? HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'id', $listDirn, $listOrder) : 'Count'; ?> - list->Direction, $this->list->Ordering); ?> + + - list->Direction, $this->list->Ordering); ?> - getGroupCheckbox('type'); ?> + + - Operation - getGroupCheckbox('operation'); ?> + + - list->Direction, $this->list->Ordering); ?> - getGroupCheckbox('user'); ?> + + - list->Direction, $this->list->Ordering); ?> - getGroupCheckbox('category'); ?> + + - list->Direction, $this->list->Ordering); ?> - getGroupCheckbox('topic'); ?> + + - list->Direction, $this->list->Ordering); ?> - getGroupCheckbox('target_user'); ?> + + - IP - getGroupCheckbox('ip'); ?> + + + group) : ?> +
- - - - - - - - - - - - - - - - - - - - - - -
+ group ? $this->escape($item->id) : (int) $item->count; ?> + + toSql(); ?>
- pagination->getListFooter(); ?> -
- group ? $this->escape($item->id) : (int) $item->count; ?> - - toSql(); ?> - - group || isset($this->group['type']) ? $this->escape($this->getType((int) $item->type)) : ''; ?> - - group || isset($this->group['operation']) ? Text::_("COM_KUNENA_{$item->operation}") : ''; ?> - - group || isset($this->group['user']) ? ($user->userid ? $this->escape($user->username) . ' (' . $this->escape($item->user_id) . ')' . '
' . $this->escape($user->name) : '') : ''; ?> -
- group || isset($this->group['category']) ? ($category->exists() ? $category->displayField('name') . ' (' . $this->escape($item->category_id) . ')' : '') : ''; ?> - - group || isset($this->group['topic']) ? ($topic->exists() ? $topic->displayField('subject') . ' (' . $this->escape($item->topic_id) . ')' : '') : ''; ?> - + group || isset($this->group['type']) ? $this->escape($this->getType((int) $item->type)) : ''; ?> + + group || isset($this->group['operation']) ? Text::_("COM_KUNENA_{$item->operation}") : ''; ?> + + group || isset($this->group['user']) ? $this->escape($item->user_username) . ' (' . $this->escape($item->user_id) . ')' . '
' . $this->escape($item->user_name) : ''; ?> +
+ group || isset($this->group['category']) ? $item->category_name . ' (' . $this->escape($item->category_id) . ')' : ''; ?> + + group || isset($this->group['topic']) ? $item->topic_subject . ' (' . $this->escape($item->topic_id) . ')' : ''; ?> + + group || isset($this->group['target_user']) ? $this->escape($item->targetuser_username) . ' (' . $this->escape($item->target_user) . ')' . '
' . $this->escape($item->targetuser_name) : ''; ?> +
+ group || isset($this->group['ip']) ? $this->escape($item->ip) : ''; ?> + - group || isset($this->group['target_user']) ? ($target->userid ? $this->escape($target->username) . ' (' . $this->escape($item->target_user) . ')' . '
' . $this->escape($target->name) : '') : ''; ?> -
- group || isset($this->group['ip']) ? $this->escape($item->ip) : ''; ?> + extra_data) && !empty($item->extra_data)) : ?> + + + escape($this->getType($item->type)) != 'ACT') : ?> + + + + + group || isset($this->group['type']) ? $this->escape($this->getType($item->type)) : ''; ?> + + - - escape($this->getType($item->type)) != 'ACT') : ?> - - - - - group || isset($this->group['type']) ? $this->escape($this->getType($item->type)) : ''; ?> - -
- - - - - - -
- - filter->Active) : - ?> - - - -
- - - - - -
-