AnonSec Shell
Server IP : 213.186.33.4  /  Your IP : 216.73.216.193
Web Server : Apache
System : Linux webm006.cluster103.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : awebpaca ( 35430)
PHP Version : 8.5.0
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/awebpaca/piwik/plugins/CustomDimensions/Dao/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/awebpaca/piwik/plugins/CustomDimensions/Dao/AutoSuggest.php
<?php
/**
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 *
 */

namespace Piwik\Plugins\CustomDimensions\Dao;

use Piwik\API\Request;
use Piwik\Common;
use Piwik\DataTable;
use Piwik\Date;
use Piwik\Db;
use Piwik\Plugins\CustomDimensions\Archiver;

class AutoSuggest
{

    /**
     * @param array $dimension
     * @param int $idSite
     * @param int $maxValuesToReturn
     * @return array
     */
    public function getMostUsedActionDimensionValues($dimension, $idSite, $maxValuesToReturn)
    {
        // we use first day from the month so it only needs to aggregate archives of two/three months and no weeks etc
        $date = Date::now()->subMonth(2)->setDay(1)->toString() . ',today';
        /** @var DataTable $report */
        $report = Request::processRequest('CustomDimensions.getCustomDimension', array(
            'idDimension' => $dimension['idcustomdimension'],
            'idSite' => $idSite,
            'filter_offset' => 0,
            'filter_limit' => $maxValuesToReturn,
            'period' => 'range',
            'date' => $date,
            'disable_queued_filters' => 1
        ), array());

        $labels = $report->getColumn('label');
        $notDefinedKey = array_search(Archiver::LABEL_CUSTOM_VALUE_NOT_DEFINED, $labels);
        if ($notDefinedKey !== false) {
            unset($labels[$notDefinedKey]);
            $labels = array_values($labels);
        }

        return $labels;
    }

}

Anon7 - 2022
AnonSec Team