@@ 470-490 (lines=21) @@ | ||
467 | * @param string $section - The kind of branch we're switching to (stable, rc, master, pr). |
|
468 | * @param string $title - The title of the branch. |
|
469 | */ |
|
470 | public static function show_branches( $section, $title = null ) { |
|
471 | if ( $title ) { |
|
472 | $title .= ': '; |
|
473 | } |
|
474 | echo '<div id="section-' . esc_attr( $section ) . '">'; |
|
475 | ||
476 | $manifest = Jetpack_Beta::get_beta_manifest(); |
|
477 | $count = 0; |
|
478 | if ( empty( $manifest->{$section} ) ) { |
|
479 | return; |
|
480 | } |
|
481 | $branches = (array) $manifest->{$section}; |
|
482 | $count_all = count( $branches ); |
|
483 | ||
484 | foreach ( $branches as $branch_name => $branch ) { |
|
485 | $count ++; |
|
486 | $is_last = $count_all === $count ? true : false; |
|
487 | self::show_branch( $title . $branch_name, $branch_name, $branch, $section, $is_last ); |
|
488 | } |
|
489 | echo '</div>'; |
|
490 | } |
|
491 | ||
492 | /** |
|
493 | * Show list of available Jetpack tags to select specific Jetpack version number. |
|
@@ 498-518 (lines=21) @@ | ||
495 | * @param string $section - The kind of version we're switching to (in this case 'tags'). |
|
496 | * @param string $title - The name of the Jetpack tag. |
|
497 | */ |
|
498 | public static function show_tags( $section, $title = null ) { |
|
499 | if ( $title ) { |
|
500 | $title .= ': '; |
|
501 | } |
|
502 | echo '<div id="section-' . esc_attr( $section ) . '">'; |
|
503 | ||
504 | $manifest = Jetpack_Beta::get_org_data(); |
|
505 | $count = 0; |
|
506 | if ( empty( $manifest->versions ) ) { |
|
507 | return; |
|
508 | } |
|
509 | $tags = array_reverse( (array) $manifest->versions ); |
|
510 | $count_all = count( $tags ); |
|
511 | ||
512 | foreach ( $tags as $tag => $url ) { |
|
513 | $count ++; |
|
514 | $is_last = $count_all === $count ? true : false; |
|
515 | self::show_tag( $title . $tag, $tag, $url, $section, $is_last ); |
|
516 | } |
|
517 | echo '</div>'; |
|
518 | } |
|
519 | ||
520 | /** Display the stable branch */ |
|
521 | public static function show_stable_branch() { |