public static function renderProgressBar($class, $mastery, $value, $max = null) { $max = !isset($max) ? \Own\Bus\Player\Service::getMaxByMasteryType($mastery) : $max; $htmlValue = $max == 100 ? $value . '%' : ($max == 1000 ? round($value / 10) . '%' : $value . ' / ' . $max); return '<div class="progress" id="progress-' . $mastery . '"> <div class="progress-bar ' . $class . '" data-value="' . $value . '" data-max="' . $max . '"> <span>' . Util\Lang::lang($mastery) . '</span> <span class="value">' . $htmlValue . '</span> </div> </div>'; }