X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=inc%2Fpoche%2FPoche.class.php;h=1ba8e7c14d39d8edfac2fa72e5d0e9431d1fab3d;hb=d47d2533accb30a69fbbb964f63793b821300974;hp=561de808d562b4938f9516770984203410adfbc7;hpb=3408ed48ba66db8d93207507777be42759f7eb0a;p=github%2Fwallabag%2Fwallabag.git diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 561de808..1ba8e7c1 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -105,10 +105,18 @@ class Poche public function themeIsInstalled() { # Twig is an absolute requirement for Poche to function. Abort immediately if the Composer installer hasn't been run yet if (! self::$canRenderTemplates) { - $this->notInstalledMessage = 'Twig does not seem to be installed. Please initialize the Composer installation to automatically fetch dependencies. Have a look at the documentation.'; + $this->notInstalledMessage = 'Twig does not seem to be installed. Please initialize the Composer installation to automatically fetch dependencies. Have a look at the documentation.'; return false; } + + if (! is_writable(CACHE)) { + $this->notInstalledMessage = '
You don\'t have write access on cache directory.
'; + + self::$canRenderTemplates = false; + + return false; + } # Check if the selected theme and its requirements are present if (! is_dir(THEME . '/' . $this->getTheme())) { @@ -145,16 +153,11 @@ class Poche if (empty($configSalt)) { $msg = 'You have not yet filled in the SALT value in the config.inc.php file.
'; - } else if (! is_writable(CACHE)) { - Tools::logm('you don\'t have write access on cache directory'); - $msg = 'You don\'t have write access on cache directory.
'; } else if (STORAGE == 'sqlite' && ! file_exists(STORAGE_SQLITE)) { Tools::logm('sqlite file doesn\'t exist'); $msg = 'sqlite file doesn\'t exist, you can find it in install folder. Copy it in /db folder.
'; - } else if (file_exists(ROOT . '/install/update.php') && ! DEBUG_POCHE) { - $msg = 'It\'s your first time here? Please copy /install/poche.sqlite in db folder. Then, delete install folder.
If you have already installed poche, an update is needed by clicking here.
If you want to update your poche, you just have to delete /install folder.
To install your poche with sqlite, copy /install/poche.sqlite in /db and delete the folder /install. you have to delete the /install folder before using poche.
you have to delete the /install folder before using poche.
'; } else if (STORAGE == 'sqlite' && ! is_writable(STORAGE_SQLITE)) { Tools::logm('you don\'t have write access on sqlite file'); $msg = 'You don\'t have write access on sqlite file.
'; @@ -255,7 +258,7 @@ class Poche while (($theme = readdir($handle)) !== false) { # Themes are stored in a directory, so all directory names are themes # @todo move theme installation data to database - if (! is_dir(THEME . '/' . $theme) || in_array($theme, array('..', '.'))) { + if (! is_dir(THEME . '/' . $theme) || in_array($theme, array('..', '.', '.git'))) { continue; } @@ -330,7 +333,7 @@ class Poche $msg = 'error : can\'t delete link #' . $id; } Tools::logm($msg); - Tools::redirect('?'); + Tools::redirect(); break; case 'toggle_fav' : $this->store->favoriteById($id, $this->user->getId()); @@ -385,7 +388,7 @@ class Poche # flattr checking $flattr = new FlattrItem(); - $flattr->checkItem($entry['url']); + $flattr->checkItem($entry['url'],$entry['id']); $tpl_vars = array( 'entry' => $entry, @@ -404,6 +407,7 @@ class Poche 'page_links' => '', 'nb_results' => '', ); + if (count($entries) > 0) { $this->pagination->set_total(count($entries)); $page_links = $this->pagination->page_links('?view=' . $view . '&sort=' . $_SESSION['sort'] . '&');