PluginProbe
Social Media Auto Poster – Schedule & Publish to Buffer / 6.0.2
Social Media Auto Poster – Schedule & Publish to Buffer v6.0.2
6.2.3 6.2.2 6.2.1 6.2.0 6.1.2 6.1.1 6.1.0 6.0.9 6.0.8 6.0.7 6.0.6 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 6.0.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.8.8 All 124 releases
wp-to-buffer / lib / views / settings.php

settings.php in Social Media Auto Poster – Schedule & Publish to Buffer 6.0.2, at lib/views/settings.php

150 lines 5.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Outputs the settings screen.
4 *
5 * @package WP_To_Social_Pro
6 * @author WP Zinc
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly.
11 }
12 ?>
13 <header>
14 <h1>
15 <?php echo esc_html( $this->base->plugin->displayName ); ?>
16
17 <span>
18 <?php esc_html_e( 'Settings', 'wp-to-buffer' ); ?>
19 </span>
20 </h1>
21 </header>
22
23 <div class="wrap">
24 <?php
25 // Output notices.
26 $this->base->get_class( 'notices' )->set_key_prefix( $this->base->plugin->filter_name . '_' . wp_get_current_user()->ID );
27 $this->base->get_class( 'notices' )->output_notices();
28 ?>
29
30 <!-- Container for JS notices -->
31 <div class="js-notices"></div>
32
33 <div class="wrap-inner">
34 <!-- Notices -->
35 <hr class="wp-header-end" />
36
37 <!-- Tabs -->
38 <h2 class="nav-tab-wrapper wpzinc-horizontal-tabbed-ui">
39 <!-- Settings -->
40 <a href="admin.php?page=<?php echo esc_attr( $this->base->plugin->name ); ?>-settings" class="nav-tab<?php echo esc_attr( $tab === 'auth' ? ' nav-tab-active' : '' ) . ( $this->base->get_class( 'settings' )->account_connected() ? ' enabled' : ' error' ); ?>" title="<?php esc_attr_e( 'Settings', 'wp-to-buffer' ); ?>">
41 <span class="dashicons dashicons-lock"></span>
42 <?php
43 if ( $this->base->get_class( 'settings' )->account_connected() ) {
44 ?>
45 <span class="dashicons dashicons-yes"></span>
46 <?php
47 } else {
48 ?>
49 <span class="dashicons dashicons-warning"></span>
50 <?php
51 }
52 ?>
53 <span class="text">
54 <?php esc_html_e( 'Settings', 'wp-to-buffer' ); ?>
55 </span>
56 </a>
57
58 <!-- Public Post Types -->
59 <?php
60 // Go through all Post Types, if authenticated.
61 if ( $this->base->get_class( 'settings' )->account_connected() ) {
62 foreach ( $post_types as $public_post_type => $post_type_obj ) {
63 // Work out the icon to display.
64 $icon = '';
65 if ( ! empty( $post_type_obj->menu_icon ) ) {
66 $icon = 'dashicons ' . $post_type_obj->menu_icon;
67 } elseif ( $public_post_type === 'post' || $public_post_type === 'page' ) {
68 $icon = 'dashicons dashicons-admin-' . $public_post_type;
69 }
70
71 // Determine if the Post Type is set to post.
72 $is_post_type_enabled = $this->base->get_class( 'settings' )->is_post_type_enabled( $public_post_type );
73 ?>
74 <a href="admin.php?page=<?php echo esc_attr( $this->base->plugin->name ); ?>-settings&amp;tab=post&amp;type=<?php echo esc_attr( $public_post_type ); ?>" class="nav-tab<?php echo esc_attr( $post_type === $public_post_type ? ' nav-tab-active' : '' ) . ( $is_post_type_enabled ? ' enabled' : '' ); ?>" title="<?php echo esc_attr( $post_type_obj->labels->name ); ?>" data-post-type="<?php echo esc_attr( $public_post_type ); ?>">
75 <span class="<?php echo esc_attr( $icon ); ?>"></span>
76 <span class="dashicons dashicons-yes"></span>
77 <span class="text">
78 <?php echo esc_attr( $post_type_obj->labels->name ); ?>
79 </span>
80 </a>
81 <?php
82 }
83 }
84 ?>
85
86 <!-- Documentation -->
87 <a href="<?php echo esc_attr( $documentation_url ); ?>" class="nav-tab last documentation" title="<?php esc_html_e( 'Documentation', 'wp-to-buffer' ); ?>" target="_blank">
88 <span class="text">
89 <?php esc_html_e( 'Documentation', 'wp-to-buffer' ); ?>
90 </span>
91 <span class="text-mobile">
92 <?php esc_html_e( 'Docs', 'wp-to-buffer' ); ?>
93 </span>
94 <span class="dashicons dashicons-admin-page"></span>
95 </a>
96 </h2>
97
98 <!-- Form Start -->
99 <?php
100 // id is deliberate; to ensure CSS, JS etc. works for all versions.
101 ?>
102 <div id="poststuff">
103 <div id="post-body" class="metabox-holder columns-2">
104 <!-- Content -->
105 <form name="post" method="post" action="<?php echo ( isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '' ); ?>" id="<?php echo esc_attr( $this->base->plugin->name ); ?>" class="wp-to-social-pro">
106 <div id="post-body-content">
107 <div id="normal-sortables" class="meta-box-sortables ui-sortable publishing-defaults">
108 <?php
109 // Load sub view.
110 require_once $this->base->plugin->folder . 'lib/views/settings-' . $tab . '.php';
111 ?>
112 </div>
113 <!-- /normal-sortables -->
114
115 <?php
116 if ( ! $disable_save_button ) {
117 ?>
118 <!-- Save -->
119 <div>
120 <?php wp_nonce_field( $this->base->plugin->name, $this->base->plugin->name . '_nonce' ); ?>
121 <input type="submit" name="submit" value="<?php esc_attr_e( 'Save', 'wp-to-buffer' ); ?>" class="button button-primary" />
122 </div>
123 <?php
124 }
125 ?>
126 </div>
127 <!-- /post-body-content -->
128 </form>
129
130 <!-- Sidebar -->
131 <div id="postbox-container-1" class="postbox-container">
132 <?php require $this->base->plugin->folder . '/_modules/dashboard/views/sidebar-upgrade.php'; ?>
133 </div>
134 <!-- /Sidebar -->
135 </div>
136 </div>
137
138 <!-- Upgrade -->
139 <div class="metabox-holder columns-1">
140 <div id="post-body-content">
141 <?php
142 require $this->base->plugin->folder . '/_modules/dashboard/views/footer-upgrade.php';
143
144 do_action( 'wpzinc_settings_footer_upgrade' );
145 ?>
146 </div>
147 </div>
148 </div><!-- ./wrap-inner -->
149 </div>
150