Completed
Push — master ( 62aa4b...3737f0 )
by
unknown
32s
created
public/includes/editor-modules.php 1 patch
Indentation   +178 added lines, -178 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 				height: 42px;
115 115
 			}
116 116
 		<?php
117
-            } 
117
+			} 
118 118
 		} else { 
119 119
 		?> 
120 120
 
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
             }
124 124
             
125 125
         <?php
126
-        }
127
-        ?>
126
+		}
127
+		?>
128 128
         </style>
129 129
 		<div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class( $status );?> <?php echo sanitize_html_class( $custom_classes );?>" data-post-id="<?php echo get_the_ID();?>" >
130 130
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 	
241 241
 	$sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active')  ? 'shortcodify-disabled' : 'shortcodify-enabled';
242 242
 
243
-    $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
243
+	$use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
244 244
 
245 245
 	?>
246 246
 	<div class="lasso--text-popup lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>"  style="display:none;">
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 function lasso_editor_text_toolbar() {
299 299
 
300 300
 	ob_start();
301
-    $text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false);
301
+	$text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false);
302 302
 
303 303
 	
304 304
 	$is_mobile = wp_is_mobile();
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 	$toolbar_class  = $toolbar_headings ? 'toolbar-extended' : false;
318 318
 	
319 319
 	// mobile styles
320
-    $mobile_class = $is_mobile ? 'lasso-mobile' : false;
320
+	$mobile_class = $is_mobile ? 'lasso-mobile' : false;
321 321
 	$mobile_style =$is_mobile ? 'style="bottom:0px;"' : null;
322 322
 	
323 323
 	//show color
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 	
333 333
 	$sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active')  ? 'shortcodify-disabled' : 'shortcodify-enabled';
334 334
 
335
-    $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
335
+	$use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
336 336
 
337 337
 	?>
338 338
 	<div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style ?>>
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 	
557 557
 	//editor options
558 558
 	$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
559
-    $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor');
559
+	$allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor');
560 560
 	$no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor');
561 561
 	$support_custom_taxonomy   = lasso_editor_get_option( 'support_custom_taxonomy', 'lasso_editor' );
562 562
 	
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 	// do we support pending status
578 578
 	$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
579 579
     
580
-    $excerpt = $post->post_excerpt;
580
+	$excerpt = $post->post_excerpt;
581 581
 
582 582
 ?>
583 583
 	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>">
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
 						}?>
675 675
 						<?php 
