C:\xampp\htdocs\landing\wp-content\plugins\wpforms-lite\src\Lite\Admin\Settings\Access.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<?php

namespace WPForms\Lite\Admin\Settings;

/**
 * Settings Access tab.
 *
 * @since 1.5.8
 */
class Access {

    
/**
     * View slug.
     *
     * @since 1.5.8
     *
     * @var string
     */
    
const SLUG 'access';

    
/**
     * Constructor.
     *
     * @since 1.5.8
     */
    
public function __construct() {

        
$this->hooks();
    }

    
/**
     * Hooks.
     *
     * @since 1.5.8
     */
    
public function hooks() {

        
add_action'admin_enqueue_scripts', array( $this'enqueues' ) );
        
add_filter'wpforms_settings_tabs', array( $this'add_tab' ) );
        
add_filter'wpforms_settings_defaults', array( $this'add_section' ) );
    }

    
/**
     * Enqueues.
     *
     * @since 1.5.8
     */
    
public function enqueues() {

        if ( ! 
wpforms_is_admin_page'settings'self::SLUG ) ) {
            return;
        }

        
// Lity.
        
wp_enqueue_style(
            
'wpforms-lity',
            
WPFORMS_PLUGIN_URL 'assets/css/lity.min.css',
            
null,
            
'3.0.0'
        
);

        
wp_enqueue_script(
            
'wpforms-lity',
            
WPFORMS_PLUGIN_URL 'assets/js/lity.min.js',
            array( 
'jquery' ),
            
'3.0.0',
            
true
        
);
    }

    
/**
     * Add Access tab.
     *
     * @since 1.5.8
     *
     * @param array $tabs Array of tabs.
     *
     * @return array Array of tabs.
     */
    
public function add_tab$tabs ) {

        
$tab = array(
            
self::SLUG => array(
                
'name'   => esc_html__'Access''wpforms-lite' ),
                
'form'   => false,
                
'submit' => false,
            ),
        );

        return 
wpforms_list_insert_after$tabs'geolocation'$tab );
    }

    
/**
     * Add Access settings section.
     *
     * @since 1.5.8
     *
     * @param array $settings Settings sections.
     *
     * @return array
     */
    
public function add_section$settings ) {

        
$section_rows = array(
            
'heading',
            
'screenshots',
            
'caps',
            
'upgrade_to_pro',
        );

        foreach ( 
$section_rows as $section_row ) {

            
$settingsself::SLUG ][ self::SLUG '-' $section_row ] = array(
                
'id'       => self::SLUG '-' $section_row,
                
'content'  => method_exists$this'output_section_row_' $section_row ) ? $this->{ 'output_section_row_' $section_row }() : '',
                
'type'     => 'content',
                
'no_label' => true,
                
'class'    => array( $section_row ),
            );
        }

        return 
$settings;
    }

    
/**
     * Generate and output section "Heading" row HTML.
     *
     * @since 1.5.8
     */
    
public function output_section_row_heading() {

        return 
sprintf(
            
'<h4>%1$s<img src="%2$s" alt="%3$s"></h4><p>%4$s</p><p>%5$s</p>',
            
esc_html__'Access Controls''wpforms-lite' ),
            
esc_urlWPFORMS_PLUGIN_URL 'assets/images/lite-settings-access/pro-plus.svg' ),
            
esc_attr__'Pro+''wpforms-lite' ),
            
esc_html__'Access controls allows you to manage and customize access to WPForms functionality.''wpforms-lite' ),
            
esc_html__'You can easily grant or restrict access using the simple built-in controls, or use our official integrations with Members and User Role Editor plugins.''wpforms-lite' )
        );
    }

    
/**
     * Generate and output section "Screenshots" row HTML.
     *
     * @since 1.5.8
     */
    
