PluginProbe
Groups – Memberships and Access Control / 1.1.4
Groups – Memberships and Access Control v1.1.4
4.7.1 4.7.0 4.6.0 4.5.0 4.4.0 4.3.0 trunk 1.0.0-beta-1 1.0.0-beta-2 1.0.0-beta-3 1.0.0-beta-3b 1.0.0-beta-3c 1.0.0-beta-3d 1.1.4 1.1.5 1.10.0 1.10.1 1.10.2 1.10.3 1.11.0 1.11.1 1.11.2 1.11.3 1.12.0 1.13.0 All 131 releases
groups / lib / core / class-groups-help.php

class-groups-help.php in Groups – Memberships and Access Control 1.1.4, at lib/core/class-groups-help.php

112 lines 3.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * class-groups-help.php
4 *
5 * Copyright (c) "kento" Karim Rahimpur www.itthinx.com
6 *
7 * This code is released under the GNU General Public License.
8 * See COPYRIGHT.txt and LICENSE.txt.
9 *
10 * This code is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * This header and all notices must be kept intact.
16 *
17 * @author Karim Rahimpur
18 * @package groups
19 * @since groups 1.0.0
20 */
21 class Groups_Help {
22
23 public static function init() {
24 add_action( 'contextual_help', array( __CLASS__, 'contextual_help' ), 10, 3 );
25 }
26
27 public static function contextual_help( $contextual_help, $screen_id, $screen ) {
28
29 $show_groups_help = false;
30 $help = '<h3><a href="http://www.itthinx.com/plugins/groups" target="_blank">Groups</a></h3>';
31 $help .= '<p>';
32 $help .= __( 'The complete documentation is available on the <a href="http://www.itthinx.com/plugins/groups" target="_blank">Groups plugin page</a>', GROUPS_PLUGIN_DOMAIN );
33 $help .= '</p>';
34
35 switch ( $screen_id ) {
36 case 'toplevel_page_groups-admin' :
37 case 'groups_page_groups-admin-groups':
38 $show_groups_help = true;
39 $help .= '<p>' . __( 'Here you can <strong>add</strong>, <strong>edit</strong> and <strong>remove</strong> groups.', GROUPS_PLUGIN_DOMAIN ) . '</p>';
40 break;
41 case 'groups_page_groups-admin-options' :
42 $show_groups_help = true;
43 break;
44 default:
45 }
46
47 $help .= '<p>';
48 $help .= __( 'If you require <em>consulting services</em>, <em>support</em> or <em>customization</em>, you may <a href="http://www.itthinx.com/" target="_blank">contact me here</a>.', GROUPS_PLUGIN_DOMAIN );
49 $help .= '</p>';
50 $help .= '<p>';
51 $help .= __( 'If you find this plugin useful, please consider making a donation:', GROUPS_PLUGIN_DOMAIN );
52 $help .= self::donate( false, true );
53 $help .= '</p>';
54
55 if ( $show_groups_help ) {
56 return $help;
57 } else {
58 return $contextual_help;
59 }
60 }
61
62 /**
63 * Returns or renders the footer.
64 * @param boolean $render
65 */
66 public static function footer( $render = true ) {
67 $footer = '<div class="groups-footer">' .
68 // '<p>' .
69 __( 'Thank you for using <a href="http://www.itthinx.com/plugins/groups" target="_blank">Groups</a> by <a href="http://www.itthinx.com" target="_blank">itthinx</a>.', GROUPS_PLUGIN_DOMAIN ) .
70 ' ' .
71 __( 'For consulting and development services related to Groups go <a href="http://www.itthinx.com/contact/" target="_blank">here</a>.', GROUPS_PLUGIN_DOMAIN ) .
72 ' ' .
73 __( 'You can also support the project:', GROUPS_PLUGIN_DOMAIN ) .
74 self::donate( false ) .
75 // '</p>' .
76 '</div>';
77 $footer = apply_filters( 'groups_footer', $footer );
78 if ( $render ) {
79 echo $footer;
80 } else {
81 return $footer;
82 }
83 }
84
85 /**
86 * Render or return a donation button.
87 * Thanks for supporting me!
88 * @param boolean $render
89 * @param boolean $small
90 */
91 public static function donate( $render = true, $small = false ) {
92 $donate =
93 '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
94 <input type="hidden" name="cmd" value="_donations">
95 <input type="hidden" name="business" value="itthinx@itthinx.com">
96 <input type="hidden" name="lc" value="US">
97 <input type="hidden" name="item_name" value="Support WordPress Plugins from itthinx">
98 <input type="hidden" name="item_number" value="WordPress Plugins">
99 <input type="hidden" name="no_note" value="0">
100 <input type="hidden" name="currency_code" value="EUR">
101 <input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_SM.gif:NonHostedGuest">
102 <input type="submit" name="submit" value="Contribute" style="border:1px solid #ccc;border-radius:4px;cursor:pointer;padding:0;margin:0;color:#999;">
103 </form>';
104 if ( $render ) {
105 echo $donate;
106 } else {
107 return $donate;
108 }
109 }
110 }
111 Groups_Help::init();
112