676 676
 						if ($allow_change_date) { 
677
-						    $dateformat = get_option( 'date_format' ); 
677
+							$dateformat = get_option( 'date_format' ); 
678 678
 						?>
679 679
 						    <label><?php _e( 'Post Date', 'lasso' ); ?></label>
680 680
 							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/>
@@ -768,8 +768,8 @@  discard block
 block discarded – undo
768 768
 								$types = lasso_post_types_names();
769 769
 								if ( !empty( $types ) ) {
770 770
 									foreach( $types as $name => $label ) 
771
-                                    {   	
772
-                                        $type = $name;									
771
+									{   	
772
+										$type = $name;									
773 773
 										//$type = preg_replace( '/s\b/','', $name );
774 774
 										if ($type == 'page' && !current_user_can('edit_pages')) {
775 775
 											continue;
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 						if ( !empty( $types ) ) {
792 792
 							// get the first element
793 793
 							$keys = array_keys($types);
794
-						    $type =$keys[0];						
794
+							$type =$keys[0];						
795 795
 							//$type = preg_replace( '/s\b/','', $type );
796 796
 							printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) );		
797 797
 						}
@@ -819,8 +819,8 @@  discard block
 block discarded – undo
819 819
 	global $post;
820 820
 	
821 821
 	global $wp_post_types;
822
-    $labels = &$wp_post_types['post']->labels;
823
-    $labels->name = 'Articles';
822
+	$labels = &$wp_post_types['post']->labels;
823
+	$labels->name = 'Articles';
824 824
 
825 825
 	ob_start();
826 826
 
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
 	ob_start();
881 881
 
882 882
 
883
-    $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
883
+	$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
884 884
     
885 885
 	// let users add custom css classes
886 886
 	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
@@ -982,9 +982,9 @@  discard block
 block discarded – undo
982 982
 function lasso_editor_options_blob() {
983 983
 
984 984
 	$codes   = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : array();
985
-    $codes   = add_wpimg_options( $codes );
985
+	$codes   = add_wpimg_options( $codes );
986 986
 	$codes   = add_wpimg_block_options( $codes );
987
-    $codes   = apply_filters( 'lasso_custom_options', $codes );
987
+	$codes   = apply_filters( 'lasso_custom_options', $codes );
988 988
 	$galleries  = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
989 989
 
990 990
 	$nonce = wp_create_nonce( 'lasso_gallery' );
@@ -1086,9 +1086,9 @@  discard block
 block discarded – undo
1086 1086
 		$return .= '</form>';
1087 1087
 
1088 1088
 		// extra JS codes
1089
-        if (isset($shortcode['codes'])) {
1090
-		    $return .= $shortcode['codes'];
1091
-        }
1089
+		if (isset($shortcode['codes'])) {
1090
+			$return .= $shortcode['codes'];
1091
+		}
1092 1092
 		$blob[$slug] = $return;
1093 1093
 	}
1094 1094
 
@@ -1097,95 +1097,95 @@  discard block
 block discarded – undo
1097 1097
 
1098 1098
 
1099 1099
 function add_wpimg_options( $shortcodes ) {
1100
-    $custom = array(
1101
-        'wpimg'    => array(
1102
-            'name'     => __( 'Image', 'lasso' ),
1103
-            'type'     => 'single',
1104
-            'atts'     => array(
1105
-                'img'    => array(
1106
-                    'type'  => 'media_upload',
1107
-                    'default'  => '',
1108
-                    'desc'   => __( 'Image URL', 'lasso' ),
1109
-                    'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
1110
-                ),
1111
-                'align'    => array(
1112
-                    'type'  => 'select',
1113
-                    'values'  => array(						
1114
-                        array(
1115
-                            'value' => 'center',
1116
-                            'name' => __( 'Center', 'aesop-core' )
1117
-                        ),
1118
-                        array(
1119
-                            'value' => 'left',
1120
-                            'name' => __( 'Left', 'aesop-core' )
1121
-                        ),
1122
-                        array(
1123
-                            'value' => 'right',
1124
-                            'name' => __( 'Right', 'aesop-core' )
1125
-                        ),
1126
-                    ),
1127
-                    'default'  => 'center',
1128
-                    'desc'   => __( 'Alignment', 'lasso' ),
1129
-                    'tip'=>''
1130
-                ),			
1100
+	$custom = array(
1101
+		'wpimg'    => array(
1102
+			'name'     => __( 'Image', 'lasso' ),
1103
+			'type'     => 'single',
1104
+			'atts'     => array(
1105
+				'img'    => array(
1106
+					'type'  => 'media_upload',
1107
+					'default'  => '',
1108
+					'desc'   => __( 'Image URL', 'lasso' ),
1109
+					'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
1110
+				),
1111
+				'align'    => array(
1112
+					'type'  => 'select',
1113
+					'values'  => array(						
1114
+						array(
1115
+							'value' => 'center',
1116
+							'name' => __( 'Center', 'aesop-core' )
1117
+						),
1118
+						array(
1119
+							'value' => 'left',
1120
+							'name' => __( 'Left', 'aesop-core' )
1121
+						),
1122
+						array(
1123
+							'value' => 'right',
1124
+							'name' => __( 'Right', 'aesop-core' )
1125
+						),
1126
+					),
1127
+					'default'  => 'center',
1128
+					'desc'   => __( 'Alignment', 'lasso' ),
1129
+					'tip'=>''
1130
+				),			
1131 1131
                 
1132
-                'imgwidth'    => array(
1133
-                    'type'  => 'text_small',
1134
-                    'default'  => '300px',
1135
-                    'desc'   => __( 'Image Width', 'lasso' ),
1136
-                    'tip'  => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' )
1137
-                ),
1138
-                'imgheight'    => array(
1139
-                    'type'  => 'text_small',
1140
-                    'default'  => '',
1141
-                    'desc'   => __( 'Image Height', 'lasso' ),
1142
-                    'tip'  => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' )
1143
-                ),	
1144
-                'linkoption'    => array(
1145
-                    'type'  => 'select',
1146
-                    'values'  => array(						
1147
-                        array(
1148
-                            'value' => 'none',
1149
-                            'name' => __( 'None', 'aesop-core' )
1150
-                        ),
1151
-                        array(
1152
-                            'value' => 'img',
1153
-                            'name' => __( 'Image', 'aesop-core' )
1154
-                        ),
1155
-                        array(
1156
-                            'value' => 'url',
1157
-                            'name' => __( 'URL', 'aesop-core' )
1158
-                        ),
1159
-                    ),
1160
-                    'default'  => 'none',
1161
-                    'desc'   => __( 'Link', 'lasso' ),
1162
-                    'tip'  => __( 'Click leads to:', 'lasso' )
1163
-                ),				
1132
+				'imgwidth'    => array(
1133
+					'type'  => 'text_small',
1134
+					'default'  => '300px',
1135
+					'desc'   => __( 'Image Width', 'lasso' ),
1136
+					'tip'  => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' )
1137
+				),
1138
+				'imgheight'    => array(
1139
+					'type'  => 'text_small',
1140
+					'default'  => '',
1141
+					'desc'   => __( 'Image Height', 'lasso' ),
1142
+					'tip'  => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' )
1143
+				),	
1144
+				'linkoption'    => array(
1145
+					'type'  => 'select',
1146
+					'values'  => array(						
1147
+						array(
1148
+							'value' => 'none',
1149
+							'name' => __( 'None', 'aesop-core' )
1150
+						),
1151
+						array(
1152
+							'value' => 'img',
1153
+							'name' => __( 'Image', 'aesop-core' )
1154
+						),
1155
+						array(
1156
+							'value' => 'url',
1157
+							'name' => __( 'URL', 'aesop-core' )
1158
+						),
1159
+					),
1160
+					'default'  => 'none',
1161
+					'desc'   => __( 'Link', 'lasso' ),
1162
+					'tip'  => __( 'Click leads to:', 'lasso' )
1163
+				),				
1164 1164
                 
1165
-                'link'    => array(
1166
-                    'type'  => 'text',
1167
-                    'default'  => '',
1168
-                    'desc'   => __( 'URL Link', 'lasso' ),
1169
-                    'tip'  => __( 'URL link', 'lasso' )
1170
-                ),
1171
-                'alt'    => array(
1172
-                    'type'  => 'text',
1173
-                    'default'  => '',
1174
-                    'desc'   => __( 'Image ALT', 'lasso' ),
1175
-                    'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1176
-                ),
1165
+				'link'    => array(
1166
+					'type'  => 'text',
1167
+					'default'  => '',
1168
+					'desc'   => __( 'URL Link', 'lasso' ),
1169
+					'tip'  => __( 'URL link', 'lasso' )
1170
+				),
1171
+				'alt'    => array(
1172
+					'type'  => 'text',
1173
+					'default'  => '',
1174
+					'desc'   => __( 'Image ALT', 'lasso' ),
1175
+					'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1176
+				),
1177 1177
                 
1178
-                'caption'    => array(
1179
-                    'type'  => 'text_area',
1180
-                    'default'  => '',
1181
-                    'desc'   => __( 'Caption', 'lasso' ),
1182
-                    'tip'  => __( 'Optional caption for the image.', 'lasso' )
1183
-                ),
1178
+				'caption'    => array(
1179
+					'type'  => 'text_area',
1180
+					'default'  => '',
1181
+					'desc'   => __( 'Caption', 'lasso' ),
1182
+					'tip'  => __( 'Optional caption for the image.', 'lasso' )
1183
+				),
1184 1184
                 
1185 1185
 
1186
-            ),
1187
-            'desc'     => __( 'An image.', 'aesop-core' ),
1188
-            'codes'    => '<script>	            
1186
+			),
1187
+			'desc'     => __( 'An image.', 'aesop-core' ),
1188
+			'codes'    => '<script>	            
1189 1189
 						jQuery(document).ready(function($){
1190 1190
                             function linkSetting(l){								
1191 1191
 							    if ( l=="url") {
@@ -1205,75 +1205,75 @@  discard block
 block discarded – undo
1205 1205
 							})
1206 1206
 						});
1207 1207
 			           </script>'
1208
-        )
1209
-    );
1208
+		)
1209
+	);
1210 1210
 
1211
-    return array_merge( $shortcodes, $custom );
1211
+	return array_merge( $shortcodes, $custom );
1212 1212
 }
1213 1213
 
1214 1214
 function add_wpimg_block_options( $shortcodes ) {
1215
-    $custom = array(
1216
-        'wpimg-block'    => array(
1217
-            'name'     => __( 'Image', 'lasso' ),
1218
-            'type'     => 'single',
1219
-            'atts'     => array(
1220
-                'img'    => array(
1221
-                    'type'  => 'media_upload',
1222
-                    'default'  => '',
1223
-                    'desc'   => __( 'Image URL', 'lasso' ),
1224
-                    'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
1225
-                ),
1226
-                'align'    => array(
1227
-                    'type'  => 'select',
1228
-                    'values'  => array(						
1229
-                        array(
1230
-                            'value' => 'center',
1231
-                            'name' => __( 'Center', 'aesop-core' )
1232
-                        ),
1233
-                        array(
1234
-                            'value' => 'left',
1235
-                            'name' => __( 'Left', 'aesop-core' )
1236
-                        ),
1237
-                        array(
1238
-                            'value' => 'right',
1239
-                            'name' => __( 'Right', 'aesop-core' )
1240
-                        ),
1241
-                    ),
1242
-                    'default'  => 'center',
1243
-                    'desc'   => __( 'Alignment', 'lasso' ),
1244
-                    'tip'=>''
1245
-                ),		
1246
-                'alt'    => array(
1247
-                    'type'  => 'text',
1248
-                    'default'  => '',
1249
-                    'desc'   => __( 'Image ALT', 'lasso' ),
1250
-                    'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1251
-                ),
1252
-                'caption'    => array(
1253
-                    'type'  => 'text',
1254
-                    'default'  => '',
1255
-                    'desc'   => __( 'Caption', 'lasso' ),
1256
-                    'tip'  => __( 'Optional caption for the image.', 'lasso' )
1257
-                ),
1258
-                'link'    => array(
1259
-                    'type'  => 'text',
1260
-                    'default'  => '',
1261
-                    'desc'   => __( 'Link URL', 'lasso' ),
1262
-                    'tip'  => __( 'Optional URL to link.', 'lasso' )
1263
-                ),
1215
+	$custom = array(
1216
+		'wpimg-block'    => array(
1217
+			'name'     => __( 'Image', 'lasso' ),
1218
+			'type'     => 'single',
1219
+			'atts'     => array(
1220
+				'img'    => array(
1221
+					'type'  => 'media_upload',
1222
+					'default'  => '',
1223
+					'desc'   => __( 'Image URL', 'lasso' ),
1224
+					'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
1225
+				),
1226
+				'align'    => array(
1227
+					'type'  => 'select',
1228
+					'values'  => array(						
1229
+						array(
1230
+							'value' => 'center',
1231
+							'name' => __( 'Center', 'aesop-core' )
1232
+						),
1233
+						array(
1234
+							'value' => 'left',
1235
+							'name' => __( 'Left', 'aesop-core' )
1236
+						),
1237
+						array(
1238
+							'value' => 'right',
1239
+							'name' => __( 'Right', 'aesop-core' )
1240
+						),
1241
+					),
1242
+					'default'  => 'center',
1243
+					'desc'   => __( 'Alignment', 'lasso' ),
1244
+					'tip'=>''
1245
+				),		
1246
+				'alt'    => array(
1247
+					'type'  => 'text',
1248
+					'default'  => '',
1249
+					'desc'   => __( 'Image ALT', 'lasso' ),
1250
+					'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1251
+				),
1252
+				'caption'    => array(
1253
+					'type'  => 'text',
1254
+					'default'  => '',
1255
+					'desc'   => __( 'Caption', 'lasso' ),
1256
+					'tip'  => __( 'Optional caption for the image.', 'lasso' )
1257
+				),
1258
+				'link'    => array(
1259
+					'type'  => 'text',
1260
+					'default'  => '',
1261
+					'desc'   => __( 'Link URL', 'lasso' ),
1262
+					'tip'  => __( 'Optional URL to link.', 'lasso' )
1263
+				),
1264 1264
                
1265 1265
 
1266
-            ),
1267
-            'desc'     => __( 'A WP Image Block.', 'aesop-core' ),
1268
-            'codes'    => '<script>	            
1266
+			),
1267
+			'desc'     => __( 'A WP Image Block.', 'aesop-core' ),
1268
+			'codes'    => '<script>	            
1269 1269
 						jQuery(document).ready(function($){
1270 1270
                             
1271 1271
 						});
1272 1272
 			           </script>'
1273
-        )
1274
-    );
1273
+		)
1274
+	);
1275 1275
 
1276
-    return array_merge( $shortcodes, $custom );
1276
+	return array_merge( $shortcodes, $custom );
1277 1277
 }
1278 1278
 
1279 1279
 /**
@@ -1318,23 +1318,23 @@  discard block
 block discarded – undo
1318 1318
  * @return string
1319 1319
  */
1320 1320
 function lasso_editor_adjustBrightness($hex, $steps) { 
1321
-    $steps = max(-255, min(255, $steps));
1321
+	$steps = max(-255, min(255, $steps));
1322 1322
 
1323
-    // Normalize into a six character long hex string
1324
-    $hex = str_replace('#', '', $hex);
1325
-    if (strlen($hex) == 3) {
1326
-        $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
1327
-    }
1323
+	// Normalize into a six character long hex string
1324
+	$hex = str_replace('#', '', $hex);
1325
+	if (strlen($hex) == 3) {
1326
+		$hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
1327
+	}
1328 1328
 
1329
-    // Split into three parts: R, G and B
1330
-    $color_parts = str_split($hex, 2);
1331
-    $return = '#';
1329
+	// Split into three parts: R, G and B
1330
+	$color_parts = str_split($hex, 2);
1331
+	$return = '#';
1332 1332
 
1333
-    foreach ($color_parts as $color) {
1334
-        $color   = hexdec($color); // Convert to decimal
1335
-        $color   = max(0,min(255,$color + $steps)); // Adjust color
1336
-        $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
1337
-    }
1333
+	foreach ($color_parts as $color) {
1334
+		$color   = hexdec($color); // Convert to decimal
1335
+		$color   = max(0,min(255,$color + $steps)); // Adjust color
1336
+		$return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
1337
+	}
1338 1338
 
1339
-    return $return;
1339
+	return $return;
1340 1340
 }
Please login to merge, or discard this patch.
public/includes/assets.php 1 patch
Indentation   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -15,29 +15,29 @@  discard block
 block discarded – undo
15 15
 		add_action('wp_enqueue_scripts', array($this,'scripts'));
16 16
 	}
17 17
     
18
-    function is_multipage()
19
-    {
20
-        global $post;
21
-        $pos = strpos($post->post_content, "<!--nextpage-->");
22
-        if (!$pos) return -1;
18
+	function is_multipage()
19
+	{
20
+		global $post;
21
+		$pos = strpos($post->post_content, "<!--nextpage-->");
22
+		if (!$pos) return -1;
23 23
         
24
-        global $wp;
25
-        $url =  home_url( $wp->request );
26
-        $index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1;
27
-        return $index;        
28
-    }
24
+		global $wp;
25
+		$url =  home_url( $wp->request );
26
+		$index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1;
27
+		return $index;        
28
+	}
29 29
 
30 30
 	public function scripts(){
31 31
 
32 32
 	
33 33
 		global $post;
34 34
 		if ( lasso_user_can('edit_posts') 
35
-		     /* uncomment this line to disable Editus on Gutenberg posts*/
36
-             /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
37
-             ) {
35
+			 /* uncomment this line to disable Editus on Gutenberg posts*/
36
+			 /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
37
+			 ) {
38 38
 			
39 39
 			/**    Returns the time offset from UTC
40
-			*/
40
+			 */
41 41
 			function get_UTC_offset() {
42 42
 				$timezone_string = get_option( 'timezone_string' );
43 43
 				if (empty( $timezone_string ) ) {
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
54 54
 
55
-            //don't load autocomplete if it's a stockholm theme
55
+			//don't load autocomplete if it's a stockholm theme
56 56
 			$themename  	= wp_get_theme()->get('Name');
57 57
 			if ($themename !='Stockholm' ) {
58 58
 				wp_enqueue_script('jquery-ui-autocomplete');
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
 			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b');
91 91
 			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i');
92 92
             
93
-            $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
93
+			$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
94 94
             
95
-            $use_wpimgblock = false;
95
+			$use_wpimgblock = false;
96 96
             
97
-            $text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false);
97
+			$text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false);
98 98
             
99
-            $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off');
99
+			$link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off');
100 100
 
101 101
 			
102 102
 			//text alignement
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 			// allow change date for post
112 112
 			$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
113 113
             
114
-            // support custom taxonomy
114
+			// support custom taxonomy
115 115
 			$support_custom_taxonomy = lasso_editor_get_option('support_custom_taxonomy', 'lasso_editor');
116 116
 			
117 117
 			if ($show_color) {
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 			$tz_offset = get_UTC_offset();
138 138
 			$post_date = get_the_time('U', $postid);
139 139
 			$time = (time()+$tz_offset);
140
-            $delta = $time - $post_date;
140
+			$delta = $time - $post_date;
141 141
             
142 142
 			$strings = array(
143 143
 				'save' 				=> __('Save','lasso'),
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 				
182 182
 				'catsPlaceholder'     => __('add categories...'),
183 183
 				'tagsPlaceholder'     => __('add tags...'),
184
-                'taxoPlaceholder'     => __('add taxonomy terms...'),
184
+				'taxoPlaceholder'     => __('add taxonomy terms...'),
185 185
 				
186 186
 				
187 187
 			);
@@ -193,11 +193,11 @@  discard block
 block discarded – undo
193 193
 			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
194 194
 			
195 195
 			
196
-            if ($allow_change_date) {
197
-			    $permalink = get_site_url().'/?p='.$postid;
198
-            } else {
199
-                $permalink = get_permalink($postid);
200
-            }
196
+			if ($allow_change_date) {
197
+				$permalink = get_site_url().'/?p='.$postid;
198
+			} else {
199
+				$permalink = get_permalink($postid);
200
+			}
201 201
 			
202 202
 			// rest api
203 203
 			$rest_nonce = '';
@@ -217,17 +217,17 @@  discard block
 block discarded – undo
217 217
 				}
218 218
 			}
219 219
             
220
-            //excerpt
221
-            $post_excerpt = "";
222
-            $post_excerpt = wp_strip_all_tags($post->post_excerpt,true);
220
+			//excerpt
221
+			$post_excerpt = "";
222
+			$post_excerpt = wp_strip_all_tags($post->post_excerpt,true);
223 223
             
224
-            //find if this is multi page. -1 if not
225
-            $multipage = self::is_multipage();
226
-            $post_content = "";
227
-            //pass post_content if we need to process multipage. In future we may need to pass this for other purposes
228
-            //if ($multipage != -1) {
229
-               $post_content = $post->post_content;
230
-            //}
224
+			//find if this is multi page. -1 if not
225
+			$multipage = self::is_multipage();
226
+			$post_content = "";
227
+			//pass post_content if we need to process multipage. In future we may need to pass this for other purposes
228
+			//if ($multipage != -1) {
229
+			   $post_content = $post->post_content;
230
+			//}
231 231
 			
232 232
 			//get custom taxonomy
233 233
 			$custom_taxonomies         = array_diff(get_object_taxonomies( get_post_type( $postid ), 'names' ), ['category','post_tag','post_format']);
@@ -240,8 +240,8 @@  discard block
 block discarded – undo
240 240
 				$existing_taxo_arr[$taxonomy] = lasso_get_objects( $taxonomy );
241 241
 			}
242 242
             
243
-            $new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );        
244
-            $new_post_text  = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso')));
243
+			$new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );        
244
+			$new_post_text  = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso')));
245 245
 
246 246
 
247 247
 			// localized objects
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 				'nonce'				=> wp_create_nonce('lasso_editor'),
271 271
 				'handle'			=> lasso_editor_settings_toolbar(),
272 272
 				'toolbar'			=> lasso_editor_text_toolbar(),
273
-                'toolbarPopup'		=> $text_select_popup ? lasso_editor_selected_text_toolbar(): false,
273
+				'toolbarPopup'		=> $text_select_popup ? lasso_editor_selected_text_toolbar(): false,
274 274
 				'toolbarHeadings'   => $toolbar_headings,
275 275
 				'toolbarHeadingsH4'   => $toolbar_headings_h4,
276 276
 				'component_modal'	=> lasso_editor_component_modal(),
@@ -322,19 +322,19 @@  discard block
 block discarded – undo
322 322
 				'customFields'      => $custom_fields,
323 323
 				'clickToInsert'     => ($insert_comp_ui =='click'),
324 324
 				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
325
-                'rtl'               => is_rtl(),				
325
+				'rtl'               => is_rtl(),				
326 326
 				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
327 327
 				'linksEditable'    => $links_editable,
328 328
 				'supportPendingStatus' => !$no_pending_status,
329 329
 				'tableCode' => apply_filters( 'lasso_table_html_code','<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table><p></p>'),
330
-                'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
331
-                'multipages'=> $multipage,
332
-                'post_content'=>$post_content,
333
-                'post_excerpt'=>$post_excerpt,
334
-                'supCustTaxo' => $support_custom_taxonomy == 'on',
335
-                'oldWPimg'=> $use_old_wpimg =='on',
336
-                'useWPImgBlk'=> $use_wpimgblock,
337
-                'prefixHTTP'=> $link_prefix_http =='on'
330
+				'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
331
+				'multipages'=> $multipage,
332
+				'post_content'=>$post_content,
333
+				'post_excerpt'=>$post_excerpt,
334
+				'supCustTaxo' => $support_custom_taxonomy == 'on',
335
+				'oldWPimg'=> $use_old_wpimg =='on',
336
+				'useWPImgBlk'=> $use_wpimgblock,
337
+				'prefixHTTP'=> $link_prefix_http =='on'
338 338
 			);
