formButtons = false;
// Check for zip extension installed
$this->zip = extension_loaded('zip');
}
// Install the plugin and create the workspace directory
public function install($position=0)
{
parent::install($position);
$workspace = $this->workspace();
return mkdir($workspace, 0755, true);
}
// Uninstall the plugin and delete the workspace directory
public function uninstall()
{
parent::uninstall();
$workspace = $this->workspace();
return Filesystem::deleteRecursive($workspace);
}
// Redefine workspace
public function workspace()
{
return PATH_CONTENT.'backup'.DS;
}
public function post()
{
if (isset($_POST['createBackup'])) {
return $this->createBackup();
}
if (isset($_POST['restoreBackup'])) {
return $this->restoreBackup($_POST['restoreBackup']);
}
return false;
}
public function form()
{
global $Language;
$backups = Filesystem::listDirectories($this->workspace(), '*', true);
if ($this->zip) {
$backups = Filesystem::listFiles($this->workspace(), '*', 'zip', true);
}
$html = '