Description
Usage
cookie_cat_save_xml();Parameters
Returns
voidSource
File name: cookie-cat/admin/cookie-cat.phpLines:
1 to 26 of 26
function cookie_cat_save_xml() { $options = "cookie_cat_saved"; $save_xml = bw_array_get( $_REQUEST, "_cookie_cat_save_xml", null ); $last_saved = bw_get_option( "last_saved", $options ); $target = cookie_cat_default_saved_xml(); // bw_get_option( "savedxml", $options ); if ( $save_xml ) { $source = cookie_cat_default_temp_xml(); //bw_get_option( "tempxml", $options ); bw_trace2( $target, "target", false ); bw_trace2( $source, "source", false ); if ( $source && $target ) { $success = copy( $source, $target ); if ( $success ) { $last_saved = bw_format_date( null, "Y-m-d H:i:s" ); bw_update_option( "last_saved", $last_saved, $options ); } } } if ( $last_saved ) { p( "Latest XML saved on $last_saved." ); $url = bw_file2url( $target ); $link = retlink( null, $url, $target, "View the latest XML file" ); p( "XML file: $link" ); } bw_flush(); }View on GitHub View on Trac
Invoked by
Calls
1 to 9 of 9
- bw_array_get() – Return the array[index] or array->index (for an object) or a default value if not set
- bw_file2url() – Convert an upload dir file name to an URL
- bw_flush() – Use bw_flush() to echo the contents of $bwecho then empty it
- bw_format_date() – Format a date with the specified format
- bw_trace2() – Trace $value to the trace log file if tracing is active
- bw_update_option() – Set the value of an option field in the options group
- cookie_cat_default_saved_xml() – Set the location of the "saved" cc_mapping XML file
- cookie_cat_default_temp_xml() – Set the location of the temporary XML file, in the upload directory folder
- p() – Output a paragraph of translatable text