public function output_section_row_screenshots() {

        
$format '<div class="cont">
            <img src="%1$s" srcset="%2$s 2x" alt="%6$s"/>
            <a href="%3$s" class="hover" data-lity data-lity-srcset="%4$s 2x" data-lity-desc="%6$s"></a>
            <span>%5$s</span>
        </div>'
;

        
$images_url WPFORMS_PLUGIN_URL 'assets/images/lite-settings-access/';

        
$content sprintf(
            
$format,
            
esc_url$images_url 'thumbnail-access-controls.png' ),
            
esc_url$images_url 'thumbnail-access-controls@2x.png' ),
            
esc_url$images_url 'screenshot-access-controls.png' ),
            
esc_url$images_url 'screenshot-access-controls@2x.png' ),
            
esc_html__'Simple Built-in Controls''wpforms-lite' ),
            
esc_attresc_html__'Simple Built-in Controls''wpforms-lite' ) )
        );

        
$content .= sprintf(
            
$format,
            
esc_url$images_url 'thumbnail-members.png' ),
            
esc_url$images_url 'thumbnail-members@2x.png' ),
            
esc_url$images_url 'screenshot-members.png' ),
            
esc_url$images_url 'screenshot-members@2x.png' ),
            
esc_html__'Members Integration''wpforms-lite' ),
            
esc_attresc_html__'Members Integration''wpforms-lite' ) )
        );

        
$content .= sprintf(
            
$format,
            
esc_url$images_url 'thumbnail-user-role-editor.png' ),
            
esc_url$images_url 'thumbnail-user-role-editor@2x.png' ),
            
esc_url$images_url 'screenshot-user-role-editor.png' ),
            
esc_url$images_url 'screenshot-user-role-editor@2x.png' ),
            
esc_html__'User Role Editor Integration''wpforms-lite' ),
            
esc_attresc_html__'User Role Editor Integration''wpforms-lite' ) )
        );

        return 
$content;
    }

    
/**
     * Generate and output section "Capabilities" row HTML.
     *
     * @since 1.5.8
     */
    
public function output_section_row_caps() {

        
$caps = array(
            array(
                
esc_html__'Create Forms''wpforms-lite' ),
                
esc_html__'Edit Forms''wpforms-lite' ),
                
esc_html__'Edit Others Forms''wpforms-lite' ),
                
esc_html__'View Forms''wpforms-lite' ),
                
esc_html__'View Others Forms''wpforms-lite' ),
            ),
            array(
                
esc_html__'Delete Forms''wpforms-lite' ),
                
esc_html__'Delete Others Forms''wpforms-lite' ),
                
esc_html__'View Forms Entries''wpforms-lite' ),
                
esc_html__'View Others Forms Entries''wpforms-lite' ),
            ),
            array(
                
esc_html__'Edit Forms Entries''wpforms-lite' ),
                
esc_html__'Edit Others Forms Entries''wpforms-lite' ),
                
esc_html__'Delete Forms Entries''wpforms-lite' ),
                
esc_html__'Delete Others Forms Entries''wpforms-lite' ),
            ),
        );

        
$content '<p>' esc_html__'Custom access to the following capabilities…''wpforms-lite' ) . '</p>';

        foreach ( 
$caps as $column ) {
            
$content .= '<ul>';
            foreach ( 
$column as $cap ) {
                
$content .= '<li>' $cap '</li>';
            }
            
$content .= '</ul>';
        }

        return 
$content;
    }

    
/**
     * Generate and output section "Upgrade to Pro" row HTML.
     *
     * @since 1.5.8
     */
    
public function output_section_row_upgrade_to_pro() {

        
$content sprintf(
            
'<a href="%1$s" target="_blank" rel="noopener noreferrer" class="wpforms-upgrade-modal wpforms-btn wpforms-btn-lg wpforms-btn-orange">%2$s</a>',
            
esc_url'https://wpforms.com/lite-upgrade/?discount=LITEUPGRADE&utm_source=WordPress&utm_medium=settings-license&utm_campaign=liteplugin' ),
            
esc_html__'Upgrade to WPForms Now''wpforms-lite' )
        );

        return 
$content;
    }
}
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586