aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/configureController.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2012-10-22 23:41:56 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2012-10-22 23:41:56 +0200
commit9a95cb844e80512205c519da69ec373e046b7f52 (patch)
treef153ffbf6952c925227581501ed25fcb94230801 /app/controllers/configureController.php
parenta928ebf1d010433d81d3afe5a6981f7ca391b9c7 (diff)
Début gestion import (non fonctionnel) / export (presque fonctionnel)
Diffstat (limited to 'app/controllers/configureController.php')
-rwxr-xr-xapp/controllers/configureController.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/controllers/configureController.php b/app/controllers/configureController.php
index 5642ef547..c501e5242 100755
--- a/app/controllers/configureController.php
+++ b/app/controllers/configureController.php
@@ -88,4 +88,26 @@ class configureController extends ActionController {
Session::_param ('conf', $this->view->conf);
}
}
+
+ public function importExportAction () {
+ $this->view->req = Request::param ('q');
+
+ if ($this->view->req == 'export') {
+ View::_title ('feeds_opml.xml');
+
+ $this->view->_useLayout (false);
+ header('Content-type: text/xml');
+
+ $feedDAO = new FeedDAO ();
+ $this->view->feeds = $feedDAO->listFeeds ();
+ } elseif (Request::isPost ()) {
+ if ($_FILES['file']['error'] == 0) {
+ $content = file_get_contents ($_FILES['file']['tmp_name']);
+ $feeds = opml_import ($content);
+
+ Request::_param ('feeds', $feeds);
+ Request::forward (array ('c' => 'feed', 'a' => 'massiveInsert'));
+ }
+ }
+ }
}