|
|
|
@ -12,7 +12,7 @@ function supportedversions_header_prive_css($flux) {
|
|
|
|
|
return supportedversions_insert_head_css($flux); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function state(array $valeurs) { |
|
|
|
|
function supver_state(array $valeurs) { |
|
|
|
|
$now = new DateTime; |
|
|
|
|
$initial = new DateTime($valeurs['initial_release']); |
|
|
|
|
$bug = $valeurs['active_support'] ? new DateTime($valeurs['active_support']) : null; |
|
|
|
@ -31,43 +31,43 @@ function state(array $valeurs) {
|
|
|
|
|
return ''; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function balise_SVG_dist($p) { |
|
|
|
|
return balise_ENV_dist($p, '$GLOBALS["svg"]'); |
|
|
|
|
function balise_SUPVER_SVG_dist($p) { |
|
|
|
|
return balise_ENV_dist($p, '$GLOBALS["supver_svg"]'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function min_date() { |
|
|
|
|
function supver_min_date() { |
|
|
|
|
$now = new DateTime('January 1'); |
|
|
|
|
|
|
|
|
|
return $now->sub(new DateInterval('P3Y')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function max_date() { |
|
|
|
|
function supver_max_date() { |
|
|
|
|
$now = new DateTime('January 1'); |
|
|
|
|
|
|
|
|
|
return $now->add(new DateInterval('P5Y')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function date_horiz_coord(DateTime $date) { |
|
|
|
|
global $svg; |
|
|
|
|
function supver_date_horiz_coord(DateTime $date) { |
|
|
|
|
global $supver_svg; |
|
|
|
|
|
|
|
|
|
$diff = $date->diff(min_date()); |
|
|
|
|
$diff = $date->diff(supver_min_date()); |
|
|
|
|
if (!$diff->invert) { |
|
|
|
|
return $svg['margin_left']; |
|
|
|
|
return $supver_svg['margin_left']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $svg['margin_left'] + ($diff->days / (365.24 / $svg['year_width'])); |
|
|
|
|
return $supver_svg['margin_left'] + ($diff->days / (365.24 / $supver_svg['year_width'])); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function horiz_coord($date) { |
|
|
|
|
function supver_horiz_coord($date) { |
|
|
|
|
if ($date) { |
|
|
|
|
return date_horiz_coord(date_create_from_format('Y-m-d', $date)); |
|
|
|
|
return supver_date_horiz_coord(date_create_from_format('Y-m-d', $date)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//return ''; |
|
|
|
|
return date_horiz_coord(max_date()); |
|
|
|
|
return supver_date_horiz_coord(supver_max_date()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function years() { |
|
|
|
|
function supver_years() { |
|
|
|
|
static $years = []; |
|
|
|
|
|
|
|
|
|
if (empty($years)) { |
|
|
|
@ -75,14 +75,14 @@ function years() {
|
|
|
|
|
function ($year) { |
|
|
|
|
return $year->format('Y-m-d'); |
|
|
|
|
}, |
|
|
|
|
iterator_to_array(new DatePeriod(min_date(), new DateInterval('P1Y'), max_date())) |
|
|
|
|
iterator_to_array(new DatePeriod(supver_min_date(), new DateInterval('P1Y'), supver_max_date())) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $years; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function branches() { |
|
|
|
|
function supver_branches() { |
|
|
|
|
static $branches = []; |
|
|
|
|
|
|
|
|
|
if (empty($branches)) { |
|
|
|
@ -97,30 +97,30 @@ function branches() {
|
|
|
|
|
return $branches; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function top($branch) { |
|
|
|
|
global $svg; |
|
|
|
|
function supver_top($branch) { |
|
|
|
|
global $supver_svg; |
|
|
|
|
|
|
|
|
|
$i = array_search($branch, branches(), true); |
|
|
|
|
$i = array_search($branch, supver_branches(), true); |
|
|
|
|
|
|
|
|
|
return $svg['header_height'] + ($svg['branch_height'] * $i++); |
|
|
|
|
return $supver_svg['header_height'] + ($supver_svg['branch_height'] * $i++); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function top_for_text($top) { |
|
|
|
|
global $svg; |
|
|
|
|
function supver_top_for_text($top) { |
|
|
|
|
global $supver_svg; |
|
|
|
|
|
|
|
|
|
$top = $top + (0.5 * $svg['branch_height']); |
|
|
|
|
$top = $top + (0.5 * $supver_svg['branch_height']); |
|
|
|
|
|
|
|
|
|
return $top; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function width($margin_left) { |
|
|
|
|
global $svg; |
|
|
|
|
function supver_width($margin_left) { |
|
|
|
|
global $supver_svg; |
|
|
|
|
|
|
|
|
|
return $margin_left + $svg['margin_right'] + ((count(years()) - 1) * $svg['year_width']); |
|
|
|
|
return $margin_left + $supver_svg['margin_right'] + ((count(supver_years()) - 1) * $supver_svg['year_width']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function height($header_height) { |
|
|
|
|
global $svg; |
|
|
|
|
function supver_height($header_height) { |
|
|
|
|
global $supver_svg; |
|
|
|
|
|
|
|
|
|
return $header_height + $svg['footer_height'] + (count(branches()) * $svg['branch_height']); |
|
|
|
|
return $header_height + $supver_svg['footer_height'] + (count(supver_branches()) * $supver_svg['branch_height']); |
|
|
|
|
} |
|
|
|
|