Completed
Push — master ( 99c38a...8d9355 )
by
unknown
01:40
created

settings::lasso_editor_settings_form()   C

Complexity

Conditions 9
Paths 65

Size

Total Lines 354

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 9
nc 65
nop 0
dl 0
loc 354
rs 6.4444
c 0
b 0
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/**
3
 * Class responsible for adding a settings submenu
4
 *
5
 */
6
namespace lasso_admin\menus;
7
8
class settings {
9
10
	function __construct() {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
11
12
		add_action( 'admin_menu',     array( $this, 'menu' ) );
13
		add_action( 'network_admin_menu',   array( $this, 'menu' ) );
14
		add_action( 'wp_ajax_lasso-editor-settings', array( $this, 'process_settings' ) );
15
16
	}
17
18
	/**
19
	 * Add a submenu page to the "Settings" tab if network activated, otherwise add to our menu page
20
	 *
21
	 * @since 1.0
22
	 */
23
	function menu() {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
24
25
		// CHANGED Removed condition.
26
		add_submenu_page( 'lasso-editor', __( 'Settings', 'lasso' ), __( 'Settings', 'lasso' ), 'manage_options', 'lasso-editor-settings', array( $this, 'settings' ) );
27
28
	}
29
30
	/**
31
	 * Submenu page callback
32
	 *
33
	 * @since 1.0
34
	 */
35
	function settings() {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
36
37
		echo self::lasso_editor_settings_form();
38
	}
39
40
	/**
41
	 * Save settings via ajax
42
	 *
43
	 * @since 1.0
44
	 */
45
	function process_settings() {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
46
47
		// bail out if current user isn't and administrator and they are not logged in
48
		if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() )
49
			return;
50
51
		if ( isset( $_POST['action'] ) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer( 'nonce', 'lasso_editor_settings' ) ) {
52
53
			$options = isset( $_POST['lasso_editor'] ) ? $_POST['lasso_editor'] : false;
54
			
55
			$arr = $options['allowed_post_types'];
56
			$options = array_map( 'sanitize_text_field', $options );
57
			$options['allowed_post_types'] = array_keys( $arr);
58
59
			
60
61
			if ( function_exists( 'is_multisite' ) && is_multisite() ) {
62
63
				update_site_option( 'lasso_editor', $options );
64
65
			} else {
66
67
				update_option( 'lasso_editor', $options );
68
			}
69
70
			wp_send_json_success();
71
72
		} else {
73
74
			wp_send_json_error();
75
76
		}
77
78
		die();
79
80
	}
81
	
82
	function create_section_for_color_picker($id, $title, $defvalue) { 
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
83
		$color_value = lasso_editor_get_option( $id, 'lasso_editor',$defvalue );
84
	 
85
		echo '<div lass="lasso-editor-settings--option-inner">'."\n";
86
		echo '<label>'.$title.'</label>';
87
		echo '<input type="text" name="lasso_editor['.$id.']" value="'.$color_value.'" id="lasso-editor-'.$title.'" class="color-picker"/>';
88
		echo "</div>\n";
89
	 }
90
91
	/**
92
	 * Draw the settings form
93
	 *
94
	 * @since 1.0
95
	 */
