PluginProbe
Gianism / trunk
Gianism vtrunk
4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.4.0 5.0.0 5.0.1 5.0.2 5.1.0 5.2.1 5.2.2 5.3.0 6.0.0 6.0.1 trunk 1.0 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 All 65 releases
gianism / templates / setting / google.php

google.php in Gianism trunk, at templates/setting/google.php

93 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /** @var \Gianism\UI\Screen $this */
3 /** @var \Gianism\Service\Google $instance */
4
5 defined( 'ABSPATH' ) || exit;
6 ?>
7
8 <h3>Google</h3>
9 <table class="form-table">
10 <tbody>
11 <tr>
12 <th><label><?php printf( $this->_( 'Connect with %s' ), 'Google' ); ?></label></th>
13 <td>
14 <?php $this->switch_button( 'ggl_enabled', $this->option->is_enabled( 'google' ) ); ?>
15 <p class="description">
16 <?php printf( $this->_( 'You have to create %1$s App <a target="_blank" href="%2$s">here</a> to get required infomation.' ), 'Google API Console', 'https://code.google.com/apis/console' ); ?>
17 <?php printf( $this->_( 'See detail at <a href="%1$s">%2$s</a>.' ), $this->setting_url( 'setup' ), $this->_( 'How to set up' ) ); ?>
18 </p>
19 </td>
20 </tr>
21
22 <tr>
23 <th><label for="ggl_consumer_key"><?php $this->e( 'Client ID' ); ?></label></th>
24 <td>
25 <input class="regular-text" type="text" name="ggl_consumer_key" id="ggl_consumer_key"
26 value="<?php echo esc_attr( $instance->ggl_consumer_key ); ?>"/>
27 </td>
28 </tr>
29 <tr>
30 <th><label for="ggl_consumer_secret"><?php $this->e( 'Client Secret' ); ?></label></th>
31 <td>
32 <input class="regular-text" type="text" name="ggl_consumer_secret" id="ggl_consumer_secret"
33 value="<?php echo esc_attr( $instance->ggl_consumer_secret ); ?>"/>
34 </td>
35 </tr>
36 <tr>
37 <th><label for="ggl_redirect_uri"><?php $this->e( 'Redirect URI' ); ?></label></th>
38 <td>
39 <p class="description">
40 <?php
41 $end_point = esc_url( $instance->get_redirect_endpoint() );
42 printf(
43 // translators: %1$s is redirect URI, %2$s is Google API Console, %3$s is link to Google API Console.
44 __( 'Please set %1$s to %2$s on <a target="_blank" href="%4$s">%3$s</a>.', 'wp-gianism' ),
45 __( 'Redirect URI', 'wp-gianism' ),
46 '<code>' . $end_point . '</code>',
47 'Google API Console',
48 'https://code.google.com/apis/console'
49 );
50 ?>
51 <a class="button" href="<?php echo esc_attr( $end_point ); ?>"
52 onclick="window.prompt('<?php esc_attr_e( 'Please copy this URL.', 'wp-gianism' ); ?>', this.href); return false;">
53 <?php esc_html_e( 'Copy', 'wp-gianism' ); ?>
54 </a>
55 <br/>
56 <?php
57 $this->new_from( '2.0' );
58 printf( $this->_( '<strong>Notice: </strong> Setting is changed on <code>Gianims v2.0</code>. You must set up again on Google API Console.' ) );
59 ?>
60 </p>
61 </td>
62 </tr>
63 <tr>
64 <th><label for="ggl_workspace_mode"><?php $this->e( 'Workspace Limited' ); ?></label></th>
65 <td>
66 <?php $this->switch_button( 'ggl_workspace_mode', $instance->ggl_workspace_mode, 1 ); ?>
67 <br />
68 <?php
69 $this->new_from( '5.4' );
70 printf(
71 '<p class="description">%s</p>',
72 wp_kses_post( __( 'Restrict site access to users from specific Google Workspace domains. Other social login providers should be disabled when this mode is active.', 'wp-gianism' ) )
73 );
74 ?>
75 </td>
76 </tr>
77 <tr>
78 <th><label for="ggl_workspace_allowed_domains"><?php $this->e( 'Allowed Domains' ); ?></label></th>
79 <td>
80 <?php
81 $allowed_domains = $instance->ggl_workspace_allowed_domains;
82 ?>
83 <textarea name="ggl_workspace_allowed_domains" id="ggl_workspace_allowed_domains"
84 class="large-text" rows="3" placeholder="example.com&#10;company.co.jp"><?php echo esc_textarea( $allowed_domains ); ?></textarea>
85 <p class="description">
86 <?php esc_html_e( 'Enter allowed domains, one per line. Only users with email addresses from these domains can log in when Workspace Limited mode is enabled.', 'wp-gianism' ); ?>
87 </p>
88 </td>
89 </tr>
90 </tbody>
91 </table>
92 <?php submit_button(); ?>
93