$entry['time'], 'y' => $entry['count']]; } } if (!empty($timeline['modified']['timeline'])) { $series[1]['name'] = __('Modified'); foreach ($timeline['modified']['timeline'] as $entry) { $series[1]['data'][] = ['x' => $entry['time'], 'y' => $entry['count']]; } } $panelControlHtml = sprintf( '
%s %s%s
', $title, $subTitle, $this->Bootstrap->button([ 'variant' => 'link', 'icon' => 'cog', 'size' => 'xs', 'nodeType' => 'a', 'onclick' => '', 'class' => ['btn-statistics-days-configurator-' . $seed,], 'attrs' => [ 'data-bs-toggle' => 'popover', ] ]) ); $createdNumber = empty($timeline['created']) ? '' : sprintf( '
%s %s
', __('{0} Created', $timeline['created']['variation']), $this->Bootstrap->icon('plus', ['class' => ['fa-fw'], 'attrs' => ['style' => 'font-size: 60%;']]), $timeline['created']['variation'] ); $modifiedNumber = empty($timeline['modified']) ? '' : sprintf( '
%s %s
', __('{0} Modified', $timeline['modified']['variation']), $this->Bootstrap->icon('edit', ['class' => ['fa-fw'], 'attrs' => ['style' => 'font-size: 60%;']]), $timeline['modified']['variation'] ); $activityNumbers = sprintf('
%s%s
', $createdNumber, $modifiedNumber); $leftContent = sprintf( '%s%s', $panelControlHtml, $activityNumbers ); $rightContent = sprintf('
%s
', $this->element('charts/bar', [ 'series' => $series, 'chartOptions' => array_merge( [ 'chart' => [ 'height' => 60, ], 'stroke' => [ 'width' => 2, 'curve' => 'smooth', ], ], !empty($chartOptions) ? $chartOptions : [] ) ])); $cardContent = sprintf( '
%s
%s
', $leftContent, $rightContent ); $card = $this->Bootstrap->card([ 'bodyVariant' => 'secondary', 'bodyHTML' => $cardContent, 'bodyClass' => 'py-1 px-2', 'class' => ['shadow-sm', 'h-100'] ]); ?>