96
	function lasso_editor_settings_form() {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
97
98
		if ( !is_user_logged_in() )
99
			return;
100
        
101
        // check for lasso story engine and add a class doniting this
102
        $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
103
104
		$article_object   = lasso_editor_get_option( 'article_class', 'lasso_editor' );
105
		$featImgClass    = lasso_editor_get_option( 'featimg_class', 'lasso_editor' );
106
		$titleClass    = lasso_editor_get_option( 'title_class', 'lasso_editor' );
107
108
		$post_new_disabled   = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' );
109
		$save_to_post_disabled  = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
110
		$edit_post_disabled  = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' );
111
		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
112
		$allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' );
113
        $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' );
114
		$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
115
		$shortcodify_disabled  = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
116
		$enable_autosave  = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' );
117
118
		$use_old_ui      = lasso_editor_get_option( 'use_old_ui', 'lasso_editor' );
119
		$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
120
		$toolbar_headings_h4      = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' );
121
		$toolbar_list      = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' );
122
		$toolbar_show_color      = lasso_editor_get_option( 'toolbar_show_color', 'lasso_editor' );
123
		$toolbar_show_alignment  = lasso_editor_get_option( 'toolbar_show_alignment', 'lasso_editor' );
124
		
125
		$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
126
		$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
127
		$disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor');
128
		$show_ignored_items = lasso_editor_get_option('show_ignored_items', 'lasso_editor');
129
		$save_using_rest_disabled = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor');
130
		
131
		$default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page'));
132
		$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor',  $default_post_types);
133
		
134
		$links_editable = lasso_editor_get_option('links_editable', 'lasso_editor', false);
0 ignored issues
show
Documentation introduced by
false is of type boolean, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
135
		$bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor',  "b");
136
		$i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor',  "i");
137
        
138
        $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
0 ignored issues
show
Documentation introduced by
false is of type boolean, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
139
		
140
		// do we support pending status
141
		$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
142
		
143
		$no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor');
144
		
145
		$insert_comp_ui = lasso_editor_get_option('insert_comp_ui', 'lasso_editor');
146
		if (!$insert_comp_ui) {
147
			$insert_comp_ui = 'drag';
148
		}
149
        
150
        $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor');
151
        
152
        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
153
154
?>
155
		<div class="wrap">
156
157
	    	<h2><?php _e( 'Editus Settings', 'lasso' );?></h2>
158
159
			<form id="lasso-editor-settings-form" class="lasso--form-settings" method="post" enctype="multipart/form-data">
160
161
				<?php do_action('lasso_settings_before');?>
162
				
163
				
164
				
165
				<h3><?php _e( 'Enable for:', 'lasso' );?></h3>
166
				<div class="lasso-editor-settings--option-wrap">
167
					<div class="lasso-editor-settings--option-inner">
168
						
169
						<span class="lasso--setting-description"><?php _e( 'Enable Editus for the following post types.', 'lasso' );?></span>
170
						<?php
171
						$args = array(
172
							'public'   => true
173
						);
174
						 
175
						$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
176
						$post_types = get_post_types( $args, 'objects' );
177
						 
178
						foreach ( $post_types  as $post_type ) {
179
						   if ($post_type->name == 'attachment') continue;
180
						   $checked ="";
181
						   if (  in_array( $post_type->name, $allowed_post_types )  ) {
182
								$checked = 'checked="checked"';
183
						   }
184
						   echo '<label><input type="checkbox" '.$checked.' name="lasso_editor[allowed_post_types]['.$post_type->name.']" id="lasso_editor[allowed_post_types]['.$post_type->name.']" >'.$post_type->name.'</label>';
185
						}
186
						?>
187
					</div>
188
				</div>
189
				
190
191
				<h3><?php _e( 'Internal Settings', 'lasso' );?></h3>
192
				<div class="lasso-editor-settings--option-wrap">
193
					<div class="lasso-editor-settings--option-inner" style="border:none;">
194
						<label><?php _e( 'Article Class', 'lasso' );?></label>
195
						<span class="lasso--setting-description"><?php _e( 'Provide the CSS class (including the preceding dot) of container that holds the post. This should be the first parent container class that holds the_content.', 'lasso' );?></span>
196
						<input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr( $article_object );?>" placeholder=".entry-content">
197
					</div>
198
				
199
					<div class="lasso-editor-settings--option-inner" style="border:none;">
200
						<label><?php _e( 'Featured Image Class', 'lasso' );?></label>
201
						<span class="lasso--setting-description"><?php _e( 'Provide the CSS class that uses a featured image as a background image. This currently only supports themes that have the featured image set as background image.', 'lasso' );?></span>
202
						<input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr( $featImgClass );?>" placeholder=".entry-content">
203
					</div>
204
				
205
					<div class="lasso-editor-settings--option-inner" style="border:none;">
206
						<label><?php _e( 'Article Title Class', 'lasso' );?></label>
207
						<span class="lasso--setting-description"><?php _e( 'Provide the CSS class for the post title. This will enable you to update the title of the post by clicking and typing.', 'lasso' );?></span>
208
						<input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr( $titleClass );?>" placeholder=".entry-content">
209
					</div>
210
				
211
					<div class="lasso-editor-settings--option-inner" style="border:none;">
212
						<label><?php _e( 'Ignored Items to Save', 'lasso' );?></label>
213
						<span class="lasso--setting-description"><?php _e( 'If your post container holds additional markup, list the css class names (comma separated, including the dot) of those items. When you enter the editor, Editus will remove (NOT delete) these items so that it does not save them as HTML.', 'lasso' );?></span>
214
						<textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNoSave );?></textarea>
