public function FileSystemBase::revert in Forena Reports 8
Revert an individual report
Parameters
$file:
Return value
int Number of files reverted.
File
- src/
File/ FileSystemBase.php, line 173 - FileSystemBase.inc File toolbox for manipulating files contained tn the report directory.
Class
Namespace
Drupal\forena\FileCode
public function revert($file) {
$i = 0;
if ($this
->includeExists($file)) {
$file_to_delete = $this->dir . '/' . $file;
if (file_exists($file_to_delete)) {
if (is_writeable(dirname($file_to_delete))) {
drupal_set_message(t('Removing customization %s', array(
'%s' => $file_to_delete,
)));
unlink($file_to_delete);
$i++;
}
else {
drupal_set_message(t('Unable to revert %s', array(
'%s' => $file_to_delete,
)), 'error');
}
}
}
return $i;
}