Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/ninja-fo.../deprecat.../includes/admin
File: sidebar.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
[0] Fix | Delete
[1] Fix | Delete
function ninja_forms_sidebar_sorter($array, $sequence){
[2] Fix | Delete
$tmp = array();
[3] Fix | Delete
foreach($sequence as $s){
[4] Fix | Delete
foreach($array as $key => $a){
[5] Fix | Delete
$s = str_replace( 'ninja_forms_metabox_', '', $s );
[6] Fix | Delete
if($key == $s){
[7] Fix | Delete
$tmp[$key] = $a;
[8] Fix | Delete
unset( $array[$key] );
[9] Fix | Delete
break;
[10] Fix | Delete
}
[11] Fix | Delete
}
[12] Fix | Delete
}
[13] Fix | Delete
if( is_array( $array ) AND !empty( $array ) ){
[14] Fix | Delete
foreach( $array as $key => $a ){
[15] Fix | Delete
$tmp[$key] = $a;
[16] Fix | Delete
}
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
return $tmp;
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
function ninja_forms_display_sidebars($data){
[23] Fix | Delete
global $ninja_forms_sidebars;
[24] Fix | Delete
$current_tab = ninja_forms_get_current_tab();
[25] Fix | Delete
$current_page = esc_html( $_REQUEST['page'] );
[26] Fix | Delete
$opt = nf_get_settings();
[27] Fix | Delete
if( isset( $opt['sidebars'][$current_page][$current_tab] ) ){
[28] Fix | Delete
$order = $opt['sidebars'][$current_page][$current_tab];
[29] Fix | Delete
if ( !is_array ( $order ) ) {
[30] Fix | Delete
$order = array();
[31] Fix | Delete
}
[32] Fix | Delete
$ninja_forms_sidebars[$current_page][$current_tab] = ninja_forms_sidebar_sorter( $ninja_forms_sidebars[$current_page][$current_tab], $order );
[33] Fix | Delete
}
[34] Fix | Delete
$plugin_settings = nf_get_settings();
[35] Fix | Delete
?>
[36] Fix | Delete
<div id="menu-settings-column" class="metabox-holder">
[37] Fix | Delete
<div id="side-sortables" class="meta-box-sortables ui-sortable">
[38] Fix | Delete
<?php
[39] Fix | Delete
if(isset($ninja_forms_sidebars[$current_page][$current_tab]) AND is_array($ninja_forms_sidebars[$current_page][$current_tab])){
[40] Fix | Delete
foreach($ninja_forms_sidebars[$current_page][$current_tab] as $slug => $sidebar){
[41] Fix | Delete
[42] Fix | Delete
if((isset($opt['screen_options']['tab'][$current_tab]['sidebars'][$slug]['visible']) AND $opt['screen_options']['tab'][$current_tab]['sidebars'][$slug]['visible'] == 1) OR !isset($opt['screen_options']['tab'][$current_tab]['sidebars'][$slug]['visible'])){
[43] Fix | Delete
[44] Fix | Delete
if ( isset ( $plugin_settings['metabox_state'][$current_page][$current_tab][$slug] ) ) {
[45] Fix | Delete
$state = $plugin_settings['metabox_state'][$current_page][$current_tab][$slug];
[46] Fix | Delete
} else {
[47] Fix | Delete
$state = '';
[48] Fix | Delete
}
[49] Fix | Delete
?>
[50] Fix | Delete
<div id="ninja_forms_metabox_<?php echo $slug;?>" class="postbox">
[51] Fix | Delete
<h3 class="hndl">
[52] Fix | Delete
<span><?php _e($sidebar['name'], 'ninja-forms');?></span>
[53] Fix | Delete
</h3>
[54] Fix | Delete
<span class="item-controls">
[55] Fix | Delete
<a class="item-edit metabox-item-edit" id="edit_id" title="<?php _e('Edit Menu Item', 'ninja-forms'); ?>" href="#"><?php _e( 'Edit Menu Item' , 'ninja-forms'); ?></a>
[56] Fix | Delete
</span>
[57] Fix | Delete
<div class="inside" id="ninja_forms_sidebar_<?php echo $slug;?>" style="<?php echo $state;?>">
[58] Fix | Delete
<?php
[59] Fix | Delete
if(isset($sidebar['display_function']) AND !empty($sidebar['display_function'])){
[60] Fix | Delete
$sidebar_callback = $sidebar['display_function'];
[61] Fix | Delete
$arguments = func_get_args();
[62] Fix | Delete
array_shift($arguments); // We need to remove the first arg ($function_name)
[63] Fix | Delete
$arguments['slug'] = $slug;
[64] Fix | Delete
$arguments['data'] = $data;
[65] Fix | Delete
call_user_func_array($sidebar_callback, $arguments);
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
if(isset($sidebar['settings']) AND !empty($sidebar['settings'])){
[69] Fix | Delete
foreach($sidebar['settings'] as $option){
[70] Fix | Delete
if( isset( $option['p_class'] ) ){
[71] Fix | Delete
$p_class = $option['p_class'];
[72] Fix | Delete
}else{
[73] Fix | Delete
$p_class = '';
[74] Fix | Delete
}
[75] Fix | Delete
?>
[76] Fix | Delete
<p class="field-controls <?php echo $p_class;?>">
[77] Fix | Delete
<?php
[78] Fix | Delete
if(isset($option['display_function']) AND !empty($option['display_function'])){
[79] Fix | Delete
call_user_func_array($option['display_function'], $arguments);
[80] Fix | Delete
}else{
[81] Fix | Delete
[82] Fix | Delete
$name = $option['name'];
[83] Fix | Delete
[84] Fix | Delete
if( isset( $option['default_value'] ) ){
[85] Fix | Delete
$value = $option['default_value'];
[86] Fix | Delete
}else{
[87] Fix | Delete
$value = '';
[88] Fix | Delete
}
[89] Fix | Delete
[90] Fix | Delete
if( isset( $data[$name] ) ){
[91] Fix | Delete
$value = $data[$name];
[92] Fix | Delete
}
[93] Fix | Delete
[94] Fix | Delete
if( isset( $option['class'] ) ){
[95] Fix | Delete
$class = $option['class'];
[96] Fix | Delete
}else{
[97] Fix | Delete
$class = '';
[98] Fix | Delete
}
[99] Fix | Delete
[100] Fix | Delete
switch($option['type']){
[101] Fix | Delete
case 'checkbox':
[102] Fix | Delete
?>
[103] Fix | Delete
<input type="hidden" name="<?php echo $name;?>" value="0">
[104] Fix | Delete
<input type="checkbox" name="<?php echo $name;?>" id="<?php echo $name;?>" value="1" <?php checked(1, $value);?>>
[105] Fix | Delete
<label for="<?php echo $name;?>"><?php _e($option['label'], 'ninja-forms');?></label>
[106] Fix | Delete
<?php
[107] Fix | Delete
break;
[108] Fix | Delete
case 'radio':
[109] Fix | Delete
?>
[110] Fix | Delete
<label for="<?php echo $name;?>"><?php _e($option['label'], 'ninja-forms');?></label>
[111] Fix | Delete
<?php
[112] Fix | Delete
if(isset($option['options'])){
[113] Fix | Delete
$x = 0;
[114] Fix | Delete
foreach($option['options'] as $option){
[115] Fix | Delete
?>
[116] Fix | Delete
<input type="radio" id="<?php echo $name.'_'.$x;?>" value="<?php echo $option['value'];?>" <?php checked($option['value'], $value);?> name="<?php echo $name;?>">
[117] Fix | Delete
<label for="<?php echo $name.'_'.$x;?>"><?php echo $option['name'];?></label>
[118] Fix | Delete
<?php
[119] Fix | Delete
$x++;
[120] Fix | Delete
}
[121] Fix | Delete
}
[122] Fix | Delete
break;
[123] Fix | Delete
case 'select':
[124] Fix | Delete
?>
[125] Fix | Delete
<label for="<?php echo $name;?>"><?php _e($option['label'], 'ninja-forms');?></label>
[126] Fix | Delete
<select name="<?php echo $name;?>" id="<?php echo $name;?>">
[127] Fix | Delete
<?php
[128] Fix | Delete
if(isset($option['options'])){
[129] Fix | Delete
foreach($option['options'] as $option){
[130] Fix | Delete
?>
[131] Fix | Delete
<option value="<?php echo $option['value'];?>" <?php selected($option['value'], $value);?>><?php echo $option['name'];?></option>
[132] Fix | Delete
<?php
[133] Fix | Delete
}
[134] Fix | Delete
}
[135] Fix | Delete
?>
[136] Fix | Delete
</select>
[137] Fix | Delete
<?php
[138] Fix | Delete
break;
[139] Fix | Delete
case 'text':
[140] Fix | Delete
?>
[141] Fix | Delete
<label for="<?php echo $name;?>"><?php _e($option['label'], 'ninja-forms');?></label>
[142] Fix | Delete
<input type="text" name="<?php echo $name;?>" id="<?php echo $name;?>" value="<?php echo $value;?>">
[143] Fix | Delete
<?php
[144] Fix | Delete
break;
[145] Fix | Delete
case 'textarea':
[146] Fix | Delete
?>
[147] Fix | Delete
<label for="<?php echo $name;?>"><?php _e($option['label'], 'ninja-forms');?></label>
[148] Fix | Delete
<textarea name="<?php echo $name;?>" id="<?php echo $name;?>"><?php echo $value;?></textarea>
[149] Fix | Delete
<?php
[150] Fix | Delete
break;
[151] Fix | Delete
case 'submit':
[152] Fix | Delete
?>
[153] Fix | Delete
<input type="submit" name="submit" id="" class="<?php echo $class;?>" value="<?php _e( 'View Submissions', 'ninja-forms' );?>">
[154] Fix | Delete
<?php
[155] Fix | Delete
break;
[156] Fix | Delete
}
[157] Fix | Delete
if(isset($option['help']) AND !empty($option['help'])){
[158] Fix | Delete
?>
[159] Fix | Delete
<a href="#" class="tooltip">
[160] Fix | Delete
<img id="" class='ninja-forms-help-text' src="<?php echo NINJA_FORMS_URL;?>images/question-ico.gif" title="">
[161] Fix | Delete
<span>
[162] Fix | Delete
<img class="callout" src="<?php echo NINJA_FORMS_URL;?>/images/callout.gif" />
[163] Fix | Delete
<?php _e($option['help'], 'ninja-forms');?>
[164] Fix | Delete
</span>
[165] Fix | Delete
</a>
[166] Fix | Delete
[167] Fix | Delete
<?php
[168] Fix | Delete
}
[169] Fix | Delete
if(isset($option['desc']) AND !empty($option['desc'])){
[170] Fix | Delete
?>
[171] Fix | Delete
<span class="howto"><?php echo $option['desc'];?></span>
[172] Fix | Delete
<?php
[173] Fix | Delete
}
[174] Fix | Delete
}
[175] Fix | Delete
?>
[176] Fix | Delete
</p>
[177] Fix | Delete
<?php
[178] Fix | Delete
}
[179] Fix | Delete
}
[180] Fix | Delete
?>
[181] Fix | Delete
</div>
[182] Fix | Delete
[183] Fix | Delete
</div>
[184] Fix | Delete
<?php
[185] Fix | Delete
}
[186] Fix | Delete
}
[187] Fix | Delete
}
[188] Fix | Delete
?>
[189] Fix | Delete
</div>
[190] Fix | Delete
<?php
[191] Fix | Delete
}
[192] Fix | Delete
?>
[193] Fix | Delete
[194] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function