form( $form_id )->get_all_settings(); $form_title = isset ( $data['form_title'] ) ? $data['form_title'] : ''; }else{ $form_id = ''; $data = ''; $form_title = ''; } if( !isset( $ninja_forms_admin_update_message ) AND isset( $_REQUEST['update_message'] ) ){ $ninja_forms_admin_update_message = esc_html( $_REQUEST['update_message'] ); } $output_form = isset ( $ninja_forms_tabs[$current_page][$current_tab]['output_form'] ) ? $ninja_forms_tabs[$current_page][$current_tab]['output_form'] : true; $form_method = isset ( $ninja_forms_tabs[$current_page][$current_tab]['form_method'] ) ? $ninja_forms_tabs[$current_page][$current_tab]['form_method'] : 'post'; $hidden_fields = isset ( $ninja_forms_tabs[$current_page][$current_tab]['hidden_fields'] ) ? $ninja_forms_tabs[$current_page][$current_tab]['hidden_fields'] : true; if ( $output_form ) { ?>
'new', 'tab' => 'builder' ) ) ); ?>

$metabox){ ninja_forms_output_tab_metabox($form_id, $slug, $metabox); } ?>

$val){ $current_tab = $key; } }else{ $current_tab = ''; } } return $current_tab; }else{ return false; } } function ninja_forms_date_to_datepicker($date){ $pattern = array( //day 'd', //day of the month 'j', //3 letter name of the day 'l', //full name of the day 'z', //day of the year //month 'F', //Month name full 'M', //Month name short 'n', //numeric month no leading zeros 'm', //numeric month leading zeros //year 'Y', //full numeric year 'y' //numeric year: 2 digit ); $replace = array( 'dd','d','DD','o', 'MM','M','m','mm', 'yy','y' ); foreach($pattern as &$p) { $p = '/'.$p.'/'; } return preg_replace($pattern,$replace,$date); } function str_putcsv( $array, $delimiter = ',', $enclosure = '"', $terminator = "\n" ) { // First convert associative array to numeric indexed array $workArray = array(); foreach ($array as $key => $value) { $workArray[] = $value; } $returnString = ''; # Initialize return string $arraySize = count( $workArray ); # Get size of array for ( $i=0; $i<$arraySize; $i++ ) { // Nested array, process nest item if ( is_array( $workArray[$i] ) ) { $returnString .= str_putcsv( $workArray[$i], $delimiter, $enclosure, $terminator ); } else { switch ( gettype( $workArray[$i] ) ) { // Manually set some strings case "NULL": $_spFormat = ''; break; case "boolean": $_spFormat = ($workArray[$i] == true) ? 'true': 'false'; break; // Make sure sprintf has a good datatype to work with case "integer": $_spFormat = '%i'; break; case "double": $_spFormat = '%0.2f'; break; case "string": $_spFormat = '%s'; $workArray[$i] = str_replace("$enclosure", "$enclosure$enclosure", $workArray[$i]); break; // Unknown or invalid items for a csv - note: the datatype of array is already handled above, assuming the data is nested case "object": case "resource": default: $_spFormat = ''; break; } $returnString .= sprintf('%2$s'.$_spFormat.'%2$s', $workArray[$i], $enclosure); $returnString .= ($i < ($arraySize-1)) ? $delimiter : $terminator; } } // Done the workload, return the output information return $returnString; }