PluginProbe
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels / 2.6.4
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels v2.6.4
2.9.1 2.9.0 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 2.0.0 2.1.0 2.2.0 2.3.2 2.3.3 2.3.5 2.3.6 2.3.8 2.3.9 2.4.3 All 37 releases
automatic-youtube-gallery / admin / templates / settings.php

settings.php in Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels 2.6.4, at admin/templates/settings.php

120 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Settings Form.
5 *
6 * @link https://plugins360.com
7 * @since 1.0.0
8 *
9 * @package Automatic_YouTube_Gallery
10 */
11
12 $gallery_settings = get_option( 'ayg_gallery_settings' );
13 $player_settings = get_option( 'ayg_player_settings' );
14
15 $active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->tabs ) ? sanitize_text_field( $_GET['tab'] ) : 'general';
16 $active_section = isset( $_GET['section'] ) ? sanitize_text_field( $_GET['section'] ) : '';
17 $active_theme = $gallery_settings['theme'];
18 $player_type = isset( $player_settings['player_type'] ) ? $player_settings['player_type'] : 'youtube';
19
20 $sections = array();
21 foreach ( $this->sections as $section ) {
22 $tab = $section['tab'];
23
24 if ( ! isset( $sections[ $tab ] ) ) {
25 $sections[ $tab ] = array();
26 }
27
28 $sections[ $tab ][] = $section;
29 }
30 ?>
31
32 <div id="ayg-settings" class="ayg ayg-settings theme-<?php echo esc_attr( $active_theme ); ?> player_type-<?php echo esc_attr( $player_type ); ?> wrap">
33 <?php settings_errors(); ?>
34
35 <h2 class="nav-tab-wrapper wp-clearfix">
36 <?php
37 foreach ( $this->tabs as $tab => $title ) {
38 $url = add_query_arg( 'tab', $tab, admin_url( 'admin.php?page=automatic-youtube-gallery-settings' ) );
39
40 foreach ( $sections[ $tab ] as $section ) {
41 $url = add_query_arg( 'section', $section['id'], $url );
42
43 if ( $tab == $active_tab && empty( $active_section ) ) {
44 $active_section = $section['id'];
45 }
46
47 break;
48 }
49
50 $classes = array( 'nav-tab' );
51 if ( $tab == $active_tab ) $classes[] = 'nav-tab-active';
52
53 printf(
54 '<a href="%s" class="%s">%s</a>',
55 esc_url( $url ),
56 implode( ' ', $classes ),
57 esc_html( $title )
58 );
59 }
60 ?>
61 </h2>
62
63 <?php
64 $section_links = array();
65
66 foreach ( $sections[ $active_tab ] as $section ) {
67 $page = $section['page'];
68
69 $url = add_query_arg(
70 array(
71 'tab' => $active_tab,
72 'section' => $page
73 ),
74 admin_url( 'admin.php?page=automatic-youtube-gallery-settings' )
75 );
76
77 if ( ! isset( $section_links[ $page ] ) ) {
78 $section_links[ $page ] = sprintf(
79 '<a href="%s" class="%s">%s</a>',
80 esc_url( $url ),
81 ( $section['id'] == $active_section ? 'current' : '' ),
82 ( isset( $section['menu_title'] ) ? esc_html( $section['menu_title'] ) : esc_html( $section['title'] ) )
83 );
84 }
85 }
86
87 if ( count( $section_links ) > 1 ) : ?>
88 <ul class="ayg-margin-bottom subsubsub"><li><?php echo implode( ' | </li><li>', $section_links ); ?></li></ul>
89 <div class="clear"></div>
90 <?php endif; ?>
91
92 <form method="post" action="options.php">
93 <?php
94 $page_hook = $active_section;
95
96 settings_fields( $page_hook );
97 do_settings_sections( $page_hook );
98 ?>
99
100 <?php if ( 'general' == $active_tab && 'ayg_general_settings' == $active_section ) : ?>
101 <table id="ayg-table-delete-cache" class="form-table">
102 <tbody>
103 <tr>
104 <th scope="row">
105 <label><?php esc_html_e( 'Delete Cache', 'automatic-youtube-gallery' ); ?></label>
106 </th>
107 <td>
108 <input type="submit" id="ayg-button-delete-cache" class="button-secondary" value="<?php esc_attr_e( 'Delete Cache', 'automatic-youtube-gallery' ); ?>" />
109 <span class="ayg-ajax-status"></span>
110 <p class="description"><?php esc_html_e( 'Delete all of the YouTube API data cached by the plugin.', 'automatic-youtube-gallery' ); ?></p>
111 </td>
112 </tr>
113 </tbody>
114 </table>
115 <?php endif; ?>
116
117 <?php submit_button(); ?>
118 </form>
119 </div>
120