Skip to content

Commit db7abdf

Browse files
committed
whitespace adjustments. spaces to tabs
1 parent 5b7bc78 commit db7abdf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+9463
-8887
lines changed

admin/admin.php

+304-293
Large diffs are not rendered by default.

admin/ajax.php

+83-86
Original file line numberDiff line numberDiff line change
@@ -2,108 +2,105 @@
22
/*
33
* Ajax form templates
44
*/
5-
function qw_form_ajax()
6-
{
7-
switch ($_POST['form'])
8-
{
9-
/*
10-
* Preview, special case
11-
*/
12-
case 'preview':
13-
$decode = urldecode($_POST['options']);
14-
$options = array();
15-
parse_str($decode, $options);
16-
$options['qw-query-options']['args']['paged'] = 1;
17-
$args = array(
18-
'options' => $options['qw-query-options'],
19-
'query_id' => $_POST['query_id'],
20-
);
21-
print theme('query_preview', $args);
22-
exit;
23-
break;
5+
function qw_form_ajax() {
6+
switch ( $_POST['form'] ) {
7+
/*
8+
* Preview, special case
9+
*/
10+
case 'preview':
11+
$decode = urldecode( $_POST['options'] );
12+
$options = array();
13+
parse_str( $decode, $options );
14+
$options['qw-query-options']['args']['paged'] = 1;
15+
$args = array(
16+
'options' => $options['qw-query-options'],
17+
'query_id' => $_POST['query_id'],
18+
);
19+
print theme( 'query_preview', $args );
20+
exit;
21+
break;
2422

25-
case 'sort_form':
26-
$template = 'query_sort';
27-
$all = qw_all_sort_options();
28-
break;
23+
case 'sort_form':
24+
$template = 'query_sort';
25+
$all = qw_all_sort_options();
26+
break;
2927

30-
case 'field_form':
31-
$template = 'query_field';
32-
$all = qw_all_fields();
33-
break;
28+
case 'field_form':
29+
$template = 'query_field';
30+
$all = qw_all_fields();
31+
break;
3432

35-
case 'filter_form':
36-
$template = 'query_filter';
37-
$all = qw_all_filters();
38-
break;
33+
case 'filter_form':
34+
$template = 'query_filter';
35+
$all = qw_all_filters();
36+
break;
3937

40-
case 'override_form':
41-
$template = 'query_override';
42-
$all = qw_all_overrides();
43-
break;
38+
case 'override_form':
39+
$template = 'query_override';
40+
$all = qw_all_overrides();
41+
break;
4442

45-
case 'sort_sortable':
46-
$template = 'query_sort_sortable';
47-
$all = qw_all_sort_options();
48-
break;
43+
case 'sort_sortable':
44+
$template = 'query_sort_sortable';
45+
$all = qw_all_sort_options();
46+
break;
4947

50-
case 'field_sortable':
51-
$template = 'query_field_sortable';
52-
$all = qw_all_fields();
53-
break;
48+
case 'field_sortable':
49+
$template = 'query_field_sortable';
50+
$all = qw_all_fields();
51+
break;
5452

55-
case 'filter_sortable':
56-
$template = 'query_filter_sortable';
57-
$all = qw_all_filters();
58-
break;
59-
}
53+
case 'filter_sortable':
54+
$template = 'query_filter_sortable';
55+
$all = qw_all_filters();
56+
break;
57+
}
6058

61-
/*
62-
* Generate handler item forms and data
63-
*/
64-
$handler = $_POST['handler'];
65-
$item = array();
59+
/*
60+
* Generate handler item forms and data
61+
*/
62+
$handler = $_POST['handler'];
63+
$item = array();
6664

67-
$hook_key = qw_get_hook_key($all, $_POST);
68-
$item = $all[$hook_key];
69-
$item['name'] = $_POST['name'];
70-
$item['form_prefix'] = qw_make_form_prefix($handler, $item['name']);
65+
$hook_key = qw_get_hook_key( $all, $_POST );
66+
$item = $all[ $hook_key ];
67+
$item['name'] = $_POST['name'];
68+
$item['form_prefix'] = qw_make_form_prefix( $handler, $item['name'] );
7169

72-
// handler item's form
73-
if (isset($item['form_callback']) && function_exists($item['form_callback'])){
74-
ob_start();
75-
$item['form_callback']($item);
76-
$item['form'] = ob_get_clean();
77-
}
78-
// provide template wrangler support
79-
else if (isset($item['form_template'])){
80-
$item['form'] = theme($item['form_template'], array($handler => $item));
81-
}
70+
// handler item's form
71+
if ( isset( $item['form_callback'] ) && function_exists( $item['form_callback'] ) ) {
72+
ob_start();
73+
$item['form_callback']( $item );
74+
$item['form'] = ob_get_clean();
75+
} // provide template wrangler support
76+
else if ( isset( $item['form_template'] ) ) {
77+
$item['form'] = theme( $item['form_template'],
78+
array( $handler => $item ) );
79+
}
8280

83-
$args = array(
84-
$handler => $item,
85-
);
86-
// weight for sortable handler items
87-
if (isset($_POST['next_weight'])){
88-
$args['weight'] = $_POST['next_weight'];
89-
}
81+
$args = array(
82+
$handler => $item,
83+
);
84+
// weight for sortable handler items
85+
if ( isset( $_POST['next_weight'] ) ) {
86+
$args['weight'] = $_POST['next_weight'];
87+
}
9088

91-
wp_send_json( array('template' => theme($template, $args) ) );
89+
wp_send_json( array( 'template' => theme( $template, $args ) ) );
9290
}
9391

9492
/*
9593
* Random data grabs
9694
*/
97-
function qw_data_ajax()
98-
{
99-
if ( isset($_POST['data']) ) {
100-
switch ($_POST['data']){
101-
case 'all_hooks':
102-
$query_id = isset( $_POST['queryId'] ) ? $_POST['queryId'] : null;
103-
$data = qw_edit_json( $query_id );
95+
function qw_data_ajax() {
96+
if ( isset( $_POST['data'] ) ) {
97+
switch ( $_POST['data'] ) {
98+
case 'all_hooks':
99+
$query_id = isset( $_POST['queryId'] ) ? $_POST['queryId'] : NULL;
100+
$data = qw_edit_json( $query_id );
104101

105-
wp_send_json( $data );
106-
break;
107-
}
108-
}
102+
wp_send_json( $data );
103+
break;
104+
}
105+
}
109106
}

0 commit comments

Comments
 (0)