This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | ;(function ( $ ) { |
||
2 | |||
3 | /** |
||
4 | * Component admin page |
||
5 | */ |
||
6 | PodsAdminI18n = { |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
7 | init : function () { |
||
8 | if ( $( '#pods_i18n_settings_save' ).length ) { |
||
9 | this.initSave(); |
||
10 | } |
||
11 | }, |
||
12 | |||
13 | initSave : function () { |
||
14 | $( document ).on( 'click', '#pods_i18n_settings_save #submit', function () { |
||
15 | $( '#_nonce_i18n' ).appendTo( '.pods-admin form#posts-filter' ); |
||
16 | |||
17 | $( '.pods-admin form#posts-filter' ).prop( 'method', 'post' ).submit(); |
||
18 | } ); |
||
19 | } |
||
20 | }; |
||
21 | |||
22 | if ( $( '#pods_admin_i18n' ).length ) { |
||
23 | PodsAdminI18n.init(); |
||
0 ignored issues
–
show
|
|||
24 | } |
||
25 | |||
26 | /** |
||
27 | * Pod edit page |
||
28 | */ |
||
29 | PodsEditI18n = { |
||
0 ignored issues
–
show
|
|||
30 | i18nVisible : true, selector : '.pods-i18n-input', toggleSpeed : 100, |
||
31 | |||
32 | init : function () { |
||
33 | this.toggleI18nInputs(); |
||
34 | this.dynamicAddRemoveInputs(); |
||
35 | }, |
||
36 | |||
37 | validateI18nVisibility : function () { |
||
38 | /** |
||
39 | * Check if we're on the fields tab |
||
40 | * If we're on a fields tab, check if the first i18n input is visible and change this object's visibility property |
||
41 | */ |
||
42 | if ( $( '#pods-manage-fields' ).is( ':visible' ) && $( '#pods-manage-fields .pods-manage-list .pods-manage-row-expanded' ).length ) { |
||
43 | var first = $( '#pods-manage-fields .pods-manage-list .pods-manage-row-expanded' ).first().find( PodsEditI18n.selector ).first(); |
||
0 ignored issues
–
show
|
|||
44 | if ( first.is( ':visible' ) ) { |
||
45 | PodsEditI18n.i18nVisible = true; |
||
0 ignored issues
–
show
|
|||
46 | } |
||
47 | else { |
||
48 | PodsEditI18n.i18nVisible = false; |
||
0 ignored issues
–
show
|
|||
49 | } |
||
50 | } |
||
51 | |||
52 | }, |
||
53 | |||
54 | toggleI18nInputs : function () { |
||
55 | |||
56 | // Toggle i18n inputs for pod options |
||
57 | // @todo Enable auto-toggle when opening a field |
||
58 | $( document ).on( 'click', 'button#toggle_i18n', function ( e ) { |
||
59 | e.preventDefault(); |
||
60 | |||
61 | PodsEditI18n.validateI18nVisibility(); |
||
0 ignored issues
–
show
|
|||
62 | |||
63 | if ( PodsEditI18n.i18nVisible ) { |
||
0 ignored issues
–
show
|
|||
64 | |||
65 | PodsEditI18n.i18nVisible = false; |
||
0 ignored issues
–
show
|
|||
66 | $( PodsEditI18n.selector ).each( function () { |
||
0 ignored issues
–
show
|
|||
67 | $( this ).slideUp( PodsEditI18n.toggleSpeed, function () { |
||
0 ignored issues
–
show
|
|||
68 | // Fallback for hidden fields |
||
69 | $( this ).css( 'display', 'none' ); |
||
70 | } ); |
||
71 | } ); |
||
72 | |||
73 | } |
||
74 | else { |
||
75 | |||
76 | PodsEditI18n.i18nVisible = true; |
||
0 ignored issues
–
show
|
|||
77 | $( PodsEditI18n.selector ).each( function () { |
||
0 ignored issues
–
show
|
|||
78 | $( this ).slideDown( PodsEditI18n.toggleSpeed, function () { |
||
0 ignored issues
–
show
|
|||
79 | // Fallback for hidden fields |
||
80 | $( this ).css( 'display', 'block' ); |
||
81 | } ); |
||
82 | } ); |
||
83 | |||
84 | } |
||
85 | return false; |
||
86 | } ); |
||
87 | }, |
||
88 | |||
89 | dynamicAddRemoveInputs : function () { |
||
90 | |||
91 | $( document ).on( 'change', '#pods_i18n .pods-enable-disable-language input', function ( e ) { |
||
92 | |||
93 | PodsEditI18n.validateI18nVisibility(); |
||
0 ignored issues
–
show
|
|||
94 | |||
95 | var locale = $( this ).parents( '.pods-enable-disable-language' ).attr( 'data-locale' ); |
||
96 | |||
97 | if ( $( this ).is( ':checked' ) ) { |
||
98 | |||
99 | // Get the index for this locale |
||
100 | var index = 0; |
||
101 | $( '#pods_i18n .pods-enable-disable-language input:checked' ).each( function () { |
||
102 | if ( $( this ).parents( '.pods-enable-disable-language' ).attr( 'data-locale' ) == locale ) { |
||
0 ignored issues
–
show
|
|||
103 | return false; |
||
104 | } |
||
105 | index++; |
||
106 | } ); |
||
107 | |||
108 | $( '.pods-i18n-field' ).each( function () { |
||
109 | if ( $( '.pods-i18n-input-' + locale, this ).length ) { |
||
110 | $( '.pods-i18n-input-' + locale, this ).slideDown( PodsEditI18n.toggleSpeed, function () { |
||
0 ignored issues
–
show
|
|||
111 | $( 'input', this ).removeAttr( 'disabled' ); |
||
112 | } ); |
||
113 | } |
||
114 | else { |
||
115 | var name = $( this ).parent().children( 'input' ).first().attr( 'name' ); |
||
116 | // Place the new input on the right index |
||
117 | if ( $( '.pods-i18n-input:visible', this ).eq( index ).length ) { |
||
118 | $( '.pods-i18n-input:visible', this ).eq( index ).before( PodsEditI18n.i18nInputTemplate( name, locale ) ); |
||
0 ignored issues
–
show
|
|||
119 | } |
||
120 | else { |
||
121 | $( this ).append( PodsEditI18n.i18nInputTemplate( name, locale ) ); |
||
0 ignored issues
–
show
|
|||
122 | } |
||
123 | if ( PodsEditI18n.i18nVisible ) { |
||
0 ignored issues
–
show
|
|||
124 | $( '.pods-i18n-input-' + locale, this ).slideDown( PodsEditI18n.toggleSpeed ); |
||
0 ignored issues
–
show
|
|||
125 | } |
||
126 | } |
||
127 | } ); |
||
128 | |||
129 | } |
||
130 | else { |
||
131 | $( '.pods-i18n-input-' + locale + ' input' ).each( function () { |
||
132 | $( this ).parent().slideUp( PodsEditI18n.toggleSpeed, function () { |
||
0 ignored issues
–
show
|
|||
133 | $( 'input', this ).attr( 'disabled', 'disabled' ); |
||
134 | } ); |
||
135 | } ); |
||
136 | } |
||
137 | |||
138 | } ); |
||
139 | |||
140 | }, |
||
141 | |||
142 | i18nInputTemplate : function ( name, locale ) { |
||
143 | |||
144 | var locale_clean = locale.toLowerCase().replace( '_', '-' ); |
||
145 | var name_clean = name.toLowerCase().replace( '_', '-' ); |
||
146 | |||
147 | html = '<div class="pods-i18n-input pods-i18n-input-' + locale + '" data-locale="' + locale + '" style="display: none;">'; |
||
0 ignored issues
–
show
|
|||
148 | html += '<label class="pods-form-ui-label" for="pods-form-ui-label-' + locale_clean + '"><small><code style="font-size: 1em;">' + locale + '</code></small></label>'; |
||
0 ignored issues
–
show
|
|||
149 | html += '<input name="' + name + '_' + locale + '" data-name-clean="' + name_clean + '-' + locale_clean + '" id="pods-form-ui-label-' + locale_clean + '" class="pods-form-ui-field pods-form-ui-field-type-text pods-form-ui-field-name-' + name_clean + '-' + locale_clean + '" type="text" value="" tabindex="2" maxlength="255">'; |
||
0 ignored issues
–
show
|
|||
150 | html += '</div>'; |
||
0 ignored issues
–
show
|
|||
151 | return html; |
||
0 ignored issues
–
show
|
|||
152 | } |
||
153 | |||
154 | }; |
||
155 | |||
156 | if ( $( '#post-body' ).length ) { |
||
157 | PodsEditI18n.init(); |
||
0 ignored issues
–
show
|
|||
158 | } |
||
159 | |||
160 | })( jQuery ); |
||
161 |