215
					</div>
216
				
217
					<div class="lasso-editor-settings--option-inner" style="border:none;">
218
						<label><?php _e( 'Read Only Items', 'lasso' );?></label>
219
						<span class="lasso--setting-description"><?php _e( 'If your post has items that should not be editable, list the css class names (comma separated, including the dot) of those items.', 'lasso' );?></span>
220
						<textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNonEditable );?></textarea>
221
					</div>
222
				
223
					<div class="lasso-editor-settings--option-inner" >
224
						<input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked( $show_ignored_items, 'on' );?> >
225
						<label for="lasso_editor[show_ignored_items]"> <?php _e( 'Show Ignored Items', 'lasso' );?></label>
226
						<span class="lasso--setting-description"><?php _e( 'By default the ignored items are hidden. Check this to show ignored items while keeping them uneditable.', 'lasso' );?></span>
227
					</div>
228
				</div>
229
230
				<h3><?php _e( 'Editor UI', 'lasso' );?></h3>
231
				<div class="lasso-editor-settings--option-wrap">
232
					<div class="lasso-editor-settings--option-inner" style="border:none;">
233
						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked( $use_old_ui, 'on' );?> >
234
						<label for="lasso_editor[use_old_ui]"><?php _e( 'Use the Old Toolbar', 'lasso' );?></label>
235
						<span class="lasso--setting-description"><?php _e( 'Use this option to disable the new color options and use the pre-1.0 toolbar.', 'lasso' );?></span>
236
					</div>
237
				    <div id="lasso-editor-settings--colors">
238
					<?php
239
					self::create_section_for_color_picker('button-color1', _e( 'Editor Bar Color Top', 'lasso' ), '#0000ff');
240
					self::create_section_for_color_picker('button-color2', _e( 'Editor Bar Color Bottom', 'lasso' ), '#000030');
241
					self::create_section_for_color_picker('dialog-color', _e( 'Dialog Color', 'lasso' ), '#000055');
242
					self::create_section_for_color_picker('text-color', _e( 'Icon/Text Color', 'lasso' ), '#ffffff');
243
					?>
244
					<button type="button" id="lasso-editor-settings--default-colors" ><?php _e( 'Default Colors', 'lasso' );?></button>
245
				    <div style="height:50px;"></div>
246
					</div>
247
					<div class="lasso-editor-settings--option-inner" style="border:none;">
248
						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked( $toolbar_headings, 'on' );?> >
249
						<label for="lasso_editor[toolbar_headings]"><?php _e( 'Enable H2 and H3 Buttons', 'lasso' );?></label>
250
						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H2 and H3 settings.', 'lasso' );?></span>
251
252
					</div>
253
					<div class="lasso-editor-settings--option-inner" style="border:none;">
254
						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked( $toolbar_headings_h4, 'on' );?> >
255
						<label for="lasso_editor[toolbar_headings_h4]"><?php _e( 'Enable H4/H5/H6 Buttons', 'lasso' );?></label>
256
						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set H4/H5/H6 settings.', 'lasso' );?></span>
257
258
					</div>
259
					
260
					<div class="lasso-editor-settings--option-inner" style="border:none;">
261
						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_list]" id="lasso_editor[toolbar_list]" <?php echo checked( $toolbar_list, 'on' );?> >
262
						<label for="lasso_editor[toolbar_list]"><?php _e( 'Enable OL/UL Buttons', 'lasso' );?></label>
263
						<span class="lasso--setting-description"><?php _e( 'Show the buttons to create Ordered and Unordered Lists from text selection.', 'lasso' );?></span>
264
					</div>
265
					
266
					<div class="lasso-editor-settings--option-inner" style="border:none;">
267
						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked( $toolbar_show_color, 'on' );?> >
