aboutsummaryrefslogtreecommitdiff
path: root/app/class/controllerart.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/class/controllerart.php')
-rw-r--r--app/class/controllerart.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/app/class/controllerart.php b/app/class/controllerart.php
index 4d7b1be..ce742a1 100644
--- a/app/class/controllerart.php
+++ b/app/class/controllerart.php
@@ -241,6 +241,29 @@ class Controllerart extends Controller
}
}
+ /**
+ * Import page and save it into the database
+ */
+ public function upload()
+ {
+ $art = $this->artmanager->getfromfile();
+
+ if(!empty($_POST['id'])) {
+ $art->setid(idclean($_POST['id']));
+ }
+
+ if($_POST['datecreation']) {
+ $art->setdatecreation($this->now);
+ }
+
+ if($art !== false) {
+ if($_POST['erase'] || $this->artmanager->get($art) === false) {
+ $this->artmanager->add($art);
+ }
+ }
+ $this->routedirect('home');
+ }
+
public function delete($id)
{
$this->setart($id, 'artdelete');