]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
comments
authorNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Thu, 8 Aug 2013 10:33:02 +0000 (12:33 +0200)
committerNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Thu, 8 Aug 2013 10:33:02 +0000 (12:33 +0200)
TODO.md [new file with mode: 0644]
inc/poche/Poche.class.php
inc/poche/config.inc.php
index.php

diff --git a/TODO.md b/TODO.md
new file mode 100644 (file)
index 0000000..9428838
--- /dev/null
+++ b/TODO.md
@@ -0,0 +1,10 @@
+# TODO
+
+pouvoir annuler la suppression
+conventions codage ? phing ? vérifier error_log qui trainent
+phpDocumentor
+minifier css 
+revoir tous les css
+barre fixe d'admin sur la page d'un billet ? 
+revoir export (export vers pocket &cie ? )
+raccourcis clavier 
\ No newline at end of file
index 0439f301fc2952ae56f5c7ade576434d9c541a57..fecb1616f256bc4fce001ad2702b88b4d857e451 100644 (file)
@@ -232,6 +232,13 @@ class Poche
         return $tpl_vars;
     }
 
+    /**
+     * update the password of the current user. 
+     * if MODE_DEMO is TRUE, the password can't be updated. 
+     * @todo add the return value
+     * @todo set the new password in function header like this updatePassword($newPassword)
+     * @return boolean
+     */
     public function updatePassword()
     {
         if (MODE_DEMO) {
@@ -256,6 +263,13 @@ class Poche
         }
     }
 
+    /**
+     * checks if login & password are correct and save the user in session.
+     * it redirects the user to the $referer link
+     * @param  string $referer the url to redirect after login
+     * @todo add the return value
+     * @return boolean
+     */
     public function login($referer)
     {
         if (!empty($_POST['login']) && !empty($_POST['password'])) {
@@ -286,6 +300,11 @@ class Poche
         }
     }
 
+    /**
+     * log out the poche user. It cleans the session.
+     * @todo add the return value
+     * @return boolean 
+     */
     public function logout()
     {
         $this->user = array();
@@ -295,6 +314,11 @@ class Poche
         Tools::redirect();
     }
 
+    /**
+     * import from Instapaper. poche needs a ./instapaper-export.html file
+     * @todo add the return value
+     * @return boolean
+     */
     private function importFromInstapaper()
     {
         # TODO gestion des articles favs
@@ -329,6 +353,11 @@ class Poche
         Tools::redirect();
     }
 
+    /**
+     * import from Pocket. poche needs a ./ril_export.html file
+     * @todo add the return value
+     * @return boolean 
+     */
     private function importFromPocket()
     {
         # TODO gestion des articles favs
@@ -363,6 +392,11 @@ class Poche
         Tools::redirect();
     }
 
+    /**
+     * import from Readability. poche needs a ./readability file
+     * @todo add the return value
+     * @return boolean 
+     */
     private function importFromReadability()
     {
         # TODO gestion des articles lus / favs
@@ -398,19 +432,29 @@ class Poche
         Tools::redirect();
     }
 
+    /**
+     * import datas into your poche
+     * @param  string $from name of the service to import : pocket, instapaper or readability
+     * @todo add the return value
+     * @return boolean       
+     */
     public function import($from)
     {
         if ($from == 'pocket') {
-            $this->importFromPocket();
+            return $this->importFromPocket();
         }
         else if ($from == 'readability') {
-            $this->importFromReadability();
+            return $this->importFromReadability();
         }
         else if ($from == 'instapaper') {
-            $this->importFromInstapaper();
+            return $this->importFromInstapaper();
         }
     }
 
+    /**
+     * export poche entries in json
+     * @return json all poche entries
+     */
     public function export()
     {
         $entries = $this->store->retrieveAll($this->user->getId());
@@ -420,6 +464,11 @@ class Poche
         Tools::logm('export view');
     }
 
+    /**
+     * Check online the latest version of poche and cache it
+     * @param  string $which 'prod' or 'dev'
+     * @return string        latest $which version
+     */
     private function getPocheVersion($which = 'prod')
     {
         $cache_file = CACHE . '/' . $which;
index 321784d770a100efd21c6ba616be8a81ca11c3a7..0958600fb7734afa8ab02d75445d83a9dd1c2c08 100644 (file)
@@ -18,7 +18,7 @@ define ('STORAGE_PASSWORD', 'postgres'); # leave blank for sqlite
 
 define ('POCHE_VERSION', '1.0-beta1');
 define ('MODE_DEMO', FALSE);
-define ('DEBUG_POCHE', FALSE);
+define ('DEBUG_POCHE', TRUE);
 define ('CONVERT_LINKS_FOOTNOTES', FALSE);
 define ('REVERT_FORCED_PARAGRAPH_ELEMENTS', FALSE);
 define ('DOWNLOAD_PICTURES', FALSE);
index 353df873fb14c7f8ce1b53e8d2f64ee9a0b8cb00..a60e4e941704c14a64f9a66c24a2cb7b9dea01e8 100644 (file)
--- a/index.php
+++ b/index.php
@@ -32,7 +32,7 @@ elseif (isset($_GET['config'])) {
     $poche->updatePassword();
 }
 elseif (isset($_GET['import'])) {
-    $poche->import($_GET['from']);
+    $import = $poche->import($_GET['from']);
 }
 elseif (isset($_GET['export'])) {
     $poche->export();
@@ -53,7 +53,6 @@ if (Session::isLogged()) {
     $tpl_vars = array_merge($tpl_vars, $poche->displayView($view, $id));
 }
 else {
-    # login
     $tpl_file = 'login.twig';
 }