Exemplo n.º 1
0
Arquivo: Os.php Projeto: piwik/piwik
 protected function configureSegments()
 {
     $segment = new Segment();
     $segment->setSegment('operatingSystemCode');
     $segment->setName('DevicesDetection_ColumnOperatingSystem');
     $segment->setAcceptedValues('WIN, MAC, LIN, AND, IPD, etc.');
     $this->addSegment($segment);
 }
Exemplo n.º 2
0
 protected function configureSegments()
 {
     $segment = new Segment();
     $segment->setSegment('browserCode');
     $segment->setName('DevicesDetection_ColumnBrowser');
     $segment->setAcceptedValues('FF, IE, CH, SF, OP, etc.');
     $this->addSegment($segment);
 }
Exemplo n.º 3
0
 protected function configureSegments()
 {
     $segment = new Segment();
     $segment->setSegment('operatingSystemVersion');
     $segment->setName('DevicesDetection_ColumnOperatingSystemVersion');
     $segment->setAcceptedValues('XP, 7, 2.3, 5.1, ...');
     $this->addSegment($segment);
 }
Exemplo n.º 4
0
 protected function configureSegments()
 {
     $segment = new Segment();
     $segment->setSegment('browserVersion');
     $segment->setName('DevicesDetection_BrowserVersion');
     $segment->setAcceptedValues('1.0, 8.0, etc.');
     $this->addSegment($segment);
 }
Exemplo n.º 5
0
 protected function configureSegments()
 {
     $segment = new Segment();
     $segment->setSegment('browserEngine');
     $segment->setName('DevicesDetection_BrowserEngine');
     $segment->setAcceptedValues('Trident, WebKit, Presto, Gecko, Blink, etc.');
     $segment->setSuggestedValuesCallback('\\DeviceDetector\\Parser\\Client\\Browser\\Engine::getAvailableEngines');
     $this->addSegment($segment);
 }
Exemplo n.º 6
0
 protected function configureSegments()
 {
     $brands = DeviceParserAbstract::$deviceBrands;
     $brandList = implode(", ", $brands);
     $segment = new Segment();
     $segment->setSegment('deviceBrand');
     $segment->setName('DevicesDetection_DeviceBrand');
     $segment->setAcceptedValues($brandList);
     $segment->setSqlFilter(function ($brand) use($brandList, $brands) {
         if ($brand == Piwik::translate('General_Unknown')) {
             return '';
         }
         $index = array_search(trim(urldecode($brand)), $brands);
         if ($index === false) {
             throw new \Exception("deviceBrand segment must be one of: {$brandList}");
         }
         return $index;
     });
     $this->addSegment($segment);
 }