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