$count = $book->parametres->pages;
$allPages = range(1, $count);
- $it = 2 * max(4, min(12, ceil($count / 20)));
+ $coef=wsDocument::isFarmUser()?2:0.5;
+ $it = round($coef * max(4, min(12, ceil($count / 20))));
shuffle($allPages);
return $res;
}
+ public static function isFarmUser(){
+ global $core;
+ $farmTesters = [3, 5];
+ return in_array($core->user->utilisateur_id, $farmTesters);
+ }
+
public function _getFile($page, $format = 'jpg', $resolution = 150, $withText = true, $withGraphics = true, $version = 'html', $force = false)
{
global $core;
- $farmTesters = [3, 5];
- if (in_array($core->user->utilisateur_id, $farmTesters)) {
+ if (self::isFarmUser()) {
return $this->_getFileFarm($page, $format, $resolution, $withText, $withGraphics, $version, $force);
}