339 339
 
340 340
 
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 			
343 343
 			
344 344
 			if (!$using_restapiv2) {
345
-               // enqueue REST API V1
345
+			   // enqueue REST API V1
346 346
 			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
347 347
 			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
348 348
 			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 			if ($show_color) {
359 359
 				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
360 360
 			} else {
361
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
361
+				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
362 362
 			}
363 363
 			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
364 364
 
@@ -367,44 +367,44 @@  discard block
 block discarded – undo
367 367
 
368 368
 	}
369 369
     
370
-    function gutenberg_active() {
370
+	function gutenberg_active() {
371 371
         
372
-        // Gutenberg plugin is installed and activated.
373
-        $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
374
-
375
-        // Block editor since 5.0.
376
-        $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
377
-
378
-        if ( ! $gutenberg && ! $block_editor ) {
379
-            return false;
380
-        }
381
-
382
-        if ( self::is_classic_editor_plugin_active() ) {
383
-            $editor_option       = get_option( 'classic-editor-replace' );
384
-            $block_editor_active = array( 'no-replace', 'block' );
385
-
386
-            return in_array( $editor_option, $block_editor_active, true );
387
-        }
388
-
389
-        return true;
390
-    }
391
-
392
-    /**
393
-     * Check if Classic Editor plugin is active.
394
-     *
395
-     * @return bool
396
-     */
397
-    function is_classic_editor_plugin_active() {
398
-        if ( ! function_exists( 'is_plugin_active' ) ) {
399
-            include_once ABSPATH . 'wp-admin/includes/plugin.php';
400
-        }
401
-
402
-        if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
403
-            return true;
404
-        }
405
-
406
-        return false;
407
-    }
372
+		// Gutenberg plugin is installed and activated.
373
+		$gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
374
+
375
+		// Block editor since 5.0.
376
+		$block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
377
+
378
+		if ( ! $gutenberg && ! $block_editor ) {
379
+			return false;
380
+		}
381
+
382
+		if ( self::is_classic_editor_plugin_active() ) {
383
+			$editor_option       = get_option( 'classic-editor-replace' );
384
+			$block_editor_active = array( 'no-replace', 'block' );
385
+
386
+			return in_array( $editor_option, $block_editor_active, true );
387
+		}
388
+
389
+		return true;
390
+	}
391
+
392
+	/**
393
+	 * Check if Classic Editor plugin is active.
394
+	 *
395
+	 * @return bool
396
+	 */
397
+	function is_classic_editor_plugin_active() {
398
+		if ( ! function_exists( 'is_plugin_active' ) ) {
399
+			include_once ABSPATH . 'wp-admin/includes/plugin.php';
400
+		}
401
+
402
+		if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
403
+			return true;
404
+		}
405
+
406
+		return false;
407
+	}
408 408
 
