@@ 488-508 (lines=21) @@ | ||
485 | * @param string $section - The kind of branch we're switching to (stable, rc, master, pr). |
|
486 | * @param string $title - The title of the branch. |
|
487 | */ |
|
488 | public static function show_branches( $section, $title = null ) { |
|
489 | if ( $title ) { |
|
490 | $title .= ': '; |
|
491 | } |
|
492 | echo '<div id="section-' . esc_attr( $section ) . '">'; |
|
493 | ||
494 | $manifest = Jetpack_Beta::get_beta_manifest(); |
|
495 | $count = 0; |
|
496 | if ( empty( $manifest->{$section} ) ) { |
|
497 | return; |
|
498 | } |
|
499 | $branches = (array) $manifest->{$section}; |
|
500 | $count_all = count( $branches ); |
|
501 | ||
502 | foreach ( $branches as $branch_name => $branch ) { |
|
503 | $count ++; |
|
504 | $is_last = $count_all === $count ? true : false; |
|
505 | self::show_branch( $title . $branch_name, $branch_name, $branch, $section, $is_last ); |
|
506 | } |
|
507 | echo '</div>'; |
|
508 | } |
|
509 | ||
510 | /** |
|
511 | * Show list of available Jetpack tags to select specific Jetpack version number. |
|
@@ 516-536 (lines=21) @@ | ||
513 | * @param string $section - The kind of version we're switching to (in this case 'tags'). |
|
514 | * @param string $title - The name of the Jetpack tag. |
|
515 | */ |
|
516 | public static function show_tags( $section, $title = null ) { |
|
517 | if ( $title ) { |
|
518 | $title .= ': '; |
|
519 | } |
|
520 | echo '<div id="section-' . esc_attr( $section ) . '">'; |
|
521 | ||
522 | $manifest = Jetpack_Beta::get_org_data(); |
|
523 | $count = 0; |
|
524 | if ( empty( $manifest->versions ) ) { |
|
525 | return; |
|
526 | } |
|
527 | $tags = array_reverse( (array) $manifest->versions ); |
|
528 | $count_all = count( $tags ); |
|
529 | ||
530 | foreach ( $tags as $tag => $url ) { |
|
531 | $count ++; |
|
532 | $is_last = $count_all === $count ? true : false; |
|
533 | self::show_tag( $title . $tag, $tag, $url, $section, $is_last ); |
|
534 | } |
|
535 | echo '</div>'; |
|
536 | } |
|
537 | ||
538 | /** Display the stable branch */ |
|
539 | public static function show_stable_branch() { |