diff --git a/inc/functions.php b/inc/functions.php index 10005df..abf70a9 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -232,6 +232,12 @@ function display_view($view, $id = 0, $full_head = 'yes') switch ($view) { + case 'export': + $entries = $store->retrieveAll(); + $tpl->assign('export', json_encode($entries)); + $tpl->draw('export'); + logm('export view'); + break; case 'config': $tpl->assign('load_all_js', 0); $tpl->draw('head'); @@ -240,7 +246,7 @@ function display_view($view, $id = 0, $full_head = 'yes') $tpl->draw('js'); $tpl->draw('footer'); logm('config view'); - break; + break; case 'view': $entry = $store->retrieveOneById($id); diff --git a/inc/store/sqlite.class.php b/inc/store/sqlite.class.php index b2ae94a..d5208a2 100644 --- a/inc/store/sqlite.class.php +++ b/inc/store/sqlite.class.php @@ -38,6 +38,14 @@ class Sqlite extends Store { } } + public function retrieveAll() { + $sql = "SELECT * FROM entries ORDER BY id"; + $query = $this->executeQuery($sql, array()); + $entries = $query->fetchAll(); + + return $entries; + } + public function retrieveOneById($id) { parent::__construct(); diff --git a/inc/store/store.class.php b/inc/store/store.class.php index ae3cb34..360ff7c 100644 --- a/inc/store/store.class.php +++ b/inc/store/store.class.php @@ -17,6 +17,10 @@ class Store { } + public function retrieveAll() { + + } + public function retrieveOneById($id) { } diff --git a/tpl/config.html b/tpl/config.html index a19a84f..7d1c6af 100644 --- a/tpl/config.html +++ b/tpl/config.html @@ -3,4 +3,6 @@

Thanks to the bookmarklet, you will be able to easily add a link to your poche. If you don't know how use a bookmarklet, have a look here.

Drag & drop this link to your bookmarks bar and have fun with poche.

poche it !

+

Export

+

Click here to export your poche datas.

\ No newline at end of file diff --git a/tpl/export.html b/tpl/export.html new file mode 100644 index 0000000..d22d05f --- /dev/null +++ b/tpl/export.html @@ -0,0 +1 @@ +export {$export} \ No newline at end of file