268
						<label for="lasso_editor[toolbar_show_color]"><?php _e( 'Enable Text Color Buttons', 'lasso' );?></label>
269
						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text colors.', 'lasso' );?></span>
270
271
					</div>
272
					<div class="lasso-editor-settings--option-inner" style="border:none;">
273
						<input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked( $toolbar_show_alignment, 'on' );?> >
274
						<label for="lasso_editor[toolbar_show_alignment]"><?php _e( 'Enable Text Align Buttons', 'lasso' );?></label>
275
						<span class="lasso--setting-description"><?php _e( 'Show the buttons to set text alignment.', 'lasso' );?></span>
276
277
					</div>
278
					
279
					<div class="lasso-editor-settings--option-inner" style="border:none;">
280
						<input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked( $links_editable, 'on' );?> >
281
						<label for="lasso_editor[links_editable]"><?php _e( 'Make links editable under the Editing Mode', 'lasso' );?></label>
282
						<span class="lasso--setting-description"><?php _e( 'Make links editable under the Editing Mode. Turning this on will make the links non-clickable while editing.', 'lasso' );?></span>
283
284
					</div>
285
					<div class="lasso-editor-settings--option-inner">
286
					    <label for="lasso_editor[insert_comp_ui]"> <?php _e( 'Insert Component UI', 'lasso' );?></label>
287
						<span class="lasso--setting-description"><?php _e( 'UI mechanism to insert components', 'lasso' );?></span>
288
						<div class="lasso-editor-settings--option-inner" style="border:none;">
289
					       <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked( $insert_comp_ui, 'drag' );?>> <?php _e( 'Drag and Drop', 'lasso' );?>
290
						</div>
291
						<div class="lasso-editor-settings--option-inner" style="border:none;">
292
						<input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked( $insert_comp_ui, 'click' );?>> <?php _e( 'Click', 'lasso' );?>
293
						</div>
294
						<div class="lasso-editor-settings--option-inner" style="border:none;">
295
						<input type="radio" name="lasso_editor[insert_comp_ui]" value="mediumcom" <?php echo checked( $insert_comp_ui, 'mediumcom' );?>> <?php _e( 'Auto Button on Empty Paragraph. medium.com-like UI.', 'lasso' );?>
296
						</div>
297
					</div>
298
                    
299
				</div>
300
				
301
				<h3><?php _e( 'Component', 'lasso' );?></h3>
302
                <div class="lasso-editor-settings--option-wrap" style="border:none;" >
303
                    <div class="lasso-editor-settings--option-inner" style="border:none">
304
						<input type="checkbox" class="checkbox" name="lasso_editor[add_table]" id="lasso_editor[add_table]" <?php echo checked( $add_table, 'on' );?> >
305
						<label for="lasso_editor[add_table]"><?php _e( 'Additional Component: Table', 'lasso' );?></label>
306
						<span class="lasso--setting-description"><?php _e( 'Allow user to add and edit tables.', 'lasso' );?></span>
307
308
					</div>
309
                
310
                <?php if ( 'ase-active' != $ase_status ) { ?>
311
                
312
                    <div class="lasso-editor-settings--option-inner" style="border:none">
313
						<input type="checkbox" class="checkbox" name="lasso_editor[use_old_wpimg]" id="lasso_editor[use_old_wpimg]" <?php echo checked( $use_old_wpimg, 'on' );?> >
314
						<label for="lasso_editor[use_old_wpimg]"><?php _e( 'Use Simple Image', 'lasso' );?></label>
315
						<span class="lasso--setting-description"><?php _e( 'Use Simple Image Component without Extra Options.', 'lasso' );?></span>
316
317
					</div>
318
                
319
                <?php }?>
320
                </div>
321
				
322
323
				<h3><?php _e( 'Post Settings UI', 'lasso' );?></h3>
324
				<div class="lasso-editor-settings--option-wrap"  >
325
					<div class="lasso-editor-settings--option-inner" style="border:none">
326
						<input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked( $post_settings_disabled, 'on' );?> >
327
						<label for="lasso_editor[post_settings_disabled]"> <?php _e( 'Disable Post Settings', 'lasso' );?></label>
