Great job!
I am testing it for a new project instead the heavy and complicated wordpress and at the moment I am in love of your project. Thank you !
My suggestions:
- User limited. (with permisions for create or edit some content only)
- Save post new content when user session was off.
- Sugestions with autocomplete for "vars" in edition
- Add a password for each private page.
- User registration with access only to a certain "tags" content
As a personal contribution:
- I added my own sidebar option to save and download a .zip file of "pages" folder like this capture.
- I will add a images backup soon.
Code i added in \automad\gui\inc\elements|sidebar.php
<li>
<a href="backup.php" target="_blank">
<i class="uk-icon-file-zip-o uk-icon-justify"></i>
BackUp Site
</a>
</li>
My backup.php code:
`<?php
class toZipArchive extends ZipArchive
{
public function __construct($a=false, $b=false) { $this->create_func($a, $b); }
public function create_func($input_folder=false, $output_zip_file=false)
{
if($input_folder !== false && $output_zip_file !== false)
{
$res = $this->open($output_zip_file, ZipArchive::CREATE);
if($res === TRUE) { $this->addDir($input_folder, basename($input_folder)); $this->close(); }
else { echo 'Could not create a zip archive. Contact Admin.'; }
}
}
// Add a Dir with Files and Subdirs to the archive
public function addDir($location, $name) {
$this->addEmptyDir($name);
$this->addDirDo($location, $name);
}
// Add Files & Dirs to archive
private function addDirDo($location, $name) {
$name .= '/'; $location .= '/';
// Read all Files in Dir
$dir = opendir ($location);
while ($file = readdir($dir)) {
if ($file == '.' || $file == '..') continue;
// Rekursiv, If dir: toZipArchive::addDir(), else ::File();
$do = (filetype( $location . $file) == 'dir') ? 'addDir' : 'addFile';
$this->$do($location . $file, $name . $file);
}
}
}
$filename = 'pages_backup_'.date('dmy-his').'.zip';
new toZipArchive('pages', $filename) ;
$filepath= $filename; //your folder file path
header($_SERVER['SERVER_PROTOCOL'].' 200 OK');
header("Content-Type: application/zip");
header("Content-Transfer-Encoding: Binary");
header("Content-Length: ".filesize($filepath));
header("Content-Disposition:attachment;filename=\"".basename($filepath)."\"");
while (ob_get_level()) { ob_end_clean(); }
readfile($filepath);
exit;
ob_start ();
?>`