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) {
}
}
+ /**
+ * 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'])) {
}
}
+ /**
+ * log out the poche user. It cleans the session.
+ * @todo add the return value
+ * @return boolean
+ */
public function logout()
{
$this->user = array();
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
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
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
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());
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;
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);