328
						<span class="lasso--setting-description"><?php _e( 'Check this to disable users from being able to edit post settings from the front-end.', 'lasso' );?></span>
329
					</div>
330
					
331
					<div class="lasso-editor-settings--option-inner" style="border:none">
332
						<input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked( $allow_change_date, 'on' );?> >
333
						<label for="lasso_editor[allow_change_date]"> <?php _e( 'Allow Changing Post Date', 'lasso' );?></label>
334
						<span class="lasso--setting-description"><?php _e( 'Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso' );?></span>
335
					</div>
336
                    
337
                    <div class="lasso-editor-settings--option-inner" style="border:none">
338
						<input type="checkbox" class="checkbox" name="lasso_editor[allow_edit_excerpt]" id="lasso_editor[allow_edit_excerpt]" <?php echo checked( $allow_edit_excerpt, 'on' );?> >
339
						<label for="lasso_editor[allow_edit_excerpt]"> <?php _e( 'Allow Editing Excerpt', 'lasso' );?></label>
340
						<span class="lasso--setting-description"><?php _e( 'Allow the post\'s excerpt to be edited in the Post Setting dialog', 'lasso' );?></span>
341
					</div>
342
					
343
					<div class="lasso-editor-settings--option-inner" style="border:none">
344
						<input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked( $allow_new_category, 'on' );?> >
345
						<label for="lasso_editor[allow_new_category]"> <?php _e( 'Allow Adding New Category', 'lasso' );?></label>
346
						<span class="lasso--setting-description"><?php _e( 'Add the user to create new, previously non-existing categories for posts.', 'lasso' );?></span>
347
					</div>
348
					
349
					<div class="lasso-editor-settings--option-inner" style="border:none">
350
						<input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked( $no_pending_status, 'on' );?> >
351
						<label for="lasso_editor[no_pending_status]"> <?php _e( 'Do Not Allow "Pending" Status', 'lasso' );?></label>
352
						<span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the Status to Pending.', 'lasso' );?></span>
353
					</div>
354
					
355
					<div class="lasso-editor-settings--option-inner" style="border:none">
356
						<input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked( $no_url_setting, 'on' );?> >
357
						<label for="lasso_editor[no_url_setting]"> <?php _e( 'Remove POST URL Option', 'lasso' );?></label>
358
						<span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the URL for the Post.', 'lasso' );?></span>
359
					</div>
360
				
361
					<div class="lasso-editor-settings--option-inner" >
362
						<input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked( $post_new_disabled, 'on' );?> >
363
						<label for="lasso_editor[post_adding_disabled]"><?php _e( 'Disable Post Adding', 'lasso' );?></label>
364
						<span class="lasso--setting-description"><?php _e( 'Check this box to disable users from being able to add new posts from the front-end.', 'lasso' );?></span>
365
					</div>
366
					
367
368
				</div>
369
				
370
				<h3><?php _e( 'Misc', 'lasso' );?></h3>
371
				<div class="lasso-editor-settings--option-wrap">
372
					<div class="lasso-editor-settings--option-inner" style="border:none">
373
						<input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked( $disable_tour, 'on' );?> >
374
						<label for="lasso_editor[disable_tour]"> <?php _e( 'Do Not Show Tour Dialog', 'lasso' );?></label>
375
						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the tour dialog box for all users.', 'lasso' );?></span>
376
					</div>
377
378
					<div class="lasso-editor-settings--option-inner" style="border:none">
379
					    <label for="lasso_editor[bold_tag]"> <?php _e( '"Bold" Tag', 'lasso' );?></label>
380
						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Bold" style.', 'lasso' );?></span>
381
					    <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked( $bold_tag, 'b' );?>> b
382
						<input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked( $bold_tag, 'strong' );?>> strong
383
					</div>
384
					<div class="lasso-editor-settings--option-inner" style="border:none">
385
					    <label for="lasso_editor[i_tag]"> <?php _e( '"Italic" Tag', 'lasso' );?></label>
386
						<span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Italic" style.', 'lasso' );?></span>
387
					    <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked( $i_tag, 'i' );?>> i
388
						<input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked( $i_tag, 'em' );?>> em
389
					</div>
