18 require_once SQ_CORE_PACKAGE_PATH.
'/files/file/file_edit_fns.inc';
38 parent::__construct();
55 if (SQ_ROLLBACK_VIEW) {
57 $fv = $GLOBALS[
'SQ_SYSTEM']->getFileVersioning();
58 $rep_file = $asset->data_path_suffix.
'/'.$asset->name;
59 $then = iso8601_ts($_SESSION[
'sq_rollback_view'][
'rollback_time']);
60 $info = @$fv->_checkOutCheck($rep_file, NULL, $then);
61 $parse_file = $info[
'source_file'];
63 $success = $fv->output($rep_file, NULL, $then);
64 $str = ob_get_clean();
65 if (!$success)
return FALSE;
67 require_once SQ_FUDGE_PATH.
'/general/file_system.inc';
68 $parse_file = $asset->data_path.
'/'.$asset->name;
69 $str = file_to_string($parse_file);
72 if ($asset->writeAccess(
'attributes')) {
73 text_area($prefix.
'_new_file', $str, 0, 0, 0,
'style="font-family: \'Courier New\', Courier, monospace; white-space: pre-wrap; width: 99%; height: 480px"');
76 echo
'<pre>', htmlspecialchars($str),
'</pre>';
95 if (!$asset->writeAccess(
'attributes'))
return FALSE;
96 if (isset($_POST[$prefix.
'_new_file'])) {
99 $str = str_replace(
"\r\n",
"\n", $_POST[$prefix.
'_new_file']);
101 require_once SQ_FUDGE_PATH.
'/general/file_system.inc';
106 'name' => $asset->name,
107 'tmp_name' => $asset->data_path.
'/'.$asset->name.
'.new',
108 'non_uploaded_file' => TRUE,
111 if (!string_to_file($str, $file_info[
'tmp_name'])) {
116 unlink($file_info[
'tmp_name']);