409 409
 }
410 410
 
Please login to merge, or discard this patch.
admin/includes/menus/settings.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 		if ( !is_user_logged_in() )
99 99
 			return;
100 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';
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 103
 
104 104
 		$article_object   = lasso_editor_get_option( 'article_class', 'lasso_editor' );
105 105
 		$featImgClass    = lasso_editor_get_option( 'featimg_class', 'lasso_editor' );
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 		$edit_post_disabled  = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' );
111 111
 		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
112 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' );
113
+		$allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' );
114 114
 		$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
115 115
 		$shortcodify_disabled  = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
116 116
 		$enable_autosave  = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' );
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		$toolbar_show_color      = lasso_editor_get_option( 'toolbar_show_color', 'lasso_editor' );
123 123
 		$toolbar_show_alignment  = lasso_editor_get_option( 'toolbar_show_alignment', 'lasso_editor' );
124 124
         
125
-        $text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false);
125
+		$text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false);
126 126
 		
127 127
 		$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
128 128
 		$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 		$bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor',  "b");
138 138
 		$i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor',  "i");
139 139
         
140
-        $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
140
+		$add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
141 141
 		
142 142
 		// do we support pending status
143 143
 		$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
@@ -149,16 +149,16 @@  discard block
 block discarded – undo
149 149
 			$insert_comp_ui = 'drag';
150 150
 		}
151 151
         
152
-        $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor');
152
+		$link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor');
153 153
         
154
-        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
155
-        $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
154
+		$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
155
+		$use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
156 156
 		
157 157
 		$support_custom_taxonomy   = lasso_editor_get_option( 'support_custom_taxonomy', 'lasso_editor' );
158 158
         
159
-        $new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );
159
+		$new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );
160 160
         
161
-        $no_wrap_shortcode    = lasso_editor_get_option( 'no_wrap_shortcode', 'lasso_editor');
161
+		$no_wrap_shortcode    = lasso_editor_get_option( 'no_wrap_shortcode', 'lasso_editor');
162 162
 
163 163
 ?>
164 164
 		<div class="wrap">
Please login to merge, or discard this patch.