390
                    <div class="lasso-editor-settings--option-inner" >
391
						<input type="checkbox" class="checkbox" name="lasso_editor[link_prefix_http]" id="lasso_editor[link_prefix_http]" <?php echo checked( $link_prefix_http, 'on' );?> >
392
						<label for="lasso_editor[link_prefix_http]"><?php _e( 'Auto Prefix HTTP to links', 'lasso' );?></label>
393
						<span class="lasso--setting-description"><?php _e( 'When user adds a hyperlink, automatically add http:// if the user does not specify it explicitly.', 'lasso' );?></span>
394
					</div>
395
				</div>
396
397
				<h3><?php _e( 'Advanced Options', 'lasso' );?></h3>
398
                <span class="lasso--setting-description"><?php _e( 'Suggested not to turn these options on without consulting the developer.', 'lasso' );?></span>
399
                <span class="lasso--setting-description"> </span>
400
				<div class="lasso-editor-settings--option-wrap ">
401
					<div class="lasso-editor-settings--option-inner" style="border:none">
402
						<input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked( $shortcodify_disabled, 'on' );?> >
403
						<label for="lasso_editor[shortcodify_disabled]"><?php _e( 'Disable Aesop Component Conversion', 'lasso' );?></label>
404
						<span class="lasso--setting-description"><?php _e( 'Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso' );?></span>
405
					</div>
406
				
407
					<div class="lasso-editor-settings--option-inner" style="border:none">
408
						<input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked( $enable_autosave, 'on' );?> >
409
						<label for="lasso_editor[enable_autosave]"><?php _e( 'Enable Auto Save', 'lasso' );?></label>
410
						<span class="lasso--setting-description"><?php _e( 'Check this box to enable auto save.', 'lasso' );?></span>
411
					</div>
412
				
413
					<div class="lasso-editor-settings--option-inner" style="border:none">
414
						<input type="checkbox" class="checkbox" name="lasso_editor[post_save_disabled]" id="lasso_editor[post_save_disabled]" <?php echo checked( $save_to_post_disabled, 'on' );?> >
415
						<label for="lasso_editor[post_save_disabled]"><?php _e( 'Disable Post Saving', 'lasso' );?></label>
416
						<span class="lasso--setting-description"><?php _e( 'By default the editor will update the database with the post or page it is being used on. Check this box to disable this. If you check this box, it is assumed that you will be using the provided filters to save your own content.', 'lasso' );?></span>
417
418
					</div>
419
					
420
					<div class="lasso-editor-settings--option-inner" style="border:none">
421
						<input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked( $edit_post_disabled, 'on' );?> >
422
						<label for="lasso_editor[post_edit_disabled]"><?php _e( 'Disable Post Editing', 'lasso' );?></label>
423
						<span class="lasso--setting-description"><?php _e( 'You may use this option if you only want to edit custom fields. Refer <a href="https://edituswp.com/editing-and-updating-custom-fields-from-frontend/">here</a> for more information. The custom fields you specify will be still editable under the editing mode.', 'lasso' );?></span>
424
425
					</div>
426
				
427
					<div class="lasso-editor-settings--option-inner">
428
						<input type="checkbox" class="checkbox" name="lasso_editor[save_using_rest_disabled]" id="lasso_editor[save_using_rest_disabled]" <?php echo checked( $save_using_rest_disabled, 'on' );?> >
429
						<label for="lasso_editor[save_using_rest_disabled]"><?php _e( "Don't Use REST API to Save", 'lasso' );?></label>
430
						<span class="lasso--setting-description"><?php _e( 'By default the editor will use REST API to save posts. Check this box to use custom AJAX calls instead.', 'lasso' );?></span>
431
432
					</div>
433
				</div>
434
				
435
				
436
437
438
				<div class="lasso-editor-settings--submit">
439
				    <input type="hidden" name="action" value="lasso-editor-settings" />
440
				    <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'lasso' );?>" />
441
					<?php wp_nonce_field( 'nonce', 'lasso_editor_settings' ); ?>
442
				</div>
443
				
444
				<?php do_action('lasso_settings_after');?>
445
			</form>
446
447
		</div><?php
448
449
	}
450
}
451
452